diff --git a/.github/workflows/_reusable-docker-build-single.yml b/.github/workflows/_reusable-docker-build-single.yml index f6de59e1b6..7606d1ff7b 100644 --- a/.github/workflows/_reusable-docker-build-single.yml +++ b/.github/workflows/_reusable-docker-build-single.yml @@ -78,7 +78,6 @@ jobs: - name: Generate API Clients run: | make gen-client-ts - make gen-client-go - name: Build Docker Image uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 id: push diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 52b77dba28..1f7621defe 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -69,9 +69,9 @@ jobs: - name: generate schema run: make migrate gen-build - name: generate API clients - run: make gen-client-rs + run: make gen-client-go gen-client-rust - name: ensure schema is up-to-date - run: git diff --exit-code -- schema.yml blueprints/schema.json packages/client-rust + run: git diff --exit-code -- schema.yml blueprints/schema.json packages/client-go packages/client-rust test-migrations: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/ci-outpost.yml b/.github/workflows/ci-outpost.yml index c0eca9c44d..c1f245048b 100644 --- a/.github/workflows/ci-outpost.yml +++ b/.github/workflows/ci-outpost.yml @@ -31,8 +31,6 @@ jobs: mkdir -p web/dist mkdir -p website/help touch web/dist/test website/help/test - - name: Generate API - run: make gen-client-go - name: golangci-lint uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v8 with: @@ -48,8 +46,6 @@ jobs: go-version-file: "go.mod" - name: Setup authentik env uses: ./.github/actions/setup - - name: Generate API - run: make gen-client-go - name: prepare database run: | uv run make migrate @@ -107,8 +103,6 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Generate API - run: make gen-client-go - name: Build Docker Image id: push uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 @@ -156,8 +150,6 @@ jobs: node-version-file: web/package.json cache: "npm" cache-dependency-path: web/package-lock.json - - name: Generate API - run: make gen-client-go - name: Build web working-directory: web/ run: | diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index c615628ee7..f050b5ceaa 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -106,7 +106,6 @@ jobs: - name: Generate API Clients run: | make gen-client-ts - make gen-client-go - name: Docker Login Registry uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 with: @@ -167,7 +166,6 @@ jobs: - name: Generate API Clients run: | make gen-client-ts - make gen-client-go - name: Build web working-directory: web/ run: | diff --git a/Makefile b/Makefile index 1e83c42b2d..b42a825c0c 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ endif GEN_API_TS = gen-ts-api GEN_API_PY = gen-py-api -GEN_API_GO = gen-go-api BREW_LDFLAGS := BREW_CPPFLAGS := @@ -125,7 +124,6 @@ core-i18n-extract: --ignore web \ --ignore internal \ --ignore ${GEN_API_TS} \ - --ignore ${GEN_API_GO} \ --ignore website \ -l en @@ -208,10 +206,14 @@ gen-clean-ts: ## Remove generated API client for TypeScript gen-clean-py: ## Remove generated API client for Python rm -rf ${PWD}/${GEN_API_PY} -gen-clean-go: ## Remove generated API client for Go - rm -rf ${PWD}/${GEN_API_GO} +gen-clean: gen-clean-ts gen-clean-py ## Remove generated API clients -gen-clean: gen-clean-ts gen-clean-go gen-clean-py ## Remove generated API clients +gen-client-go: ## Build and install the authentik API for Golang + make -C "${PWD}/packages/client-go" build + +gen-client-rust: + make -C "${PWD}/packages/client-rust" build version=${NPM_VERSION} + make lint-fix-rust gen-client-ts: gen-clean-ts ## Build and install the authentik API for Typescript into the authentik UI Application docker compose -f scripts/api/compose.yml run --rm --user "${UID}:${GID}" gen \ @@ -234,21 +236,10 @@ gen-client-py: gen-clean-py ## Build and install the authentik API for Python cp ${PWD}/schema.yml ${PWD}/${GEN_API_PY} make -C ${PWD}/${GEN_API_PY} build version=${NPM_VERSION} -gen-client-go: gen-clean-go ## Build and install the authentik API for Golang - mkdir -p ${PWD}/${GEN_API_GO} - git clone --depth 1 https://github.com/goauthentik/client-go.git ${PWD}/${GEN_API_GO} - cp ${PWD}/schema.yml ${PWD}/${GEN_API_GO} - make -C ${PWD}/${GEN_API_GO} build version=${NPM_VERSION} - go mod edit -replace goauthentik.io/api/v3=./${GEN_API_GO} - -gen-client-rs: - make -C "${PWD}/packages/client-rust" build version=${NPM_VERSION} - make lint-fix-rust - gen-dev-config: ## Generate a local development config file $(UV) run scripts/generate_config.py -gen: gen-build gen-client-ts gen-client-rs +gen: gen-build gen-client-go gen-client-rust gen-client-ts ######################### ## Node.js diff --git a/cspell.config.jsonc b/cspell.config.jsonc index 3e94ac0dde..44e87f5508 100644 --- a/cspell.config.jsonc +++ b/cspell.config.jsonc @@ -232,6 +232,7 @@ "custom-elements.json", // TypeScript custom element definitions "./gen-*-api", // Generated API Client "./packages/client-rust/src", // Generated API Client + "./packages/client-go", // Generated API Client "./schemas/**", // XML Schemas "./authentik/sources/**/schemas", // Source schemas "**vendored**", // Vendored files diff --git a/go.mod b/go.mod index 7ef2ef6fc2..fa2dec2355 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,6 @@ require ( github.com/spf13/cobra v1.10.2 github.com/stretchr/testify v1.11.1 github.com/wwt/guac v1.3.2 - goauthentik.io/api/v3 v3.2026020.17-0.20260323171523-ab05463a3eba golang.org/x/exp v0.0.0-20230210204819-062eb4c674ab golang.org/x/oauth2 v0.36.0 golang.org/x/sync v0.20.0 diff --git a/go.sum b/go.sum index cc440c9975..65d750c2cb 100644 --- a/go.sum +++ b/go.sum @@ -213,8 +213,6 @@ go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI= go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -goauthentik.io/api/v3 v3.2026020.17-0.20260323171523-ab05463a3eba h1:qwBygmfe8YE7m2pObvrUFC17tdaRIe84w1qjHGvBJ4w= -goauthentik.io/api/v3 v3.2026020.17-0.20260323171523-ab05463a3eba/go.mod h1:uYa+yGMglhJy8ymyUQ8KQiJjOb3UZTuPQ24Ot2s9BCo= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= diff --git a/internal/outpost/ak/api.go b/internal/outpost/ak/api.go index 1448e10e1d..8cb5c4830a 100644 --- a/internal/outpost/ak/api.go +++ b/internal/outpost/ak/api.go @@ -21,10 +21,10 @@ import ( "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/constants" cryptobackend "goauthentik.io/internal/crypto/backend" "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" ) const ConfigLogLevel = "log_level" diff --git a/internal/outpost/ak/api_utils.go b/internal/outpost/ak/api_utils.go index b4ba8f57d3..e06575949f 100644 --- a/internal/outpost/ak/api_utils.go +++ b/internal/outpost/ak/api_utils.go @@ -5,7 +5,7 @@ import ( "net/http" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) // Generic interface that mimics a generated request by the API client diff --git a/internal/outpost/ak/api_utils_test.go b/internal/outpost/ak/api_utils_test.go index 7ee84e13f4..74278dac12 100644 --- a/internal/outpost/ak/api_utils_test.go +++ b/internal/outpost/ak/api_utils_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) type fakeAPIType struct{} diff --git a/internal/outpost/ak/crypto.go b/internal/outpost/ak/crypto.go index 4649c505db..10fb8d5d2e 100644 --- a/internal/outpost/ak/crypto.go +++ b/internal/outpost/ak/crypto.go @@ -7,7 +7,7 @@ import ( "encoding/pem" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) type CryptoStore struct { diff --git a/internal/outpost/ak/global.go b/internal/outpost/ak/global.go index 46b483afe5..0e211c412d 100644 --- a/internal/outpost/ak/global.go +++ b/internal/outpost/ak/global.go @@ -7,11 +7,11 @@ import ( "github.com/getsentry/sentry-go" httptransport "github.com/go-openapi/runtime/client" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" "goauthentik.io/internal/constants" sentryutils "goauthentik.io/internal/utils/sentry" webutils "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" ) var ( diff --git a/internal/outpost/ak/test.go b/internal/outpost/ak/test.go index 4de4642a76..a143a3b565 100644 --- a/internal/outpost/ak/test.go +++ b/internal/outpost/ak/test.go @@ -10,7 +10,7 @@ import ( "github.com/google/uuid" "github.com/gorilla/securecookie" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func TestSecret() string { diff --git a/internal/outpost/flow/executor.go b/internal/outpost/flow/executor.go index 369cb8c08c..26c0ea82fe 100644 --- a/internal/outpost/flow/executor.go +++ b/internal/outpost/flow/executor.go @@ -14,10 +14,10 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/constants" "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" ) var ( diff --git a/internal/outpost/flow/executor_test.go b/internal/outpost/flow/executor_test.go index 0e416eb26f..29a23270f7 100644 --- a/internal/outpost/flow/executor_test.go +++ b/internal/outpost/flow/executor_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func TestConvert(t *testing.T) { diff --git a/internal/outpost/flow/solvers.go b/internal/outpost/flow/solvers.go index 745df12aa4..42980eb864 100644 --- a/internal/outpost/flow/solvers.go +++ b/internal/outpost/flow/solvers.go @@ -4,7 +4,7 @@ import ( "errors" "strconv" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func (fe *FlowExecutor) solveChallenge_Identification(challenge *api.ChallengeTypes, req api.ApiFlowsExecutorSolveRequest) (api.FlowChallengeResponseRequest, error) { diff --git a/internal/outpost/flow/solvers_mfa_test.go b/internal/outpost/flow/solvers_mfa_test.go index 7b523b05d5..1b7f6f70f5 100644 --- a/internal/outpost/flow/solvers_mfa_test.go +++ b/internal/outpost/flow/solvers_mfa_test.go @@ -10,8 +10,8 @@ import ( "github.com/gorilla/securecookie" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/flow" + api "goauthentik.io/packages/client-go" ) func testSecret() string { diff --git a/internal/outpost/ldap/entries.go b/internal/outpost/ldap/entries.go index 3dcc30a3b3..f133d200eb 100644 --- a/internal/outpost/ldap/entries.go +++ b/internal/outpost/ldap/entries.go @@ -8,9 +8,9 @@ import ( "beryju.io/ldap" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/constants" "goauthentik.io/internal/outpost/ldap/utils" + api "goauthentik.io/packages/client-go" ) func (pi *ProviderInstance) UserEntry(u api.User) *ldap.Entry { diff --git a/internal/outpost/ldap/entries_test.go b/internal/outpost/ldap/entries_test.go index dc01f2d2c7..93cc574389 100644 --- a/internal/outpost/ldap/entries_test.go +++ b/internal/outpost/ldap/entries_test.go @@ -5,7 +5,7 @@ import ( "beryju.io/ldap" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func Test_UserEntry(t *testing.T) { diff --git a/internal/outpost/ldap/flags/flags.go b/internal/outpost/ldap/flags/flags.go index bf7faf473e..7c207e16c9 100644 --- a/internal/outpost/ldap/flags/flags.go +++ b/internal/outpost/ldap/flags/flags.go @@ -6,8 +6,8 @@ import ( "net/http" "github.com/golang-jwt/jwt/v5" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/flow" + api "goauthentik.io/packages/client-go" ) const InvalidUserPK = -1 diff --git a/internal/outpost/ldap/group/group.go b/internal/outpost/ldap/group/group.go index 97541f35e3..fc9b299e15 100644 --- a/internal/outpost/ldap/group/group.go +++ b/internal/outpost/ldap/group/group.go @@ -5,10 +5,10 @@ import ( "beryju.io/ldap" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/constants" "goauthentik.io/internal/outpost/ldap/server" "goauthentik.io/internal/outpost/ldap/utils" + api "goauthentik.io/packages/client-go" ) type LDAPGroup struct { diff --git a/internal/outpost/ldap/instance.go b/internal/outpost/ldap/instance.go index fc88ad13c1..bfbbbcde33 100644 --- a/internal/outpost/ldap/instance.go +++ b/internal/outpost/ldap/instance.go @@ -7,12 +7,12 @@ import ( log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/bind" ldapConstants "goauthentik.io/internal/outpost/ldap/constants" "goauthentik.io/internal/outpost/ldap/flags" "goauthentik.io/internal/outpost/ldap/search" "goauthentik.io/internal/outpost/ldap/utils" + api "goauthentik.io/packages/client-go" ) type ProviderInstance struct { diff --git a/internal/outpost/ldap/refresh.go b/internal/outpost/ldap/refresh.go index f5832e1929..dc80adc52f 100644 --- a/internal/outpost/ldap/refresh.go +++ b/internal/outpost/ldap/refresh.go @@ -9,7 +9,6 @@ import ( log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/outpost/ldap/bind" directbind "goauthentik.io/internal/outpost/ldap/bind/direct" @@ -19,6 +18,7 @@ import ( "goauthentik.io/internal/outpost/ldap/search" directsearch "goauthentik.io/internal/outpost/ldap/search/direct" memorysearch "goauthentik.io/internal/outpost/ldap/search/memory" + api "goauthentik.io/packages/client-go" ) func (ls *LDAPServer) getCurrentProvider(pk int32) *ProviderInstance { diff --git a/internal/outpost/ldap/search/direct/direct.go b/internal/outpost/ldap/search/direct/direct.go index 713f81aac3..d1189a6e4e 100644 --- a/internal/outpost/ldap/search/direct/direct.go +++ b/internal/outpost/ldap/search/direct/direct.go @@ -11,7 +11,6 @@ import ( "beryju.io/ldap" "github.com/getsentry/sentry-go" "github.com/prometheus/client_golang/prometheus" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/outpost/ldap/constants" "goauthentik.io/internal/outpost/ldap/group" @@ -19,6 +18,7 @@ import ( "goauthentik.io/internal/outpost/ldap/search" "goauthentik.io/internal/outpost/ldap/server" "goauthentik.io/internal/outpost/ldap/utils" + api "goauthentik.io/packages/client-go" ) type DirectSearcher struct { diff --git a/internal/outpost/ldap/search/memory/memory.go b/internal/outpost/ldap/search/memory/memory.go index 74f4fd3736..47a0212c92 100644 --- a/internal/outpost/ldap/search/memory/memory.go +++ b/internal/outpost/ldap/search/memory/memory.go @@ -10,7 +10,6 @@ import ( "github.com/getsentry/sentry-go" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/outpost/ldap/constants" "goauthentik.io/internal/outpost/ldap/flags" @@ -20,6 +19,7 @@ import ( "goauthentik.io/internal/outpost/ldap/search/direct" "goauthentik.io/internal/outpost/ldap/server" "goauthentik.io/internal/outpost/ldap/utils" + api "goauthentik.io/packages/client-go" ) type MemorySearcher struct { diff --git a/internal/outpost/ldap/server/base.go b/internal/outpost/ldap/server/base.go index ecc39617b3..13712d6664 100644 --- a/internal/outpost/ldap/server/base.go +++ b/internal/outpost/ldap/server/base.go @@ -3,8 +3,8 @@ package server import ( "beryju.io/ldap" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/flags" + api "goauthentik.io/packages/client-go" ) type LDAPServerInstance interface { diff --git a/internal/outpost/ldap/utils.go b/internal/outpost/ldap/utils.go index b44b7e342d..7ca16ac6ad 100644 --- a/internal/outpost/ldap/utils.go +++ b/internal/outpost/ldap/utils.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func (pi *ProviderInstance) GroupsForUser(user api.User) []string { diff --git a/internal/outpost/ldap/utils/utils_group.go b/internal/outpost/ldap/utils/utils_group.go index 51a120593c..1afe761581 100644 --- a/internal/outpost/ldap/utils/utils_group.go +++ b/internal/outpost/ldap/utils/utils_group.go @@ -6,8 +6,8 @@ import ( "beryju.io/ldap" goldap "github.com/go-ldap/ldap/v3" ber "github.com/nmcclain/asn1-ber" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/constants" + api "goauthentik.io/packages/client-go" ) func ParseFilterForGroup(req api.ApiCoreGroupsListRequest, f *ber.Packet, skip bool) (api.ApiCoreGroupsListRequest, bool) { diff --git a/internal/outpost/ldap/utils/utils_test.go b/internal/outpost/ldap/utils/utils_test.go index 185710d627..198353c8f8 100644 --- a/internal/outpost/ldap/utils/utils_test.go +++ b/internal/outpost/ldap/utils/utils_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func Test_stringify_nil(t *testing.T) { diff --git a/internal/outpost/ldap/utils/utils_user.go b/internal/outpost/ldap/utils/utils_user.go index 571fcd7ce3..3fc2e7415b 100644 --- a/internal/outpost/ldap/utils/utils_user.go +++ b/internal/outpost/ldap/utils/utils_user.go @@ -4,8 +4,8 @@ import ( "beryju.io/ldap" goldap "github.com/go-ldap/ldap/v3" ber "github.com/nmcclain/asn1-ber" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ldap/constants" + api "goauthentik.io/packages/client-go" ) func ParseFilterForUser(req api.ApiCoreUsersListRequest, f *ber.Packet, skip bool) (api.ApiCoreUsersListRequest, bool) { diff --git a/internal/outpost/proxyv2/application/application.go b/internal/outpost/proxyv2/application/application.go index f7adbf2413..d94cd53618 100644 --- a/internal/outpost/proxyv2/application/application.go +++ b/internal/outpost/proxyv2/application/application.go @@ -23,7 +23,6 @@ import ( "github.com/jellydator/ttlcache/v3" "github.com/prometheus/client_golang/prometheus" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" "goauthentik.io/internal/outpost/ak" "goauthentik.io/internal/outpost/proxyv2/hs256" @@ -31,6 +30,7 @@ import ( "goauthentik.io/internal/outpost/proxyv2/templates" "goauthentik.io/internal/outpost/proxyv2/types" "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" "golang.org/x/oauth2" ) diff --git a/internal/outpost/proxyv2/application/endpoint.go b/internal/outpost/proxyv2/application/endpoint.go index 6137de2254..7b26d7fff7 100644 --- a/internal/outpost/proxyv2/application/endpoint.go +++ b/internal/outpost/proxyv2/application/endpoint.go @@ -4,8 +4,8 @@ import ( "net/url" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" + api "goauthentik.io/packages/client-go" "golang.org/x/oauth2" ) diff --git a/internal/outpost/proxyv2/application/endpoint_test.go b/internal/outpost/proxyv2/application/endpoint_test.go index bd2be424d6..8daf215f56 100644 --- a/internal/outpost/proxyv2/application/endpoint_test.go +++ b/internal/outpost/proxyv2/application/endpoint_test.go @@ -4,8 +4,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" + api "goauthentik.io/packages/client-go" ) func TestEndpointDefault(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/mode_common.go b/internal/outpost/proxyv2/application/mode_common.go index 8e5cac514b..87a8bb0ff5 100644 --- a/internal/outpost/proxyv2/application/mode_common.go +++ b/internal/outpost/proxyv2/application/mode_common.go @@ -9,9 +9,9 @@ import ( "net/url" "strings" - "goauthentik.io/api/v3" "goauthentik.io/internal/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func (a *Application) addHeaders(headers http.Header, c *types.Claims) { diff --git a/internal/outpost/proxyv2/application/mode_common_test.go b/internal/outpost/proxyv2/application/mode_common_test.go index 896d097af6..6419856a10 100644 --- a/internal/outpost/proxyv2/application/mode_common_test.go +++ b/internal/outpost/proxyv2/application/mode_common_test.go @@ -7,9 +7,9 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func urlMustParse(u string) *url.URL { diff --git a/internal/outpost/proxyv2/application/mode_forward_caddy_test.go b/internal/outpost/proxyv2/application/mode_forward_caddy_test.go index cf03bae978..2137d0f486 100644 --- a/internal/outpost/proxyv2/application/mode_forward_caddy_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_caddy_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func TestForwardHandleCaddy_Single_Blank(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/mode_forward_envoy_test.go b/internal/outpost/proxyv2/application/mode_forward_envoy_test.go index 2d9f6d90be..56e033b57d 100644 --- a/internal/outpost/proxyv2/application/mode_forward_envoy_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_envoy_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func TestForwardHandleEnvoy_Single_Skip(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/mode_forward_nginx_test.go b/internal/outpost/proxyv2/application/mode_forward_nginx_test.go index fa0f92ae04..a07eeba4bf 100644 --- a/internal/outpost/proxyv2/application/mode_forward_nginx_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_nginx_test.go @@ -7,9 +7,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func TestForwardHandleNginx_Single_Blank(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/mode_forward_traefik_test.go b/internal/outpost/proxyv2/application/mode_forward_traefik_test.go index 4c24bafeaa..611bce1646 100644 --- a/internal/outpost/proxyv2/application/mode_forward_traefik_test.go +++ b/internal/outpost/proxyv2/application/mode_forward_traefik_test.go @@ -9,9 +9,9 @@ import ( "github.com/google/uuid" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) func TestForwardHandleTraefik_Single_Blank(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/oauth.go b/internal/outpost/proxyv2/application/oauth.go index 7b8df2f505..d6486db1dc 100644 --- a/internal/outpost/proxyv2/application/oauth.go +++ b/internal/outpost/proxyv2/application/oauth.go @@ -6,8 +6,8 @@ import ( "net/url" "strings" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" + api "goauthentik.io/packages/client-go" ) const ( diff --git a/internal/outpost/proxyv2/application/oauth_state.go b/internal/outpost/proxyv2/application/oauth_state.go index b97500b653..7938df1a06 100644 --- a/internal/outpost/proxyv2/application/oauth_state.go +++ b/internal/outpost/proxyv2/application/oauth_state.go @@ -11,7 +11,7 @@ import ( "github.com/golang-jwt/jwt/v5" "github.com/gorilla/securecookie" "github.com/mitchellh/mapstructure" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) type OAuthState struct { diff --git a/internal/outpost/proxyv2/application/oauth_test.go b/internal/outpost/proxyv2/application/oauth_test.go index 4c4f01449a..c77088c223 100644 --- a/internal/outpost/proxyv2/application/oauth_test.go +++ b/internal/outpost/proxyv2/application/oauth_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" + api "goauthentik.io/packages/client-go" ) func TestCheckRedirectParam_None(t *testing.T) { diff --git a/internal/outpost/proxyv2/application/session.go b/internal/outpost/proxyv2/application/session.go index 361bf2b9aa..1ff35f5df6 100644 --- a/internal/outpost/proxyv2/application/session.go +++ b/internal/outpost/proxyv2/application/session.go @@ -12,12 +12,12 @@ import ( "github.com/gorilla/securecookie" "github.com/gorilla/sessions" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/codecs" "goauthentik.io/internal/outpost/proxyv2/constants" "goauthentik.io/internal/outpost/proxyv2/filesystemstore" "goauthentik.io/internal/outpost/proxyv2/postgresstore" "goauthentik.io/internal/outpost/proxyv2/types" + api "goauthentik.io/packages/client-go" ) const PostgresKeyPrefix = "authentik_proxy_session_" diff --git a/internal/outpost/proxyv2/application/test.go b/internal/outpost/proxyv2/application/test.go index 23e7d40605..718ac8272e 100644 --- a/internal/outpost/proxyv2/application/test.go +++ b/internal/outpost/proxyv2/application/test.go @@ -6,8 +6,8 @@ import ( "net/url" "testing" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/ak" + api "goauthentik.io/packages/client-go" ) type testServer struct { diff --git a/internal/outpost/proxyv2/application/utils_test.go b/internal/outpost/proxyv2/application/utils_test.go index f35827ff9f..9800549005 100644 --- a/internal/outpost/proxyv2/application/utils_test.go +++ b/internal/outpost/proxyv2/application/utils_test.go @@ -6,8 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/constants" + api "goauthentik.io/packages/client-go" ) func TestRedirectToStart_Proxy(t *testing.T) { diff --git a/internal/outpost/proxyv2/handlers.go b/internal/outpost/proxyv2/handlers.go index 5ea61060b4..7033052691 100644 --- a/internal/outpost/proxyv2/handlers.go +++ b/internal/outpost/proxyv2/handlers.go @@ -8,11 +8,11 @@ import ( "time" "github.com/prometheus/client_golang/prometheus" - "goauthentik.io/api/v3" "goauthentik.io/internal/outpost/proxyv2/application" "goauthentik.io/internal/outpost/proxyv2/metrics" sentryutils "goauthentik.io/internal/utils/sentry" "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" staticWeb "goauthentik.io/web" ) diff --git a/internal/outpost/proxyv2/proxyv2.go b/internal/outpost/proxyv2/proxyv2.go index ead5e56483..eda14d974e 100644 --- a/internal/outpost/proxyv2/proxyv2.go +++ b/internal/outpost/proxyv2/proxyv2.go @@ -13,7 +13,6 @@ import ( "github.com/gorilla/mux" "github.com/pires/go-proxyproto" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" "goauthentik.io/internal/crypto" "goauthentik.io/internal/outpost/ak" @@ -21,6 +20,7 @@ import ( "goauthentik.io/internal/utils" sentryutils "goauthentik.io/internal/utils/sentry" "goauthentik.io/internal/utils/web" + api "goauthentik.io/packages/client-go" ) type ProxyServer struct { diff --git a/internal/web/brand_tls/brand_tls.go b/internal/web/brand_tls/brand_tls.go index adde7a2c03..a6e7595ad3 100644 --- a/internal/web/brand_tls/brand_tls.go +++ b/internal/web/brand_tls/brand_tls.go @@ -9,9 +9,9 @@ import ( log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/crypto" "goauthentik.io/internal/outpost/ak" + api "goauthentik.io/packages/client-go" ) type Watcher struct { diff --git a/internal/web/web.go b/internal/web/web.go index d49733e852..ad9c47c7fa 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -17,7 +17,6 @@ import ( "github.com/pires/go-proxyproto" log "github.com/sirupsen/logrus" - "goauthentik.io/api/v3" "goauthentik.io/internal/config" "goauthentik.io/internal/constants" "goauthentik.io/internal/gounicorn" @@ -26,6 +25,7 @@ import ( "goauthentik.io/internal/utils/unix" "goauthentik.io/internal/utils/web" "goauthentik.io/internal/web/brand_tls" + api "goauthentik.io/packages/client-go" ) const ( diff --git a/lifecycle/container/Dockerfile b/lifecycle/container/Dockerfile index 5b298c9445..fca6268084 100644 --- a/lifecycle/container/Dockerfile +++ b/lifecycle/container/Dockerfile @@ -44,7 +44,6 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v RUN --mount=type=bind,target=/go/src/goauthentik.io/go.mod,src=./go.mod \ --mount=type=bind,target=/go/src/goauthentik.io/go.sum,src=./go.sum \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,target=/go/pkg/mod \ go mod download @@ -56,9 +55,9 @@ COPY --from=node-builder /work/web/security.txt /go/src/goauthentik.io/web/secur COPY ./internal /go/src/goauthentik.io/internal COPY ./go.mod /go/src/goauthentik.io/go.mod COPY ./go.sum /go/src/goauthentik.io/go.sum +COPY ./packages/client-go /go/src/goauthentik.io/packages/client-go RUN --mount=type=cache,sharing=locked,target=/go/pkg/mod \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,id=go-build-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/root/.cache/go-build \ if [ "$TARGETARCH" = "arm64" ]; then export CC=aarch64-linux-gnu-gcc && export CC_FOR_TARGET=gcc-aarch64-linux-gnu; fi && \ CGO_ENABLED=1 GOFIPS140=latest GOARM="${TARGETVARIANT#v}" \ diff --git a/lifecycle/container/ldap.Dockerfile b/lifecycle/container/ldap.Dockerfile index c6654519ba..eba0b50257 100644 --- a/lifecycle/container/ldap.Dockerfile +++ b/lifecycle/container/ldap.Dockerfile @@ -19,7 +19,6 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v RUN --mount=type=bind,target=/go/src/goauthentik.io/go.mod,src=./go.mod \ --mount=type=bind,target=/go/src/goauthentik.io/go.sum,src=./go.sum \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,target=/go/pkg/mod \ go mod download diff --git a/lifecycle/container/proxy.Dockerfile b/lifecycle/container/proxy.Dockerfile index 68f42ba99e..d3060ad245 100644 --- a/lifecycle/container/proxy.Dockerfile +++ b/lifecycle/container/proxy.Dockerfile @@ -35,7 +35,6 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v RUN --mount=type=bind,target=/go/src/goauthentik.io/go.mod,src=./go.mod \ --mount=type=bind,target=/go/src/goauthentik.io/go.sum,src=./go.sum \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,target=/go/pkg/mod \ go mod download diff --git a/lifecycle/container/rac.Dockerfile b/lifecycle/container/rac.Dockerfile index 606cfad982..6f77576a65 100644 --- a/lifecycle/container/rac.Dockerfile +++ b/lifecycle/container/rac.Dockerfile @@ -19,7 +19,6 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v RUN --mount=type=bind,target=/go/src/goauthentik.io/go.mod,src=./go.mod \ --mount=type=bind,target=/go/src/goauthentik.io/go.sum,src=./go.sum \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,target=/go/pkg/mod \ go mod download diff --git a/lifecycle/container/radius.Dockerfile b/lifecycle/container/radius.Dockerfile index cf64ae3c7f..6fd6a050ba 100644 --- a/lifecycle/container/radius.Dockerfile +++ b/lifecycle/container/radius.Dockerfile @@ -19,7 +19,6 @@ RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/v RUN --mount=type=bind,target=/go/src/goauthentik.io/go.mod,src=./go.mod \ --mount=type=bind,target=/go/src/goauthentik.io/go.sum,src=./go.sum \ - --mount=type=bind,target=/go/src/goauthentik.io/gen-go-api,src=./gen-go-api \ --mount=type=cache,target=/go/pkg/mod \ go mod download diff --git a/packages/client-go/.openapi-generator-ignore b/packages/client-go/.openapi-generator-ignore new file mode 100644 index 0000000000..6db33941e3 --- /dev/null +++ b/packages/client-go/.openapi-generator-ignore @@ -0,0 +1,2 @@ +go.mod +go.sum diff --git a/packages/client-go/Makefile b/packages/client-go/Makefile new file mode 100644 index 0000000000..6cd944a35e --- /dev/null +++ b/packages/client-go/Makefile @@ -0,0 +1,25 @@ +.SHELLFLAGS += -x -e +PWD = $(shell pwd) +UID = $(shell id -u) +GID = $(shell id -g) + +build: + rm -rf "${PWD}"/*.go + docker compose run --rm --user "${UID}:${GID}" gen \ + generate \ + -i /schema.yml \ + -g go \ + -o local \ + -c /local/config.yaml + rm -rf \ + "${PWD}/.gitignore" \ + "${PWD}/.openapi-generator" \ + "${PWD}/.travis.yml" \ + "${PWD}/README.md" \ + "${PWD}/api" \ + "${PWD}/docs" \ + "${PWD}/git_push.sh" \ + "${PWD}/test" \ + "${PWD}/go.mod" \ + "${PWD}/go.sum" + go fmt . diff --git a/packages/client-go/api_admin.go b/packages/client-go/api_admin.go new file mode 100644 index 0000000000..92cd42f422 --- /dev/null +++ b/packages/client-go/api_admin.go @@ -0,0 +1,1863 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "strings" +) + +// AdminAPIService AdminAPI service +type AdminAPIService service + +type ApiAdminAppsListRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminAppsListRequest) Execute() ([]App, *http.Response, error) { + return r.ApiService.AdminAppsListExecute(r) +} + +/* +AdminAppsList Method for AdminAppsList + +Read-only view list all installed apps + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminAppsListRequest +*/ +func (a *AdminAPIService) AdminAppsList(ctx context.Context) ApiAdminAppsListRequest { + return ApiAdminAppsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []App +func (a *AdminAPIService) AdminAppsListExecute(r ApiAdminAppsListRequest) ([]App, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []App + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminAppsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/apps/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminFileCreateRequest struct { + ctx context.Context + ApiService *AdminAPIService + file *os.File + name *string + usage *string +} + +func (r ApiAdminFileCreateRequest) File(file *os.File) ApiAdminFileCreateRequest { + r.file = file + return r +} + +func (r ApiAdminFileCreateRequest) Name(name string) ApiAdminFileCreateRequest { + r.name = &name + return r +} + +func (r ApiAdminFileCreateRequest) Usage(usage string) ApiAdminFileCreateRequest { + r.usage = &usage + return r +} + +func (r ApiAdminFileCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.AdminFileCreateExecute(r) +} + +/* +AdminFileCreate Method for AdminFileCreate + +Upload file to storage backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminFileCreateRequest +*/ +func (a *AdminAPIService) AdminFileCreate(ctx context.Context) ApiAdminFileCreateRequest { + return ApiAdminFileCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *AdminAPIService) AdminFileCreateExecute(r ApiAdminFileCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminFileCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/file/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.file == nil { + return nil, reportError("file is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + fileLocalVarFile := r.file + + if fileLocalVarFile != nil { + fbs, _ := io.ReadAll(fileLocalVarFile) + + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarFormParams, "name", r.name, "", "") + } + if r.usage != nil { + parameterAddToHeaderOrQuery(localVarFormParams, "usage", r.usage, "", "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdminFileDestroyRequest struct { + ctx context.Context + ApiService *AdminAPIService + name *string + usage *string +} + +func (r ApiAdminFileDestroyRequest) Name(name string) ApiAdminFileDestroyRequest { + r.name = &name + return r +} + +func (r ApiAdminFileDestroyRequest) Usage(usage string) ApiAdminFileDestroyRequest { + r.usage = &usage + return r +} + +func (r ApiAdminFileDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AdminFileDestroyExecute(r) +} + +/* +AdminFileDestroy Method for AdminFileDestroy + +Delete file from storage backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminFileDestroyRequest +*/ +func (a *AdminAPIService) AdminFileDestroy(ctx context.Context) ApiAdminFileDestroyRequest { + return ApiAdminFileDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *AdminAPIService) AdminFileDestroyExecute(r ApiAdminFileDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminFileDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/file/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.usage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "usage", r.usage, "form", "") + } else { + var defaultValue string = "media" + parameterAddToHeaderOrQuery(localVarQueryParams, "usage", defaultValue, "form", "") + r.usage = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAdminFileListRequest struct { + ctx context.Context + ApiService *AdminAPIService + manageableOnly *bool + search *string + usage *string +} + +func (r ApiAdminFileListRequest) ManageableOnly(manageableOnly bool) ApiAdminFileListRequest { + r.manageableOnly = &manageableOnly + return r +} + +// A search term. +func (r ApiAdminFileListRequest) Search(search string) ApiAdminFileListRequest { + r.search = &search + return r +} + +func (r ApiAdminFileListRequest) Usage(usage string) ApiAdminFileListRequest { + r.usage = &usage + return r +} + +func (r ApiAdminFileListRequest) Execute() ([]FileList, *http.Response, error) { + return r.ApiService.AdminFileListExecute(r) +} + +/* +AdminFileList Method for AdminFileList + +List files from storage backend. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminFileListRequest +*/ +func (a *AdminAPIService) AdminFileList(ctx context.Context) ApiAdminFileListRequest { + return ApiAdminFileListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []FileList +func (a *AdminAPIService) AdminFileListExecute(r ApiAdminFileListRequest) ([]FileList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []FileList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminFileList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/file/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.manageableOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "manageable_only", r.manageableOnly, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "manageable_only", defaultValue, "form", "") + r.manageableOnly = &defaultValue + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.usage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "usage", r.usage, "form", "") + } else { + var defaultValue string = "media" + parameterAddToHeaderOrQuery(localVarQueryParams, "usage", defaultValue, "form", "") + r.usage = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminFileUsedByListRequest struct { + ctx context.Context + ApiService *AdminAPIService + name *string +} + +func (r ApiAdminFileUsedByListRequest) Name(name string) ApiAdminFileUsedByListRequest { + r.name = &name + return r +} + +func (r ApiAdminFileUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AdminFileUsedByListExecute(r) +} + +/* +AdminFileUsedByList Method for AdminFileUsedByList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminFileUsedByListRequest +*/ +func (a *AdminAPIService) AdminFileUsedByList(ctx context.Context) ApiAdminFileUsedByListRequest { + return ApiAdminFileUsedByListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AdminAPIService) AdminFileUsedByListExecute(r ApiAdminFileUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminFileUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/file/used_by/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminModelsListRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminModelsListRequest) Execute() ([]App, *http.Response, error) { + return r.ApiService.AdminModelsListExecute(r) +} + +/* +AdminModelsList Method for AdminModelsList + +Read-only view list all installed models + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminModelsListRequest +*/ +func (a *AdminAPIService) AdminModelsList(ctx context.Context) ApiAdminModelsListRequest { + return ApiAdminModelsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []App +func (a *AdminAPIService) AdminModelsListExecute(r ApiAdminModelsListRequest) ([]App, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []App + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminModelsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/models/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminSettingsPartialUpdateRequest struct { + ctx context.Context + ApiService *AdminAPIService + patchedSettingsRequest *PatchedSettingsRequest +} + +func (r ApiAdminSettingsPartialUpdateRequest) PatchedSettingsRequest(patchedSettingsRequest PatchedSettingsRequest) ApiAdminSettingsPartialUpdateRequest { + r.patchedSettingsRequest = &patchedSettingsRequest + return r +} + +func (r ApiAdminSettingsPartialUpdateRequest) Execute() (*Settings, *http.Response, error) { + return r.ApiService.AdminSettingsPartialUpdateExecute(r) +} + +/* +AdminSettingsPartialUpdate Method for AdminSettingsPartialUpdate + +Settings view + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminSettingsPartialUpdateRequest +*/ +func (a *AdminAPIService) AdminSettingsPartialUpdate(ctx context.Context) ApiAdminSettingsPartialUpdateRequest { + return ApiAdminSettingsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Settings +func (a *AdminAPIService) AdminSettingsPartialUpdateExecute(r ApiAdminSettingsPartialUpdateRequest) (*Settings, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Settings + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminSettingsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSettingsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminSettingsRetrieveRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminSettingsRetrieveRequest) Execute() (*Settings, *http.Response, error) { + return r.ApiService.AdminSettingsRetrieveExecute(r) +} + +/* +AdminSettingsRetrieve Method for AdminSettingsRetrieve + +Settings view + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminSettingsRetrieveRequest +*/ +func (a *AdminAPIService) AdminSettingsRetrieve(ctx context.Context) ApiAdminSettingsRetrieveRequest { + return ApiAdminSettingsRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Settings +func (a *AdminAPIService) AdminSettingsRetrieveExecute(r ApiAdminSettingsRetrieveRequest) (*Settings, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Settings + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminSettingsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminSettingsUpdateRequest struct { + ctx context.Context + ApiService *AdminAPIService + settingsRequest *SettingsRequest +} + +func (r ApiAdminSettingsUpdateRequest) SettingsRequest(settingsRequest SettingsRequest) ApiAdminSettingsUpdateRequest { + r.settingsRequest = &settingsRequest + return r +} + +func (r ApiAdminSettingsUpdateRequest) Execute() (*Settings, *http.Response, error) { + return r.ApiService.AdminSettingsUpdateExecute(r) +} + +/* +AdminSettingsUpdate Method for AdminSettingsUpdate + +Settings view + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminSettingsUpdateRequest +*/ +func (a *AdminAPIService) AdminSettingsUpdate(ctx context.Context) ApiAdminSettingsUpdateRequest { + return ApiAdminSettingsUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Settings +func (a *AdminAPIService) AdminSettingsUpdateExecute(r ApiAdminSettingsUpdateRequest) (*Settings, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Settings + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminSettingsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.settingsRequest == nil { + return localVarReturnValue, nil, reportError("settingsRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.settingsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminSystemCreateRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminSystemCreateRequest) Execute() (*SystemInfo, *http.Response, error) { + return r.ApiService.AdminSystemCreateExecute(r) +} + +/* +AdminSystemCreate Method for AdminSystemCreate + +Get system information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminSystemCreateRequest +*/ +func (a *AdminAPIService) AdminSystemCreate(ctx context.Context) ApiAdminSystemCreateRequest { + return ApiAdminSystemCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SystemInfo +func (a *AdminAPIService) AdminSystemCreateExecute(r ApiAdminSystemCreateRequest) (*SystemInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SystemInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminSystemCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/system/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminSystemRetrieveRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminSystemRetrieveRequest) Execute() (*SystemInfo, *http.Response, error) { + return r.ApiService.AdminSystemRetrieveExecute(r) +} + +/* +AdminSystemRetrieve Method for AdminSystemRetrieve + +Get system information. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminSystemRetrieveRequest +*/ +func (a *AdminAPIService) AdminSystemRetrieve(ctx context.Context) ApiAdminSystemRetrieveRequest { + return ApiAdminSystemRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SystemInfo +func (a *AdminAPIService) AdminSystemRetrieveExecute(r ApiAdminSystemRetrieveRequest) (*SystemInfo, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SystemInfo + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminSystemRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/system/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminVersionHistoryListRequest struct { + ctx context.Context + ApiService *AdminAPIService + build *string + ordering *string + search *string + version *string +} + +func (r ApiAdminVersionHistoryListRequest) Build(build string) ApiAdminVersionHistoryListRequest { + r.build = &build + return r +} + +// Which field to use when ordering the results. +func (r ApiAdminVersionHistoryListRequest) Ordering(ordering string) ApiAdminVersionHistoryListRequest { + r.ordering = &ordering + return r +} + +// A search term. +func (r ApiAdminVersionHistoryListRequest) Search(search string) ApiAdminVersionHistoryListRequest { + r.search = &search + return r +} + +func (r ApiAdminVersionHistoryListRequest) Version(version string) ApiAdminVersionHistoryListRequest { + r.version = &version + return r +} + +func (r ApiAdminVersionHistoryListRequest) Execute() ([]VersionHistory, *http.Response, error) { + return r.ApiService.AdminVersionHistoryListExecute(r) +} + +/* +AdminVersionHistoryList Method for AdminVersionHistoryList + +VersionHistory Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminVersionHistoryListRequest +*/ +func (a *AdminAPIService) AdminVersionHistoryList(ctx context.Context) ApiAdminVersionHistoryListRequest { + return ApiAdminVersionHistoryListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []VersionHistory +func (a *AdminAPIService) AdminVersionHistoryListExecute(r ApiAdminVersionHistoryListRequest) ([]VersionHistory, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []VersionHistory + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminVersionHistoryList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/version/history/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.build != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "build", r.build, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.version != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "version", r.version, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminVersionHistoryRetrieveRequest struct { + ctx context.Context + ApiService *AdminAPIService + id int32 +} + +func (r ApiAdminVersionHistoryRetrieveRequest) Execute() (*VersionHistory, *http.Response, error) { + return r.ApiService.AdminVersionHistoryRetrieveExecute(r) +} + +/* +AdminVersionHistoryRetrieve Method for AdminVersionHistoryRetrieve + +VersionHistory Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Version history. + @return ApiAdminVersionHistoryRetrieveRequest +*/ +func (a *AdminAPIService) AdminVersionHistoryRetrieve(ctx context.Context, id int32) ApiAdminVersionHistoryRetrieveRequest { + return ApiAdminVersionHistoryRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return VersionHistory +func (a *AdminAPIService) AdminVersionHistoryRetrieveExecute(r ApiAdminVersionHistoryRetrieveRequest) (*VersionHistory, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VersionHistory + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminVersionHistoryRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/version/history/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAdminVersionRetrieveRequest struct { + ctx context.Context + ApiService *AdminAPIService +} + +func (r ApiAdminVersionRetrieveRequest) Execute() (*Version, *http.Response, error) { + return r.ApiService.AdminVersionRetrieveExecute(r) +} + +/* +AdminVersionRetrieve Method for AdminVersionRetrieve + +Get running and latest version. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAdminVersionRetrieveRequest +*/ +func (a *AdminAPIService) AdminVersionRetrieve(ctx context.Context) ApiAdminVersionRetrieveRequest { + return ApiAdminVersionRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Version +func (a *AdminAPIService) AdminVersionRetrieveExecute(r ApiAdminVersionRetrieveRequest) (*Version, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Version + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminAPIService.AdminVersionRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/version/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_authenticators.go b/packages/client-go/api_authenticators.go new file mode 100644 index 0000000000..67d16a528c --- /dev/null +++ b/packages/client-go/api_authenticators.go @@ -0,0 +1,11170 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// AuthenticatorsAPIService AuthenticatorsAPI service +type AuthenticatorsAPIService service + +type ApiAuthenticatorsAdminAllListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + user *int32 +} + +func (r ApiAuthenticatorsAdminAllListRequest) User(user int32) ApiAuthenticatorsAdminAllListRequest { + r.user = &user + return r +} + +func (r ApiAuthenticatorsAdminAllListRequest) Execute() ([]Device, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminAllListExecute(r) +} + +/* +AuthenticatorsAdminAllList Method for AuthenticatorsAdminAllList + +Get all devices for current user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminAllListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminAllList(ctx context.Context) ApiAuthenticatorsAdminAllListRequest { + return ApiAuthenticatorsAdminAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Device +func (a *AuthenticatorsAPIService) AuthenticatorsAdminAllListExecute(r ApiAuthenticatorsAdminAllListRequest) ([]Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + duoDeviceRequest *DuoDeviceRequest +} + +func (r ApiAuthenticatorsAdminDuoCreateRequest) DuoDeviceRequest(duoDeviceRequest DuoDeviceRequest) ApiAuthenticatorsAdminDuoCreateRequest { + r.duoDeviceRequest = &duoDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminDuoCreateRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoCreateExecute(r) +} + +/* +AuthenticatorsAdminDuoCreate Method for AuthenticatorsAdminDuoCreate + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminDuoCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoCreate(ctx context.Context) ApiAuthenticatorsAdminDuoCreateRequest { + return ApiAuthenticatorsAdminDuoCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoCreateExecute(r ApiAuthenticatorsAdminDuoCreateRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.duoDeviceRequest == nil { + return localVarReturnValue, nil, reportError("duoDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.duoDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminDuoDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoDestroyExecute(r) +} + +/* +AuthenticatorsAdminDuoDestroy Method for AuthenticatorsAdminDuoDestroy + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsAdminDuoDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminDuoDestroyRequest { + return ApiAuthenticatorsAdminDuoDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoDestroyExecute(r ApiAuthenticatorsAdminDuoDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminDuoListRequest) Name(name string) ApiAuthenticatorsAdminDuoListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminDuoListRequest) Ordering(ordering string) ApiAuthenticatorsAdminDuoListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminDuoListRequest) Page(page int32) ApiAuthenticatorsAdminDuoListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminDuoListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminDuoListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminDuoListRequest) Search(search string) ApiAuthenticatorsAdminDuoListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminDuoListRequest) Execute() (*PaginatedDuoDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoListExecute(r) +} + +/* +AuthenticatorsAdminDuoList Method for AuthenticatorsAdminDuoList + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminDuoListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoList(ctx context.Context) ApiAuthenticatorsAdminDuoListRequest { + return ApiAuthenticatorsAdminDuoListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDuoDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoListExecute(r ApiAuthenticatorsAdminDuoListRequest) (*PaginatedDuoDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDuoDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedDuoDeviceRequest *PatchedDuoDeviceRequest +} + +func (r ApiAuthenticatorsAdminDuoPartialUpdateRequest) PatchedDuoDeviceRequest(patchedDuoDeviceRequest PatchedDuoDeviceRequest) ApiAuthenticatorsAdminDuoPartialUpdateRequest { + r.patchedDuoDeviceRequest = &patchedDuoDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminDuoPartialUpdateRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminDuoPartialUpdate Method for AuthenticatorsAdminDuoPartialUpdate + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsAdminDuoPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminDuoPartialUpdateRequest { + return ApiAuthenticatorsAdminDuoPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoPartialUpdateExecute(r ApiAuthenticatorsAdminDuoPartialUpdateRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDuoDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminDuoRetrieveRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoRetrieveExecute(r) +} + +/* +AuthenticatorsAdminDuoRetrieve Method for AuthenticatorsAdminDuoRetrieve + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsAdminDuoRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminDuoRetrieveRequest { + return ApiAuthenticatorsAdminDuoRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoRetrieveExecute(r ApiAuthenticatorsAdminDuoRetrieveRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminDuoUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + duoDeviceRequest *DuoDeviceRequest +} + +func (r ApiAuthenticatorsAdminDuoUpdateRequest) DuoDeviceRequest(duoDeviceRequest DuoDeviceRequest) ApiAuthenticatorsAdminDuoUpdateRequest { + r.duoDeviceRequest = &duoDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminDuoUpdateRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminDuoUpdateExecute(r) +} + +/* +AuthenticatorsAdminDuoUpdate Method for AuthenticatorsAdminDuoUpdate + +Viewset for Duo authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsAdminDuoUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminDuoUpdateRequest { + return ApiAuthenticatorsAdminDuoUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminDuoUpdateExecute(r ApiAuthenticatorsAdminDuoUpdateRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminDuoUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.duoDeviceRequest == nil { + return localVarReturnValue, nil, reportError("duoDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.duoDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + emailDeviceRequest *EmailDeviceRequest +} + +func (r ApiAuthenticatorsAdminEmailCreateRequest) EmailDeviceRequest(emailDeviceRequest EmailDeviceRequest) ApiAuthenticatorsAdminEmailCreateRequest { + r.emailDeviceRequest = &emailDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEmailCreateRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailCreateExecute(r) +} + +/* +AuthenticatorsAdminEmailCreate Method for AuthenticatorsAdminEmailCreate + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminEmailCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailCreate(ctx context.Context) ApiAuthenticatorsAdminEmailCreateRequest { + return ApiAuthenticatorsAdminEmailCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailCreateExecute(r ApiAuthenticatorsAdminEmailCreateRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.emailDeviceRequest == nil { + return localVarReturnValue, nil, reportError("emailDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.emailDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminEmailDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailDestroyExecute(r) +} + +/* +AuthenticatorsAdminEmailDestroy Method for AuthenticatorsAdminEmailDestroy + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsAdminEmailDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminEmailDestroyRequest { + return ApiAuthenticatorsAdminEmailDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailDestroyExecute(r ApiAuthenticatorsAdminEmailDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminEmailListRequest) Name(name string) ApiAuthenticatorsAdminEmailListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminEmailListRequest) Ordering(ordering string) ApiAuthenticatorsAdminEmailListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminEmailListRequest) Page(page int32) ApiAuthenticatorsAdminEmailListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminEmailListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminEmailListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminEmailListRequest) Search(search string) ApiAuthenticatorsAdminEmailListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminEmailListRequest) Execute() (*PaginatedEmailDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailListExecute(r) +} + +/* +AuthenticatorsAdminEmailList Method for AuthenticatorsAdminEmailList + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminEmailListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailList(ctx context.Context) ApiAuthenticatorsAdminEmailListRequest { + return ApiAuthenticatorsAdminEmailListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEmailDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailListExecute(r ApiAuthenticatorsAdminEmailListRequest) (*PaginatedEmailDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEmailDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedEmailDeviceRequest *PatchedEmailDeviceRequest +} + +func (r ApiAuthenticatorsAdminEmailPartialUpdateRequest) PatchedEmailDeviceRequest(patchedEmailDeviceRequest PatchedEmailDeviceRequest) ApiAuthenticatorsAdminEmailPartialUpdateRequest { + r.patchedEmailDeviceRequest = &patchedEmailDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEmailPartialUpdateRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminEmailPartialUpdate Method for AuthenticatorsAdminEmailPartialUpdate + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsAdminEmailPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminEmailPartialUpdateRequest { + return ApiAuthenticatorsAdminEmailPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailPartialUpdateExecute(r ApiAuthenticatorsAdminEmailPartialUpdateRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEmailDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminEmailRetrieveRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailRetrieveExecute(r) +} + +/* +AuthenticatorsAdminEmailRetrieve Method for AuthenticatorsAdminEmailRetrieve + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsAdminEmailRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminEmailRetrieveRequest { + return ApiAuthenticatorsAdminEmailRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailRetrieveExecute(r ApiAuthenticatorsAdminEmailRetrieveRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEmailUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + emailDeviceRequest *EmailDeviceRequest +} + +func (r ApiAuthenticatorsAdminEmailUpdateRequest) EmailDeviceRequest(emailDeviceRequest EmailDeviceRequest) ApiAuthenticatorsAdminEmailUpdateRequest { + r.emailDeviceRequest = &emailDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEmailUpdateRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEmailUpdateExecute(r) +} + +/* +AuthenticatorsAdminEmailUpdate Method for AuthenticatorsAdminEmailUpdate + +Viewset for email authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsAdminEmailUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminEmailUpdateRequest { + return ApiAuthenticatorsAdminEmailUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEmailUpdateExecute(r ApiAuthenticatorsAdminEmailUpdateRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEmailUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.emailDeviceRequest == nil { + return localVarReturnValue, nil, reportError("emailDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.emailDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + googleEndpointDeviceRequest *GoogleEndpointDeviceRequest +} + +func (r ApiAuthenticatorsAdminEndpointCreateRequest) GoogleEndpointDeviceRequest(googleEndpointDeviceRequest GoogleEndpointDeviceRequest) ApiAuthenticatorsAdminEndpointCreateRequest { + r.googleEndpointDeviceRequest = &googleEndpointDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEndpointCreateRequest) Execute() (*GoogleEndpointDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointCreateExecute(r) +} + +/* +AuthenticatorsAdminEndpointCreate Method for AuthenticatorsAdminEndpointCreate + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminEndpointCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointCreate(ctx context.Context) ApiAuthenticatorsAdminEndpointCreateRequest { + return ApiAuthenticatorsAdminEndpointCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleEndpointDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointCreateExecute(r ApiAuthenticatorsAdminEndpointCreateRequest) (*GoogleEndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleEndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleEndpointDeviceRequest == nil { + return localVarReturnValue, nil, reportError("googleEndpointDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleEndpointDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string +} + +func (r ApiAuthenticatorsAdminEndpointDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointDestroyExecute(r) +} + +/* +AuthenticatorsAdminEndpointDestroy Method for AuthenticatorsAdminEndpointDestroy + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsAdminEndpointDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointDestroy(ctx context.Context, uuid string) ApiAuthenticatorsAdminEndpointDestroyRequest { + return ApiAuthenticatorsAdminEndpointDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointDestroyExecute(r ApiAuthenticatorsAdminEndpointDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminEndpointListRequest) Name(name string) ApiAuthenticatorsAdminEndpointListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminEndpointListRequest) Ordering(ordering string) ApiAuthenticatorsAdminEndpointListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminEndpointListRequest) Page(page int32) ApiAuthenticatorsAdminEndpointListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminEndpointListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminEndpointListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminEndpointListRequest) Search(search string) ApiAuthenticatorsAdminEndpointListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminEndpointListRequest) Execute() (*PaginatedGoogleEndpointDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointListExecute(r) +} + +/* +AuthenticatorsAdminEndpointList Method for AuthenticatorsAdminEndpointList + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminEndpointListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointList(ctx context.Context) ApiAuthenticatorsAdminEndpointListRequest { + return ApiAuthenticatorsAdminEndpointListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleEndpointDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointListExecute(r ApiAuthenticatorsAdminEndpointListRequest) (*PaginatedGoogleEndpointDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleEndpointDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string + patchedGoogleEndpointDeviceRequest *PatchedGoogleEndpointDeviceRequest +} + +func (r ApiAuthenticatorsAdminEndpointPartialUpdateRequest) PatchedGoogleEndpointDeviceRequest(patchedGoogleEndpointDeviceRequest PatchedGoogleEndpointDeviceRequest) ApiAuthenticatorsAdminEndpointPartialUpdateRequest { + r.patchedGoogleEndpointDeviceRequest = &patchedGoogleEndpointDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEndpointPartialUpdateRequest) Execute() (*GoogleEndpointDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminEndpointPartialUpdate Method for AuthenticatorsAdminEndpointPartialUpdate + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsAdminEndpointPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointPartialUpdate(ctx context.Context, uuid string) ApiAuthenticatorsAdminEndpointPartialUpdateRequest { + return ApiAuthenticatorsAdminEndpointPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return GoogleEndpointDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointPartialUpdateExecute(r ApiAuthenticatorsAdminEndpointPartialUpdateRequest) (*GoogleEndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleEndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGoogleEndpointDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string +} + +func (r ApiAuthenticatorsAdminEndpointRetrieveRequest) Execute() (*GoogleEndpointDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointRetrieveExecute(r) +} + +/* +AuthenticatorsAdminEndpointRetrieve Method for AuthenticatorsAdminEndpointRetrieve + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsAdminEndpointRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointRetrieve(ctx context.Context, uuid string) ApiAuthenticatorsAdminEndpointRetrieveRequest { + return ApiAuthenticatorsAdminEndpointRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return GoogleEndpointDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointRetrieveExecute(r ApiAuthenticatorsAdminEndpointRetrieveRequest) (*GoogleEndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleEndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminEndpointUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string + googleEndpointDeviceRequest *GoogleEndpointDeviceRequest +} + +func (r ApiAuthenticatorsAdminEndpointUpdateRequest) GoogleEndpointDeviceRequest(googleEndpointDeviceRequest GoogleEndpointDeviceRequest) ApiAuthenticatorsAdminEndpointUpdateRequest { + r.googleEndpointDeviceRequest = &googleEndpointDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminEndpointUpdateRequest) Execute() (*GoogleEndpointDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminEndpointUpdateExecute(r) +} + +/* +AuthenticatorsAdminEndpointUpdate Method for AuthenticatorsAdminEndpointUpdate + +Viewset for Endpoint authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsAdminEndpointUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointUpdate(ctx context.Context, uuid string) ApiAuthenticatorsAdminEndpointUpdateRequest { + return ApiAuthenticatorsAdminEndpointUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return GoogleEndpointDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminEndpointUpdateExecute(r ApiAuthenticatorsAdminEndpointUpdateRequest) (*GoogleEndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleEndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminEndpointUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/endpoint/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleEndpointDeviceRequest == nil { + return localVarReturnValue, nil, reportError("googleEndpointDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleEndpointDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + sMSDeviceRequest *SMSDeviceRequest +} + +func (r ApiAuthenticatorsAdminSmsCreateRequest) SMSDeviceRequest(sMSDeviceRequest SMSDeviceRequest) ApiAuthenticatorsAdminSmsCreateRequest { + r.sMSDeviceRequest = &sMSDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminSmsCreateRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsCreateExecute(r) +} + +/* +AuthenticatorsAdminSmsCreate Method for AuthenticatorsAdminSmsCreate + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminSmsCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsCreate(ctx context.Context) ApiAuthenticatorsAdminSmsCreateRequest { + return ApiAuthenticatorsAdminSmsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsCreateExecute(r ApiAuthenticatorsAdminSmsCreateRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sMSDeviceRequest == nil { + return localVarReturnValue, nil, reportError("sMSDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sMSDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminSmsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsDestroyExecute(r) +} + +/* +AuthenticatorsAdminSmsDestroy Method for AuthenticatorsAdminSmsDestroy + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsAdminSmsDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminSmsDestroyRequest { + return ApiAuthenticatorsAdminSmsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsDestroyExecute(r ApiAuthenticatorsAdminSmsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminSmsListRequest) Name(name string) ApiAuthenticatorsAdminSmsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminSmsListRequest) Ordering(ordering string) ApiAuthenticatorsAdminSmsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminSmsListRequest) Page(page int32) ApiAuthenticatorsAdminSmsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminSmsListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminSmsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminSmsListRequest) Search(search string) ApiAuthenticatorsAdminSmsListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminSmsListRequest) Execute() (*PaginatedSMSDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsListExecute(r) +} + +/* +AuthenticatorsAdminSmsList Method for AuthenticatorsAdminSmsList + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminSmsListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsList(ctx context.Context) ApiAuthenticatorsAdminSmsListRequest { + return ApiAuthenticatorsAdminSmsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSMSDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsListExecute(r ApiAuthenticatorsAdminSmsListRequest) (*PaginatedSMSDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSMSDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedSMSDeviceRequest *PatchedSMSDeviceRequest +} + +func (r ApiAuthenticatorsAdminSmsPartialUpdateRequest) PatchedSMSDeviceRequest(patchedSMSDeviceRequest PatchedSMSDeviceRequest) ApiAuthenticatorsAdminSmsPartialUpdateRequest { + r.patchedSMSDeviceRequest = &patchedSMSDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminSmsPartialUpdateRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminSmsPartialUpdate Method for AuthenticatorsAdminSmsPartialUpdate + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsAdminSmsPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminSmsPartialUpdateRequest { + return ApiAuthenticatorsAdminSmsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsPartialUpdateExecute(r ApiAuthenticatorsAdminSmsPartialUpdateRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSMSDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminSmsRetrieveRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsRetrieveExecute(r) +} + +/* +AuthenticatorsAdminSmsRetrieve Method for AuthenticatorsAdminSmsRetrieve + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsAdminSmsRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminSmsRetrieveRequest { + return ApiAuthenticatorsAdminSmsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsRetrieveExecute(r ApiAuthenticatorsAdminSmsRetrieveRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminSmsUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + sMSDeviceRequest *SMSDeviceRequest +} + +func (r ApiAuthenticatorsAdminSmsUpdateRequest) SMSDeviceRequest(sMSDeviceRequest SMSDeviceRequest) ApiAuthenticatorsAdminSmsUpdateRequest { + r.sMSDeviceRequest = &sMSDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminSmsUpdateRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminSmsUpdateExecute(r) +} + +/* +AuthenticatorsAdminSmsUpdate Method for AuthenticatorsAdminSmsUpdate + +Viewset for sms authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsAdminSmsUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminSmsUpdateRequest { + return ApiAuthenticatorsAdminSmsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminSmsUpdateExecute(r ApiAuthenticatorsAdminSmsUpdateRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminSmsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sMSDeviceRequest == nil { + return localVarReturnValue, nil, reportError("sMSDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sMSDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + staticDeviceRequest *StaticDeviceRequest +} + +func (r ApiAuthenticatorsAdminStaticCreateRequest) StaticDeviceRequest(staticDeviceRequest StaticDeviceRequest) ApiAuthenticatorsAdminStaticCreateRequest { + r.staticDeviceRequest = &staticDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminStaticCreateRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticCreateExecute(r) +} + +/* +AuthenticatorsAdminStaticCreate Method for AuthenticatorsAdminStaticCreate + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminStaticCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticCreate(ctx context.Context) ApiAuthenticatorsAdminStaticCreateRequest { + return ApiAuthenticatorsAdminStaticCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticCreateExecute(r ApiAuthenticatorsAdminStaticCreateRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.staticDeviceRequest == nil { + return localVarReturnValue, nil, reportError("staticDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.staticDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminStaticDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticDestroyExecute(r) +} + +/* +AuthenticatorsAdminStaticDestroy Method for AuthenticatorsAdminStaticDestroy + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsAdminStaticDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminStaticDestroyRequest { + return ApiAuthenticatorsAdminStaticDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticDestroyExecute(r ApiAuthenticatorsAdminStaticDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminStaticListRequest) Name(name string) ApiAuthenticatorsAdminStaticListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminStaticListRequest) Ordering(ordering string) ApiAuthenticatorsAdminStaticListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminStaticListRequest) Page(page int32) ApiAuthenticatorsAdminStaticListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminStaticListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminStaticListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminStaticListRequest) Search(search string) ApiAuthenticatorsAdminStaticListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminStaticListRequest) Execute() (*PaginatedStaticDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticListExecute(r) +} + +/* +AuthenticatorsAdminStaticList Method for AuthenticatorsAdminStaticList + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminStaticListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticList(ctx context.Context) ApiAuthenticatorsAdminStaticListRequest { + return ApiAuthenticatorsAdminStaticListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedStaticDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticListExecute(r ApiAuthenticatorsAdminStaticListRequest) (*PaginatedStaticDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedStaticDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedStaticDeviceRequest *PatchedStaticDeviceRequest +} + +func (r ApiAuthenticatorsAdminStaticPartialUpdateRequest) PatchedStaticDeviceRequest(patchedStaticDeviceRequest PatchedStaticDeviceRequest) ApiAuthenticatorsAdminStaticPartialUpdateRequest { + r.patchedStaticDeviceRequest = &patchedStaticDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminStaticPartialUpdateRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminStaticPartialUpdate Method for AuthenticatorsAdminStaticPartialUpdate + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsAdminStaticPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminStaticPartialUpdateRequest { + return ApiAuthenticatorsAdminStaticPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticPartialUpdateExecute(r ApiAuthenticatorsAdminStaticPartialUpdateRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedStaticDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminStaticRetrieveRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticRetrieveExecute(r) +} + +/* +AuthenticatorsAdminStaticRetrieve Method for AuthenticatorsAdminStaticRetrieve + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsAdminStaticRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminStaticRetrieveRequest { + return ApiAuthenticatorsAdminStaticRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticRetrieveExecute(r ApiAuthenticatorsAdminStaticRetrieveRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminStaticUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + staticDeviceRequest *StaticDeviceRequest +} + +func (r ApiAuthenticatorsAdminStaticUpdateRequest) StaticDeviceRequest(staticDeviceRequest StaticDeviceRequest) ApiAuthenticatorsAdminStaticUpdateRequest { + r.staticDeviceRequest = &staticDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminStaticUpdateRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminStaticUpdateExecute(r) +} + +/* +AuthenticatorsAdminStaticUpdate Method for AuthenticatorsAdminStaticUpdate + +Viewset for static authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsAdminStaticUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminStaticUpdateRequest { + return ApiAuthenticatorsAdminStaticUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminStaticUpdateExecute(r ApiAuthenticatorsAdminStaticUpdateRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminStaticUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.staticDeviceRequest == nil { + return localVarReturnValue, nil, reportError("staticDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.staticDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + tOTPDeviceRequest *TOTPDeviceRequest +} + +func (r ApiAuthenticatorsAdminTotpCreateRequest) TOTPDeviceRequest(tOTPDeviceRequest TOTPDeviceRequest) ApiAuthenticatorsAdminTotpCreateRequest { + r.tOTPDeviceRequest = &tOTPDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminTotpCreateRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpCreateExecute(r) +} + +/* +AuthenticatorsAdminTotpCreate Method for AuthenticatorsAdminTotpCreate + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminTotpCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpCreate(ctx context.Context) ApiAuthenticatorsAdminTotpCreateRequest { + return ApiAuthenticatorsAdminTotpCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpCreateExecute(r ApiAuthenticatorsAdminTotpCreateRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tOTPDeviceRequest == nil { + return localVarReturnValue, nil, reportError("tOTPDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tOTPDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminTotpDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpDestroyExecute(r) +} + +/* +AuthenticatorsAdminTotpDestroy Method for AuthenticatorsAdminTotpDestroy + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsAdminTotpDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminTotpDestroyRequest { + return ApiAuthenticatorsAdminTotpDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpDestroyExecute(r ApiAuthenticatorsAdminTotpDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminTotpListRequest) Name(name string) ApiAuthenticatorsAdminTotpListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminTotpListRequest) Ordering(ordering string) ApiAuthenticatorsAdminTotpListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminTotpListRequest) Page(page int32) ApiAuthenticatorsAdminTotpListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminTotpListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminTotpListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminTotpListRequest) Search(search string) ApiAuthenticatorsAdminTotpListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminTotpListRequest) Execute() (*PaginatedTOTPDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpListExecute(r) +} + +/* +AuthenticatorsAdminTotpList Method for AuthenticatorsAdminTotpList + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminTotpListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpList(ctx context.Context) ApiAuthenticatorsAdminTotpListRequest { + return ApiAuthenticatorsAdminTotpListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTOTPDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpListExecute(r ApiAuthenticatorsAdminTotpListRequest) (*PaginatedTOTPDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTOTPDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedTOTPDeviceRequest *PatchedTOTPDeviceRequest +} + +func (r ApiAuthenticatorsAdminTotpPartialUpdateRequest) PatchedTOTPDeviceRequest(patchedTOTPDeviceRequest PatchedTOTPDeviceRequest) ApiAuthenticatorsAdminTotpPartialUpdateRequest { + r.patchedTOTPDeviceRequest = &patchedTOTPDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminTotpPartialUpdateRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminTotpPartialUpdate Method for AuthenticatorsAdminTotpPartialUpdate + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsAdminTotpPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminTotpPartialUpdateRequest { + return ApiAuthenticatorsAdminTotpPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpPartialUpdateExecute(r ApiAuthenticatorsAdminTotpPartialUpdateRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTOTPDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminTotpRetrieveRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpRetrieveExecute(r) +} + +/* +AuthenticatorsAdminTotpRetrieve Method for AuthenticatorsAdminTotpRetrieve + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsAdminTotpRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminTotpRetrieveRequest { + return ApiAuthenticatorsAdminTotpRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpRetrieveExecute(r ApiAuthenticatorsAdminTotpRetrieveRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminTotpUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + tOTPDeviceRequest *TOTPDeviceRequest +} + +func (r ApiAuthenticatorsAdminTotpUpdateRequest) TOTPDeviceRequest(tOTPDeviceRequest TOTPDeviceRequest) ApiAuthenticatorsAdminTotpUpdateRequest { + r.tOTPDeviceRequest = &tOTPDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminTotpUpdateRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminTotpUpdateExecute(r) +} + +/* +AuthenticatorsAdminTotpUpdate Method for AuthenticatorsAdminTotpUpdate + +Viewset for totp authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsAdminTotpUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminTotpUpdateRequest { + return ApiAuthenticatorsAdminTotpUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminTotpUpdateExecute(r ApiAuthenticatorsAdminTotpUpdateRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminTotpUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tOTPDeviceRequest == nil { + return localVarReturnValue, nil, reportError("tOTPDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tOTPDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnCreateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + webAuthnDeviceRequest *WebAuthnDeviceRequest +} + +func (r ApiAuthenticatorsAdminWebauthnCreateRequest) WebAuthnDeviceRequest(webAuthnDeviceRequest WebAuthnDeviceRequest) ApiAuthenticatorsAdminWebauthnCreateRequest { + r.webAuthnDeviceRequest = &webAuthnDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminWebauthnCreateRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnCreateExecute(r) +} + +/* +AuthenticatorsAdminWebauthnCreate Method for AuthenticatorsAdminWebauthnCreate + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminWebauthnCreateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnCreate(ctx context.Context) ApiAuthenticatorsAdminWebauthnCreateRequest { + return ApiAuthenticatorsAdminWebauthnCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnCreateExecute(r ApiAuthenticatorsAdminWebauthnCreateRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webAuthnDeviceRequest == nil { + return localVarReturnValue, nil, reportError("webAuthnDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webAuthnDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminWebauthnDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnDestroyExecute(r) +} + +/* +AuthenticatorsAdminWebauthnDestroy Method for AuthenticatorsAdminWebauthnDestroy + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsAdminWebauthnDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnDestroy(ctx context.Context, id int32) ApiAuthenticatorsAdminWebauthnDestroyRequest { + return ApiAuthenticatorsAdminWebauthnDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnDestroyExecute(r ApiAuthenticatorsAdminWebauthnDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsAdminWebauthnListRequest) Name(name string) ApiAuthenticatorsAdminWebauthnListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsAdminWebauthnListRequest) Ordering(ordering string) ApiAuthenticatorsAdminWebauthnListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsAdminWebauthnListRequest) Page(page int32) ApiAuthenticatorsAdminWebauthnListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsAdminWebauthnListRequest) PageSize(pageSize int32) ApiAuthenticatorsAdminWebauthnListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsAdminWebauthnListRequest) Search(search string) ApiAuthenticatorsAdminWebauthnListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsAdminWebauthnListRequest) Execute() (*PaginatedWebAuthnDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnListExecute(r) +} + +/* +AuthenticatorsAdminWebauthnList Method for AuthenticatorsAdminWebauthnList + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAdminWebauthnListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnList(ctx context.Context) ApiAuthenticatorsAdminWebauthnListRequest { + return ApiAuthenticatorsAdminWebauthnListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWebAuthnDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnListExecute(r ApiAuthenticatorsAdminWebauthnListRequest) (*PaginatedWebAuthnDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWebAuthnDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedWebAuthnDeviceRequest *PatchedWebAuthnDeviceRequest +} + +func (r ApiAuthenticatorsAdminWebauthnPartialUpdateRequest) PatchedWebAuthnDeviceRequest(patchedWebAuthnDeviceRequest PatchedWebAuthnDeviceRequest) ApiAuthenticatorsAdminWebauthnPartialUpdateRequest { + r.patchedWebAuthnDeviceRequest = &patchedWebAuthnDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminWebauthnPartialUpdateRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnPartialUpdateExecute(r) +} + +/* +AuthenticatorsAdminWebauthnPartialUpdate Method for AuthenticatorsAdminWebauthnPartialUpdate + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsAdminWebauthnPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminWebauthnPartialUpdateRequest { + return ApiAuthenticatorsAdminWebauthnPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnPartialUpdateExecute(r ApiAuthenticatorsAdminWebauthnPartialUpdateRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWebAuthnDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsAdminWebauthnRetrieveRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnRetrieveExecute(r) +} + +/* +AuthenticatorsAdminWebauthnRetrieve Method for AuthenticatorsAdminWebauthnRetrieve + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsAdminWebauthnRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnRetrieve(ctx context.Context, id int32) ApiAuthenticatorsAdminWebauthnRetrieveRequest { + return ApiAuthenticatorsAdminWebauthnRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnRetrieveExecute(r ApiAuthenticatorsAdminWebauthnRetrieveRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAdminWebauthnUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + webAuthnDeviceRequest *WebAuthnDeviceRequest +} + +func (r ApiAuthenticatorsAdminWebauthnUpdateRequest) WebAuthnDeviceRequest(webAuthnDeviceRequest WebAuthnDeviceRequest) ApiAuthenticatorsAdminWebauthnUpdateRequest { + r.webAuthnDeviceRequest = &webAuthnDeviceRequest + return r +} + +func (r ApiAuthenticatorsAdminWebauthnUpdateRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsAdminWebauthnUpdateExecute(r) +} + +/* +AuthenticatorsAdminWebauthnUpdate Method for AuthenticatorsAdminWebauthnUpdate + +Viewset for WebAuthn authenticator devices (for admins) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsAdminWebauthnUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnUpdate(ctx context.Context, id int32) ApiAuthenticatorsAdminWebauthnUpdateRequest { + return ApiAuthenticatorsAdminWebauthnUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsAdminWebauthnUpdateExecute(r ApiAuthenticatorsAdminWebauthnUpdateRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAdminWebauthnUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/admin/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webAuthnDeviceRequest == nil { + return localVarReturnValue, nil, reportError("webAuthnDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webAuthnDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsAllListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService +} + +func (r ApiAuthenticatorsAllListRequest) Execute() ([]Device, *http.Response, error) { + return r.ApiService.AuthenticatorsAllListExecute(r) +} + +/* +AuthenticatorsAllList Method for AuthenticatorsAllList + +Get all devices for current user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsAllListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsAllList(ctx context.Context) ApiAuthenticatorsAllListRequest { + return ApiAuthenticatorsAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Device +func (a *AuthenticatorsAPIService) AuthenticatorsAllListExecute(r ApiAuthenticatorsAllListRequest) ([]Device, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Device + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsDuoDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsDuoDestroyExecute(r) +} + +/* +AuthenticatorsDuoDestroy Method for AuthenticatorsDuoDestroy + +Viewset for Duo authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsDuoDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoDestroy(ctx context.Context, id int32) ApiAuthenticatorsDuoDestroyRequest { + return ApiAuthenticatorsDuoDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsDuoDestroyExecute(r ApiAuthenticatorsDuoDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsDuoListRequest) Name(name string) ApiAuthenticatorsDuoListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsDuoListRequest) Ordering(ordering string) ApiAuthenticatorsDuoListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsDuoListRequest) Page(page int32) ApiAuthenticatorsDuoListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsDuoListRequest) PageSize(pageSize int32) ApiAuthenticatorsDuoListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsDuoListRequest) Search(search string) ApiAuthenticatorsDuoListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsDuoListRequest) Execute() (*PaginatedDuoDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsDuoListExecute(r) +} + +/* +AuthenticatorsDuoList Method for AuthenticatorsDuoList + +Viewset for Duo authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsDuoListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoList(ctx context.Context) ApiAuthenticatorsDuoListRequest { + return ApiAuthenticatorsDuoListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDuoDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsDuoListExecute(r ApiAuthenticatorsDuoListRequest) (*PaginatedDuoDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDuoDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedDuoDeviceRequest *PatchedDuoDeviceRequest +} + +func (r ApiAuthenticatorsDuoPartialUpdateRequest) PatchedDuoDeviceRequest(patchedDuoDeviceRequest PatchedDuoDeviceRequest) ApiAuthenticatorsDuoPartialUpdateRequest { + r.patchedDuoDeviceRequest = &patchedDuoDeviceRequest + return r +} + +func (r ApiAuthenticatorsDuoPartialUpdateRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsDuoPartialUpdateExecute(r) +} + +/* +AuthenticatorsDuoPartialUpdate Method for AuthenticatorsDuoPartialUpdate + +Viewset for Duo authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsDuoPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsDuoPartialUpdateRequest { + return ApiAuthenticatorsDuoPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsDuoPartialUpdateExecute(r ApiAuthenticatorsDuoPartialUpdateRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDuoDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsDuoRetrieveRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsDuoRetrieveExecute(r) +} + +/* +AuthenticatorsDuoRetrieve Method for AuthenticatorsDuoRetrieve + +Viewset for Duo authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsDuoRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoRetrieve(ctx context.Context, id int32) ApiAuthenticatorsDuoRetrieveRequest { + return ApiAuthenticatorsDuoRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsDuoRetrieveExecute(r ApiAuthenticatorsDuoRetrieveRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + duoDeviceRequest *DuoDeviceRequest +} + +func (r ApiAuthenticatorsDuoUpdateRequest) DuoDeviceRequest(duoDeviceRequest DuoDeviceRequest) ApiAuthenticatorsDuoUpdateRequest { + r.duoDeviceRequest = &duoDeviceRequest + return r +} + +func (r ApiAuthenticatorsDuoUpdateRequest) Execute() (*DuoDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsDuoUpdateExecute(r) +} + +/* +AuthenticatorsDuoUpdate Method for AuthenticatorsDuoUpdate + +Viewset for Duo authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsDuoUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoUpdate(ctx context.Context, id int32) ApiAuthenticatorsDuoUpdateRequest { + return ApiAuthenticatorsDuoUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DuoDevice +func (a *AuthenticatorsAPIService) AuthenticatorsDuoUpdateExecute(r ApiAuthenticatorsDuoUpdateRequest) (*DuoDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.duoDeviceRequest == nil { + return localVarReturnValue, nil, reportError("duoDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.duoDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsDuoUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsDuoUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsDuoUsedByListExecute(r) +} + +/* +AuthenticatorsDuoUsedByList Method for AuthenticatorsDuoUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Duo Device. + @return ApiAuthenticatorsDuoUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsDuoUsedByList(ctx context.Context, id int32) ApiAuthenticatorsDuoUsedByListRequest { + return ApiAuthenticatorsDuoUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsDuoUsedByListExecute(r ApiAuthenticatorsDuoUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsDuoUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/duo/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsEmailDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsEmailDestroyExecute(r) +} + +/* +AuthenticatorsEmailDestroy Method for AuthenticatorsEmailDestroy + +Viewset for email authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsEmailDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailDestroy(ctx context.Context, id int32) ApiAuthenticatorsEmailDestroyRequest { + return ApiAuthenticatorsEmailDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsEmailDestroyExecute(r ApiAuthenticatorsEmailDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsEmailListRequest) Name(name string) ApiAuthenticatorsEmailListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsEmailListRequest) Ordering(ordering string) ApiAuthenticatorsEmailListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsEmailListRequest) Page(page int32) ApiAuthenticatorsEmailListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsEmailListRequest) PageSize(pageSize int32) ApiAuthenticatorsEmailListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsEmailListRequest) Search(search string) ApiAuthenticatorsEmailListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsEmailListRequest) Execute() (*PaginatedEmailDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsEmailListExecute(r) +} + +/* +AuthenticatorsEmailList Method for AuthenticatorsEmailList + +Viewset for email authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsEmailListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailList(ctx context.Context) ApiAuthenticatorsEmailListRequest { + return ApiAuthenticatorsEmailListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEmailDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsEmailListExecute(r ApiAuthenticatorsEmailListRequest) (*PaginatedEmailDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEmailDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedEmailDeviceRequest *PatchedEmailDeviceRequest +} + +func (r ApiAuthenticatorsEmailPartialUpdateRequest) PatchedEmailDeviceRequest(patchedEmailDeviceRequest PatchedEmailDeviceRequest) ApiAuthenticatorsEmailPartialUpdateRequest { + r.patchedEmailDeviceRequest = &patchedEmailDeviceRequest + return r +} + +func (r ApiAuthenticatorsEmailPartialUpdateRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsEmailPartialUpdateExecute(r) +} + +/* +AuthenticatorsEmailPartialUpdate Method for AuthenticatorsEmailPartialUpdate + +Viewset for email authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsEmailPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsEmailPartialUpdateRequest { + return ApiAuthenticatorsEmailPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsEmailPartialUpdateExecute(r ApiAuthenticatorsEmailPartialUpdateRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEmailDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsEmailRetrieveRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsEmailRetrieveExecute(r) +} + +/* +AuthenticatorsEmailRetrieve Method for AuthenticatorsEmailRetrieve + +Viewset for email authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsEmailRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailRetrieve(ctx context.Context, id int32) ApiAuthenticatorsEmailRetrieveRequest { + return ApiAuthenticatorsEmailRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsEmailRetrieveExecute(r ApiAuthenticatorsEmailRetrieveRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + emailDeviceRequest *EmailDeviceRequest +} + +func (r ApiAuthenticatorsEmailUpdateRequest) EmailDeviceRequest(emailDeviceRequest EmailDeviceRequest) ApiAuthenticatorsEmailUpdateRequest { + r.emailDeviceRequest = &emailDeviceRequest + return r +} + +func (r ApiAuthenticatorsEmailUpdateRequest) Execute() (*EmailDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsEmailUpdateExecute(r) +} + +/* +AuthenticatorsEmailUpdate Method for AuthenticatorsEmailUpdate + +Viewset for email authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsEmailUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailUpdate(ctx context.Context, id int32) ApiAuthenticatorsEmailUpdateRequest { + return ApiAuthenticatorsEmailUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return EmailDevice +func (a *AuthenticatorsAPIService) AuthenticatorsEmailUpdateExecute(r ApiAuthenticatorsEmailUpdateRequest) (*EmailDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.emailDeviceRequest == nil { + return localVarReturnValue, nil, reportError("emailDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.emailDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEmailUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsEmailUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsEmailUsedByListExecute(r) +} + +/* +AuthenticatorsEmailUsedByList Method for AuthenticatorsEmailUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Email Device. + @return ApiAuthenticatorsEmailUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEmailUsedByList(ctx context.Context, id int32) ApiAuthenticatorsEmailUsedByListRequest { + return ApiAuthenticatorsEmailUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsEmailUsedByListExecute(r ApiAuthenticatorsEmailUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEmailUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/email/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEndpointListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsEndpointListRequest) Name(name string) ApiAuthenticatorsEndpointListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsEndpointListRequest) Ordering(ordering string) ApiAuthenticatorsEndpointListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsEndpointListRequest) Page(page int32) ApiAuthenticatorsEndpointListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsEndpointListRequest) PageSize(pageSize int32) ApiAuthenticatorsEndpointListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsEndpointListRequest) Search(search string) ApiAuthenticatorsEndpointListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsEndpointListRequest) Execute() (*PaginatedGoogleEndpointDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsEndpointListExecute(r) +} + +/* +AuthenticatorsEndpointList Method for AuthenticatorsEndpointList + +Viewset for Endpoint authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsEndpointListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointList(ctx context.Context) ApiAuthenticatorsEndpointListRequest { + return ApiAuthenticatorsEndpointListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleEndpointDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointListExecute(r ApiAuthenticatorsEndpointListRequest) (*PaginatedGoogleEndpointDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleEndpointDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEndpointList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/endpoint/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEndpointRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string +} + +func (r ApiAuthenticatorsEndpointRetrieveRequest) Execute() (*GoogleEndpointDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsEndpointRetrieveExecute(r) +} + +/* +AuthenticatorsEndpointRetrieve Method for AuthenticatorsEndpointRetrieve + +Viewset for Endpoint authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsEndpointRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointRetrieve(ctx context.Context, uuid string) ApiAuthenticatorsEndpointRetrieveRequest { + return ApiAuthenticatorsEndpointRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return GoogleEndpointDevice +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointRetrieveExecute(r ApiAuthenticatorsEndpointRetrieveRequest) (*GoogleEndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleEndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEndpointRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/endpoint/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsEndpointUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + uuid string +} + +func (r ApiAuthenticatorsEndpointUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsEndpointUsedByListExecute(r) +} + +/* +AuthenticatorsEndpointUsedByList Method for AuthenticatorsEndpointUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Endpoint Device. + @return ApiAuthenticatorsEndpointUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointUsedByList(ctx context.Context, uuid string) ApiAuthenticatorsEndpointUsedByListRequest { + return ApiAuthenticatorsEndpointUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsEndpointUsedByListExecute(r ApiAuthenticatorsEndpointUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsEndpointUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/endpoint/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsSmsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsSmsDestroyExecute(r) +} + +/* +AuthenticatorsSmsDestroy Method for AuthenticatorsSmsDestroy + +Viewset for sms authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsSmsDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsDestroy(ctx context.Context, id int32) ApiAuthenticatorsSmsDestroyRequest { + return ApiAuthenticatorsSmsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsSmsDestroyExecute(r ApiAuthenticatorsSmsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsSmsListRequest) Name(name string) ApiAuthenticatorsSmsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsSmsListRequest) Ordering(ordering string) ApiAuthenticatorsSmsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsSmsListRequest) Page(page int32) ApiAuthenticatorsSmsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsSmsListRequest) PageSize(pageSize int32) ApiAuthenticatorsSmsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsSmsListRequest) Search(search string) ApiAuthenticatorsSmsListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsSmsListRequest) Execute() (*PaginatedSMSDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsSmsListExecute(r) +} + +/* +AuthenticatorsSmsList Method for AuthenticatorsSmsList + +Viewset for sms authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsSmsListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsList(ctx context.Context) ApiAuthenticatorsSmsListRequest { + return ApiAuthenticatorsSmsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSMSDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsSmsListExecute(r ApiAuthenticatorsSmsListRequest) (*PaginatedSMSDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSMSDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedSMSDeviceRequest *PatchedSMSDeviceRequest +} + +func (r ApiAuthenticatorsSmsPartialUpdateRequest) PatchedSMSDeviceRequest(patchedSMSDeviceRequest PatchedSMSDeviceRequest) ApiAuthenticatorsSmsPartialUpdateRequest { + r.patchedSMSDeviceRequest = &patchedSMSDeviceRequest + return r +} + +func (r ApiAuthenticatorsSmsPartialUpdateRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsSmsPartialUpdateExecute(r) +} + +/* +AuthenticatorsSmsPartialUpdate Method for AuthenticatorsSmsPartialUpdate + +Viewset for sms authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsSmsPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsSmsPartialUpdateRequest { + return ApiAuthenticatorsSmsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsSmsPartialUpdateExecute(r ApiAuthenticatorsSmsPartialUpdateRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSMSDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsSmsRetrieveRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsSmsRetrieveExecute(r) +} + +/* +AuthenticatorsSmsRetrieve Method for AuthenticatorsSmsRetrieve + +Viewset for sms authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsSmsRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsRetrieve(ctx context.Context, id int32) ApiAuthenticatorsSmsRetrieveRequest { + return ApiAuthenticatorsSmsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsSmsRetrieveExecute(r ApiAuthenticatorsSmsRetrieveRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + sMSDeviceRequest *SMSDeviceRequest +} + +func (r ApiAuthenticatorsSmsUpdateRequest) SMSDeviceRequest(sMSDeviceRequest SMSDeviceRequest) ApiAuthenticatorsSmsUpdateRequest { + r.sMSDeviceRequest = &sMSDeviceRequest + return r +} + +func (r ApiAuthenticatorsSmsUpdateRequest) Execute() (*SMSDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsSmsUpdateExecute(r) +} + +/* +AuthenticatorsSmsUpdate Method for AuthenticatorsSmsUpdate + +Viewset for sms authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsSmsUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsUpdate(ctx context.Context, id int32) ApiAuthenticatorsSmsUpdateRequest { + return ApiAuthenticatorsSmsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SMSDevice +func (a *AuthenticatorsAPIService) AuthenticatorsSmsUpdateExecute(r ApiAuthenticatorsSmsUpdateRequest) (*SMSDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SMSDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sMSDeviceRequest == nil { + return localVarReturnValue, nil, reportError("sMSDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sMSDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsSmsUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsSmsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsSmsUsedByListExecute(r) +} + +/* +AuthenticatorsSmsUsedByList Method for AuthenticatorsSmsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SMS Device. + @return ApiAuthenticatorsSmsUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsSmsUsedByList(ctx context.Context, id int32) ApiAuthenticatorsSmsUsedByListRequest { + return ApiAuthenticatorsSmsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsSmsUsedByListExecute(r ApiAuthenticatorsSmsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsSmsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/sms/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsStaticDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsStaticDestroyExecute(r) +} + +/* +AuthenticatorsStaticDestroy Method for AuthenticatorsStaticDestroy + +Viewset for static authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsStaticDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticDestroy(ctx context.Context, id int32) ApiAuthenticatorsStaticDestroyRequest { + return ApiAuthenticatorsStaticDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsStaticDestroyExecute(r ApiAuthenticatorsStaticDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsStaticListRequest) Name(name string) ApiAuthenticatorsStaticListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsStaticListRequest) Ordering(ordering string) ApiAuthenticatorsStaticListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsStaticListRequest) Page(page int32) ApiAuthenticatorsStaticListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsStaticListRequest) PageSize(pageSize int32) ApiAuthenticatorsStaticListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsStaticListRequest) Search(search string) ApiAuthenticatorsStaticListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsStaticListRequest) Execute() (*PaginatedStaticDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsStaticListExecute(r) +} + +/* +AuthenticatorsStaticList Method for AuthenticatorsStaticList + +Viewset for static authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsStaticListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticList(ctx context.Context) ApiAuthenticatorsStaticListRequest { + return ApiAuthenticatorsStaticListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedStaticDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsStaticListExecute(r ApiAuthenticatorsStaticListRequest) (*PaginatedStaticDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedStaticDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedStaticDeviceRequest *PatchedStaticDeviceRequest +} + +func (r ApiAuthenticatorsStaticPartialUpdateRequest) PatchedStaticDeviceRequest(patchedStaticDeviceRequest PatchedStaticDeviceRequest) ApiAuthenticatorsStaticPartialUpdateRequest { + r.patchedStaticDeviceRequest = &patchedStaticDeviceRequest + return r +} + +func (r ApiAuthenticatorsStaticPartialUpdateRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsStaticPartialUpdateExecute(r) +} + +/* +AuthenticatorsStaticPartialUpdate Method for AuthenticatorsStaticPartialUpdate + +Viewset for static authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsStaticPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsStaticPartialUpdateRequest { + return ApiAuthenticatorsStaticPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsStaticPartialUpdateExecute(r ApiAuthenticatorsStaticPartialUpdateRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedStaticDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsStaticRetrieveRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsStaticRetrieveExecute(r) +} + +/* +AuthenticatorsStaticRetrieve Method for AuthenticatorsStaticRetrieve + +Viewset for static authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsStaticRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticRetrieve(ctx context.Context, id int32) ApiAuthenticatorsStaticRetrieveRequest { + return ApiAuthenticatorsStaticRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsStaticRetrieveExecute(r ApiAuthenticatorsStaticRetrieveRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + staticDeviceRequest *StaticDeviceRequest +} + +func (r ApiAuthenticatorsStaticUpdateRequest) StaticDeviceRequest(staticDeviceRequest StaticDeviceRequest) ApiAuthenticatorsStaticUpdateRequest { + r.staticDeviceRequest = &staticDeviceRequest + return r +} + +func (r ApiAuthenticatorsStaticUpdateRequest) Execute() (*StaticDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsStaticUpdateExecute(r) +} + +/* +AuthenticatorsStaticUpdate Method for AuthenticatorsStaticUpdate + +Viewset for static authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsStaticUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticUpdate(ctx context.Context, id int32) ApiAuthenticatorsStaticUpdateRequest { + return ApiAuthenticatorsStaticUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return StaticDevice +func (a *AuthenticatorsAPIService) AuthenticatorsStaticUpdateExecute(r ApiAuthenticatorsStaticUpdateRequest) (*StaticDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *StaticDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.staticDeviceRequest == nil { + return localVarReturnValue, nil, reportError("staticDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.staticDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsStaticUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsStaticUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsStaticUsedByListExecute(r) +} + +/* +AuthenticatorsStaticUsedByList Method for AuthenticatorsStaticUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Static Device. + @return ApiAuthenticatorsStaticUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsStaticUsedByList(ctx context.Context, id int32) ApiAuthenticatorsStaticUsedByListRequest { + return ApiAuthenticatorsStaticUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsStaticUsedByListExecute(r ApiAuthenticatorsStaticUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsStaticUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/static/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsTotpDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsTotpDestroyExecute(r) +} + +/* +AuthenticatorsTotpDestroy Method for AuthenticatorsTotpDestroy + +Viewset for totp authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsTotpDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpDestroy(ctx context.Context, id int32) ApiAuthenticatorsTotpDestroyRequest { + return ApiAuthenticatorsTotpDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsTotpDestroyExecute(r ApiAuthenticatorsTotpDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsTotpListRequest) Name(name string) ApiAuthenticatorsTotpListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsTotpListRequest) Ordering(ordering string) ApiAuthenticatorsTotpListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsTotpListRequest) Page(page int32) ApiAuthenticatorsTotpListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsTotpListRequest) PageSize(pageSize int32) ApiAuthenticatorsTotpListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsTotpListRequest) Search(search string) ApiAuthenticatorsTotpListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsTotpListRequest) Execute() (*PaginatedTOTPDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsTotpListExecute(r) +} + +/* +AuthenticatorsTotpList Method for AuthenticatorsTotpList + +Viewset for totp authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsTotpListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpList(ctx context.Context) ApiAuthenticatorsTotpListRequest { + return ApiAuthenticatorsTotpListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTOTPDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsTotpListExecute(r ApiAuthenticatorsTotpListRequest) (*PaginatedTOTPDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTOTPDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedTOTPDeviceRequest *PatchedTOTPDeviceRequest +} + +func (r ApiAuthenticatorsTotpPartialUpdateRequest) PatchedTOTPDeviceRequest(patchedTOTPDeviceRequest PatchedTOTPDeviceRequest) ApiAuthenticatorsTotpPartialUpdateRequest { + r.patchedTOTPDeviceRequest = &patchedTOTPDeviceRequest + return r +} + +func (r ApiAuthenticatorsTotpPartialUpdateRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsTotpPartialUpdateExecute(r) +} + +/* +AuthenticatorsTotpPartialUpdate Method for AuthenticatorsTotpPartialUpdate + +Viewset for totp authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsTotpPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsTotpPartialUpdateRequest { + return ApiAuthenticatorsTotpPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsTotpPartialUpdateExecute(r ApiAuthenticatorsTotpPartialUpdateRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTOTPDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsTotpRetrieveRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsTotpRetrieveExecute(r) +} + +/* +AuthenticatorsTotpRetrieve Method for AuthenticatorsTotpRetrieve + +Viewset for totp authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsTotpRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpRetrieve(ctx context.Context, id int32) ApiAuthenticatorsTotpRetrieveRequest { + return ApiAuthenticatorsTotpRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsTotpRetrieveExecute(r ApiAuthenticatorsTotpRetrieveRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + tOTPDeviceRequest *TOTPDeviceRequest +} + +func (r ApiAuthenticatorsTotpUpdateRequest) TOTPDeviceRequest(tOTPDeviceRequest TOTPDeviceRequest) ApiAuthenticatorsTotpUpdateRequest { + r.tOTPDeviceRequest = &tOTPDeviceRequest + return r +} + +func (r ApiAuthenticatorsTotpUpdateRequest) Execute() (*TOTPDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsTotpUpdateExecute(r) +} + +/* +AuthenticatorsTotpUpdate Method for AuthenticatorsTotpUpdate + +Viewset for totp authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsTotpUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpUpdate(ctx context.Context, id int32) ApiAuthenticatorsTotpUpdateRequest { + return ApiAuthenticatorsTotpUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TOTPDevice +func (a *AuthenticatorsAPIService) AuthenticatorsTotpUpdateExecute(r ApiAuthenticatorsTotpUpdateRequest) (*TOTPDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TOTPDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tOTPDeviceRequest == nil { + return localVarReturnValue, nil, reportError("tOTPDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tOTPDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsTotpUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsTotpUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsTotpUsedByListExecute(r) +} + +/* +AuthenticatorsTotpUsedByList Method for AuthenticatorsTotpUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this TOTP Device. + @return ApiAuthenticatorsTotpUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsTotpUsedByList(ctx context.Context, id int32) ApiAuthenticatorsTotpUsedByListRequest { + return ApiAuthenticatorsTotpUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsTotpUsedByListExecute(r ApiAuthenticatorsTotpUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsTotpUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/totp/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnDestroyRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsWebauthnDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnDestroyExecute(r) +} + +/* +AuthenticatorsWebauthnDestroy Method for AuthenticatorsWebauthnDestroy + +Viewset for WebAuthn authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsWebauthnDestroyRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnDestroy(ctx context.Context, id int32) ApiAuthenticatorsWebauthnDestroyRequest { + return ApiAuthenticatorsWebauthnDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnDestroyExecute(r ApiAuthenticatorsWebauthnDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiAuthenticatorsWebauthnListRequest) Name(name string) ApiAuthenticatorsWebauthnListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiAuthenticatorsWebauthnListRequest) Ordering(ordering string) ApiAuthenticatorsWebauthnListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiAuthenticatorsWebauthnListRequest) Page(page int32) ApiAuthenticatorsWebauthnListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiAuthenticatorsWebauthnListRequest) PageSize(pageSize int32) ApiAuthenticatorsWebauthnListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiAuthenticatorsWebauthnListRequest) Search(search string) ApiAuthenticatorsWebauthnListRequest { + r.search = &search + return r +} + +func (r ApiAuthenticatorsWebauthnListRequest) Execute() (*PaginatedWebAuthnDeviceList, *http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnListExecute(r) +} + +/* +AuthenticatorsWebauthnList Method for AuthenticatorsWebauthnList + +Viewset for WebAuthn authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiAuthenticatorsWebauthnListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnList(ctx context.Context) ApiAuthenticatorsWebauthnListRequest { + return ApiAuthenticatorsWebauthnListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWebAuthnDeviceList +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnListExecute(r ApiAuthenticatorsWebauthnListRequest) (*PaginatedWebAuthnDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWebAuthnDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnPartialUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + patchedWebAuthnDeviceRequest *PatchedWebAuthnDeviceRequest +} + +func (r ApiAuthenticatorsWebauthnPartialUpdateRequest) PatchedWebAuthnDeviceRequest(patchedWebAuthnDeviceRequest PatchedWebAuthnDeviceRequest) ApiAuthenticatorsWebauthnPartialUpdateRequest { + r.patchedWebAuthnDeviceRequest = &patchedWebAuthnDeviceRequest + return r +} + +func (r ApiAuthenticatorsWebauthnPartialUpdateRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnPartialUpdateExecute(r) +} + +/* +AuthenticatorsWebauthnPartialUpdate Method for AuthenticatorsWebauthnPartialUpdate + +Viewset for WebAuthn authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsWebauthnPartialUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnPartialUpdate(ctx context.Context, id int32) ApiAuthenticatorsWebauthnPartialUpdateRequest { + return ApiAuthenticatorsWebauthnPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnPartialUpdateExecute(r ApiAuthenticatorsWebauthnPartialUpdateRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWebAuthnDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnRetrieveRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsWebauthnRetrieveRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnRetrieveExecute(r) +} + +/* +AuthenticatorsWebauthnRetrieve Method for AuthenticatorsWebauthnRetrieve + +Viewset for WebAuthn authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsWebauthnRetrieveRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnRetrieve(ctx context.Context, id int32) ApiAuthenticatorsWebauthnRetrieveRequest { + return ApiAuthenticatorsWebauthnRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnRetrieveExecute(r ApiAuthenticatorsWebauthnRetrieveRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnUpdateRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 + webAuthnDeviceRequest *WebAuthnDeviceRequest +} + +func (r ApiAuthenticatorsWebauthnUpdateRequest) WebAuthnDeviceRequest(webAuthnDeviceRequest WebAuthnDeviceRequest) ApiAuthenticatorsWebauthnUpdateRequest { + r.webAuthnDeviceRequest = &webAuthnDeviceRequest + return r +} + +func (r ApiAuthenticatorsWebauthnUpdateRequest) Execute() (*WebAuthnDevice, *http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnUpdateExecute(r) +} + +/* +AuthenticatorsWebauthnUpdate Method for AuthenticatorsWebauthnUpdate + +Viewset for WebAuthn authenticator devices + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsWebauthnUpdateRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnUpdate(ctx context.Context, id int32) ApiAuthenticatorsWebauthnUpdateRequest { + return ApiAuthenticatorsWebauthnUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WebAuthnDevice +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnUpdateExecute(r ApiAuthenticatorsWebauthnUpdateRequest) (*WebAuthnDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.webAuthnDeviceRequest == nil { + return localVarReturnValue, nil, reportError("webAuthnDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.webAuthnDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAuthenticatorsWebauthnUsedByListRequest struct { + ctx context.Context + ApiService *AuthenticatorsAPIService + id int32 +} + +func (r ApiAuthenticatorsWebauthnUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.AuthenticatorsWebauthnUsedByListExecute(r) +} + +/* +AuthenticatorsWebauthnUsedByList Method for AuthenticatorsWebauthnUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WebAuthn Device. + @return ApiAuthenticatorsWebauthnUsedByListRequest +*/ +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnUsedByList(ctx context.Context, id int32) ApiAuthenticatorsWebauthnUsedByListRequest { + return ApiAuthenticatorsWebauthnUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *AuthenticatorsAPIService) AuthenticatorsWebauthnUsedByListExecute(r ApiAuthenticatorsWebauthnUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticatorsAPIService.AuthenticatorsWebauthnUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/authenticators/webauthn/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_core.go b/packages/client-go/api_core.go new file mode 100644 index 0000000000..2e721c0173 --- /dev/null +++ b/packages/client-go/api_core.go @@ -0,0 +1,9838 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// CoreAPIService CoreAPI service +type CoreAPIService service + +type ApiCoreApplicationEntitlementsCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + applicationEntitlementRequest *ApplicationEntitlementRequest +} + +func (r ApiCoreApplicationEntitlementsCreateRequest) ApplicationEntitlementRequest(applicationEntitlementRequest ApplicationEntitlementRequest) ApiCoreApplicationEntitlementsCreateRequest { + r.applicationEntitlementRequest = &applicationEntitlementRequest + return r +} + +func (r ApiCoreApplicationEntitlementsCreateRequest) Execute() (*ApplicationEntitlement, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsCreateExecute(r) +} + +/* +CoreApplicationEntitlementsCreate Method for CoreApplicationEntitlementsCreate + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreApplicationEntitlementsCreateRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsCreate(ctx context.Context) ApiCoreApplicationEntitlementsCreateRequest { + return ApiCoreApplicationEntitlementsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ApplicationEntitlement +func (a *CoreAPIService) CoreApplicationEntitlementsCreateExecute(r ApiCoreApplicationEntitlementsCreateRequest) (*ApplicationEntitlement, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ApplicationEntitlement + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.applicationEntitlementRequest == nil { + return localVarReturnValue, nil, reportError("applicationEntitlementRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.applicationEntitlementRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + pbmUuid string +} + +func (r ApiCoreApplicationEntitlementsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsDestroyExecute(r) +} + +/* +CoreApplicationEntitlementsDestroy Method for CoreApplicationEntitlementsDestroy + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Application Entitlement. + @return ApiCoreApplicationEntitlementsDestroyRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsDestroy(ctx context.Context, pbmUuid string) ApiCoreApplicationEntitlementsDestroyRequest { + return ApiCoreApplicationEntitlementsDestroyRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreApplicationEntitlementsDestroyExecute(r ApiCoreApplicationEntitlementsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + app *string + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + search *string +} + +func (r ApiCoreApplicationEntitlementsListRequest) App(app string) ApiCoreApplicationEntitlementsListRequest { + r.app = &app + return r +} + +func (r ApiCoreApplicationEntitlementsListRequest) Name(name string) ApiCoreApplicationEntitlementsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreApplicationEntitlementsListRequest) Ordering(ordering string) ApiCoreApplicationEntitlementsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreApplicationEntitlementsListRequest) Page(page int32) ApiCoreApplicationEntitlementsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreApplicationEntitlementsListRequest) PageSize(pageSize int32) ApiCoreApplicationEntitlementsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiCoreApplicationEntitlementsListRequest) PbmUuid(pbmUuid string) ApiCoreApplicationEntitlementsListRequest { + r.pbmUuid = &pbmUuid + return r +} + +// A search term. +func (r ApiCoreApplicationEntitlementsListRequest) Search(search string) ApiCoreApplicationEntitlementsListRequest { + r.search = &search + return r +} + +func (r ApiCoreApplicationEntitlementsListRequest) Execute() (*PaginatedApplicationEntitlementList, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsListExecute(r) +} + +/* +CoreApplicationEntitlementsList Method for CoreApplicationEntitlementsList + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreApplicationEntitlementsListRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsList(ctx context.Context) ApiCoreApplicationEntitlementsListRequest { + return ApiCoreApplicationEntitlementsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedApplicationEntitlementList +func (a *CoreAPIService) CoreApplicationEntitlementsListExecute(r ApiCoreApplicationEntitlementsListRequest) (*PaginatedApplicationEntitlementList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedApplicationEntitlementList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.app != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "app", r.app, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + pbmUuid string + patchedApplicationEntitlementRequest *PatchedApplicationEntitlementRequest +} + +func (r ApiCoreApplicationEntitlementsPartialUpdateRequest) PatchedApplicationEntitlementRequest(patchedApplicationEntitlementRequest PatchedApplicationEntitlementRequest) ApiCoreApplicationEntitlementsPartialUpdateRequest { + r.patchedApplicationEntitlementRequest = &patchedApplicationEntitlementRequest + return r +} + +func (r ApiCoreApplicationEntitlementsPartialUpdateRequest) Execute() (*ApplicationEntitlement, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsPartialUpdateExecute(r) +} + +/* +CoreApplicationEntitlementsPartialUpdate Method for CoreApplicationEntitlementsPartialUpdate + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Application Entitlement. + @return ApiCoreApplicationEntitlementsPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsPartialUpdate(ctx context.Context, pbmUuid string) ApiCoreApplicationEntitlementsPartialUpdateRequest { + return ApiCoreApplicationEntitlementsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return ApplicationEntitlement +func (a *CoreAPIService) CoreApplicationEntitlementsPartialUpdateExecute(r ApiCoreApplicationEntitlementsPartialUpdateRequest) (*ApplicationEntitlement, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ApplicationEntitlement + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedApplicationEntitlementRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + pbmUuid string +} + +func (r ApiCoreApplicationEntitlementsRetrieveRequest) Execute() (*ApplicationEntitlement, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsRetrieveExecute(r) +} + +/* +CoreApplicationEntitlementsRetrieve Method for CoreApplicationEntitlementsRetrieve + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Application Entitlement. + @return ApiCoreApplicationEntitlementsRetrieveRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsRetrieve(ctx context.Context, pbmUuid string) ApiCoreApplicationEntitlementsRetrieveRequest { + return ApiCoreApplicationEntitlementsRetrieveRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return ApplicationEntitlement +func (a *CoreAPIService) CoreApplicationEntitlementsRetrieveExecute(r ApiCoreApplicationEntitlementsRetrieveRequest) (*ApplicationEntitlement, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ApplicationEntitlement + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + pbmUuid string + applicationEntitlementRequest *ApplicationEntitlementRequest +} + +func (r ApiCoreApplicationEntitlementsUpdateRequest) ApplicationEntitlementRequest(applicationEntitlementRequest ApplicationEntitlementRequest) ApiCoreApplicationEntitlementsUpdateRequest { + r.applicationEntitlementRequest = &applicationEntitlementRequest + return r +} + +func (r ApiCoreApplicationEntitlementsUpdateRequest) Execute() (*ApplicationEntitlement, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsUpdateExecute(r) +} + +/* +CoreApplicationEntitlementsUpdate Method for CoreApplicationEntitlementsUpdate + +ApplicationEntitlement Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Application Entitlement. + @return ApiCoreApplicationEntitlementsUpdateRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsUpdate(ctx context.Context, pbmUuid string) ApiCoreApplicationEntitlementsUpdateRequest { + return ApiCoreApplicationEntitlementsUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return ApplicationEntitlement +func (a *CoreAPIService) CoreApplicationEntitlementsUpdateExecute(r ApiCoreApplicationEntitlementsUpdateRequest) (*ApplicationEntitlement, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ApplicationEntitlement + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.applicationEntitlementRequest == nil { + return localVarReturnValue, nil, reportError("applicationEntitlementRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.applicationEntitlementRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationEntitlementsUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + pbmUuid string +} + +func (r ApiCoreApplicationEntitlementsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreApplicationEntitlementsUsedByListExecute(r) +} + +/* +CoreApplicationEntitlementsUsedByList Method for CoreApplicationEntitlementsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Application Entitlement. + @return ApiCoreApplicationEntitlementsUsedByListRequest +*/ +func (a *CoreAPIService) CoreApplicationEntitlementsUsedByList(ctx context.Context, pbmUuid string) ApiCoreApplicationEntitlementsUsedByListRequest { + return ApiCoreApplicationEntitlementsUsedByListRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreApplicationEntitlementsUsedByListExecute(r ApiCoreApplicationEntitlementsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationEntitlementsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/application_entitlements/{pbm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsCheckAccessRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string + forUser *int32 +} + +func (r ApiCoreApplicationsCheckAccessRetrieveRequest) ForUser(forUser int32) ApiCoreApplicationsCheckAccessRetrieveRequest { + r.forUser = &forUser + return r +} + +func (r ApiCoreApplicationsCheckAccessRetrieveRequest) Execute() (*PolicyTestResult, *http.Response, error) { + return r.ApiService.CoreApplicationsCheckAccessRetrieveExecute(r) +} + +/* +CoreApplicationsCheckAccessRetrieve Method for CoreApplicationsCheckAccessRetrieve + +Check access to a single application by slug + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsCheckAccessRetrieveRequest +*/ +func (a *CoreAPIService) CoreApplicationsCheckAccessRetrieve(ctx context.Context, slug string) ApiCoreApplicationsCheckAccessRetrieveRequest { + return ApiCoreApplicationsCheckAccessRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return PolicyTestResult +func (a *CoreAPIService) CoreApplicationsCheckAccessRetrieveExecute(r ApiCoreApplicationsCheckAccessRetrieveRequest) (*PolicyTestResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyTestResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsCheckAccessRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/check_access/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_user", r.forUser, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + applicationRequest *ApplicationRequest +} + +func (r ApiCoreApplicationsCreateRequest) ApplicationRequest(applicationRequest ApplicationRequest) ApiCoreApplicationsCreateRequest { + r.applicationRequest = &applicationRequest + return r +} + +func (r ApiCoreApplicationsCreateRequest) Execute() (*Application, *http.Response, error) { + return r.ApiService.CoreApplicationsCreateExecute(r) +} + +/* +CoreApplicationsCreate Method for CoreApplicationsCreate + +Application Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreApplicationsCreateRequest +*/ +func (a *CoreAPIService) CoreApplicationsCreate(ctx context.Context) ApiCoreApplicationsCreateRequest { + return ApiCoreApplicationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Application +func (a *CoreAPIService) CoreApplicationsCreateExecute(r ApiCoreApplicationsCreateRequest) (*Application, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.applicationRequest == nil { + return localVarReturnValue, nil, reportError("applicationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.applicationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string +} + +func (r ApiCoreApplicationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreApplicationsDestroyExecute(r) +} + +/* +CoreApplicationsDestroy Method for CoreApplicationsDestroy + +Application Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsDestroyRequest +*/ +func (a *CoreAPIService) CoreApplicationsDestroy(ctx context.Context, slug string) ApiCoreApplicationsDestroyRequest { + return ApiCoreApplicationsDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreApplicationsDestroyExecute(r ApiCoreApplicationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreApplicationsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + forUser *int32 + group *string + metaDescription *string + metaLaunchUrl *string + metaPublisher *string + name *string + onlyWithLaunchUrl *bool + ordering *string + page *int32 + pageSize *int32 + search *string + slug *string + superuserFullList *bool +} + +func (r ApiCoreApplicationsListRequest) ForUser(forUser int32) ApiCoreApplicationsListRequest { + r.forUser = &forUser + return r +} + +func (r ApiCoreApplicationsListRequest) Group(group string) ApiCoreApplicationsListRequest { + r.group = &group + return r +} + +func (r ApiCoreApplicationsListRequest) MetaDescription(metaDescription string) ApiCoreApplicationsListRequest { + r.metaDescription = &metaDescription + return r +} + +func (r ApiCoreApplicationsListRequest) MetaLaunchUrl(metaLaunchUrl string) ApiCoreApplicationsListRequest { + r.metaLaunchUrl = &metaLaunchUrl + return r +} + +func (r ApiCoreApplicationsListRequest) MetaPublisher(metaPublisher string) ApiCoreApplicationsListRequest { + r.metaPublisher = &metaPublisher + return r +} + +func (r ApiCoreApplicationsListRequest) Name(name string) ApiCoreApplicationsListRequest { + r.name = &name + return r +} + +func (r ApiCoreApplicationsListRequest) OnlyWithLaunchUrl(onlyWithLaunchUrl bool) ApiCoreApplicationsListRequest { + r.onlyWithLaunchUrl = &onlyWithLaunchUrl + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreApplicationsListRequest) Ordering(ordering string) ApiCoreApplicationsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreApplicationsListRequest) Page(page int32) ApiCoreApplicationsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreApplicationsListRequest) PageSize(pageSize int32) ApiCoreApplicationsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreApplicationsListRequest) Search(search string) ApiCoreApplicationsListRequest { + r.search = &search + return r +} + +func (r ApiCoreApplicationsListRequest) Slug(slug string) ApiCoreApplicationsListRequest { + r.slug = &slug + return r +} + +func (r ApiCoreApplicationsListRequest) SuperuserFullList(superuserFullList bool) ApiCoreApplicationsListRequest { + r.superuserFullList = &superuserFullList + return r +} + +func (r ApiCoreApplicationsListRequest) Execute() (*PaginatedApplicationList, *http.Response, error) { + return r.ApiService.CoreApplicationsListExecute(r) +} + +/* +CoreApplicationsList Method for CoreApplicationsList + +Custom list method that checks Policy based access instead of guardian + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreApplicationsListRequest +*/ +func (a *CoreAPIService) CoreApplicationsList(ctx context.Context) ApiCoreApplicationsListRequest { + return ApiCoreApplicationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedApplicationList +func (a *CoreAPIService) CoreApplicationsListExecute(r ApiCoreApplicationsListRequest) (*PaginatedApplicationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedApplicationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_user", r.forUser, "form", "") + } + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.metaDescription != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "meta_description", r.metaDescription, "form", "") + } + if r.metaLaunchUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "meta_launch_url", r.metaLaunchUrl, "form", "") + } + if r.metaPublisher != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "meta_publisher", r.metaPublisher, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.onlyWithLaunchUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "only_with_launch_url", r.onlyWithLaunchUrl, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.superuserFullList != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "superuser_full_list", r.superuserFullList, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string + patchedApplicationRequest *PatchedApplicationRequest +} + +func (r ApiCoreApplicationsPartialUpdateRequest) PatchedApplicationRequest(patchedApplicationRequest PatchedApplicationRequest) ApiCoreApplicationsPartialUpdateRequest { + r.patchedApplicationRequest = &patchedApplicationRequest + return r +} + +func (r ApiCoreApplicationsPartialUpdateRequest) Execute() (*Application, *http.Response, error) { + return r.ApiService.CoreApplicationsPartialUpdateExecute(r) +} + +/* +CoreApplicationsPartialUpdate Method for CoreApplicationsPartialUpdate + +Application Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreApplicationsPartialUpdate(ctx context.Context, slug string) ApiCoreApplicationsPartialUpdateRequest { + return ApiCoreApplicationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Application +func (a *CoreAPIService) CoreApplicationsPartialUpdateExecute(r ApiCoreApplicationsPartialUpdateRequest) (*Application, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedApplicationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string +} + +func (r ApiCoreApplicationsRetrieveRequest) Execute() (*Application, *http.Response, error) { + return r.ApiService.CoreApplicationsRetrieveExecute(r) +} + +/* +CoreApplicationsRetrieve Method for CoreApplicationsRetrieve + +Application Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsRetrieveRequest +*/ +func (a *CoreAPIService) CoreApplicationsRetrieve(ctx context.Context, slug string) ApiCoreApplicationsRetrieveRequest { + return ApiCoreApplicationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Application +func (a *CoreAPIService) CoreApplicationsRetrieveExecute(r ApiCoreApplicationsRetrieveRequest) (*Application, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string + applicationRequest *ApplicationRequest +} + +func (r ApiCoreApplicationsUpdateRequest) ApplicationRequest(applicationRequest ApplicationRequest) ApiCoreApplicationsUpdateRequest { + r.applicationRequest = &applicationRequest + return r +} + +func (r ApiCoreApplicationsUpdateRequest) Execute() (*Application, *http.Response, error) { + return r.ApiService.CoreApplicationsUpdateExecute(r) +} + +/* +CoreApplicationsUpdate Method for CoreApplicationsUpdate + +Application Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsUpdateRequest +*/ +func (a *CoreAPIService) CoreApplicationsUpdate(ctx context.Context, slug string) ApiCoreApplicationsUpdateRequest { + return ApiCoreApplicationsUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Application +func (a *CoreAPIService) CoreApplicationsUpdateExecute(r ApiCoreApplicationsUpdateRequest) (*Application, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Application + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.applicationRequest == nil { + return localVarReturnValue, nil, reportError("applicationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.applicationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreApplicationsUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + slug string +} + +func (r ApiCoreApplicationsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreApplicationsUsedByListExecute(r) +} + +/* +CoreApplicationsUsedByList Method for CoreApplicationsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiCoreApplicationsUsedByListRequest +*/ +func (a *CoreAPIService) CoreApplicationsUsedByList(ctx context.Context, slug string) ApiCoreApplicationsUsedByListRequest { + return ApiCoreApplicationsUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreApplicationsUsedByListExecute(r ApiCoreApplicationsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreApplicationsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/applications/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + userPks *[]int32 +} + +// List of user IDs to revoke all sessions for +func (r ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest) UserPks(userPks []int32) ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest { + r.userPks = &userPks + return r +} + +func (r ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest) Execute() (*BulkDeleteSessionResponse, *http.Response, error) { + return r.ApiService.CoreAuthenticatedSessionsBulkDeleteDestroyExecute(r) +} + +/* +CoreAuthenticatedSessionsBulkDeleteDestroy Method for CoreAuthenticatedSessionsBulkDeleteDestroy + +Bulk revoke all sessions for multiple users + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest +*/ +func (a *CoreAPIService) CoreAuthenticatedSessionsBulkDeleteDestroy(ctx context.Context) ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest { + return ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return BulkDeleteSessionResponse +func (a *CoreAPIService) CoreAuthenticatedSessionsBulkDeleteDestroyExecute(r ApiCoreAuthenticatedSessionsBulkDeleteDestroyRequest) (*BulkDeleteSessionResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BulkDeleteSessionResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreAuthenticatedSessionsBulkDeleteDestroy") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/authenticated_sessions/bulk_delete/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userPks == nil { + return localVarReturnValue, nil, reportError("userPks is required and must be specified") + } + + { + t := *r.userPks + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_pks", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_pks", t, "form", "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreAuthenticatedSessionsDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + uuid string +} + +func (r ApiCoreAuthenticatedSessionsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreAuthenticatedSessionsDestroyExecute(r) +} + +/* +CoreAuthenticatedSessionsDestroy Method for CoreAuthenticatedSessionsDestroy + +AuthenticatedSession Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid + @return ApiCoreAuthenticatedSessionsDestroyRequest +*/ +func (a *CoreAPIService) CoreAuthenticatedSessionsDestroy(ctx context.Context, uuid string) ApiCoreAuthenticatedSessionsDestroyRequest { + return ApiCoreAuthenticatedSessionsDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreAuthenticatedSessionsDestroyExecute(r ApiCoreAuthenticatedSessionsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreAuthenticatedSessionsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/authenticated_sessions/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreAuthenticatedSessionsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sessionLastIp *string + sessionLastUserAgent *string + userUsername *string +} + +// Which field to use when ordering the results. +func (r ApiCoreAuthenticatedSessionsListRequest) Ordering(ordering string) ApiCoreAuthenticatedSessionsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreAuthenticatedSessionsListRequest) Page(page int32) ApiCoreAuthenticatedSessionsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreAuthenticatedSessionsListRequest) PageSize(pageSize int32) ApiCoreAuthenticatedSessionsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreAuthenticatedSessionsListRequest) Search(search string) ApiCoreAuthenticatedSessionsListRequest { + r.search = &search + return r +} + +func (r ApiCoreAuthenticatedSessionsListRequest) SessionLastIp(sessionLastIp string) ApiCoreAuthenticatedSessionsListRequest { + r.sessionLastIp = &sessionLastIp + return r +} + +func (r ApiCoreAuthenticatedSessionsListRequest) SessionLastUserAgent(sessionLastUserAgent string) ApiCoreAuthenticatedSessionsListRequest { + r.sessionLastUserAgent = &sessionLastUserAgent + return r +} + +func (r ApiCoreAuthenticatedSessionsListRequest) UserUsername(userUsername string) ApiCoreAuthenticatedSessionsListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiCoreAuthenticatedSessionsListRequest) Execute() (*PaginatedAuthenticatedSessionList, *http.Response, error) { + return r.ApiService.CoreAuthenticatedSessionsListExecute(r) +} + +/* +CoreAuthenticatedSessionsList Method for CoreAuthenticatedSessionsList + +AuthenticatedSession Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreAuthenticatedSessionsListRequest +*/ +func (a *CoreAPIService) CoreAuthenticatedSessionsList(ctx context.Context) ApiCoreAuthenticatedSessionsListRequest { + return ApiCoreAuthenticatedSessionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatedSessionList +func (a *CoreAPIService) CoreAuthenticatedSessionsListExecute(r ApiCoreAuthenticatedSessionsListRequest) (*PaginatedAuthenticatedSessionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatedSessionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreAuthenticatedSessionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/authenticated_sessions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sessionLastIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session__last_ip", r.sessionLastIp, "form", "") + } + if r.sessionLastUserAgent != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session__last_user_agent", r.sessionLastUserAgent, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreAuthenticatedSessionsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + uuid string +} + +func (r ApiCoreAuthenticatedSessionsRetrieveRequest) Execute() (*AuthenticatedSession, *http.Response, error) { + return r.ApiService.CoreAuthenticatedSessionsRetrieveExecute(r) +} + +/* +CoreAuthenticatedSessionsRetrieve Method for CoreAuthenticatedSessionsRetrieve + +AuthenticatedSession Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid + @return ApiCoreAuthenticatedSessionsRetrieveRequest +*/ +func (a *CoreAPIService) CoreAuthenticatedSessionsRetrieve(ctx context.Context, uuid string) ApiCoreAuthenticatedSessionsRetrieveRequest { + return ApiCoreAuthenticatedSessionsRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return AuthenticatedSession +func (a *CoreAPIService) CoreAuthenticatedSessionsRetrieveExecute(r ApiCoreAuthenticatedSessionsRetrieveRequest) (*AuthenticatedSession, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatedSession + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreAuthenticatedSessionsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/authenticated_sessions/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreAuthenticatedSessionsUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + uuid string +} + +func (r ApiCoreAuthenticatedSessionsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreAuthenticatedSessionsUsedByListExecute(r) +} + +/* +CoreAuthenticatedSessionsUsedByList Method for CoreAuthenticatedSessionsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid + @return ApiCoreAuthenticatedSessionsUsedByListRequest +*/ +func (a *CoreAPIService) CoreAuthenticatedSessionsUsedByList(ctx context.Context, uuid string) ApiCoreAuthenticatedSessionsUsedByListRequest { + return ApiCoreAuthenticatedSessionsUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreAuthenticatedSessionsUsedByListExecute(r ApiCoreAuthenticatedSessionsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreAuthenticatedSessionsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/authenticated_sessions/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandRequest *BrandRequest +} + +func (r ApiCoreBrandsCreateRequest) BrandRequest(brandRequest BrandRequest) ApiCoreBrandsCreateRequest { + r.brandRequest = &brandRequest + return r +} + +func (r ApiCoreBrandsCreateRequest) Execute() (*Brand, *http.Response, error) { + return r.ApiService.CoreBrandsCreateExecute(r) +} + +/* +CoreBrandsCreate Method for CoreBrandsCreate + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreBrandsCreateRequest +*/ +func (a *CoreAPIService) CoreBrandsCreate(ctx context.Context) ApiCoreBrandsCreateRequest { + return ApiCoreBrandsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Brand +func (a *CoreAPIService) CoreBrandsCreateExecute(r ApiCoreBrandsCreateRequest) (*Brand, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Brand + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.brandRequest == nil { + return localVarReturnValue, nil, reportError("brandRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.brandRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsCurrentRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService +} + +func (r ApiCoreBrandsCurrentRetrieveRequest) Execute() (*CurrentBrand, *http.Response, error) { + return r.ApiService.CoreBrandsCurrentRetrieveExecute(r) +} + +/* +CoreBrandsCurrentRetrieve Method for CoreBrandsCurrentRetrieve + +Get current brand + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreBrandsCurrentRetrieveRequest +*/ +func (a *CoreAPIService) CoreBrandsCurrentRetrieve(ctx context.Context) ApiCoreBrandsCurrentRetrieveRequest { + return ApiCoreBrandsCurrentRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CurrentBrand +func (a *CoreAPIService) CoreBrandsCurrentRetrieveExecute(r ApiCoreBrandsCurrentRetrieveRequest) (*CurrentBrand, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CurrentBrand + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsCurrentRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/current/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid string +} + +func (r ApiCoreBrandsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreBrandsDestroyExecute(r) +} + +/* +CoreBrandsDestroy Method for CoreBrandsDestroy + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param brandUuid A UUID string identifying this Brand. + @return ApiCoreBrandsDestroyRequest +*/ +func (a *CoreAPIService) CoreBrandsDestroy(ctx context.Context, brandUuid string) ApiCoreBrandsDestroyRequest { + return ApiCoreBrandsDestroyRequest{ + ApiService: a, + ctx: ctx, + brandUuid: brandUuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreBrandsDestroyExecute(r ApiCoreBrandsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/{brand_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"brand_uuid"+"}", url.PathEscape(parameterValueToString(r.brandUuid, "brandUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreBrandsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid *string + brandingDefaultFlowBackground *string + brandingFavicon *string + brandingLogo *string + brandingTitle *string + clientCertificates *[]string + default_ *bool + domain *string + flowAuthentication *string + flowDeviceCode *string + flowInvalidation *string + flowRecovery *string + flowUnenrollment *string + flowUserSettings *string + ordering *string + page *int32 + pageSize *int32 + search *string + webCertificate *string +} + +func (r ApiCoreBrandsListRequest) BrandUuid(brandUuid string) ApiCoreBrandsListRequest { + r.brandUuid = &brandUuid + return r +} + +func (r ApiCoreBrandsListRequest) BrandingDefaultFlowBackground(brandingDefaultFlowBackground string) ApiCoreBrandsListRequest { + r.brandingDefaultFlowBackground = &brandingDefaultFlowBackground + return r +} + +func (r ApiCoreBrandsListRequest) BrandingFavicon(brandingFavicon string) ApiCoreBrandsListRequest { + r.brandingFavicon = &brandingFavicon + return r +} + +func (r ApiCoreBrandsListRequest) BrandingLogo(brandingLogo string) ApiCoreBrandsListRequest { + r.brandingLogo = &brandingLogo + return r +} + +func (r ApiCoreBrandsListRequest) BrandingTitle(brandingTitle string) ApiCoreBrandsListRequest { + r.brandingTitle = &brandingTitle + return r +} + +func (r ApiCoreBrandsListRequest) ClientCertificates(clientCertificates []string) ApiCoreBrandsListRequest { + r.clientCertificates = &clientCertificates + return r +} + +func (r ApiCoreBrandsListRequest) Default_(default_ bool) ApiCoreBrandsListRequest { + r.default_ = &default_ + return r +} + +func (r ApiCoreBrandsListRequest) Domain(domain string) ApiCoreBrandsListRequest { + r.domain = &domain + return r +} + +func (r ApiCoreBrandsListRequest) FlowAuthentication(flowAuthentication string) ApiCoreBrandsListRequest { + r.flowAuthentication = &flowAuthentication + return r +} + +func (r ApiCoreBrandsListRequest) FlowDeviceCode(flowDeviceCode string) ApiCoreBrandsListRequest { + r.flowDeviceCode = &flowDeviceCode + return r +} + +func (r ApiCoreBrandsListRequest) FlowInvalidation(flowInvalidation string) ApiCoreBrandsListRequest { + r.flowInvalidation = &flowInvalidation + return r +} + +func (r ApiCoreBrandsListRequest) FlowRecovery(flowRecovery string) ApiCoreBrandsListRequest { + r.flowRecovery = &flowRecovery + return r +} + +func (r ApiCoreBrandsListRequest) FlowUnenrollment(flowUnenrollment string) ApiCoreBrandsListRequest { + r.flowUnenrollment = &flowUnenrollment + return r +} + +func (r ApiCoreBrandsListRequest) FlowUserSettings(flowUserSettings string) ApiCoreBrandsListRequest { + r.flowUserSettings = &flowUserSettings + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreBrandsListRequest) Ordering(ordering string) ApiCoreBrandsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreBrandsListRequest) Page(page int32) ApiCoreBrandsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreBrandsListRequest) PageSize(pageSize int32) ApiCoreBrandsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreBrandsListRequest) Search(search string) ApiCoreBrandsListRequest { + r.search = &search + return r +} + +func (r ApiCoreBrandsListRequest) WebCertificate(webCertificate string) ApiCoreBrandsListRequest { + r.webCertificate = &webCertificate + return r +} + +func (r ApiCoreBrandsListRequest) Execute() (*PaginatedBrandList, *http.Response, error) { + return r.ApiService.CoreBrandsListExecute(r) +} + +/* +CoreBrandsList Method for CoreBrandsList + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreBrandsListRequest +*/ +func (a *CoreAPIService) CoreBrandsList(ctx context.Context) ApiCoreBrandsListRequest { + return ApiCoreBrandsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedBrandList +func (a *CoreAPIService) CoreBrandsListExecute(r ApiCoreBrandsListRequest) (*PaginatedBrandList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedBrandList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.brandUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "brand_uuid", r.brandUuid, "form", "") + } + if r.brandingDefaultFlowBackground != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "branding_default_flow_background", r.brandingDefaultFlowBackground, "form", "") + } + if r.brandingFavicon != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "branding_favicon", r.brandingFavicon, "form", "") + } + if r.brandingLogo != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "branding_logo", r.brandingLogo, "form", "") + } + if r.brandingTitle != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "branding_title", r.brandingTitle, "form", "") + } + if r.clientCertificates != nil { + t := *r.clientCertificates + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_certificates", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_certificates", t, "form", "multi") + } + } + if r.default_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "default", r.default_, "form", "") + } + if r.domain != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "domain", r.domain, "form", "") + } + if r.flowAuthentication != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_authentication", r.flowAuthentication, "form", "") + } + if r.flowDeviceCode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_device_code", r.flowDeviceCode, "form", "") + } + if r.flowInvalidation != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_invalidation", r.flowInvalidation, "form", "") + } + if r.flowRecovery != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_recovery", r.flowRecovery, "form", "") + } + if r.flowUnenrollment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_unenrollment", r.flowUnenrollment, "form", "") + } + if r.flowUserSettings != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_user_settings", r.flowUserSettings, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.webCertificate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "web_certificate", r.webCertificate, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid string + patchedBrandRequest *PatchedBrandRequest +} + +func (r ApiCoreBrandsPartialUpdateRequest) PatchedBrandRequest(patchedBrandRequest PatchedBrandRequest) ApiCoreBrandsPartialUpdateRequest { + r.patchedBrandRequest = &patchedBrandRequest + return r +} + +func (r ApiCoreBrandsPartialUpdateRequest) Execute() (*Brand, *http.Response, error) { + return r.ApiService.CoreBrandsPartialUpdateExecute(r) +} + +/* +CoreBrandsPartialUpdate Method for CoreBrandsPartialUpdate + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param brandUuid A UUID string identifying this Brand. + @return ApiCoreBrandsPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreBrandsPartialUpdate(ctx context.Context, brandUuid string) ApiCoreBrandsPartialUpdateRequest { + return ApiCoreBrandsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + brandUuid: brandUuid, + } +} + +// Execute executes the request +// +// @return Brand +func (a *CoreAPIService) CoreBrandsPartialUpdateExecute(r ApiCoreBrandsPartialUpdateRequest) (*Brand, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Brand + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/{brand_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"brand_uuid"+"}", url.PathEscape(parameterValueToString(r.brandUuid, "brandUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedBrandRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid string +} + +func (r ApiCoreBrandsRetrieveRequest) Execute() (*Brand, *http.Response, error) { + return r.ApiService.CoreBrandsRetrieveExecute(r) +} + +/* +CoreBrandsRetrieve Method for CoreBrandsRetrieve + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param brandUuid A UUID string identifying this Brand. + @return ApiCoreBrandsRetrieveRequest +*/ +func (a *CoreAPIService) CoreBrandsRetrieve(ctx context.Context, brandUuid string) ApiCoreBrandsRetrieveRequest { + return ApiCoreBrandsRetrieveRequest{ + ApiService: a, + ctx: ctx, + brandUuid: brandUuid, + } +} + +// Execute executes the request +// +// @return Brand +func (a *CoreAPIService) CoreBrandsRetrieveExecute(r ApiCoreBrandsRetrieveRequest) (*Brand, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Brand + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/{brand_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"brand_uuid"+"}", url.PathEscape(parameterValueToString(r.brandUuid, "brandUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid string + brandRequest *BrandRequest +} + +func (r ApiCoreBrandsUpdateRequest) BrandRequest(brandRequest BrandRequest) ApiCoreBrandsUpdateRequest { + r.brandRequest = &brandRequest + return r +} + +func (r ApiCoreBrandsUpdateRequest) Execute() (*Brand, *http.Response, error) { + return r.ApiService.CoreBrandsUpdateExecute(r) +} + +/* +CoreBrandsUpdate Method for CoreBrandsUpdate + +Brand Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param brandUuid A UUID string identifying this Brand. + @return ApiCoreBrandsUpdateRequest +*/ +func (a *CoreAPIService) CoreBrandsUpdate(ctx context.Context, brandUuid string) ApiCoreBrandsUpdateRequest { + return ApiCoreBrandsUpdateRequest{ + ApiService: a, + ctx: ctx, + brandUuid: brandUuid, + } +} + +// Execute executes the request +// +// @return Brand +func (a *CoreAPIService) CoreBrandsUpdateExecute(r ApiCoreBrandsUpdateRequest) (*Brand, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Brand + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/{brand_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"brand_uuid"+"}", url.PathEscape(parameterValueToString(r.brandUuid, "brandUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.brandRequest == nil { + return localVarReturnValue, nil, reportError("brandRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.brandRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreBrandsUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + brandUuid string +} + +func (r ApiCoreBrandsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreBrandsUsedByListExecute(r) +} + +/* +CoreBrandsUsedByList Method for CoreBrandsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param brandUuid A UUID string identifying this Brand. + @return ApiCoreBrandsUsedByListRequest +*/ +func (a *CoreAPIService) CoreBrandsUsedByList(ctx context.Context, brandUuid string) ApiCoreBrandsUsedByListRequest { + return ApiCoreBrandsUsedByListRequest{ + ApiService: a, + ctx: ctx, + brandUuid: brandUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreBrandsUsedByListExecute(r ApiCoreBrandsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreBrandsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/brands/{brand_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"brand_uuid"+"}", url.PathEscape(parameterValueToString(r.brandUuid, "brandUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsAddUserCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string + userAccountRequest *UserAccountRequest +} + +func (r ApiCoreGroupsAddUserCreateRequest) UserAccountRequest(userAccountRequest UserAccountRequest) ApiCoreGroupsAddUserCreateRequest { + r.userAccountRequest = &userAccountRequest + return r +} + +func (r ApiCoreGroupsAddUserCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreGroupsAddUserCreateExecute(r) +} + +/* +CoreGroupsAddUserCreate Method for CoreGroupsAddUserCreate + +Add user to group + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsAddUserCreateRequest +*/ +func (a *CoreAPIService) CoreGroupsAddUserCreate(ctx context.Context, groupUuid string) ApiCoreGroupsAddUserCreateRequest { + return ApiCoreGroupsAddUserCreateRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreGroupsAddUserCreateExecute(r ApiCoreGroupsAddUserCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsAddUserCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/add_user/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userAccountRequest == nil { + return nil, reportError("userAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userAccountRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreGroupsCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupRequest *GroupRequest +} + +func (r ApiCoreGroupsCreateRequest) GroupRequest(groupRequest GroupRequest) ApiCoreGroupsCreateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiCoreGroupsCreateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.CoreGroupsCreateExecute(r) +} + +/* +CoreGroupsCreate Method for CoreGroupsCreate + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreGroupsCreateRequest +*/ +func (a *CoreAPIService) CoreGroupsCreate(ctx context.Context) ApiCoreGroupsCreateRequest { + return ApiCoreGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Group +func (a *CoreAPIService) CoreGroupsCreateExecute(r ApiCoreGroupsCreateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string +} + +func (r ApiCoreGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreGroupsDestroyExecute(r) +} + +/* +CoreGroupsDestroy Method for CoreGroupsDestroy + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsDestroyRequest +*/ +func (a *CoreAPIService) CoreGroupsDestroy(ctx context.Context, groupUuid string) ApiCoreGroupsDestroyRequest { + return ApiCoreGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreGroupsDestroyExecute(r ApiCoreGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreGroupsListRequest struct { + ctx context.Context + ApiService *CoreAPIService + attributes *string + includeChildren *bool + includeInheritedRoles *bool + includeParents *bool + includeUsers *bool + isSuperuser *bool + membersByPk *[]int32 + membersByUsername *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Attributes +func (r ApiCoreGroupsListRequest) Attributes(attributes string) ApiCoreGroupsListRequest { + r.attributes = &attributes + return r +} + +func (r ApiCoreGroupsListRequest) IncludeChildren(includeChildren bool) ApiCoreGroupsListRequest { + r.includeChildren = &includeChildren + return r +} + +func (r ApiCoreGroupsListRequest) IncludeInheritedRoles(includeInheritedRoles bool) ApiCoreGroupsListRequest { + r.includeInheritedRoles = &includeInheritedRoles + return r +} + +func (r ApiCoreGroupsListRequest) IncludeParents(includeParents bool) ApiCoreGroupsListRequest { + r.includeParents = &includeParents + return r +} + +func (r ApiCoreGroupsListRequest) IncludeUsers(includeUsers bool) ApiCoreGroupsListRequest { + r.includeUsers = &includeUsers + return r +} + +func (r ApiCoreGroupsListRequest) IsSuperuser(isSuperuser bool) ApiCoreGroupsListRequest { + r.isSuperuser = &isSuperuser + return r +} + +func (r ApiCoreGroupsListRequest) MembersByPk(membersByPk []int32) ApiCoreGroupsListRequest { + r.membersByPk = &membersByPk + return r +} + +// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. +func (r ApiCoreGroupsListRequest) MembersByUsername(membersByUsername []string) ApiCoreGroupsListRequest { + r.membersByUsername = &membersByUsername + return r +} + +func (r ApiCoreGroupsListRequest) Name(name string) ApiCoreGroupsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreGroupsListRequest) Ordering(ordering string) ApiCoreGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreGroupsListRequest) Page(page int32) ApiCoreGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreGroupsListRequest) PageSize(pageSize int32) ApiCoreGroupsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreGroupsListRequest) Search(search string) ApiCoreGroupsListRequest { + r.search = &search + return r +} + +func (r ApiCoreGroupsListRequest) Execute() (*PaginatedGroupList, *http.Response, error) { + return r.ApiService.CoreGroupsListExecute(r) +} + +/* +CoreGroupsList Method for CoreGroupsList + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreGroupsListRequest +*/ +func (a *CoreAPIService) CoreGroupsList(ctx context.Context) ApiCoreGroupsListRequest { + return ApiCoreGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupList +func (a *CoreAPIService) CoreGroupsListExecute(r ApiCoreGroupsListRequest) (*PaginatedGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.attributes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attributes", r.attributes, "form", "") + } + if r.includeChildren != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_children", r.includeChildren, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_children", defaultValue, "form", "") + r.includeChildren = &defaultValue + } + if r.includeInheritedRoles != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_inherited_roles", r.includeInheritedRoles, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_inherited_roles", defaultValue, "form", "") + r.includeInheritedRoles = &defaultValue + } + if r.includeParents != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_parents", r.includeParents, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_parents", defaultValue, "form", "") + r.includeParents = &defaultValue + } + if r.includeUsers != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_users", r.includeUsers, "form", "") + } else { + var defaultValue bool = true + parameterAddToHeaderOrQuery(localVarQueryParams, "include_users", defaultValue, "form", "") + r.includeUsers = &defaultValue + } + if r.isSuperuser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_superuser", r.isSuperuser, "form", "") + } + if r.membersByPk != nil { + t := *r.membersByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "members_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "members_by_pk", t, "form", "multi") + } + } + if r.membersByUsername != nil { + t := *r.membersByUsername + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "members_by_username", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "members_by_username", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string + patchedGroupRequest *PatchedGroupRequest +} + +func (r ApiCoreGroupsPartialUpdateRequest) PatchedGroupRequest(patchedGroupRequest PatchedGroupRequest) ApiCoreGroupsPartialUpdateRequest { + r.patchedGroupRequest = &patchedGroupRequest + return r +} + +func (r ApiCoreGroupsPartialUpdateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.CoreGroupsPartialUpdateExecute(r) +} + +/* +CoreGroupsPartialUpdate Method for CoreGroupsPartialUpdate + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreGroupsPartialUpdate(ctx context.Context, groupUuid string) ApiCoreGroupsPartialUpdateRequest { + return ApiCoreGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +// +// @return Group +func (a *CoreAPIService) CoreGroupsPartialUpdateExecute(r ApiCoreGroupsPartialUpdateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsRemoveUserCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string + userAccountRequest *UserAccountRequest +} + +func (r ApiCoreGroupsRemoveUserCreateRequest) UserAccountRequest(userAccountRequest UserAccountRequest) ApiCoreGroupsRemoveUserCreateRequest { + r.userAccountRequest = &userAccountRequest + return r +} + +func (r ApiCoreGroupsRemoveUserCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreGroupsRemoveUserCreateExecute(r) +} + +/* +CoreGroupsRemoveUserCreate Method for CoreGroupsRemoveUserCreate + +Remove user from group + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsRemoveUserCreateRequest +*/ +func (a *CoreAPIService) CoreGroupsRemoveUserCreate(ctx context.Context, groupUuid string) ApiCoreGroupsRemoveUserCreateRequest { + return ApiCoreGroupsRemoveUserCreateRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreGroupsRemoveUserCreateExecute(r ApiCoreGroupsRemoveUserCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsRemoveUserCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/remove_user/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userAccountRequest == nil { + return nil, reportError("userAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userAccountRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreGroupsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string + includeChildren *bool + includeInheritedRoles *bool + includeParents *bool + includeUsers *bool +} + +func (r ApiCoreGroupsRetrieveRequest) IncludeChildren(includeChildren bool) ApiCoreGroupsRetrieveRequest { + r.includeChildren = &includeChildren + return r +} + +func (r ApiCoreGroupsRetrieveRequest) IncludeInheritedRoles(includeInheritedRoles bool) ApiCoreGroupsRetrieveRequest { + r.includeInheritedRoles = &includeInheritedRoles + return r +} + +func (r ApiCoreGroupsRetrieveRequest) IncludeParents(includeParents bool) ApiCoreGroupsRetrieveRequest { + r.includeParents = &includeParents + return r +} + +func (r ApiCoreGroupsRetrieveRequest) IncludeUsers(includeUsers bool) ApiCoreGroupsRetrieveRequest { + r.includeUsers = &includeUsers + return r +} + +func (r ApiCoreGroupsRetrieveRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.CoreGroupsRetrieveExecute(r) +} + +/* +CoreGroupsRetrieve Method for CoreGroupsRetrieve + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsRetrieveRequest +*/ +func (a *CoreAPIService) CoreGroupsRetrieve(ctx context.Context, groupUuid string) ApiCoreGroupsRetrieveRequest { + return ApiCoreGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +// +// @return Group +func (a *CoreAPIService) CoreGroupsRetrieveExecute(r ApiCoreGroupsRetrieveRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.includeChildren != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_children", r.includeChildren, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_children", defaultValue, "form", "") + r.includeChildren = &defaultValue + } + if r.includeInheritedRoles != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_inherited_roles", r.includeInheritedRoles, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_inherited_roles", defaultValue, "form", "") + r.includeInheritedRoles = &defaultValue + } + if r.includeParents != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_parents", r.includeParents, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "include_parents", defaultValue, "form", "") + r.includeParents = &defaultValue + } + if r.includeUsers != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_users", r.includeUsers, "form", "") + } else { + var defaultValue bool = true + parameterAddToHeaderOrQuery(localVarQueryParams, "include_users", defaultValue, "form", "") + r.includeUsers = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string + groupRequest *GroupRequest +} + +func (r ApiCoreGroupsUpdateRequest) GroupRequest(groupRequest GroupRequest) ApiCoreGroupsUpdateRequest { + r.groupRequest = &groupRequest + return r +} + +func (r ApiCoreGroupsUpdateRequest) Execute() (*Group, *http.Response, error) { + return r.ApiService.CoreGroupsUpdateExecute(r) +} + +/* +CoreGroupsUpdate Method for CoreGroupsUpdate + +Group Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsUpdateRequest +*/ +func (a *CoreAPIService) CoreGroupsUpdate(ctx context.Context, groupUuid string) ApiCoreGroupsUpdateRequest { + return ApiCoreGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +// +// @return Group +func (a *CoreAPIService) CoreGroupsUpdateExecute(r ApiCoreGroupsUpdateRequest) (*Group, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Group + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupRequest == nil { + return localVarReturnValue, nil, reportError("groupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreGroupsUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + groupUuid string +} + +func (r ApiCoreGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreGroupsUsedByListExecute(r) +} + +/* +CoreGroupsUsedByList Method for CoreGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param groupUuid A UUID string identifying this Group. + @return ApiCoreGroupsUsedByListRequest +*/ +func (a *CoreAPIService) CoreGroupsUsedByList(ctx context.Context, groupUuid string) ApiCoreGroupsUsedByListRequest { + return ApiCoreGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + groupUuid: groupUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreGroupsUsedByListExecute(r ApiCoreGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/groups/{group_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"group_uuid"+"}", url.PathEscape(parameterValueToString(r.groupUuid, "groupUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + tokenRequest *TokenRequest +} + +func (r ApiCoreTokensCreateRequest) TokenRequest(tokenRequest TokenRequest) ApiCoreTokensCreateRequest { + r.tokenRequest = &tokenRequest + return r +} + +func (r ApiCoreTokensCreateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.CoreTokensCreateExecute(r) +} + +/* +CoreTokensCreate Method for CoreTokensCreate + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreTokensCreateRequest +*/ +func (a *CoreAPIService) CoreTokensCreate(ctx context.Context) ApiCoreTokensCreateRequest { + return ApiCoreTokensCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Token +func (a *CoreAPIService) CoreTokensCreateExecute(r ApiCoreTokensCreateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenRequest == nil { + return localVarReturnValue, nil, reportError("tokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string +} + +func (r ApiCoreTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreTokensDestroyExecute(r) +} + +/* +CoreTokensDestroy Method for CoreTokensDestroy + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensDestroyRequest +*/ +func (a *CoreAPIService) CoreTokensDestroy(ctx context.Context, identifier string) ApiCoreTokensDestroyRequest { + return ApiCoreTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreTokensDestroyExecute(r ApiCoreTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreTokensListRequest struct { + ctx context.Context + ApiService *CoreAPIService + description *string + expires *time.Time + expiring *bool + identifier *string + intent *string + managed *string + ordering *string + page *int32 + pageSize *int32 + search *string + userUsername *string +} + +func (r ApiCoreTokensListRequest) Description(description string) ApiCoreTokensListRequest { + r.description = &description + return r +} + +func (r ApiCoreTokensListRequest) Expires(expires time.Time) ApiCoreTokensListRequest { + r.expires = &expires + return r +} + +func (r ApiCoreTokensListRequest) Expiring(expiring bool) ApiCoreTokensListRequest { + r.expiring = &expiring + return r +} + +func (r ApiCoreTokensListRequest) Identifier(identifier string) ApiCoreTokensListRequest { + r.identifier = &identifier + return r +} + +func (r ApiCoreTokensListRequest) Intent(intent string) ApiCoreTokensListRequest { + r.intent = &intent + return r +} + +func (r ApiCoreTokensListRequest) Managed(managed string) ApiCoreTokensListRequest { + r.managed = &managed + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreTokensListRequest) Ordering(ordering string) ApiCoreTokensListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreTokensListRequest) Page(page int32) ApiCoreTokensListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreTokensListRequest) PageSize(pageSize int32) ApiCoreTokensListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreTokensListRequest) Search(search string) ApiCoreTokensListRequest { + r.search = &search + return r +} + +func (r ApiCoreTokensListRequest) UserUsername(userUsername string) ApiCoreTokensListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiCoreTokensListRequest) Execute() (*PaginatedTokenList, *http.Response, error) { + return r.ApiService.CoreTokensListExecute(r) +} + +/* +CoreTokensList Method for CoreTokensList + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreTokensListRequest +*/ +func (a *CoreAPIService) CoreTokensList(ctx context.Context) ApiCoreTokensListRequest { + return ApiCoreTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTokenList +func (a *CoreAPIService) CoreTokensListExecute(r ApiCoreTokensListRequest) (*PaginatedTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.description != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", r.description, "form", "") + } + if r.expires != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expires", r.expires, "form", "") + } + if r.expiring != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expiring", r.expiring, "form", "") + } + if r.identifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier", r.identifier, "form", "") + } + if r.intent != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "intent", r.intent, "form", "") + } + if r.managed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", r.managed, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string + patchedTokenRequest *PatchedTokenRequest +} + +func (r ApiCoreTokensPartialUpdateRequest) PatchedTokenRequest(patchedTokenRequest PatchedTokenRequest) ApiCoreTokensPartialUpdateRequest { + r.patchedTokenRequest = &patchedTokenRequest + return r +} + +func (r ApiCoreTokensPartialUpdateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.CoreTokensPartialUpdateExecute(r) +} + +/* +CoreTokensPartialUpdate Method for CoreTokensPartialUpdate + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreTokensPartialUpdate(ctx context.Context, identifier string) ApiCoreTokensPartialUpdateRequest { + return ApiCoreTokensPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +// +// @return Token +func (a *CoreAPIService) CoreTokensPartialUpdateExecute(r ApiCoreTokensPartialUpdateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string +} + +func (r ApiCoreTokensRetrieveRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.CoreTokensRetrieveExecute(r) +} + +/* +CoreTokensRetrieve Method for CoreTokensRetrieve + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensRetrieveRequest +*/ +func (a *CoreAPIService) CoreTokensRetrieve(ctx context.Context, identifier string) ApiCoreTokensRetrieveRequest { + return ApiCoreTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +// +// @return Token +func (a *CoreAPIService) CoreTokensRetrieveExecute(r ApiCoreTokensRetrieveRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensSetKeyCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string + tokenSetKeyRequest *TokenSetKeyRequest +} + +func (r ApiCoreTokensSetKeyCreateRequest) TokenSetKeyRequest(tokenSetKeyRequest TokenSetKeyRequest) ApiCoreTokensSetKeyCreateRequest { + r.tokenSetKeyRequest = &tokenSetKeyRequest + return r +} + +func (r ApiCoreTokensSetKeyCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreTokensSetKeyCreateExecute(r) +} + +/* +CoreTokensSetKeyCreate Method for CoreTokensSetKeyCreate + +Set token key. Action is logged as event. `authentik_core.set_token_key` permission +is required. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensSetKeyCreateRequest +*/ +func (a *CoreAPIService) CoreTokensSetKeyCreate(ctx context.Context, identifier string) ApiCoreTokensSetKeyCreateRequest { + return ApiCoreTokensSetKeyCreateRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreTokensSetKeyCreateExecute(r ApiCoreTokensSetKeyCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensSetKeyCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/set_key/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenSetKeyRequest == nil { + return nil, reportError("tokenSetKeyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenSetKeyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreTokensUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string + tokenRequest *TokenRequest +} + +func (r ApiCoreTokensUpdateRequest) TokenRequest(tokenRequest TokenRequest) ApiCoreTokensUpdateRequest { + r.tokenRequest = &tokenRequest + return r +} + +func (r ApiCoreTokensUpdateRequest) Execute() (*Token, *http.Response, error) { + return r.ApiService.CoreTokensUpdateExecute(r) +} + +/* +CoreTokensUpdate Method for CoreTokensUpdate + +Token Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensUpdateRequest +*/ +func (a *CoreAPIService) CoreTokensUpdate(ctx context.Context, identifier string) ApiCoreTokensUpdateRequest { + return ApiCoreTokensUpdateRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +// +// @return Token +func (a *CoreAPIService) CoreTokensUpdateExecute(r ApiCoreTokensUpdateRequest) (*Token, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Token + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tokenRequest == nil { + return localVarReturnValue, nil, reportError("tokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string +} + +func (r ApiCoreTokensUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreTokensUsedByListExecute(r) +} + +/* +CoreTokensUsedByList Method for CoreTokensUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensUsedByListRequest +*/ +func (a *CoreAPIService) CoreTokensUsedByList(ctx context.Context, identifier string) ApiCoreTokensUsedByListRequest { + return ApiCoreTokensUsedByListRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreTokensUsedByListExecute(r ApiCoreTokensUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTokensViewKeyRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + identifier string +} + +func (r ApiCoreTokensViewKeyRetrieveRequest) Execute() (*TokenView, *http.Response, error) { + return r.ApiService.CoreTokensViewKeyRetrieveExecute(r) +} + +/* +CoreTokensViewKeyRetrieve Method for CoreTokensViewKeyRetrieve + +Return token key and log access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param identifier + @return ApiCoreTokensViewKeyRetrieveRequest +*/ +func (a *CoreAPIService) CoreTokensViewKeyRetrieve(ctx context.Context, identifier string) ApiCoreTokensViewKeyRetrieveRequest { + return ApiCoreTokensViewKeyRetrieveRequest{ + ApiService: a, + ctx: ctx, + identifier: identifier, + } +} + +// Execute executes the request +// +// @return TokenView +func (a *CoreAPIService) CoreTokensViewKeyRetrieveExecute(r ApiCoreTokensViewKeyRetrieveRequest) (*TokenView, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TokenView + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTokensViewKeyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/tokens/{identifier}/view_key/" + localVarPath = strings.Replace(localVarPath, "{"+"identifier"+"}", url.PathEscape(parameterValueToString(r.identifier, "identifier")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreTransactionalApplicationsUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + transactionApplicationRequest *TransactionApplicationRequest +} + +func (r ApiCoreTransactionalApplicationsUpdateRequest) TransactionApplicationRequest(transactionApplicationRequest TransactionApplicationRequest) ApiCoreTransactionalApplicationsUpdateRequest { + r.transactionApplicationRequest = &transactionApplicationRequest + return r +} + +func (r ApiCoreTransactionalApplicationsUpdateRequest) Execute() (*TransactionApplicationResponse, *http.Response, error) { + return r.ApiService.CoreTransactionalApplicationsUpdateExecute(r) +} + +/* +CoreTransactionalApplicationsUpdate Method for CoreTransactionalApplicationsUpdate + +Convert data into a blueprint, validate it and apply it + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreTransactionalApplicationsUpdateRequest +*/ +func (a *CoreAPIService) CoreTransactionalApplicationsUpdate(ctx context.Context) ApiCoreTransactionalApplicationsUpdateRequest { + return ApiCoreTransactionalApplicationsUpdateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TransactionApplicationResponse +func (a *CoreAPIService) CoreTransactionalApplicationsUpdateExecute(r ApiCoreTransactionalApplicationsUpdateRequest) (*TransactionApplicationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TransactionApplicationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreTransactionalApplicationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/transactional/applications/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.transactionApplicationRequest == nil { + return localVarReturnValue, nil, reportError("transactionApplicationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.transactionApplicationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUserConsentDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUserConsentDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUserConsentDestroyExecute(r) +} + +/* +CoreUserConsentDestroy Method for CoreUserConsentDestroy + +UserConsent Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Consent. + @return ApiCoreUserConsentDestroyRequest +*/ +func (a *CoreAPIService) CoreUserConsentDestroy(ctx context.Context, id int32) ApiCoreUserConsentDestroyRequest { + return ApiCoreUserConsentDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUserConsentDestroyExecute(r ApiCoreUserConsentDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUserConsentDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/user_consent/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUserConsentListRequest struct { + ctx context.Context + ApiService *CoreAPIService + application *string + ordering *string + page *int32 + pageSize *int32 + search *string + user *int32 +} + +func (r ApiCoreUserConsentListRequest) Application(application string) ApiCoreUserConsentListRequest { + r.application = &application + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreUserConsentListRequest) Ordering(ordering string) ApiCoreUserConsentListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreUserConsentListRequest) Page(page int32) ApiCoreUserConsentListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreUserConsentListRequest) PageSize(pageSize int32) ApiCoreUserConsentListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCoreUserConsentListRequest) Search(search string) ApiCoreUserConsentListRequest { + r.search = &search + return r +} + +func (r ApiCoreUserConsentListRequest) User(user int32) ApiCoreUserConsentListRequest { + r.user = &user + return r +} + +func (r ApiCoreUserConsentListRequest) Execute() (*PaginatedUserConsentList, *http.Response, error) { + return r.ApiService.CoreUserConsentListExecute(r) +} + +/* +CoreUserConsentList Method for CoreUserConsentList + +UserConsent Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUserConsentListRequest +*/ +func (a *CoreAPIService) CoreUserConsentList(ctx context.Context) ApiCoreUserConsentListRequest { + return ApiCoreUserConsentListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserConsentList +func (a *CoreAPIService) CoreUserConsentListExecute(r ApiCoreUserConsentListRequest) (*PaginatedUserConsentList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserConsentList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUserConsentList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/user_consent/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.application != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application", r.application, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUserConsentRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUserConsentRetrieveRequest) Execute() (*UserConsent, *http.Response, error) { + return r.ApiService.CoreUserConsentRetrieveExecute(r) +} + +/* +CoreUserConsentRetrieve Method for CoreUserConsentRetrieve + +UserConsent Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Consent. + @return ApiCoreUserConsentRetrieveRequest +*/ +func (a *CoreAPIService) CoreUserConsentRetrieve(ctx context.Context, id int32) ApiCoreUserConsentRetrieveRequest { + return ApiCoreUserConsentRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserConsent +func (a *CoreAPIService) CoreUserConsentRetrieveExecute(r ApiCoreUserConsentRetrieveRequest) (*UserConsent, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserConsent + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUserConsentRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/user_consent/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUserConsentUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUserConsentUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreUserConsentUsedByListExecute(r) +} + +/* +CoreUserConsentUsedByList Method for CoreUserConsentUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Consent. + @return ApiCoreUserConsentUsedByListRequest +*/ +func (a *CoreAPIService) CoreUserConsentUsedByList(ctx context.Context, id int32) ApiCoreUserConsentUsedByListRequest { + return ApiCoreUserConsentUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreUserConsentUsedByListExecute(r ApiCoreUserConsentUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUserConsentUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/user_consent/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + userRequest *UserRequest +} + +func (r ApiCoreUsersCreateRequest) UserRequest(userRequest UserRequest) ApiCoreUsersCreateRequest { + r.userRequest = &userRequest + return r +} + +func (r ApiCoreUsersCreateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CoreUsersCreateExecute(r) +} + +/* +CoreUsersCreate Method for CoreUsersCreate + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersCreateRequest +*/ +func (a *CoreAPIService) CoreUsersCreate(ctx context.Context) ApiCoreUsersCreateRequest { + return ApiCoreUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return User +func (a *CoreAPIService) CoreUsersCreateExecute(r ApiCoreUsersCreateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRequest == nil { + return localVarReturnValue, nil, reportError("userRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersDestroyRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUsersDestroyExecute(r) +} + +/* +CoreUsersDestroy Method for CoreUsersDestroy + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersDestroyRequest +*/ +func (a *CoreAPIService) CoreUsersDestroy(ctx context.Context, id int32) ApiCoreUsersDestroyRequest { + return ApiCoreUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUsersDestroyExecute(r ApiCoreUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUsersExportCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + attributes *string + dateJoined *time.Time + dateJoinedGt *time.Time + dateJoinedLt *time.Time + email *string + groupsByName *[]string + groupsByPk *[]string + isActive *bool + isSuperuser *bool + lastLogin *time.Time + lastLoginGt *time.Time + lastLoginIsnull *bool + lastLoginLt *time.Time + lastUpdated *time.Time + lastUpdatedGt *time.Time + lastUpdatedLt *time.Time + name *string + ordering *string + path *string + pathStartswith *string + rolesByName *[]string + rolesByPk *[]string + search *string + type_ *[]string + username *string + uuid *string +} + +// Attributes +func (r ApiCoreUsersExportCreateRequest) Attributes(attributes string) ApiCoreUsersExportCreateRequest { + r.attributes = &attributes + return r +} + +func (r ApiCoreUsersExportCreateRequest) DateJoined(dateJoined time.Time) ApiCoreUsersExportCreateRequest { + r.dateJoined = &dateJoined + return r +} + +func (r ApiCoreUsersExportCreateRequest) DateJoinedGt(dateJoinedGt time.Time) ApiCoreUsersExportCreateRequest { + r.dateJoinedGt = &dateJoinedGt + return r +} + +func (r ApiCoreUsersExportCreateRequest) DateJoinedLt(dateJoinedLt time.Time) ApiCoreUsersExportCreateRequest { + r.dateJoinedLt = &dateJoinedLt + return r +} + +func (r ApiCoreUsersExportCreateRequest) Email(email string) ApiCoreUsersExportCreateRequest { + r.email = &email + return r +} + +func (r ApiCoreUsersExportCreateRequest) GroupsByName(groupsByName []string) ApiCoreUsersExportCreateRequest { + r.groupsByName = &groupsByName + return r +} + +func (r ApiCoreUsersExportCreateRequest) GroupsByPk(groupsByPk []string) ApiCoreUsersExportCreateRequest { + r.groupsByPk = &groupsByPk + return r +} + +func (r ApiCoreUsersExportCreateRequest) IsActive(isActive bool) ApiCoreUsersExportCreateRequest { + r.isActive = &isActive + return r +} + +func (r ApiCoreUsersExportCreateRequest) IsSuperuser(isSuperuser bool) ApiCoreUsersExportCreateRequest { + r.isSuperuser = &isSuperuser + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastLogin(lastLogin time.Time) ApiCoreUsersExportCreateRequest { + r.lastLogin = &lastLogin + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastLoginGt(lastLoginGt time.Time) ApiCoreUsersExportCreateRequest { + r.lastLoginGt = &lastLoginGt + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastLoginIsnull(lastLoginIsnull bool) ApiCoreUsersExportCreateRequest { + r.lastLoginIsnull = &lastLoginIsnull + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastLoginLt(lastLoginLt time.Time) ApiCoreUsersExportCreateRequest { + r.lastLoginLt = &lastLoginLt + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastUpdated(lastUpdated time.Time) ApiCoreUsersExportCreateRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastUpdatedGt(lastUpdatedGt time.Time) ApiCoreUsersExportCreateRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCoreUsersExportCreateRequest) LastUpdatedLt(lastUpdatedLt time.Time) ApiCoreUsersExportCreateRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCoreUsersExportCreateRequest) Name(name string) ApiCoreUsersExportCreateRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreUsersExportCreateRequest) Ordering(ordering string) ApiCoreUsersExportCreateRequest { + r.ordering = &ordering + return r +} + +func (r ApiCoreUsersExportCreateRequest) Path(path string) ApiCoreUsersExportCreateRequest { + r.path = &path + return r +} + +func (r ApiCoreUsersExportCreateRequest) PathStartswith(pathStartswith string) ApiCoreUsersExportCreateRequest { + r.pathStartswith = &pathStartswith + return r +} + +func (r ApiCoreUsersExportCreateRequest) RolesByName(rolesByName []string) ApiCoreUsersExportCreateRequest { + r.rolesByName = &rolesByName + return r +} + +func (r ApiCoreUsersExportCreateRequest) RolesByPk(rolesByPk []string) ApiCoreUsersExportCreateRequest { + r.rolesByPk = &rolesByPk + return r +} + +// A search term. +func (r ApiCoreUsersExportCreateRequest) Search(search string) ApiCoreUsersExportCreateRequest { + r.search = &search + return r +} + +func (r ApiCoreUsersExportCreateRequest) Type_(type_ []string) ApiCoreUsersExportCreateRequest { + r.type_ = &type_ + return r +} + +func (r ApiCoreUsersExportCreateRequest) Username(username string) ApiCoreUsersExportCreateRequest { + r.username = &username + return r +} + +func (r ApiCoreUsersExportCreateRequest) Uuid(uuid string) ApiCoreUsersExportCreateRequest { + r.uuid = &uuid + return r +} + +func (r ApiCoreUsersExportCreateRequest) Execute() (*DataExport, *http.Response, error) { + return r.ApiService.CoreUsersExportCreateExecute(r) +} + +/* +CoreUsersExportCreate Method for CoreUsersExportCreate + +Create a data export for this data type. Note that the export is generated asynchronously: +this method returns a `DataExport` object that will initially have `completed=false` as well +as the permanent URL to that object in the `Location` header. +You can poll that URL until `completed=true`, at which point the `file_url` property will +contain a URL to download + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersExportCreateRequest +*/ +func (a *CoreAPIService) CoreUsersExportCreate(ctx context.Context) ApiCoreUsersExportCreateRequest { + return ApiCoreUsersExportCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DataExport +func (a *CoreAPIService) CoreUsersExportCreateExecute(r ApiCoreUsersExportCreateRequest) (*DataExport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataExport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersExportCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/export/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.attributes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attributes", r.attributes, "form", "") + } + if r.dateJoined != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined", r.dateJoined, "form", "") + } + if r.dateJoinedGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined__gt", r.dateJoinedGt, "form", "") + } + if r.dateJoinedLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined__lt", r.dateJoinedLt, "form", "") + } + if r.email != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", r.email, "form", "") + } + if r.groupsByName != nil { + t := *r.groupsByName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_name", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_name", t, "form", "multi") + } + } + if r.groupsByPk != nil { + t := *r.groupsByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_pk", t, "form", "multi") + } + } + if r.isActive != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_active", r.isActive, "form", "") + } + if r.isSuperuser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_superuser", r.isSuperuser, "form", "") + } + if r.lastLogin != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login", r.lastLogin, "form", "") + } + if r.lastLoginGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__gt", r.lastLoginGt, "form", "") + } + if r.lastLoginIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__isnull", r.lastLoginIsnull, "form", "") + } + if r.lastLoginLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__lt", r.lastLoginLt, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.lastUpdatedGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", r.lastUpdatedGt, "form", "") + } + if r.lastUpdatedLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", r.lastUpdatedLt, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.path != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + } + if r.pathStartswith != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path_startswith", r.pathStartswith, "form", "") + } + if r.rolesByName != nil { + t := *r.rolesByName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_name", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_name", t, "form", "multi") + } + } + if r.rolesByPk != nil { + t := *r.rolesByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_pk", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "form", "multi") + } + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + if r.uuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "uuid", r.uuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersImpersonateCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + impersonationRequest *ImpersonationRequest +} + +func (r ApiCoreUsersImpersonateCreateRequest) ImpersonationRequest(impersonationRequest ImpersonationRequest) ApiCoreUsersImpersonateCreateRequest { + r.impersonationRequest = &impersonationRequest + return r +} + +func (r ApiCoreUsersImpersonateCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUsersImpersonateCreateExecute(r) +} + +/* +CoreUsersImpersonateCreate Method for CoreUsersImpersonateCreate + +Impersonate a user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersImpersonateCreateRequest +*/ +func (a *CoreAPIService) CoreUsersImpersonateCreate(ctx context.Context, id int32) ApiCoreUsersImpersonateCreateRequest { + return ApiCoreUsersImpersonateCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUsersImpersonateCreateExecute(r ApiCoreUsersImpersonateCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersImpersonateCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/impersonate/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.impersonationRequest == nil { + return nil, reportError("impersonationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.impersonationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUsersImpersonateEndRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService +} + +func (r ApiCoreUsersImpersonateEndRetrieveRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUsersImpersonateEndRetrieveExecute(r) +} + +/* +CoreUsersImpersonateEndRetrieve Method for CoreUsersImpersonateEndRetrieve + +End Impersonation a user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersImpersonateEndRetrieveRequest +*/ +func (a *CoreAPIService) CoreUsersImpersonateEndRetrieve(ctx context.Context) ApiCoreUsersImpersonateEndRetrieveRequest { + return ApiCoreUsersImpersonateEndRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUsersImpersonateEndRetrieveExecute(r ApiCoreUsersImpersonateEndRetrieveRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersImpersonateEndRetrieve") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/impersonate_end/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUsersListRequest struct { + ctx context.Context + ApiService *CoreAPIService + attributes *string + dateJoined *time.Time + dateJoinedGt *time.Time + dateJoinedLt *time.Time + email *string + groupsByName *[]string + groupsByPk *[]string + includeGroups *bool + includeRoles *bool + isActive *bool + isSuperuser *bool + lastLogin *time.Time + lastLoginGt *time.Time + lastLoginIsnull *bool + lastLoginLt *time.Time + lastUpdated *time.Time + lastUpdatedGt *time.Time + lastUpdatedLt *time.Time + name *string + ordering *string + page *int32 + pageSize *int32 + path *string + pathStartswith *string + rolesByName *[]string + rolesByPk *[]string + search *string + type_ *[]string + username *string + uuid *string +} + +// Attributes +func (r ApiCoreUsersListRequest) Attributes(attributes string) ApiCoreUsersListRequest { + r.attributes = &attributes + return r +} + +func (r ApiCoreUsersListRequest) DateJoined(dateJoined time.Time) ApiCoreUsersListRequest { + r.dateJoined = &dateJoined + return r +} + +func (r ApiCoreUsersListRequest) DateJoinedGt(dateJoinedGt time.Time) ApiCoreUsersListRequest { + r.dateJoinedGt = &dateJoinedGt + return r +} + +func (r ApiCoreUsersListRequest) DateJoinedLt(dateJoinedLt time.Time) ApiCoreUsersListRequest { + r.dateJoinedLt = &dateJoinedLt + return r +} + +func (r ApiCoreUsersListRequest) Email(email string) ApiCoreUsersListRequest { + r.email = &email + return r +} + +func (r ApiCoreUsersListRequest) GroupsByName(groupsByName []string) ApiCoreUsersListRequest { + r.groupsByName = &groupsByName + return r +} + +func (r ApiCoreUsersListRequest) GroupsByPk(groupsByPk []string) ApiCoreUsersListRequest { + r.groupsByPk = &groupsByPk + return r +} + +func (r ApiCoreUsersListRequest) IncludeGroups(includeGroups bool) ApiCoreUsersListRequest { + r.includeGroups = &includeGroups + return r +} + +func (r ApiCoreUsersListRequest) IncludeRoles(includeRoles bool) ApiCoreUsersListRequest { + r.includeRoles = &includeRoles + return r +} + +func (r ApiCoreUsersListRequest) IsActive(isActive bool) ApiCoreUsersListRequest { + r.isActive = &isActive + return r +} + +func (r ApiCoreUsersListRequest) IsSuperuser(isSuperuser bool) ApiCoreUsersListRequest { + r.isSuperuser = &isSuperuser + return r +} + +func (r ApiCoreUsersListRequest) LastLogin(lastLogin time.Time) ApiCoreUsersListRequest { + r.lastLogin = &lastLogin + return r +} + +func (r ApiCoreUsersListRequest) LastLoginGt(lastLoginGt time.Time) ApiCoreUsersListRequest { + r.lastLoginGt = &lastLoginGt + return r +} + +func (r ApiCoreUsersListRequest) LastLoginIsnull(lastLoginIsnull bool) ApiCoreUsersListRequest { + r.lastLoginIsnull = &lastLoginIsnull + return r +} + +func (r ApiCoreUsersListRequest) LastLoginLt(lastLoginLt time.Time) ApiCoreUsersListRequest { + r.lastLoginLt = &lastLoginLt + return r +} + +func (r ApiCoreUsersListRequest) LastUpdated(lastUpdated time.Time) ApiCoreUsersListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiCoreUsersListRequest) LastUpdatedGt(lastUpdatedGt time.Time) ApiCoreUsersListRequest { + r.lastUpdatedGt = &lastUpdatedGt + return r +} + +func (r ApiCoreUsersListRequest) LastUpdatedLt(lastUpdatedLt time.Time) ApiCoreUsersListRequest { + r.lastUpdatedLt = &lastUpdatedLt + return r +} + +func (r ApiCoreUsersListRequest) Name(name string) ApiCoreUsersListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiCoreUsersListRequest) Ordering(ordering string) ApiCoreUsersListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCoreUsersListRequest) Page(page int32) ApiCoreUsersListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCoreUsersListRequest) PageSize(pageSize int32) ApiCoreUsersListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiCoreUsersListRequest) Path(path string) ApiCoreUsersListRequest { + r.path = &path + return r +} + +func (r ApiCoreUsersListRequest) PathStartswith(pathStartswith string) ApiCoreUsersListRequest { + r.pathStartswith = &pathStartswith + return r +} + +func (r ApiCoreUsersListRequest) RolesByName(rolesByName []string) ApiCoreUsersListRequest { + r.rolesByName = &rolesByName + return r +} + +func (r ApiCoreUsersListRequest) RolesByPk(rolesByPk []string) ApiCoreUsersListRequest { + r.rolesByPk = &rolesByPk + return r +} + +// A search term. +func (r ApiCoreUsersListRequest) Search(search string) ApiCoreUsersListRequest { + r.search = &search + return r +} + +func (r ApiCoreUsersListRequest) Type_(type_ []string) ApiCoreUsersListRequest { + r.type_ = &type_ + return r +} + +func (r ApiCoreUsersListRequest) Username(username string) ApiCoreUsersListRequest { + r.username = &username + return r +} + +func (r ApiCoreUsersListRequest) Uuid(uuid string) ApiCoreUsersListRequest { + r.uuid = &uuid + return r +} + +func (r ApiCoreUsersListRequest) Execute() (*PaginatedUserList, *http.Response, error) { + return r.ApiService.CoreUsersListExecute(r) +} + +/* +CoreUsersList Method for CoreUsersList + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersListRequest +*/ +func (a *CoreAPIService) CoreUsersList(ctx context.Context) ApiCoreUsersListRequest { + return ApiCoreUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserList +func (a *CoreAPIService) CoreUsersListExecute(r ApiCoreUsersListRequest) (*PaginatedUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.attributes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "attributes", r.attributes, "form", "") + } + if r.dateJoined != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined", r.dateJoined, "form", "") + } + if r.dateJoinedGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined__gt", r.dateJoinedGt, "form", "") + } + if r.dateJoinedLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "date_joined__lt", r.dateJoinedLt, "form", "") + } + if r.email != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "email", r.email, "form", "") + } + if r.groupsByName != nil { + t := *r.groupsByName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_name", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_name", t, "form", "multi") + } + } + if r.groupsByPk != nil { + t := *r.groupsByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups_by_pk", t, "form", "multi") + } + } + if r.includeGroups != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_groups", r.includeGroups, "form", "") + } else { + var defaultValue bool = true + parameterAddToHeaderOrQuery(localVarQueryParams, "include_groups", defaultValue, "form", "") + r.includeGroups = &defaultValue + } + if r.includeRoles != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_roles", r.includeRoles, "form", "") + } else { + var defaultValue bool = true + parameterAddToHeaderOrQuery(localVarQueryParams, "include_roles", defaultValue, "form", "") + r.includeRoles = &defaultValue + } + if r.isActive != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_active", r.isActive, "form", "") + } + if r.isSuperuser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_superuser", r.isSuperuser, "form", "") + } + if r.lastLogin != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login", r.lastLogin, "form", "") + } + if r.lastLoginGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__gt", r.lastLoginGt, "form", "") + } + if r.lastLoginIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__isnull", r.lastLoginIsnull, "form", "") + } + if r.lastLoginLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_login__lt", r.lastLoginLt, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.lastUpdatedGt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__gt", r.lastUpdatedGt, "form", "") + } + if r.lastUpdatedLt != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated__lt", r.lastUpdatedLt, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.path != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + } + if r.pathStartswith != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path_startswith", r.pathStartswith, "form", "") + } + if r.rolesByName != nil { + t := *r.rolesByName + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_name", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_name", t, "form", "multi") + } + } + if r.rolesByPk != nil { + t := *r.rolesByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "roles_by_pk", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.type_ != nil { + t := *r.type_ + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", t, "form", "multi") + } + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + if r.uuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "uuid", r.uuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersMeRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService +} + +func (r ApiCoreUsersMeRetrieveRequest) Execute() (*SessionUser, *http.Response, error) { + return r.ApiService.CoreUsersMeRetrieveExecute(r) +} + +/* +CoreUsersMeRetrieve Method for CoreUsersMeRetrieve + +Get information about current user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersMeRetrieveRequest +*/ +func (a *CoreAPIService) CoreUsersMeRetrieve(ctx context.Context) ApiCoreUsersMeRetrieveRequest { + return ApiCoreUsersMeRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SessionUser +func (a *CoreAPIService) CoreUsersMeRetrieveExecute(r ApiCoreUsersMeRetrieveRequest) (*SessionUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SessionUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersMeRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/me/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersPartialUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + patchedUserRequest *PatchedUserRequest +} + +func (r ApiCoreUsersPartialUpdateRequest) PatchedUserRequest(patchedUserRequest PatchedUserRequest) ApiCoreUsersPartialUpdateRequest { + r.patchedUserRequest = &patchedUserRequest + return r +} + +func (r ApiCoreUsersPartialUpdateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CoreUsersPartialUpdateExecute(r) +} + +/* +CoreUsersPartialUpdate Method for CoreUsersPartialUpdate + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersPartialUpdateRequest +*/ +func (a *CoreAPIService) CoreUsersPartialUpdate(ctx context.Context, id int32) ApiCoreUsersPartialUpdateRequest { + return ApiCoreUsersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *CoreAPIService) CoreUsersPartialUpdateExecute(r ApiCoreUsersPartialUpdateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersPathsRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + search *string +} + +// A search term. +func (r ApiCoreUsersPathsRetrieveRequest) Search(search string) ApiCoreUsersPathsRetrieveRequest { + r.search = &search + return r +} + +func (r ApiCoreUsersPathsRetrieveRequest) Execute() (*UserPath, *http.Response, error) { + return r.ApiService.CoreUsersPathsRetrieveExecute(r) +} + +/* +CoreUsersPathsRetrieve Method for CoreUsersPathsRetrieve + +Get all user paths + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersPathsRetrieveRequest +*/ +func (a *CoreAPIService) CoreUsersPathsRetrieve(ctx context.Context) ApiCoreUsersPathsRetrieveRequest { + return ApiCoreUsersPathsRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserPath +func (a *CoreAPIService) CoreUsersPathsRetrieveExecute(r ApiCoreUsersPathsRetrieveRequest) (*UserPath, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserPath + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersPathsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/paths/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersRecoveryCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + userRecoveryLinkRequest *UserRecoveryLinkRequest +} + +func (r ApiCoreUsersRecoveryCreateRequest) UserRecoveryLinkRequest(userRecoveryLinkRequest UserRecoveryLinkRequest) ApiCoreUsersRecoveryCreateRequest { + r.userRecoveryLinkRequest = &userRecoveryLinkRequest + return r +} + +func (r ApiCoreUsersRecoveryCreateRequest) Execute() (*Link, *http.Response, error) { + return r.ApiService.CoreUsersRecoveryCreateExecute(r) +} + +/* +CoreUsersRecoveryCreate Method for CoreUsersRecoveryCreate + +Create a temporary link that a user can use to recover their account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersRecoveryCreateRequest +*/ +func (a *CoreAPIService) CoreUsersRecoveryCreate(ctx context.Context, id int32) ApiCoreUsersRecoveryCreateRequest { + return ApiCoreUsersRecoveryCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Link +func (a *CoreAPIService) CoreUsersRecoveryCreateExecute(r ApiCoreUsersRecoveryCreateRequest) (*Link, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Link + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersRecoveryCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/recovery/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRecoveryLinkRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersRecoveryEmailCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + userRecoveryEmailRequest *UserRecoveryEmailRequest +} + +func (r ApiCoreUsersRecoveryEmailCreateRequest) UserRecoveryEmailRequest(userRecoveryEmailRequest UserRecoveryEmailRequest) ApiCoreUsersRecoveryEmailCreateRequest { + r.userRecoveryEmailRequest = &userRecoveryEmailRequest + return r +} + +func (r ApiCoreUsersRecoveryEmailCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUsersRecoveryEmailCreateExecute(r) +} + +/* +CoreUsersRecoveryEmailCreate Method for CoreUsersRecoveryEmailCreate + +Send an email with a temporary link that a user can use to recover their account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersRecoveryEmailCreateRequest +*/ +func (a *CoreAPIService) CoreUsersRecoveryEmailCreate(ctx context.Context, id int32) ApiCoreUsersRecoveryEmailCreateRequest { + return ApiCoreUsersRecoveryEmailCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUsersRecoveryEmailCreateExecute(r ApiCoreUsersRecoveryEmailCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersRecoveryEmailCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/recovery_email/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRecoveryEmailRequest == nil { + return nil, reportError("userRecoveryEmailRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRecoveryEmailRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUsersRetrieveRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUsersRetrieveRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CoreUsersRetrieveExecute(r) +} + +/* +CoreUsersRetrieve Method for CoreUsersRetrieve + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersRetrieveRequest +*/ +func (a *CoreAPIService) CoreUsersRetrieve(ctx context.Context, id int32) ApiCoreUsersRetrieveRequest { + return ApiCoreUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *CoreAPIService) CoreUsersRetrieveExecute(r ApiCoreUsersRetrieveRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersServiceAccountCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + userServiceAccountRequest *UserServiceAccountRequest +} + +func (r ApiCoreUsersServiceAccountCreateRequest) UserServiceAccountRequest(userServiceAccountRequest UserServiceAccountRequest) ApiCoreUsersServiceAccountCreateRequest { + r.userServiceAccountRequest = &userServiceAccountRequest + return r +} + +func (r ApiCoreUsersServiceAccountCreateRequest) Execute() (*UserServiceAccountResponse, *http.Response, error) { + return r.ApiService.CoreUsersServiceAccountCreateExecute(r) +} + +/* +CoreUsersServiceAccountCreate Method for CoreUsersServiceAccountCreate + +Create a new user account that is marked as a service account + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCoreUsersServiceAccountCreateRequest +*/ +func (a *CoreAPIService) CoreUsersServiceAccountCreate(ctx context.Context) ApiCoreUsersServiceAccountCreateRequest { + return ApiCoreUsersServiceAccountCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserServiceAccountResponse +func (a *CoreAPIService) CoreUsersServiceAccountCreateExecute(r ApiCoreUsersServiceAccountCreateRequest) (*UserServiceAccountResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserServiceAccountResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersServiceAccountCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/service_account/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userServiceAccountRequest == nil { + return localVarReturnValue, nil, reportError("userServiceAccountRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userServiceAccountRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersSetPasswordCreateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + userPasswordSetRequest *UserPasswordSetRequest +} + +func (r ApiCoreUsersSetPasswordCreateRequest) UserPasswordSetRequest(userPasswordSetRequest UserPasswordSetRequest) ApiCoreUsersSetPasswordCreateRequest { + r.userPasswordSetRequest = &userPasswordSetRequest + return r +} + +func (r ApiCoreUsersSetPasswordCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.CoreUsersSetPasswordCreateExecute(r) +} + +/* +CoreUsersSetPasswordCreate Method for CoreUsersSetPasswordCreate + +Set password for user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersSetPasswordCreateRequest +*/ +func (a *CoreAPIService) CoreUsersSetPasswordCreate(ctx context.Context, id int32) ApiCoreUsersSetPasswordCreateRequest { + return ApiCoreUsersSetPasswordCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *CoreAPIService) CoreUsersSetPasswordCreateExecute(r ApiCoreUsersSetPasswordCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersSetPasswordCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/set_password/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userPasswordSetRequest == nil { + return nil, reportError("userPasswordSetRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userPasswordSetRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCoreUsersUpdateRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 + userRequest *UserRequest +} + +func (r ApiCoreUsersUpdateRequest) UserRequest(userRequest UserRequest) ApiCoreUsersUpdateRequest { + r.userRequest = &userRequest + return r +} + +func (r ApiCoreUsersUpdateRequest) Execute() (*User, *http.Response, error) { + return r.ApiService.CoreUsersUpdateExecute(r) +} + +/* +CoreUsersUpdate Method for CoreUsersUpdate + +User Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersUpdateRequest +*/ +func (a *CoreAPIService) CoreUsersUpdate(ctx context.Context, id int32) ApiCoreUsersUpdateRequest { + return ApiCoreUsersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return User +func (a *CoreAPIService) CoreUsersUpdateExecute(r ApiCoreUsersUpdateRequest) (*User, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *User + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userRequest == nil { + return localVarReturnValue, nil, reportError("userRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCoreUsersUsedByListRequest struct { + ctx context.Context + ApiService *CoreAPIService + id int32 +} + +func (r ApiCoreUsersUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CoreUsersUsedByListExecute(r) +} + +/* +CoreUsersUsedByList Method for CoreUsersUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User. + @return ApiCoreUsersUsedByListRequest +*/ +func (a *CoreAPIService) CoreUsersUsedByList(ctx context.Context, id int32) ApiCoreUsersUsedByListRequest { + return ApiCoreUsersUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CoreAPIService) CoreUsersUsedByListExecute(r ApiCoreUsersUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CoreAPIService.CoreUsersUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/core/users/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_crypto.go b/packages/client-go/api_crypto.go new file mode 100644 index 0000000000..c6a52b1b06 --- /dev/null +++ b/packages/client-go/api_crypto.go @@ -0,0 +1,1385 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// CryptoAPIService CryptoAPI service +type CryptoAPIService service + +type ApiCryptoCertificatekeypairsCreateRequest struct { + ctx context.Context + ApiService *CryptoAPIService + certificateKeyPairRequest *CertificateKeyPairRequest +} + +func (r ApiCryptoCertificatekeypairsCreateRequest) CertificateKeyPairRequest(certificateKeyPairRequest CertificateKeyPairRequest) ApiCryptoCertificatekeypairsCreateRequest { + r.certificateKeyPairRequest = &certificateKeyPairRequest + return r +} + +func (r ApiCryptoCertificatekeypairsCreateRequest) Execute() (*CertificateKeyPair, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsCreateExecute(r) +} + +/* +CryptoCertificatekeypairsCreate Method for CryptoCertificatekeypairsCreate + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCryptoCertificatekeypairsCreateRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsCreate(ctx context.Context) ApiCryptoCertificatekeypairsCreateRequest { + return ApiCryptoCertificatekeypairsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CertificateKeyPair +func (a *CryptoAPIService) CryptoCertificatekeypairsCreateExecute(r ApiCryptoCertificatekeypairsCreateRequest) (*CertificateKeyPair, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateKeyPair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.certificateKeyPairRequest == nil { + return localVarReturnValue, nil, reportError("certificateKeyPairRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.certificateKeyPairRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsDestroyRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string +} + +func (r ApiCryptoCertificatekeypairsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsDestroyExecute(r) +} + +/* +CryptoCertificatekeypairsDestroy Method for CryptoCertificatekeypairsDestroy + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsDestroyRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsDestroy(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsDestroyRequest { + return ApiCryptoCertificatekeypairsDestroyRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +func (a *CryptoAPIService) CryptoCertificatekeypairsDestroyExecute(r ApiCryptoCertificatekeypairsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsGenerateCreateRequest struct { + ctx context.Context + ApiService *CryptoAPIService + certificateGenerationRequest *CertificateGenerationRequest +} + +func (r ApiCryptoCertificatekeypairsGenerateCreateRequest) CertificateGenerationRequest(certificateGenerationRequest CertificateGenerationRequest) ApiCryptoCertificatekeypairsGenerateCreateRequest { + r.certificateGenerationRequest = &certificateGenerationRequest + return r +} + +func (r ApiCryptoCertificatekeypairsGenerateCreateRequest) Execute() (*CertificateKeyPair, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsGenerateCreateExecute(r) +} + +/* +CryptoCertificatekeypairsGenerateCreate Method for CryptoCertificatekeypairsGenerateCreate + +Generate a new, self-signed certificate-key pair + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCryptoCertificatekeypairsGenerateCreateRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsGenerateCreate(ctx context.Context) ApiCryptoCertificatekeypairsGenerateCreateRequest { + return ApiCryptoCertificatekeypairsGenerateCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CertificateKeyPair +func (a *CryptoAPIService) CryptoCertificatekeypairsGenerateCreateExecute(r ApiCryptoCertificatekeypairsGenerateCreateRequest) (*CertificateKeyPair, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateKeyPair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsGenerateCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/generate/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.certificateGenerationRequest == nil { + return localVarReturnValue, nil, reportError("certificateGenerationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.certificateGenerationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsListRequest struct { + ctx context.Context + ApiService *CryptoAPIService + hasKey *bool + keyType *[]string + managed *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Only return certificate-key pairs with keys +func (r ApiCryptoCertificatekeypairsListRequest) HasKey(hasKey bool) ApiCryptoCertificatekeypairsListRequest { + r.hasKey = &hasKey + return r +} + +// Filter by key algorithm type (RSA, EC, DSA, etc). Can be specified multiple times (e.g. '?key_type=rsa&key_type=ec') +func (r ApiCryptoCertificatekeypairsListRequest) KeyType(keyType []string) ApiCryptoCertificatekeypairsListRequest { + r.keyType = &keyType + return r +} + +func (r ApiCryptoCertificatekeypairsListRequest) Managed(managed string) ApiCryptoCertificatekeypairsListRequest { + r.managed = &managed + return r +} + +func (r ApiCryptoCertificatekeypairsListRequest) Name(name string) ApiCryptoCertificatekeypairsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiCryptoCertificatekeypairsListRequest) Ordering(ordering string) ApiCryptoCertificatekeypairsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiCryptoCertificatekeypairsListRequest) Page(page int32) ApiCryptoCertificatekeypairsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiCryptoCertificatekeypairsListRequest) PageSize(pageSize int32) ApiCryptoCertificatekeypairsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiCryptoCertificatekeypairsListRequest) Search(search string) ApiCryptoCertificatekeypairsListRequest { + r.search = &search + return r +} + +func (r ApiCryptoCertificatekeypairsListRequest) Execute() (*PaginatedCertificateKeyPairList, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsListExecute(r) +} + +/* +CryptoCertificatekeypairsList Method for CryptoCertificatekeypairsList + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCryptoCertificatekeypairsListRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsList(ctx context.Context) ApiCryptoCertificatekeypairsListRequest { + return ApiCryptoCertificatekeypairsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCertificateKeyPairList +func (a *CryptoAPIService) CryptoCertificatekeypairsListExecute(r ApiCryptoCertificatekeypairsListRequest) (*PaginatedCertificateKeyPairList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCertificateKeyPairList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.hasKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_key", r.hasKey, "form", "") + } + if r.keyType != nil { + t := *r.keyType + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "key_type", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "key_type", t, "form", "multi") + } + } + if r.managed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", r.managed, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsPartialUpdateRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string + patchedCertificateKeyPairRequest *PatchedCertificateKeyPairRequest +} + +func (r ApiCryptoCertificatekeypairsPartialUpdateRequest) PatchedCertificateKeyPairRequest(patchedCertificateKeyPairRequest PatchedCertificateKeyPairRequest) ApiCryptoCertificatekeypairsPartialUpdateRequest { + r.patchedCertificateKeyPairRequest = &patchedCertificateKeyPairRequest + return r +} + +func (r ApiCryptoCertificatekeypairsPartialUpdateRequest) Execute() (*CertificateKeyPair, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsPartialUpdateExecute(r) +} + +/* +CryptoCertificatekeypairsPartialUpdate Method for CryptoCertificatekeypairsPartialUpdate + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsPartialUpdateRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsPartialUpdate(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsPartialUpdateRequest { + return ApiCryptoCertificatekeypairsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return CertificateKeyPair +func (a *CryptoAPIService) CryptoCertificatekeypairsPartialUpdateExecute(r ApiCryptoCertificatekeypairsPartialUpdateRequest) (*CertificateKeyPair, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateKeyPair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedCertificateKeyPairRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsRetrieveRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string +} + +func (r ApiCryptoCertificatekeypairsRetrieveRequest) Execute() (*CertificateKeyPair, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsRetrieveExecute(r) +} + +/* +CryptoCertificatekeypairsRetrieve Method for CryptoCertificatekeypairsRetrieve + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsRetrieveRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsRetrieve(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsRetrieveRequest { + return ApiCryptoCertificatekeypairsRetrieveRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return CertificateKeyPair +func (a *CryptoAPIService) CryptoCertificatekeypairsRetrieveExecute(r ApiCryptoCertificatekeypairsRetrieveRequest) (*CertificateKeyPair, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateKeyPair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsUpdateRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string + certificateKeyPairRequest *CertificateKeyPairRequest +} + +func (r ApiCryptoCertificatekeypairsUpdateRequest) CertificateKeyPairRequest(certificateKeyPairRequest CertificateKeyPairRequest) ApiCryptoCertificatekeypairsUpdateRequest { + r.certificateKeyPairRequest = &certificateKeyPairRequest + return r +} + +func (r ApiCryptoCertificatekeypairsUpdateRequest) Execute() (*CertificateKeyPair, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsUpdateExecute(r) +} + +/* +CryptoCertificatekeypairsUpdate Method for CryptoCertificatekeypairsUpdate + +CertificateKeyPair Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsUpdateRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsUpdate(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsUpdateRequest { + return ApiCryptoCertificatekeypairsUpdateRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return CertificateKeyPair +func (a *CryptoAPIService) CryptoCertificatekeypairsUpdateExecute(r ApiCryptoCertificatekeypairsUpdateRequest) (*CertificateKeyPair, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateKeyPair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.certificateKeyPairRequest == nil { + return localVarReturnValue, nil, reportError("certificateKeyPairRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.certificateKeyPairRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsUsedByListRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string +} + +func (r ApiCryptoCertificatekeypairsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsUsedByListExecute(r) +} + +/* +CryptoCertificatekeypairsUsedByList Method for CryptoCertificatekeypairsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsUsedByListRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsUsedByList(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsUsedByListRequest { + return ApiCryptoCertificatekeypairsUsedByListRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *CryptoAPIService) CryptoCertificatekeypairsUsedByListExecute(r ApiCryptoCertificatekeypairsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string + download *bool +} + +func (r ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest) Download(download bool) ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest { + r.download = &download + return r +} + +func (r ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest) Execute() (*CertificateData, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsViewCertificateRetrieveExecute(r) +} + +/* +CryptoCertificatekeypairsViewCertificateRetrieve Method for CryptoCertificatekeypairsViewCertificateRetrieve + +Return certificate-key pairs certificate and log access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsViewCertificateRetrieve(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest { + return ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return CertificateData +func (a *CryptoAPIService) CryptoCertificatekeypairsViewCertificateRetrieveExecute(r ApiCryptoCertificatekeypairsViewCertificateRetrieveRequest) (*CertificateData, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateData + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsViewCertificateRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/view_certificate/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest struct { + ctx context.Context + ApiService *CryptoAPIService + kpUuid string + download *bool +} + +func (r ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest) Download(download bool) ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest { + r.download = &download + return r +} + +func (r ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest) Execute() (*CertificateData, *http.Response, error) { + return r.ApiService.CryptoCertificatekeypairsViewPrivateKeyRetrieveExecute(r) +} + +/* +CryptoCertificatekeypairsViewPrivateKeyRetrieve Method for CryptoCertificatekeypairsViewPrivateKeyRetrieve + +Return certificate-key pairs private key and log access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param kpUuid A UUID string identifying this Certificate-Key Pair. + @return ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest +*/ +func (a *CryptoAPIService) CryptoCertificatekeypairsViewPrivateKeyRetrieve(ctx context.Context, kpUuid string) ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest { + return ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest{ + ApiService: a, + ctx: ctx, + kpUuid: kpUuid, + } +} + +// Execute executes the request +// +// @return CertificateData +func (a *CryptoAPIService) CryptoCertificatekeypairsViewPrivateKeyRetrieveExecute(r ApiCryptoCertificatekeypairsViewPrivateKeyRetrieveRequest) (*CertificateData, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CertificateData + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "CryptoAPIService.CryptoCertificatekeypairsViewPrivateKeyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/crypto/certificatekeypairs/{kp_uuid}/view_private_key/" + localVarPath = strings.Replace(localVarPath, "{"+"kp_uuid"+"}", url.PathEscape(parameterValueToString(r.kpUuid, "kpUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_endpoints.go b/packages/client-go/api_endpoints.go new file mode 100644 index 0000000000..aa14dc547b --- /dev/null +++ b/packages/client-go/api_endpoints.go @@ -0,0 +1,8438 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// EndpointsAPIService EndpointsAPI service +type EndpointsAPIService service + +type ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService +} + +func (r ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest) Execute() (*AgentConfig, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsAgentConfigRetrieveExecute(r) +} + +/* +EndpointsAgentsConnectorsAgentConfigRetrieve Method for EndpointsAgentsConnectorsAgentConfigRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAgentConfigRetrieve(ctx context.Context) ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest { + return ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentConfig +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAgentConfigRetrieveExecute(r ApiEndpointsAgentsConnectorsAgentConfigRetrieveRequest) (*AgentConfig, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentConfig + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsAgentConfigRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/agent_config/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsAuthFedCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + device *string +} + +func (r ApiEndpointsAgentsConnectorsAuthFedCreateRequest) Device(device string) ApiEndpointsAgentsConnectorsAuthFedCreateRequest { + r.device = &device + return r +} + +func (r ApiEndpointsAgentsConnectorsAuthFedCreateRequest) Execute() (*AgentTokenResponse, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsAuthFedCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsAuthFedCreate Method for EndpointsAgentsConnectorsAuthFedCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsAuthFedCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAuthFedCreate(ctx context.Context) ApiEndpointsAgentsConnectorsAuthFedCreateRequest { + return ApiEndpointsAgentsConnectorsAuthFedCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentTokenResponse +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAuthFedCreateExecute(r ApiEndpointsAgentsConnectorsAuthFedCreateRequest) (*AgentTokenResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentTokenResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsAuthFedCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/auth_fed/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.device == nil { + return localVarReturnValue, nil, reportError("device is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "device", r.device, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsAuthIaCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService +} + +func (r ApiEndpointsAgentsConnectorsAuthIaCreateRequest) Execute() (*AgentAuthenticationResponse, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsAuthIaCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsAuthIaCreate Method for EndpointsAgentsConnectorsAuthIaCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsAuthIaCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAuthIaCreate(ctx context.Context) ApiEndpointsAgentsConnectorsAuthIaCreateRequest { + return ApiEndpointsAgentsConnectorsAuthIaCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentAuthenticationResponse +func (a *EndpointsAPIService) EndpointsAgentsConnectorsAuthIaCreateExecute(r ApiEndpointsAgentsConnectorsAuthIaCreateRequest) (*AgentAuthenticationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentAuthenticationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsAuthIaCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/auth_ia/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsCheckInCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceFactsRequest *DeviceFactsRequest +} + +func (r ApiEndpointsAgentsConnectorsCheckInCreateRequest) DeviceFactsRequest(deviceFactsRequest DeviceFactsRequest) ApiEndpointsAgentsConnectorsCheckInCreateRequest { + r.deviceFactsRequest = &deviceFactsRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsCheckInCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsCheckInCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsCheckInCreate Method for EndpointsAgentsConnectorsCheckInCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsCheckInCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsCheckInCreate(ctx context.Context) ApiEndpointsAgentsConnectorsCheckInCreateRequest { + return ApiEndpointsAgentsConnectorsCheckInCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsAgentsConnectorsCheckInCreateExecute(r ApiEndpointsAgentsConnectorsCheckInCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsCheckInCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/check_in/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceFactsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + agentConnectorRequest *AgentConnectorRequest +} + +func (r ApiEndpointsAgentsConnectorsCreateRequest) AgentConnectorRequest(agentConnectorRequest AgentConnectorRequest) ApiEndpointsAgentsConnectorsCreateRequest { + r.agentConnectorRequest = &agentConnectorRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsCreateRequest) Execute() (*AgentConnector, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsCreate Method for EndpointsAgentsConnectorsCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsCreate(ctx context.Context) ApiEndpointsAgentsConnectorsCreateRequest { + return ApiEndpointsAgentsConnectorsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentConnector +func (a *EndpointsAPIService) EndpointsAgentsConnectorsCreateExecute(r ApiEndpointsAgentsConnectorsCreateRequest) (*AgentConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.agentConnectorRequest == nil { + return localVarReturnValue, nil, reportError("agentConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.agentConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsAgentsConnectorsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsDestroyExecute(r) +} + +/* +EndpointsAgentsConnectorsDestroy Method for EndpointsAgentsConnectorsDestroy + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsDestroy(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsDestroyRequest { + return ApiEndpointsAgentsConnectorsDestroyRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsAgentsConnectorsDestroyExecute(r ApiEndpointsAgentsConnectorsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsEnrollCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + enrollRequest *EnrollRequest +} + +func (r ApiEndpointsAgentsConnectorsEnrollCreateRequest) EnrollRequest(enrollRequest EnrollRequest) ApiEndpointsAgentsConnectorsEnrollCreateRequest { + r.enrollRequest = &enrollRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsEnrollCreateRequest) Execute() (*AgentTokenResponse, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsEnrollCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsEnrollCreate Method for EndpointsAgentsConnectorsEnrollCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsEnrollCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsEnrollCreate(ctx context.Context) ApiEndpointsAgentsConnectorsEnrollCreateRequest { + return ApiEndpointsAgentsConnectorsEnrollCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentTokenResponse +func (a *EndpointsAPIService) EndpointsAgentsConnectorsEnrollCreateExecute(r ApiEndpointsAgentsConnectorsEnrollCreateRequest) (*AgentTokenResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentTokenResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsEnrollCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/enroll/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.enrollRequest == nil { + return localVarReturnValue, nil, reportError("enrollRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enrollRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + enabled *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiEndpointsAgentsConnectorsListRequest) Enabled(enabled bool) ApiEndpointsAgentsConnectorsListRequest { + r.enabled = &enabled + return r +} + +func (r ApiEndpointsAgentsConnectorsListRequest) Name(name string) ApiEndpointsAgentsConnectorsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsAgentsConnectorsListRequest) Ordering(ordering string) ApiEndpointsAgentsConnectorsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsAgentsConnectorsListRequest) Page(page int32) ApiEndpointsAgentsConnectorsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsAgentsConnectorsListRequest) PageSize(pageSize int32) ApiEndpointsAgentsConnectorsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsAgentsConnectorsListRequest) Search(search string) ApiEndpointsAgentsConnectorsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsAgentsConnectorsListRequest) Execute() (*PaginatedAgentConnectorList, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsListExecute(r) +} + +/* +EndpointsAgentsConnectorsList Method for EndpointsAgentsConnectorsList + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsConnectorsListRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsList(ctx context.Context) ApiEndpointsAgentsConnectorsListRequest { + return ApiEndpointsAgentsConnectorsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAgentConnectorList +func (a *EndpointsAPIService) EndpointsAgentsConnectorsListExecute(r ApiEndpointsAgentsConnectorsListRequest) (*PaginatedAgentConnectorList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAgentConnectorList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsMdmConfigCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + mDMConfigRequest *MDMConfigRequest +} + +func (r ApiEndpointsAgentsConnectorsMdmConfigCreateRequest) MDMConfigRequest(mDMConfigRequest MDMConfigRequest) ApiEndpointsAgentsConnectorsMdmConfigCreateRequest { + r.mDMConfigRequest = &mDMConfigRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsMdmConfigCreateRequest) Execute() (*MDMConfigResponse, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsMdmConfigCreateExecute(r) +} + +/* +EndpointsAgentsConnectorsMdmConfigCreate Method for EndpointsAgentsConnectorsMdmConfigCreate + +Generate configuration for MDM systems to deploy authentik Agent + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsMdmConfigCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsMdmConfigCreate(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsMdmConfigCreateRequest { + return ApiEndpointsAgentsConnectorsMdmConfigCreateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return MDMConfigResponse +func (a *EndpointsAPIService) EndpointsAgentsConnectorsMdmConfigCreateExecute(r ApiEndpointsAgentsConnectorsMdmConfigCreateRequest) (*MDMConfigResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MDMConfigResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsMdmConfigCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/mdm_config/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mDMConfigRequest == nil { + return localVarReturnValue, nil, reportError("mDMConfigRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.mDMConfigRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + patchedAgentConnectorRequest *PatchedAgentConnectorRequest +} + +func (r ApiEndpointsAgentsConnectorsPartialUpdateRequest) PatchedAgentConnectorRequest(patchedAgentConnectorRequest PatchedAgentConnectorRequest) ApiEndpointsAgentsConnectorsPartialUpdateRequest { + r.patchedAgentConnectorRequest = &patchedAgentConnectorRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsPartialUpdateRequest) Execute() (*AgentConnector, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsPartialUpdateExecute(r) +} + +/* +EndpointsAgentsConnectorsPartialUpdate Method for EndpointsAgentsConnectorsPartialUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsPartialUpdate(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsPartialUpdateRequest { + return ApiEndpointsAgentsConnectorsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return AgentConnector +func (a *EndpointsAPIService) EndpointsAgentsConnectorsPartialUpdateExecute(r ApiEndpointsAgentsConnectorsPartialUpdateRequest) (*AgentConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAgentConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsAgentsConnectorsRetrieveRequest) Execute() (*AgentConnector, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsRetrieveExecute(r) +} + +/* +EndpointsAgentsConnectorsRetrieve Method for EndpointsAgentsConnectorsRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsRetrieve(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsRetrieveRequest { + return ApiEndpointsAgentsConnectorsRetrieveRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return AgentConnector +func (a *EndpointsAPIService) EndpointsAgentsConnectorsRetrieveExecute(r ApiEndpointsAgentsConnectorsRetrieveRequest) (*AgentConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + agentConnectorRequest *AgentConnectorRequest +} + +func (r ApiEndpointsAgentsConnectorsUpdateRequest) AgentConnectorRequest(agentConnectorRequest AgentConnectorRequest) ApiEndpointsAgentsConnectorsUpdateRequest { + r.agentConnectorRequest = &agentConnectorRequest + return r +} + +func (r ApiEndpointsAgentsConnectorsUpdateRequest) Execute() (*AgentConnector, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsUpdateExecute(r) +} + +/* +EndpointsAgentsConnectorsUpdate Method for EndpointsAgentsConnectorsUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsUpdate(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsUpdateRequest { + return ApiEndpointsAgentsConnectorsUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return AgentConnector +func (a *EndpointsAPIService) EndpointsAgentsConnectorsUpdateExecute(r ApiEndpointsAgentsConnectorsUpdateRequest) (*AgentConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.agentConnectorRequest == nil { + return localVarReturnValue, nil, reportError("agentConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.agentConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsConnectorsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsAgentsConnectorsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsAgentsConnectorsUsedByListExecute(r) +} + +/* +EndpointsAgentsConnectorsUsedByList Method for EndpointsAgentsConnectorsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Agent Connector. + @return ApiEndpointsAgentsConnectorsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsConnectorsUsedByList(ctx context.Context, connectorUuid string) ApiEndpointsAgentsConnectorsUsedByListRequest { + return ApiEndpointsAgentsConnectorsUsedByListRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsAgentsConnectorsUsedByListExecute(r ApiEndpointsAgentsConnectorsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsConnectorsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/connectors/{connector_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + enrollmentTokenRequest *EnrollmentTokenRequest +} + +func (r ApiEndpointsAgentsEnrollmentTokensCreateRequest) EnrollmentTokenRequest(enrollmentTokenRequest EnrollmentTokenRequest) ApiEndpointsAgentsEnrollmentTokensCreateRequest { + r.enrollmentTokenRequest = &enrollmentTokenRequest + return r +} + +func (r ApiEndpointsAgentsEnrollmentTokensCreateRequest) Execute() (*EnrollmentToken, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensCreateExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensCreate Method for EndpointsAgentsEnrollmentTokensCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsEnrollmentTokensCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensCreate(ctx context.Context) ApiEndpointsAgentsEnrollmentTokensCreateRequest { + return ApiEndpointsAgentsEnrollmentTokensCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EnrollmentToken +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensCreateExecute(r ApiEndpointsAgentsEnrollmentTokensCreateRequest) (*EnrollmentToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnrollmentToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.enrollmentTokenRequest == nil { + return localVarReturnValue, nil, reportError("enrollmentTokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enrollmentTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string +} + +func (r ApiEndpointsAgentsEnrollmentTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensDestroyExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensDestroy Method for EndpointsAgentsEnrollmentTokensDestroy + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensDestroy(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensDestroyRequest { + return ApiEndpointsAgentsEnrollmentTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensDestroyExecute(r ApiEndpointsAgentsEnrollmentTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connector *string + ordering *string + page *int32 + pageSize *int32 + search *string + tokenUuid *string +} + +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) Connector(connector string) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.connector = &connector + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) Ordering(ordering string) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) Page(page int32) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) PageSize(pageSize int32) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) Search(search string) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) TokenUuid(tokenUuid string) ApiEndpointsAgentsEnrollmentTokensListRequest { + r.tokenUuid = &tokenUuid + return r +} + +func (r ApiEndpointsAgentsEnrollmentTokensListRequest) Execute() (*PaginatedEnrollmentTokenList, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensListExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensList Method for EndpointsAgentsEnrollmentTokensList + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsEnrollmentTokensListRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensList(ctx context.Context) ApiEndpointsAgentsEnrollmentTokensListRequest { + return ApiEndpointsAgentsEnrollmentTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEnrollmentTokenList +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensListExecute(r ApiEndpointsAgentsEnrollmentTokensListRequest) (*PaginatedEnrollmentTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEnrollmentTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.connector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "connector", r.connector, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.tokenUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "token_uuid", r.tokenUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string + patchedEnrollmentTokenRequest *PatchedEnrollmentTokenRequest +} + +func (r ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest) PatchedEnrollmentTokenRequest(patchedEnrollmentTokenRequest PatchedEnrollmentTokenRequest) ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest { + r.patchedEnrollmentTokenRequest = &patchedEnrollmentTokenRequest + return r +} + +func (r ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest) Execute() (*EnrollmentToken, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensPartialUpdateExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensPartialUpdate Method for EndpointsAgentsEnrollmentTokensPartialUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensPartialUpdate(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest { + return ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +// +// @return EnrollmentToken +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensPartialUpdateExecute(r ApiEndpointsAgentsEnrollmentTokensPartialUpdateRequest) (*EnrollmentToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnrollmentToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEnrollmentTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string +} + +func (r ApiEndpointsAgentsEnrollmentTokensRetrieveRequest) Execute() (*EnrollmentToken, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensRetrieveExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensRetrieve Method for EndpointsAgentsEnrollmentTokensRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensRetrieve(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensRetrieveRequest { + return ApiEndpointsAgentsEnrollmentTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +// +// @return EnrollmentToken +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensRetrieveExecute(r ApiEndpointsAgentsEnrollmentTokensRetrieveRequest) (*EnrollmentToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnrollmentToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string + enrollmentTokenRequest *EnrollmentTokenRequest +} + +func (r ApiEndpointsAgentsEnrollmentTokensUpdateRequest) EnrollmentTokenRequest(enrollmentTokenRequest EnrollmentTokenRequest) ApiEndpointsAgentsEnrollmentTokensUpdateRequest { + r.enrollmentTokenRequest = &enrollmentTokenRequest + return r +} + +func (r ApiEndpointsAgentsEnrollmentTokensUpdateRequest) Execute() (*EnrollmentToken, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensUpdateExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensUpdate Method for EndpointsAgentsEnrollmentTokensUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensUpdate(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensUpdateRequest { + return ApiEndpointsAgentsEnrollmentTokensUpdateRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +// +// @return EnrollmentToken +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensUpdateExecute(r ApiEndpointsAgentsEnrollmentTokensUpdateRequest) (*EnrollmentToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EnrollmentToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.enrollmentTokenRequest == nil { + return localVarReturnValue, nil, reportError("enrollmentTokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enrollmentTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string +} + +func (r ApiEndpointsAgentsEnrollmentTokensUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensUsedByListExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensUsedByList Method for EndpointsAgentsEnrollmentTokensUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensUsedByList(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensUsedByListRequest { + return ApiEndpointsAgentsEnrollmentTokensUsedByListRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensUsedByListExecute(r ApiEndpointsAgentsEnrollmentTokensUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + tokenUuid string +} + +func (r ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest) Execute() (*TokenView, *http.Response, error) { + return r.ApiService.EndpointsAgentsEnrollmentTokensViewKeyRetrieveExecute(r) +} + +/* +EndpointsAgentsEnrollmentTokensViewKeyRetrieve Method for EndpointsAgentsEnrollmentTokensViewKeyRetrieve + +Return token key and log access + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tokenUuid A UUID string identifying this Enrollment Token. + @return ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensViewKeyRetrieve(ctx context.Context, tokenUuid string) ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest { + return ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest{ + ApiService: a, + ctx: ctx, + tokenUuid: tokenUuid, + } +} + +// Execute executes the request +// +// @return TokenView +func (a *EndpointsAPIService) EndpointsAgentsEnrollmentTokensViewKeyRetrieveExecute(r ApiEndpointsAgentsEnrollmentTokensViewKeyRetrieveRequest) (*TokenView, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TokenView + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsEnrollmentTokensViewKeyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/enrollment_tokens/{token_uuid}/view_key/" + localVarPath = strings.Replace(localVarPath, "{"+"token_uuid"+"}", url.PathEscape(parameterValueToString(r.tokenUuid, "tokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsPssoRegisterDeviceCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + agentPSSODeviceRegistrationRequest *AgentPSSODeviceRegistrationRequest +} + +func (r ApiEndpointsAgentsPssoRegisterDeviceCreateRequest) AgentPSSODeviceRegistrationRequest(agentPSSODeviceRegistrationRequest AgentPSSODeviceRegistrationRequest) ApiEndpointsAgentsPssoRegisterDeviceCreateRequest { + r.agentPSSODeviceRegistrationRequest = &agentPSSODeviceRegistrationRequest + return r +} + +func (r ApiEndpointsAgentsPssoRegisterDeviceCreateRequest) Execute() (*AgentPSSODeviceRegistrationResponse, *http.Response, error) { + return r.ApiService.EndpointsAgentsPssoRegisterDeviceCreateExecute(r) +} + +/* +EndpointsAgentsPssoRegisterDeviceCreate Method for EndpointsAgentsPssoRegisterDeviceCreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsPssoRegisterDeviceCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsPssoRegisterDeviceCreate(ctx context.Context) ApiEndpointsAgentsPssoRegisterDeviceCreateRequest { + return ApiEndpointsAgentsPssoRegisterDeviceCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AgentPSSODeviceRegistrationResponse +func (a *EndpointsAPIService) EndpointsAgentsPssoRegisterDeviceCreateExecute(r ApiEndpointsAgentsPssoRegisterDeviceCreateRequest) (*AgentPSSODeviceRegistrationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AgentPSSODeviceRegistrationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsPssoRegisterDeviceCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/psso/register/device/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.agentPSSODeviceRegistrationRequest == nil { + return localVarReturnValue, nil, reportError("agentPSSODeviceRegistrationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.agentPSSODeviceRegistrationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsAgentsPssoRegisterUserCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + agentPSSOUserRegistrationRequest *AgentPSSOUserRegistrationRequest +} + +func (r ApiEndpointsAgentsPssoRegisterUserCreateRequest) AgentPSSOUserRegistrationRequest(agentPSSOUserRegistrationRequest AgentPSSOUserRegistrationRequest) ApiEndpointsAgentsPssoRegisterUserCreateRequest { + r.agentPSSOUserRegistrationRequest = &agentPSSOUserRegistrationRequest + return r +} + +func (r ApiEndpointsAgentsPssoRegisterUserCreateRequest) Execute() (*UserSelf, *http.Response, error) { + return r.ApiService.EndpointsAgentsPssoRegisterUserCreateExecute(r) +} + +/* +EndpointsAgentsPssoRegisterUserCreate Method for EndpointsAgentsPssoRegisterUserCreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsAgentsPssoRegisterUserCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsAgentsPssoRegisterUserCreate(ctx context.Context) ApiEndpointsAgentsPssoRegisterUserCreateRequest { + return ApiEndpointsAgentsPssoRegisterUserCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserSelf +func (a *EndpointsAPIService) EndpointsAgentsPssoRegisterUserCreateExecute(r ApiEndpointsAgentsPssoRegisterUserCreateRequest) (*UserSelf, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSelf + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsAgentsPssoRegisterUserCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/agents/psso/register/user/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.agentPSSOUserRegistrationRequest == nil { + return localVarReturnValue, nil, reportError("agentPSSOUserRegistrationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.agentPSSOUserRegistrationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsConnectorsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsConnectorsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsConnectorsDestroyExecute(r) +} + +/* +EndpointsConnectorsDestroy Method for EndpointsConnectorsDestroy + +Connector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this connector. + @return ApiEndpointsConnectorsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsConnectorsDestroy(ctx context.Context, connectorUuid string) ApiEndpointsConnectorsDestroyRequest { + return ApiEndpointsConnectorsDestroyRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsConnectorsDestroyExecute(r ApiEndpointsConnectorsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsConnectorsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsConnectorsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Which field to use when ordering the results. +func (r ApiEndpointsConnectorsListRequest) Ordering(ordering string) ApiEndpointsConnectorsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsConnectorsListRequest) Page(page int32) ApiEndpointsConnectorsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsConnectorsListRequest) PageSize(pageSize int32) ApiEndpointsConnectorsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsConnectorsListRequest) Search(search string) ApiEndpointsConnectorsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsConnectorsListRequest) Execute() (*PaginatedConnectorList, *http.Response, error) { + return r.ApiService.EndpointsConnectorsListExecute(r) +} + +/* +EndpointsConnectorsList Method for EndpointsConnectorsList + +Connector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsConnectorsListRequest +*/ +func (a *EndpointsAPIService) EndpointsConnectorsList(ctx context.Context) ApiEndpointsConnectorsListRequest { + return ApiEndpointsConnectorsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConnectorList +func (a *EndpointsAPIService) EndpointsConnectorsListExecute(r ApiEndpointsConnectorsListRequest) (*PaginatedConnectorList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConnectorList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsConnectorsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsConnectorsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsConnectorsRetrieveRequest) Execute() (*Connector, *http.Response, error) { + return r.ApiService.EndpointsConnectorsRetrieveExecute(r) +} + +/* +EndpointsConnectorsRetrieve Method for EndpointsConnectorsRetrieve + +Connector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this connector. + @return ApiEndpointsConnectorsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsConnectorsRetrieve(ctx context.Context, connectorUuid string) ApiEndpointsConnectorsRetrieveRequest { + return ApiEndpointsConnectorsRetrieveRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return Connector +func (a *EndpointsAPIService) EndpointsConnectorsRetrieveExecute(r ApiEndpointsConnectorsRetrieveRequest) (*Connector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Connector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsConnectorsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsConnectorsTypesListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService +} + +func (r ApiEndpointsConnectorsTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.EndpointsConnectorsTypesListExecute(r) +} + +/* +EndpointsConnectorsTypesList Method for EndpointsConnectorsTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsConnectorsTypesListRequest +*/ +func (a *EndpointsAPIService) EndpointsConnectorsTypesList(ctx context.Context) ApiEndpointsConnectorsTypesListRequest { + return ApiEndpointsConnectorsTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *EndpointsAPIService) EndpointsConnectorsTypesListExecute(r ApiEndpointsConnectorsTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsConnectorsTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/connectors/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsConnectorsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsConnectorsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsConnectorsUsedByListExecute(r) +} + +/* +EndpointsConnectorsUsedByList Method for EndpointsConnectorsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this connector. + @return ApiEndpointsConnectorsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsConnectorsUsedByList(ctx context.Context, connectorUuid string) ApiEndpointsConnectorsUsedByListRequest { + return ApiEndpointsConnectorsUsedByListRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsConnectorsUsedByListExecute(r ApiEndpointsConnectorsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsConnectorsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/connectors/{connector_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceAccessGroupRequest *DeviceAccessGroupRequest +} + +func (r ApiEndpointsDeviceAccessGroupsCreateRequest) DeviceAccessGroupRequest(deviceAccessGroupRequest DeviceAccessGroupRequest) ApiEndpointsDeviceAccessGroupsCreateRequest { + r.deviceAccessGroupRequest = &deviceAccessGroupRequest + return r +} + +func (r ApiEndpointsDeviceAccessGroupsCreateRequest) Execute() (*DeviceAccessGroup, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsCreateExecute(r) +} + +/* +EndpointsDeviceAccessGroupsCreate Method for EndpointsDeviceAccessGroupsCreate + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDeviceAccessGroupsCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsCreate(ctx context.Context) ApiEndpointsDeviceAccessGroupsCreateRequest { + return ApiEndpointsDeviceAccessGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceAccessGroup +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsCreateExecute(r ApiEndpointsDeviceAccessGroupsCreateRequest) (*DeviceAccessGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceAccessGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceAccessGroupRequest == nil { + return localVarReturnValue, nil, reportError("deviceAccessGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceAccessGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + pbmUuid string +} + +func (r ApiEndpointsDeviceAccessGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsDestroyExecute(r) +} + +/* +EndpointsDeviceAccessGroupsDestroy Method for EndpointsDeviceAccessGroupsDestroy + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Device access group. + @return ApiEndpointsDeviceAccessGroupsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsDestroy(ctx context.Context, pbmUuid string) ApiEndpointsDeviceAccessGroupsDestroyRequest { + return ApiEndpointsDeviceAccessGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsDestroyExecute(r ApiEndpointsDeviceAccessGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + search *string +} + +func (r ApiEndpointsDeviceAccessGroupsListRequest) Name(name string) ApiEndpointsDeviceAccessGroupsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsDeviceAccessGroupsListRequest) Ordering(ordering string) ApiEndpointsDeviceAccessGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsDeviceAccessGroupsListRequest) Page(page int32) ApiEndpointsDeviceAccessGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsDeviceAccessGroupsListRequest) PageSize(pageSize int32) ApiEndpointsDeviceAccessGroupsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiEndpointsDeviceAccessGroupsListRequest) PbmUuid(pbmUuid string) ApiEndpointsDeviceAccessGroupsListRequest { + r.pbmUuid = &pbmUuid + return r +} + +// A search term. +func (r ApiEndpointsDeviceAccessGroupsListRequest) Search(search string) ApiEndpointsDeviceAccessGroupsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsDeviceAccessGroupsListRequest) Execute() (*PaginatedDeviceAccessGroupList, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsListExecute(r) +} + +/* +EndpointsDeviceAccessGroupsList Method for EndpointsDeviceAccessGroupsList + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDeviceAccessGroupsListRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsList(ctx context.Context) ApiEndpointsDeviceAccessGroupsListRequest { + return ApiEndpointsDeviceAccessGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceAccessGroupList +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsListExecute(r ApiEndpointsDeviceAccessGroupsListRequest) (*PaginatedDeviceAccessGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceAccessGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + pbmUuid string + patchedDeviceAccessGroupRequest *PatchedDeviceAccessGroupRequest +} + +func (r ApiEndpointsDeviceAccessGroupsPartialUpdateRequest) PatchedDeviceAccessGroupRequest(patchedDeviceAccessGroupRequest PatchedDeviceAccessGroupRequest) ApiEndpointsDeviceAccessGroupsPartialUpdateRequest { + r.patchedDeviceAccessGroupRequest = &patchedDeviceAccessGroupRequest + return r +} + +func (r ApiEndpointsDeviceAccessGroupsPartialUpdateRequest) Execute() (*DeviceAccessGroup, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsPartialUpdateExecute(r) +} + +/* +EndpointsDeviceAccessGroupsPartialUpdate Method for EndpointsDeviceAccessGroupsPartialUpdate + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Device access group. + @return ApiEndpointsDeviceAccessGroupsPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsPartialUpdate(ctx context.Context, pbmUuid string) ApiEndpointsDeviceAccessGroupsPartialUpdateRequest { + return ApiEndpointsDeviceAccessGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return DeviceAccessGroup +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsPartialUpdateExecute(r ApiEndpointsDeviceAccessGroupsPartialUpdateRequest) (*DeviceAccessGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceAccessGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDeviceAccessGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + pbmUuid string +} + +func (r ApiEndpointsDeviceAccessGroupsRetrieveRequest) Execute() (*DeviceAccessGroup, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsRetrieveExecute(r) +} + +/* +EndpointsDeviceAccessGroupsRetrieve Method for EndpointsDeviceAccessGroupsRetrieve + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Device access group. + @return ApiEndpointsDeviceAccessGroupsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsRetrieve(ctx context.Context, pbmUuid string) ApiEndpointsDeviceAccessGroupsRetrieveRequest { + return ApiEndpointsDeviceAccessGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return DeviceAccessGroup +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsRetrieveExecute(r ApiEndpointsDeviceAccessGroupsRetrieveRequest) (*DeviceAccessGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceAccessGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + pbmUuid string + deviceAccessGroupRequest *DeviceAccessGroupRequest +} + +func (r ApiEndpointsDeviceAccessGroupsUpdateRequest) DeviceAccessGroupRequest(deviceAccessGroupRequest DeviceAccessGroupRequest) ApiEndpointsDeviceAccessGroupsUpdateRequest { + r.deviceAccessGroupRequest = &deviceAccessGroupRequest + return r +} + +func (r ApiEndpointsDeviceAccessGroupsUpdateRequest) Execute() (*DeviceAccessGroup, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsUpdateExecute(r) +} + +/* +EndpointsDeviceAccessGroupsUpdate Method for EndpointsDeviceAccessGroupsUpdate + +DeviceAccessGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Device access group. + @return ApiEndpointsDeviceAccessGroupsUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsUpdate(ctx context.Context, pbmUuid string) ApiEndpointsDeviceAccessGroupsUpdateRequest { + return ApiEndpointsDeviceAccessGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return DeviceAccessGroup +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsUpdateExecute(r ApiEndpointsDeviceAccessGroupsUpdateRequest) (*DeviceAccessGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceAccessGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceAccessGroupRequest == nil { + return localVarReturnValue, nil, reportError("deviceAccessGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceAccessGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceAccessGroupsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + pbmUuid string +} + +func (r ApiEndpointsDeviceAccessGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsDeviceAccessGroupsUsedByListExecute(r) +} + +/* +EndpointsDeviceAccessGroupsUsedByList Method for EndpointsDeviceAccessGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Device access group. + @return ApiEndpointsDeviceAccessGroupsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsUsedByList(ctx context.Context, pbmUuid string) ApiEndpointsDeviceAccessGroupsUsedByListRequest { + return ApiEndpointsDeviceAccessGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsDeviceAccessGroupsUsedByListExecute(r ApiEndpointsDeviceAccessGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceAccessGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_access_groups/{pbm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUserBindingRequest *DeviceUserBindingRequest +} + +func (r ApiEndpointsDeviceBindingsCreateRequest) DeviceUserBindingRequest(deviceUserBindingRequest DeviceUserBindingRequest) ApiEndpointsDeviceBindingsCreateRequest { + r.deviceUserBindingRequest = &deviceUserBindingRequest + return r +} + +func (r ApiEndpointsDeviceBindingsCreateRequest) Execute() (*DeviceUserBinding, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsCreateExecute(r) +} + +/* +EndpointsDeviceBindingsCreate Method for EndpointsDeviceBindingsCreate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDeviceBindingsCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsCreate(ctx context.Context) ApiEndpointsDeviceBindingsCreateRequest { + return ApiEndpointsDeviceBindingsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceUserBinding +func (a *EndpointsAPIService) EndpointsDeviceBindingsCreateExecute(r ApiEndpointsDeviceBindingsCreateRequest) (*DeviceUserBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceUserBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceUserBindingRequest == nil { + return localVarReturnValue, nil, reportError("deviceUserBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceUserBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + policyBindingUuid string +} + +func (r ApiEndpointsDeviceBindingsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsDestroyExecute(r) +} + +/* +EndpointsDeviceBindingsDestroy Method for EndpointsDeviceBindingsDestroy + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Device User binding. + @return ApiEndpointsDeviceBindingsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsDestroy(ctx context.Context, policyBindingUuid string) ApiEndpointsDeviceBindingsDestroyRequest { + return ApiEndpointsDeviceBindingsDestroyRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsDeviceBindingsDestroyExecute(r ApiEndpointsDeviceBindingsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + enabled *bool + order *int32 + ordering *string + page *int32 + pageSize *int32 + policy *string + policyIsnull *bool + search *string + target *string + targetIn *[]string + timeout *int32 +} + +func (r ApiEndpointsDeviceBindingsListRequest) Enabled(enabled bool) ApiEndpointsDeviceBindingsListRequest { + r.enabled = &enabled + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) Order(order int32) ApiEndpointsDeviceBindingsListRequest { + r.order = &order + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsDeviceBindingsListRequest) Ordering(ordering string) ApiEndpointsDeviceBindingsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsDeviceBindingsListRequest) Page(page int32) ApiEndpointsDeviceBindingsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsDeviceBindingsListRequest) PageSize(pageSize int32) ApiEndpointsDeviceBindingsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) Policy(policy string) ApiEndpointsDeviceBindingsListRequest { + r.policy = &policy + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) PolicyIsnull(policyIsnull bool) ApiEndpointsDeviceBindingsListRequest { + r.policyIsnull = &policyIsnull + return r +} + +// A search term. +func (r ApiEndpointsDeviceBindingsListRequest) Search(search string) ApiEndpointsDeviceBindingsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) Target(target string) ApiEndpointsDeviceBindingsListRequest { + r.target = &target + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) TargetIn(targetIn []string) ApiEndpointsDeviceBindingsListRequest { + r.targetIn = &targetIn + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) Timeout(timeout int32) ApiEndpointsDeviceBindingsListRequest { + r.timeout = &timeout + return r +} + +func (r ApiEndpointsDeviceBindingsListRequest) Execute() (*PaginatedDeviceUserBindingList, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsListExecute(r) +} + +/* +EndpointsDeviceBindingsList Method for EndpointsDeviceBindingsList + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDeviceBindingsListRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsList(ctx context.Context) ApiEndpointsDeviceBindingsListRequest { + return ApiEndpointsDeviceBindingsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDeviceUserBindingList +func (a *EndpointsAPIService) EndpointsDeviceBindingsListExecute(r ApiEndpointsDeviceBindingsListRequest) (*PaginatedDeviceUserBindingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDeviceUserBindingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.order != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy", r.policy, "form", "") + } + if r.policyIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy__isnull", r.policyIsnull, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.target != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "target", r.target, "form", "") + } + if r.targetIn != nil { + t := *r.targetIn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "target_in", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "target_in", t, "form", "multi") + } + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + policyBindingUuid string + patchedDeviceUserBindingRequest *PatchedDeviceUserBindingRequest +} + +func (r ApiEndpointsDeviceBindingsPartialUpdateRequest) PatchedDeviceUserBindingRequest(patchedDeviceUserBindingRequest PatchedDeviceUserBindingRequest) ApiEndpointsDeviceBindingsPartialUpdateRequest { + r.patchedDeviceUserBindingRequest = &patchedDeviceUserBindingRequest + return r +} + +func (r ApiEndpointsDeviceBindingsPartialUpdateRequest) Execute() (*DeviceUserBinding, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsPartialUpdateExecute(r) +} + +/* +EndpointsDeviceBindingsPartialUpdate Method for EndpointsDeviceBindingsPartialUpdate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Device User binding. + @return ApiEndpointsDeviceBindingsPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsPartialUpdate(ctx context.Context, policyBindingUuid string) ApiEndpointsDeviceBindingsPartialUpdateRequest { + return ApiEndpointsDeviceBindingsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return DeviceUserBinding +func (a *EndpointsAPIService) EndpointsDeviceBindingsPartialUpdateExecute(r ApiEndpointsDeviceBindingsPartialUpdateRequest) (*DeviceUserBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceUserBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDeviceUserBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + policyBindingUuid string +} + +func (r ApiEndpointsDeviceBindingsRetrieveRequest) Execute() (*DeviceUserBinding, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsRetrieveExecute(r) +} + +/* +EndpointsDeviceBindingsRetrieve Method for EndpointsDeviceBindingsRetrieve + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Device User binding. + @return ApiEndpointsDeviceBindingsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsRetrieve(ctx context.Context, policyBindingUuid string) ApiEndpointsDeviceBindingsRetrieveRequest { + return ApiEndpointsDeviceBindingsRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return DeviceUserBinding +func (a *EndpointsAPIService) EndpointsDeviceBindingsRetrieveExecute(r ApiEndpointsDeviceBindingsRetrieveRequest) (*DeviceUserBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceUserBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + policyBindingUuid string + deviceUserBindingRequest *DeviceUserBindingRequest +} + +func (r ApiEndpointsDeviceBindingsUpdateRequest) DeviceUserBindingRequest(deviceUserBindingRequest DeviceUserBindingRequest) ApiEndpointsDeviceBindingsUpdateRequest { + r.deviceUserBindingRequest = &deviceUserBindingRequest + return r +} + +func (r ApiEndpointsDeviceBindingsUpdateRequest) Execute() (*DeviceUserBinding, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsUpdateExecute(r) +} + +/* +EndpointsDeviceBindingsUpdate Method for EndpointsDeviceBindingsUpdate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Device User binding. + @return ApiEndpointsDeviceBindingsUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsUpdate(ctx context.Context, policyBindingUuid string) ApiEndpointsDeviceBindingsUpdateRequest { + return ApiEndpointsDeviceBindingsUpdateRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return DeviceUserBinding +func (a *EndpointsAPIService) EndpointsDeviceBindingsUpdateExecute(r ApiEndpointsDeviceBindingsUpdateRequest) (*DeviceUserBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceUserBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.deviceUserBindingRequest == nil { + return localVarReturnValue, nil, reportError("deviceUserBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.deviceUserBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDeviceBindingsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + policyBindingUuid string +} + +func (r ApiEndpointsDeviceBindingsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsDeviceBindingsUsedByListExecute(r) +} + +/* +EndpointsDeviceBindingsUsedByList Method for EndpointsDeviceBindingsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Device User binding. + @return ApiEndpointsDeviceBindingsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsDeviceBindingsUsedByList(ctx context.Context, policyBindingUuid string) ApiEndpointsDeviceBindingsUsedByListRequest { + return ApiEndpointsDeviceBindingsUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsDeviceBindingsUsedByListExecute(r ApiEndpointsDeviceBindingsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDeviceBindingsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/device_bindings/{policy_binding_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUuid string +} + +func (r ApiEndpointsDevicesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsDevicesDestroyExecute(r) +} + +/* +EndpointsDevicesDestroy Method for EndpointsDevicesDestroy + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deviceUuid A UUID string identifying this Device. + @return ApiEndpointsDevicesDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesDestroy(ctx context.Context, deviceUuid string) ApiEndpointsDevicesDestroyRequest { + return ApiEndpointsDevicesDestroyRequest{ + ApiService: a, + ctx: ctx, + deviceUuid: deviceUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsDevicesDestroyExecute(r ApiEndpointsDevicesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/{device_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"device_uuid"+"}", url.PathEscape(parameterValueToString(r.deviceUuid, "deviceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + identifier *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiEndpointsDevicesListRequest) Identifier(identifier string) ApiEndpointsDevicesListRequest { + r.identifier = &identifier + return r +} + +func (r ApiEndpointsDevicesListRequest) Name(name string) ApiEndpointsDevicesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsDevicesListRequest) Ordering(ordering string) ApiEndpointsDevicesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsDevicesListRequest) Page(page int32) ApiEndpointsDevicesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsDevicesListRequest) PageSize(pageSize int32) ApiEndpointsDevicesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsDevicesListRequest) Search(search string) ApiEndpointsDevicesListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsDevicesListRequest) Execute() (*PaginatedEndpointDeviceList, *http.Response, error) { + return r.ApiService.EndpointsDevicesListExecute(r) +} + +/* +EndpointsDevicesList Method for EndpointsDevicesList + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDevicesListRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesList(ctx context.Context) ApiEndpointsDevicesListRequest { + return ApiEndpointsDevicesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEndpointDeviceList +func (a *EndpointsAPIService) EndpointsDevicesListExecute(r ApiEndpointsDevicesListRequest) (*PaginatedEndpointDeviceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEndpointDeviceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.identifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier", r.identifier, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUuid string + patchedEndpointDeviceRequest *PatchedEndpointDeviceRequest +} + +func (r ApiEndpointsDevicesPartialUpdateRequest) PatchedEndpointDeviceRequest(patchedEndpointDeviceRequest PatchedEndpointDeviceRequest) ApiEndpointsDevicesPartialUpdateRequest { + r.patchedEndpointDeviceRequest = &patchedEndpointDeviceRequest + return r +} + +func (r ApiEndpointsDevicesPartialUpdateRequest) Execute() (*EndpointDevice, *http.Response, error) { + return r.ApiService.EndpointsDevicesPartialUpdateExecute(r) +} + +/* +EndpointsDevicesPartialUpdate Method for EndpointsDevicesPartialUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deviceUuid A UUID string identifying this Device. + @return ApiEndpointsDevicesPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesPartialUpdate(ctx context.Context, deviceUuid string) ApiEndpointsDevicesPartialUpdateRequest { + return ApiEndpointsDevicesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + deviceUuid: deviceUuid, + } +} + +// Execute executes the request +// +// @return EndpointDevice +func (a *EndpointsAPIService) EndpointsDevicesPartialUpdateExecute(r ApiEndpointsDevicesPartialUpdateRequest) (*EndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/{device_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"device_uuid"+"}", url.PathEscape(parameterValueToString(r.deviceUuid, "deviceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEndpointDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUuid string +} + +func (r ApiEndpointsDevicesRetrieveRequest) Execute() (*EndpointDeviceDetails, *http.Response, error) { + return r.ApiService.EndpointsDevicesRetrieveExecute(r) +} + +/* +EndpointsDevicesRetrieve Method for EndpointsDevicesRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deviceUuid A UUID string identifying this Device. + @return ApiEndpointsDevicesRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesRetrieve(ctx context.Context, deviceUuid string) ApiEndpointsDevicesRetrieveRequest { + return ApiEndpointsDevicesRetrieveRequest{ + ApiService: a, + ctx: ctx, + deviceUuid: deviceUuid, + } +} + +// Execute executes the request +// +// @return EndpointDeviceDetails +func (a *EndpointsAPIService) EndpointsDevicesRetrieveExecute(r ApiEndpointsDevicesRetrieveRequest) (*EndpointDeviceDetails, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointDeviceDetails + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/{device_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"device_uuid"+"}", url.PathEscape(parameterValueToString(r.deviceUuid, "deviceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesSummaryRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService +} + +func (r ApiEndpointsDevicesSummaryRetrieveRequest) Execute() (*DeviceSummary, *http.Response, error) { + return r.ApiService.EndpointsDevicesSummaryRetrieveExecute(r) +} + +/* +EndpointsDevicesSummaryRetrieve Method for EndpointsDevicesSummaryRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsDevicesSummaryRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesSummaryRetrieve(ctx context.Context) ApiEndpointsDevicesSummaryRetrieveRequest { + return ApiEndpointsDevicesSummaryRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DeviceSummary +func (a *EndpointsAPIService) EndpointsDevicesSummaryRetrieveExecute(r ApiEndpointsDevicesSummaryRetrieveRequest) (*DeviceSummary, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DeviceSummary + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesSummaryRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/summary/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUuid string + endpointDeviceRequest *EndpointDeviceRequest +} + +func (r ApiEndpointsDevicesUpdateRequest) EndpointDeviceRequest(endpointDeviceRequest EndpointDeviceRequest) ApiEndpointsDevicesUpdateRequest { + r.endpointDeviceRequest = &endpointDeviceRequest + return r +} + +func (r ApiEndpointsDevicesUpdateRequest) Execute() (*EndpointDevice, *http.Response, error) { + return r.ApiService.EndpointsDevicesUpdateExecute(r) +} + +/* +EndpointsDevicesUpdate Method for EndpointsDevicesUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deviceUuid A UUID string identifying this Device. + @return ApiEndpointsDevicesUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesUpdate(ctx context.Context, deviceUuid string) ApiEndpointsDevicesUpdateRequest { + return ApiEndpointsDevicesUpdateRequest{ + ApiService: a, + ctx: ctx, + deviceUuid: deviceUuid, + } +} + +// Execute executes the request +// +// @return EndpointDevice +func (a *EndpointsAPIService) EndpointsDevicesUpdateExecute(r ApiEndpointsDevicesUpdateRequest) (*EndpointDevice, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointDevice + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/{device_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"device_uuid"+"}", url.PathEscape(parameterValueToString(r.deviceUuid, "deviceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.endpointDeviceRequest == nil { + return localVarReturnValue, nil, reportError("endpointDeviceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.endpointDeviceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsDevicesUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + deviceUuid string +} + +func (r ApiEndpointsDevicesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsDevicesUsedByListExecute(r) +} + +/* +EndpointsDevicesUsedByList Method for EndpointsDevicesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param deviceUuid A UUID string identifying this Device. + @return ApiEndpointsDevicesUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsDevicesUsedByList(ctx context.Context, deviceUuid string) ApiEndpointsDevicesUsedByListRequest { + return ApiEndpointsDevicesUsedByListRequest{ + ApiService: a, + ctx: ctx, + deviceUuid: deviceUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsDevicesUsedByListExecute(r ApiEndpointsDevicesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsDevicesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/devices/{device_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"device_uuid"+"}", url.PathEscape(parameterValueToString(r.deviceUuid, "deviceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + fleetConnectorRequest *FleetConnectorRequest +} + +func (r ApiEndpointsFleetConnectorsCreateRequest) FleetConnectorRequest(fleetConnectorRequest FleetConnectorRequest) ApiEndpointsFleetConnectorsCreateRequest { + r.fleetConnectorRequest = &fleetConnectorRequest + return r +} + +func (r ApiEndpointsFleetConnectorsCreateRequest) Execute() (*FleetConnector, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsCreateExecute(r) +} + +/* +EndpointsFleetConnectorsCreate Method for EndpointsFleetConnectorsCreate + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsFleetConnectorsCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsCreate(ctx context.Context) ApiEndpointsFleetConnectorsCreateRequest { + return ApiEndpointsFleetConnectorsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FleetConnector +func (a *EndpointsAPIService) EndpointsFleetConnectorsCreateExecute(r ApiEndpointsFleetConnectorsCreateRequest) (*FleetConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FleetConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fleetConnectorRequest == nil { + return localVarReturnValue, nil, reportError("fleetConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fleetConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsFleetConnectorsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsDestroyExecute(r) +} + +/* +EndpointsFleetConnectorsDestroy Method for EndpointsFleetConnectorsDestroy + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Fleet Connector. + @return ApiEndpointsFleetConnectorsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsDestroy(ctx context.Context, connectorUuid string) ApiEndpointsFleetConnectorsDestroyRequest { + return ApiEndpointsFleetConnectorsDestroyRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsFleetConnectorsDestroyExecute(r ApiEndpointsFleetConnectorsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiEndpointsFleetConnectorsListRequest) Name(name string) ApiEndpointsFleetConnectorsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsFleetConnectorsListRequest) Ordering(ordering string) ApiEndpointsFleetConnectorsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsFleetConnectorsListRequest) Page(page int32) ApiEndpointsFleetConnectorsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsFleetConnectorsListRequest) PageSize(pageSize int32) ApiEndpointsFleetConnectorsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsFleetConnectorsListRequest) Search(search string) ApiEndpointsFleetConnectorsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsFleetConnectorsListRequest) Execute() (*PaginatedFleetConnectorList, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsListExecute(r) +} + +/* +EndpointsFleetConnectorsList Method for EndpointsFleetConnectorsList + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsFleetConnectorsListRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsList(ctx context.Context) ApiEndpointsFleetConnectorsListRequest { + return ApiEndpointsFleetConnectorsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFleetConnectorList +func (a *EndpointsAPIService) EndpointsFleetConnectorsListExecute(r ApiEndpointsFleetConnectorsListRequest) (*PaginatedFleetConnectorList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFleetConnectorList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + patchedFleetConnectorRequest *PatchedFleetConnectorRequest +} + +func (r ApiEndpointsFleetConnectorsPartialUpdateRequest) PatchedFleetConnectorRequest(patchedFleetConnectorRequest PatchedFleetConnectorRequest) ApiEndpointsFleetConnectorsPartialUpdateRequest { + r.patchedFleetConnectorRequest = &patchedFleetConnectorRequest + return r +} + +func (r ApiEndpointsFleetConnectorsPartialUpdateRequest) Execute() (*FleetConnector, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsPartialUpdateExecute(r) +} + +/* +EndpointsFleetConnectorsPartialUpdate Method for EndpointsFleetConnectorsPartialUpdate + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Fleet Connector. + @return ApiEndpointsFleetConnectorsPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsPartialUpdate(ctx context.Context, connectorUuid string) ApiEndpointsFleetConnectorsPartialUpdateRequest { + return ApiEndpointsFleetConnectorsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return FleetConnector +func (a *EndpointsAPIService) EndpointsFleetConnectorsPartialUpdateExecute(r ApiEndpointsFleetConnectorsPartialUpdateRequest) (*FleetConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FleetConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedFleetConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsFleetConnectorsRetrieveRequest) Execute() (*FleetConnector, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsRetrieveExecute(r) +} + +/* +EndpointsFleetConnectorsRetrieve Method for EndpointsFleetConnectorsRetrieve + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Fleet Connector. + @return ApiEndpointsFleetConnectorsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsRetrieve(ctx context.Context, connectorUuid string) ApiEndpointsFleetConnectorsRetrieveRequest { + return ApiEndpointsFleetConnectorsRetrieveRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return FleetConnector +func (a *EndpointsAPIService) EndpointsFleetConnectorsRetrieveExecute(r ApiEndpointsFleetConnectorsRetrieveRequest) (*FleetConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FleetConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + fleetConnectorRequest *FleetConnectorRequest +} + +func (r ApiEndpointsFleetConnectorsUpdateRequest) FleetConnectorRequest(fleetConnectorRequest FleetConnectorRequest) ApiEndpointsFleetConnectorsUpdateRequest { + r.fleetConnectorRequest = &fleetConnectorRequest + return r +} + +func (r ApiEndpointsFleetConnectorsUpdateRequest) Execute() (*FleetConnector, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsUpdateExecute(r) +} + +/* +EndpointsFleetConnectorsUpdate Method for EndpointsFleetConnectorsUpdate + +FleetConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Fleet Connector. + @return ApiEndpointsFleetConnectorsUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsUpdate(ctx context.Context, connectorUuid string) ApiEndpointsFleetConnectorsUpdateRequest { + return ApiEndpointsFleetConnectorsUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return FleetConnector +func (a *EndpointsAPIService) EndpointsFleetConnectorsUpdateExecute(r ApiEndpointsFleetConnectorsUpdateRequest) (*FleetConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FleetConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.fleetConnectorRequest == nil { + return localVarReturnValue, nil, reportError("fleetConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.fleetConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsFleetConnectorsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsFleetConnectorsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsFleetConnectorsUsedByListExecute(r) +} + +/* +EndpointsFleetConnectorsUsedByList Method for EndpointsFleetConnectorsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Fleet Connector. + @return ApiEndpointsFleetConnectorsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsFleetConnectorsUsedByList(ctx context.Context, connectorUuid string) ApiEndpointsFleetConnectorsUsedByListRequest { + return ApiEndpointsFleetConnectorsUsedByListRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsFleetConnectorsUsedByListExecute(r ApiEndpointsFleetConnectorsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsFleetConnectorsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/fleet/connectors/{connector_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsCreateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + googleChromeConnectorRequest *GoogleChromeConnectorRequest +} + +func (r ApiEndpointsGoogleChromeConnectorsCreateRequest) GoogleChromeConnectorRequest(googleChromeConnectorRequest GoogleChromeConnectorRequest) ApiEndpointsGoogleChromeConnectorsCreateRequest { + r.googleChromeConnectorRequest = &googleChromeConnectorRequest + return r +} + +func (r ApiEndpointsGoogleChromeConnectorsCreateRequest) Execute() (*GoogleChromeConnector, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsCreateExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsCreate Method for EndpointsGoogleChromeConnectorsCreate + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsGoogleChromeConnectorsCreateRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsCreate(ctx context.Context) ApiEndpointsGoogleChromeConnectorsCreateRequest { + return ApiEndpointsGoogleChromeConnectorsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleChromeConnector +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsCreateExecute(r ApiEndpointsGoogleChromeConnectorsCreateRequest) (*GoogleChromeConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleChromeConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleChromeConnectorRequest == nil { + return localVarReturnValue, nil, reportError("googleChromeConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleChromeConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsDestroyRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsGoogleChromeConnectorsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsDestroyExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsDestroy Method for EndpointsGoogleChromeConnectorsDestroy + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Google Device Trust Connector. + @return ApiEndpointsGoogleChromeConnectorsDestroyRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsDestroy(ctx context.Context, connectorUuid string) ApiEndpointsGoogleChromeConnectorsDestroyRequest { + return ApiEndpointsGoogleChromeConnectorsDestroyRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsDestroyExecute(r ApiEndpointsGoogleChromeConnectorsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiEndpointsGoogleChromeConnectorsListRequest) Name(name string) ApiEndpointsGoogleChromeConnectorsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEndpointsGoogleChromeConnectorsListRequest) Ordering(ordering string) ApiEndpointsGoogleChromeConnectorsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEndpointsGoogleChromeConnectorsListRequest) Page(page int32) ApiEndpointsGoogleChromeConnectorsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEndpointsGoogleChromeConnectorsListRequest) PageSize(pageSize int32) ApiEndpointsGoogleChromeConnectorsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEndpointsGoogleChromeConnectorsListRequest) Search(search string) ApiEndpointsGoogleChromeConnectorsListRequest { + r.search = &search + return r +} + +func (r ApiEndpointsGoogleChromeConnectorsListRequest) Execute() (*PaginatedGoogleChromeConnectorList, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsListExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsList Method for EndpointsGoogleChromeConnectorsList + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEndpointsGoogleChromeConnectorsListRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsList(ctx context.Context) ApiEndpointsGoogleChromeConnectorsListRequest { + return ApiEndpointsGoogleChromeConnectorsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleChromeConnectorList +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsListExecute(r ApiEndpointsGoogleChromeConnectorsListRequest) (*PaginatedGoogleChromeConnectorList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleChromeConnectorList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + patchedGoogleChromeConnectorRequest *PatchedGoogleChromeConnectorRequest +} + +func (r ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest) PatchedGoogleChromeConnectorRequest(patchedGoogleChromeConnectorRequest PatchedGoogleChromeConnectorRequest) ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest { + r.patchedGoogleChromeConnectorRequest = &patchedGoogleChromeConnectorRequest + return r +} + +func (r ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest) Execute() (*GoogleChromeConnector, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsPartialUpdateExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsPartialUpdate Method for EndpointsGoogleChromeConnectorsPartialUpdate + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Google Device Trust Connector. + @return ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsPartialUpdate(ctx context.Context, connectorUuid string) ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest { + return ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return GoogleChromeConnector +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsPartialUpdateExecute(r ApiEndpointsGoogleChromeConnectorsPartialUpdateRequest) (*GoogleChromeConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleChromeConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGoogleChromeConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsRetrieveRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsGoogleChromeConnectorsRetrieveRequest) Execute() (*GoogleChromeConnector, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsRetrieveExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsRetrieve Method for EndpointsGoogleChromeConnectorsRetrieve + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Google Device Trust Connector. + @return ApiEndpointsGoogleChromeConnectorsRetrieveRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsRetrieve(ctx context.Context, connectorUuid string) ApiEndpointsGoogleChromeConnectorsRetrieveRequest { + return ApiEndpointsGoogleChromeConnectorsRetrieveRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return GoogleChromeConnector +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsRetrieveExecute(r ApiEndpointsGoogleChromeConnectorsRetrieveRequest) (*GoogleChromeConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleChromeConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsUpdateRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string + googleChromeConnectorRequest *GoogleChromeConnectorRequest +} + +func (r ApiEndpointsGoogleChromeConnectorsUpdateRequest) GoogleChromeConnectorRequest(googleChromeConnectorRequest GoogleChromeConnectorRequest) ApiEndpointsGoogleChromeConnectorsUpdateRequest { + r.googleChromeConnectorRequest = &googleChromeConnectorRequest + return r +} + +func (r ApiEndpointsGoogleChromeConnectorsUpdateRequest) Execute() (*GoogleChromeConnector, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsUpdateExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsUpdate Method for EndpointsGoogleChromeConnectorsUpdate + +GoogleChromeConnector Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Google Device Trust Connector. + @return ApiEndpointsGoogleChromeConnectorsUpdateRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsUpdate(ctx context.Context, connectorUuid string) ApiEndpointsGoogleChromeConnectorsUpdateRequest { + return ApiEndpointsGoogleChromeConnectorsUpdateRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return GoogleChromeConnector +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsUpdateExecute(r ApiEndpointsGoogleChromeConnectorsUpdateRequest) (*GoogleChromeConnector, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleChromeConnector + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/{connector_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleChromeConnectorRequest == nil { + return localVarReturnValue, nil, reportError("googleChromeConnectorRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleChromeConnectorRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEndpointsGoogleChromeConnectorsUsedByListRequest struct { + ctx context.Context + ApiService *EndpointsAPIService + connectorUuid string +} + +func (r ApiEndpointsGoogleChromeConnectorsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EndpointsGoogleChromeConnectorsUsedByListExecute(r) +} + +/* +EndpointsGoogleChromeConnectorsUsedByList Method for EndpointsGoogleChromeConnectorsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectorUuid A UUID string identifying this Google Device Trust Connector. + @return ApiEndpointsGoogleChromeConnectorsUsedByListRequest +*/ +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsUsedByList(ctx context.Context, connectorUuid string) ApiEndpointsGoogleChromeConnectorsUsedByListRequest { + return ApiEndpointsGoogleChromeConnectorsUsedByListRequest{ + ApiService: a, + ctx: ctx, + connectorUuid: connectorUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EndpointsAPIService) EndpointsGoogleChromeConnectorsUsedByListExecute(r ApiEndpointsGoogleChromeConnectorsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EndpointsAPIService.EndpointsGoogleChromeConnectorsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/endpoints/google_chrome/connectors/{connector_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"connector_uuid"+"}", url.PathEscape(parameterValueToString(r.connectorUuid, "connectorUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_enterprise.go b/packages/client-go/api_enterprise.go new file mode 100644 index 0000000000..6d44944c74 --- /dev/null +++ b/packages/client-go/api_enterprise.go @@ -0,0 +1,1334 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// EnterpriseAPIService EnterpriseAPI service +type EnterpriseAPIService service + +type ApiEnterpriseLicenseCreateRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseRequest *LicenseRequest +} + +func (r ApiEnterpriseLicenseCreateRequest) LicenseRequest(licenseRequest LicenseRequest) ApiEnterpriseLicenseCreateRequest { + r.licenseRequest = &licenseRequest + return r +} + +func (r ApiEnterpriseLicenseCreateRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.EnterpriseLicenseCreateExecute(r) +} + +/* +EnterpriseLicenseCreate Method for EnterpriseLicenseCreate + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnterpriseLicenseCreateRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseCreate(ctx context.Context) ApiEnterpriseLicenseCreateRequest { + return ApiEnterpriseLicenseCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return License +func (a *EnterpriseAPIService) EnterpriseLicenseCreateExecute(r ApiEnterpriseLicenseCreateRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.licenseRequest == nil { + return localVarReturnValue, nil, reportError("licenseRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.licenseRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseDestroyRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseUuid string +} + +func (r ApiEnterpriseLicenseDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EnterpriseLicenseDestroyExecute(r) +} + +/* +EnterpriseLicenseDestroy Method for EnterpriseLicenseDestroy + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param licenseUuid A UUID string identifying this License. + @return ApiEnterpriseLicenseDestroyRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseDestroy(ctx context.Context, licenseUuid string) ApiEnterpriseLicenseDestroyRequest { + return ApiEnterpriseLicenseDestroyRequest{ + ApiService: a, + ctx: ctx, + licenseUuid: licenseUuid, + } +} + +// Execute executes the request +func (a *EnterpriseAPIService) EnterpriseLicenseDestroyExecute(r ApiEnterpriseLicenseDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/{license_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"license_uuid"+"}", url.PathEscape(parameterValueToString(r.licenseUuid, "licenseUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseForecastRetrieveRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService +} + +func (r ApiEnterpriseLicenseForecastRetrieveRequest) Execute() (*LicenseForecast, *http.Response, error) { + return r.ApiService.EnterpriseLicenseForecastRetrieveExecute(r) +} + +/* +EnterpriseLicenseForecastRetrieve Method for EnterpriseLicenseForecastRetrieve + +Forecast how many users will be required in a year + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnterpriseLicenseForecastRetrieveRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseForecastRetrieve(ctx context.Context) ApiEnterpriseLicenseForecastRetrieveRequest { + return ApiEnterpriseLicenseForecastRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LicenseForecast +func (a *EnterpriseAPIService) EnterpriseLicenseForecastRetrieveExecute(r ApiEnterpriseLicenseForecastRetrieveRequest) (*LicenseForecast, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LicenseForecast + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseForecastRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/forecast/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseInstallIdRetrieveRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService +} + +func (r ApiEnterpriseLicenseInstallIdRetrieveRequest) Execute() (*InstallID, *http.Response, error) { + return r.ApiService.EnterpriseLicenseInstallIdRetrieveExecute(r) +} + +/* +EnterpriseLicenseInstallIdRetrieve Method for EnterpriseLicenseInstallIdRetrieve + +Get install_id + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnterpriseLicenseInstallIdRetrieveRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseInstallIdRetrieve(ctx context.Context) ApiEnterpriseLicenseInstallIdRetrieveRequest { + return ApiEnterpriseLicenseInstallIdRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InstallID +func (a *EnterpriseAPIService) EnterpriseLicenseInstallIdRetrieveExecute(r ApiEnterpriseLicenseInstallIdRetrieveRequest) (*InstallID, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InstallID + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseInstallIdRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/install_id/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseListRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiEnterpriseLicenseListRequest) Name(name string) ApiEnterpriseLicenseListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEnterpriseLicenseListRequest) Ordering(ordering string) ApiEnterpriseLicenseListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEnterpriseLicenseListRequest) Page(page int32) ApiEnterpriseLicenseListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEnterpriseLicenseListRequest) PageSize(pageSize int32) ApiEnterpriseLicenseListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEnterpriseLicenseListRequest) Search(search string) ApiEnterpriseLicenseListRequest { + r.search = &search + return r +} + +func (r ApiEnterpriseLicenseListRequest) Execute() (*PaginatedLicenseList, *http.Response, error) { + return r.ApiService.EnterpriseLicenseListExecute(r) +} + +/* +EnterpriseLicenseList Method for EnterpriseLicenseList + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnterpriseLicenseListRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseList(ctx context.Context) ApiEnterpriseLicenseListRequest { + return ApiEnterpriseLicenseListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLicenseList +func (a *EnterpriseAPIService) EnterpriseLicenseListExecute(r ApiEnterpriseLicenseListRequest) (*PaginatedLicenseList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLicenseList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicensePartialUpdateRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseUuid string + patchedLicenseRequest *PatchedLicenseRequest +} + +func (r ApiEnterpriseLicensePartialUpdateRequest) PatchedLicenseRequest(patchedLicenseRequest PatchedLicenseRequest) ApiEnterpriseLicensePartialUpdateRequest { + r.patchedLicenseRequest = &patchedLicenseRequest + return r +} + +func (r ApiEnterpriseLicensePartialUpdateRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.EnterpriseLicensePartialUpdateExecute(r) +} + +/* +EnterpriseLicensePartialUpdate Method for EnterpriseLicensePartialUpdate + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param licenseUuid A UUID string identifying this License. + @return ApiEnterpriseLicensePartialUpdateRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicensePartialUpdate(ctx context.Context, licenseUuid string) ApiEnterpriseLicensePartialUpdateRequest { + return ApiEnterpriseLicensePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + licenseUuid: licenseUuid, + } +} + +// Execute executes the request +// +// @return License +func (a *EnterpriseAPIService) EnterpriseLicensePartialUpdateExecute(r ApiEnterpriseLicensePartialUpdateRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicensePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/{license_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"license_uuid"+"}", url.PathEscape(parameterValueToString(r.licenseUuid, "licenseUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedLicenseRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseRetrieveRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseUuid string +} + +func (r ApiEnterpriseLicenseRetrieveRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.EnterpriseLicenseRetrieveExecute(r) +} + +/* +EnterpriseLicenseRetrieve Method for EnterpriseLicenseRetrieve + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param licenseUuid A UUID string identifying this License. + @return ApiEnterpriseLicenseRetrieveRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseRetrieve(ctx context.Context, licenseUuid string) ApiEnterpriseLicenseRetrieveRequest { + return ApiEnterpriseLicenseRetrieveRequest{ + ApiService: a, + ctx: ctx, + licenseUuid: licenseUuid, + } +} + +// Execute executes the request +// +// @return License +func (a *EnterpriseAPIService) EnterpriseLicenseRetrieveExecute(r ApiEnterpriseLicenseRetrieveRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/{license_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"license_uuid"+"}", url.PathEscape(parameterValueToString(r.licenseUuid, "licenseUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseSummaryRetrieveRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + cached *bool +} + +func (r ApiEnterpriseLicenseSummaryRetrieveRequest) Cached(cached bool) ApiEnterpriseLicenseSummaryRetrieveRequest { + r.cached = &cached + return r +} + +func (r ApiEnterpriseLicenseSummaryRetrieveRequest) Execute() (*LicenseSummary, *http.Response, error) { + return r.ApiService.EnterpriseLicenseSummaryRetrieveExecute(r) +} + +/* +EnterpriseLicenseSummaryRetrieve Method for EnterpriseLicenseSummaryRetrieve + +Get the total license status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEnterpriseLicenseSummaryRetrieveRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseSummaryRetrieve(ctx context.Context) ApiEnterpriseLicenseSummaryRetrieveRequest { + return ApiEnterpriseLicenseSummaryRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LicenseSummary +func (a *EnterpriseAPIService) EnterpriseLicenseSummaryRetrieveExecute(r ApiEnterpriseLicenseSummaryRetrieveRequest) (*LicenseSummary, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LicenseSummary + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseSummaryRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/summary/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.cached != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cached", r.cached, "form", "") + } else { + var defaultValue bool = true + parameterAddToHeaderOrQuery(localVarQueryParams, "cached", defaultValue, "form", "") + r.cached = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseUpdateRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseUuid string + licenseRequest *LicenseRequest +} + +func (r ApiEnterpriseLicenseUpdateRequest) LicenseRequest(licenseRequest LicenseRequest) ApiEnterpriseLicenseUpdateRequest { + r.licenseRequest = &licenseRequest + return r +} + +func (r ApiEnterpriseLicenseUpdateRequest) Execute() (*License, *http.Response, error) { + return r.ApiService.EnterpriseLicenseUpdateExecute(r) +} + +/* +EnterpriseLicenseUpdate Method for EnterpriseLicenseUpdate + +License Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param licenseUuid A UUID string identifying this License. + @return ApiEnterpriseLicenseUpdateRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseUpdate(ctx context.Context, licenseUuid string) ApiEnterpriseLicenseUpdateRequest { + return ApiEnterpriseLicenseUpdateRequest{ + ApiService: a, + ctx: ctx, + licenseUuid: licenseUuid, + } +} + +// Execute executes the request +// +// @return License +func (a *EnterpriseAPIService) EnterpriseLicenseUpdateExecute(r ApiEnterpriseLicenseUpdateRequest) (*License, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *License + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/{license_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"license_uuid"+"}", url.PathEscape(parameterValueToString(r.licenseUuid, "licenseUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.licenseRequest == nil { + return localVarReturnValue, nil, reportError("licenseRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.licenseRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEnterpriseLicenseUsedByListRequest struct { + ctx context.Context + ApiService *EnterpriseAPIService + licenseUuid string +} + +func (r ApiEnterpriseLicenseUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EnterpriseLicenseUsedByListExecute(r) +} + +/* +EnterpriseLicenseUsedByList Method for EnterpriseLicenseUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param licenseUuid A UUID string identifying this License. + @return ApiEnterpriseLicenseUsedByListRequest +*/ +func (a *EnterpriseAPIService) EnterpriseLicenseUsedByList(ctx context.Context, licenseUuid string) ApiEnterpriseLicenseUsedByListRequest { + return ApiEnterpriseLicenseUsedByListRequest{ + ApiService: a, + ctx: ctx, + licenseUuid: licenseUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EnterpriseAPIService) EnterpriseLicenseUsedByListExecute(r ApiEnterpriseLicenseUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EnterpriseAPIService.EnterpriseLicenseUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/enterprise/license/{license_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"license_uuid"+"}", url.PathEscape(parameterValueToString(r.licenseUuid, "licenseUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_events.go b/packages/client-go/api_events.go new file mode 100644 index 0000000000..9439132387 --- /dev/null +++ b/packages/client-go/api_events.go @@ -0,0 +1,4663 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// EventsAPIService EventsAPI service +type EventsAPIService service + +type ApiEventsEventsActionsListRequest struct { + ctx context.Context + ApiService *EventsAPIService +} + +func (r ApiEventsEventsActionsListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.EventsEventsActionsListExecute(r) +} + +/* +EventsEventsActionsList Method for EventsEventsActionsList + +Get all actions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsActionsListRequest +*/ +func (a *EventsAPIService) EventsEventsActionsList(ctx context.Context) ApiEventsEventsActionsListRequest { + return ApiEventsEventsActionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *EventsAPIService) EventsEventsActionsListExecute(r ApiEventsEventsActionsListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsActionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/actions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService + eventRequest *EventRequest +} + +func (r ApiEventsEventsCreateRequest) EventRequest(eventRequest EventRequest) ApiEventsEventsCreateRequest { + r.eventRequest = &eventRequest + return r +} + +func (r ApiEventsEventsCreateRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.EventsEventsCreateExecute(r) +} + +/* +EventsEventsCreate Method for EventsEventsCreate + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsCreateRequest +*/ +func (a *EventsAPIService) EventsEventsCreate(ctx context.Context) ApiEventsEventsCreateRequest { + return ApiEventsEventsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsAPIService) EventsEventsCreateExecute(r ApiEventsEventsCreateRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventRequest == nil { + return localVarReturnValue, nil, reportError("eventRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsDestroyRequest struct { + ctx context.Context + ApiService *EventsAPIService + eventUuid string +} + +func (r ApiEventsEventsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EventsEventsDestroyExecute(r) +} + +/* +EventsEventsDestroy Method for EventsEventsDestroy + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventUuid A UUID string identifying this Event. + @return ApiEventsEventsDestroyRequest +*/ +func (a *EventsAPIService) EventsEventsDestroy(ctx context.Context, eventUuid string) ApiEventsEventsDestroyRequest { + return ApiEventsEventsDestroyRequest{ + ApiService: a, + ctx: ctx, + eventUuid: eventUuid, + } +} + +// Execute executes the request +func (a *EventsAPIService) EventsEventsDestroyExecute(r ApiEventsEventsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/{event_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"event_uuid"+"}", url.PathEscape(parameterValueToString(r.eventUuid, "eventUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEventsEventsExportCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService + action *string + actions *[]string + brandName *string + clientIp *string + contextAuthorizedApp *string + contextModelApp *string + contextModelName *string + contextModelPk *string + ordering *string + search *string + username *string +} + +func (r ApiEventsEventsExportCreateRequest) Action(action string) ApiEventsEventsExportCreateRequest { + r.action = &action + return r +} + +func (r ApiEventsEventsExportCreateRequest) Actions(actions []string) ApiEventsEventsExportCreateRequest { + r.actions = &actions + return r +} + +// Brand name +func (r ApiEventsEventsExportCreateRequest) BrandName(brandName string) ApiEventsEventsExportCreateRequest { + r.brandName = &brandName + return r +} + +func (r ApiEventsEventsExportCreateRequest) ClientIp(clientIp string) ApiEventsEventsExportCreateRequest { + r.clientIp = &clientIp + return r +} + +// Context Authorized application +func (r ApiEventsEventsExportCreateRequest) ContextAuthorizedApp(contextAuthorizedApp string) ApiEventsEventsExportCreateRequest { + r.contextAuthorizedApp = &contextAuthorizedApp + return r +} + +// Context Model App +func (r ApiEventsEventsExportCreateRequest) ContextModelApp(contextModelApp string) ApiEventsEventsExportCreateRequest { + r.contextModelApp = &contextModelApp + return r +} + +// Context Model Name +func (r ApiEventsEventsExportCreateRequest) ContextModelName(contextModelName string) ApiEventsEventsExportCreateRequest { + r.contextModelName = &contextModelName + return r +} + +// Context Model Primary Key +func (r ApiEventsEventsExportCreateRequest) ContextModelPk(contextModelPk string) ApiEventsEventsExportCreateRequest { + r.contextModelPk = &contextModelPk + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsEventsExportCreateRequest) Ordering(ordering string) ApiEventsEventsExportCreateRequest { + r.ordering = &ordering + return r +} + +// A search term. +func (r ApiEventsEventsExportCreateRequest) Search(search string) ApiEventsEventsExportCreateRequest { + r.search = &search + return r +} + +// Username +func (r ApiEventsEventsExportCreateRequest) Username(username string) ApiEventsEventsExportCreateRequest { + r.username = &username + return r +} + +func (r ApiEventsEventsExportCreateRequest) Execute() (*DataExport, *http.Response, error) { + return r.ApiService.EventsEventsExportCreateExecute(r) +} + +/* +EventsEventsExportCreate Method for EventsEventsExportCreate + +Create a data export for this data type. Note that the export is generated asynchronously: +this method returns a `DataExport` object that will initially have `completed=false` as well +as the permanent URL to that object in the `Location` header. +You can poll that URL until `completed=true`, at which point the `file_url` property will +contain a URL to download + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsExportCreateRequest +*/ +func (a *EventsAPIService) EventsEventsExportCreate(ctx context.Context) ApiEventsEventsExportCreateRequest { + return ApiEventsEventsExportCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DataExport +func (a *EventsAPIService) EventsEventsExportCreateExecute(r ApiEventsEventsExportCreateRequest) (*DataExport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataExport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsExportCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/export/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } + if r.actions != nil { + t := *r.actions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", t, "form", "multi") + } + } + if r.brandName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "brand_name", r.brandName, "form", "") + } + if r.clientIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_ip", r.clientIp, "form", "") + } + if r.contextAuthorizedApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_authorized_app", r.contextAuthorizedApp, "form", "") + } + if r.contextModelApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_app", r.contextModelApp, "form", "") + } + if r.contextModelName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_name", r.contextModelName, "form", "") + } + if r.contextModelPk != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_pk", r.contextModelPk, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsListRequest struct { + ctx context.Context + ApiService *EventsAPIService + action *string + actions *[]string + brandName *string + clientIp *string + contextAuthorizedApp *string + contextModelApp *string + contextModelName *string + contextModelPk *string + ordering *string + page *int32 + pageSize *int32 + search *string + username *string +} + +func (r ApiEventsEventsListRequest) Action(action string) ApiEventsEventsListRequest { + r.action = &action + return r +} + +func (r ApiEventsEventsListRequest) Actions(actions []string) ApiEventsEventsListRequest { + r.actions = &actions + return r +} + +// Brand name +func (r ApiEventsEventsListRequest) BrandName(brandName string) ApiEventsEventsListRequest { + r.brandName = &brandName + return r +} + +func (r ApiEventsEventsListRequest) ClientIp(clientIp string) ApiEventsEventsListRequest { + r.clientIp = &clientIp + return r +} + +// Context Authorized application +func (r ApiEventsEventsListRequest) ContextAuthorizedApp(contextAuthorizedApp string) ApiEventsEventsListRequest { + r.contextAuthorizedApp = &contextAuthorizedApp + return r +} + +// Context Model App +func (r ApiEventsEventsListRequest) ContextModelApp(contextModelApp string) ApiEventsEventsListRequest { + r.contextModelApp = &contextModelApp + return r +} + +// Context Model Name +func (r ApiEventsEventsListRequest) ContextModelName(contextModelName string) ApiEventsEventsListRequest { + r.contextModelName = &contextModelName + return r +} + +// Context Model Primary Key +func (r ApiEventsEventsListRequest) ContextModelPk(contextModelPk string) ApiEventsEventsListRequest { + r.contextModelPk = &contextModelPk + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsEventsListRequest) Ordering(ordering string) ApiEventsEventsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEventsEventsListRequest) Page(page int32) ApiEventsEventsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEventsEventsListRequest) PageSize(pageSize int32) ApiEventsEventsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEventsEventsListRequest) Search(search string) ApiEventsEventsListRequest { + r.search = &search + return r +} + +// Username +func (r ApiEventsEventsListRequest) Username(username string) ApiEventsEventsListRequest { + r.username = &username + return r +} + +func (r ApiEventsEventsListRequest) Execute() (*PaginatedEventList, *http.Response, error) { + return r.ApiService.EventsEventsListExecute(r) +} + +/* +EventsEventsList Method for EventsEventsList + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsListRequest +*/ +func (a *EventsAPIService) EventsEventsList(ctx context.Context) ApiEventsEventsListRequest { + return ApiEventsEventsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEventList +func (a *EventsAPIService) EventsEventsListExecute(r ApiEventsEventsListRequest) (*PaginatedEventList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEventList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } + if r.actions != nil { + t := *r.actions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", t, "form", "multi") + } + } + if r.brandName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "brand_name", r.brandName, "form", "") + } + if r.clientIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_ip", r.clientIp, "form", "") + } + if r.contextAuthorizedApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_authorized_app", r.contextAuthorizedApp, "form", "") + } + if r.contextModelApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_app", r.contextModelApp, "form", "") + } + if r.contextModelName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_name", r.contextModelName, "form", "") + } + if r.contextModelPk != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_pk", r.contextModelPk, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsPartialUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + eventUuid string + patchedEventRequest *PatchedEventRequest +} + +func (r ApiEventsEventsPartialUpdateRequest) PatchedEventRequest(patchedEventRequest PatchedEventRequest) ApiEventsEventsPartialUpdateRequest { + r.patchedEventRequest = &patchedEventRequest + return r +} + +func (r ApiEventsEventsPartialUpdateRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.EventsEventsPartialUpdateExecute(r) +} + +/* +EventsEventsPartialUpdate Method for EventsEventsPartialUpdate + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventUuid A UUID string identifying this Event. + @return ApiEventsEventsPartialUpdateRequest +*/ +func (a *EventsAPIService) EventsEventsPartialUpdate(ctx context.Context, eventUuid string) ApiEventsEventsPartialUpdateRequest { + return ApiEventsEventsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + eventUuid: eventUuid, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsAPIService) EventsEventsPartialUpdateExecute(r ApiEventsEventsPartialUpdateRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/{event_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"event_uuid"+"}", url.PathEscape(parameterValueToString(r.eventUuid, "eventUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEventRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsRetrieveRequest struct { + ctx context.Context + ApiService *EventsAPIService + eventUuid string +} + +func (r ApiEventsEventsRetrieveRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.EventsEventsRetrieveExecute(r) +} + +/* +EventsEventsRetrieve Method for EventsEventsRetrieve + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventUuid A UUID string identifying this Event. + @return ApiEventsEventsRetrieveRequest +*/ +func (a *EventsAPIService) EventsEventsRetrieve(ctx context.Context, eventUuid string) ApiEventsEventsRetrieveRequest { + return ApiEventsEventsRetrieveRequest{ + ApiService: a, + ctx: ctx, + eventUuid: eventUuid, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsAPIService) EventsEventsRetrieveExecute(r ApiEventsEventsRetrieveRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/{event_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"event_uuid"+"}", url.PathEscape(parameterValueToString(r.eventUuid, "eventUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsTopPerUserListRequest struct { + ctx context.Context + ApiService *EventsAPIService + action *string + topN *int32 +} + +func (r ApiEventsEventsTopPerUserListRequest) Action(action string) ApiEventsEventsTopPerUserListRequest { + r.action = &action + return r +} + +func (r ApiEventsEventsTopPerUserListRequest) TopN(topN int32) ApiEventsEventsTopPerUserListRequest { + r.topN = &topN + return r +} + +func (r ApiEventsEventsTopPerUserListRequest) Execute() ([]EventTopPerUser, *http.Response, error) { + return r.ApiService.EventsEventsTopPerUserListExecute(r) +} + +/* +EventsEventsTopPerUserList Method for EventsEventsTopPerUserList + +Get the top_n events grouped by user count + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsTopPerUserListRequest +*/ +func (a *EventsAPIService) EventsEventsTopPerUserList(ctx context.Context) ApiEventsEventsTopPerUserListRequest { + return ApiEventsEventsTopPerUserListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []EventTopPerUser +func (a *EventsAPIService) EventsEventsTopPerUserListExecute(r ApiEventsEventsTopPerUserListRequest) ([]EventTopPerUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []EventTopPerUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsTopPerUserList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/top_per_user/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } + if r.topN != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "top_n", r.topN, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + eventUuid string + eventRequest *EventRequest +} + +func (r ApiEventsEventsUpdateRequest) EventRequest(eventRequest EventRequest) ApiEventsEventsUpdateRequest { + r.eventRequest = &eventRequest + return r +} + +func (r ApiEventsEventsUpdateRequest) Execute() (*Event, *http.Response, error) { + return r.ApiService.EventsEventsUpdateExecute(r) +} + +/* +EventsEventsUpdate Method for EventsEventsUpdate + +Event Read-Only Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param eventUuid A UUID string identifying this Event. + @return ApiEventsEventsUpdateRequest +*/ +func (a *EventsAPIService) EventsEventsUpdate(ctx context.Context, eventUuid string) ApiEventsEventsUpdateRequest { + return ApiEventsEventsUpdateRequest{ + ApiService: a, + ctx: ctx, + eventUuid: eventUuid, + } +} + +// Execute executes the request +// +// @return Event +func (a *EventsAPIService) EventsEventsUpdateExecute(r ApiEventsEventsUpdateRequest) (*Event, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Event + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/{event_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"event_uuid"+"}", url.PathEscape(parameterValueToString(r.eventUuid, "eventUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventRequest == nil { + return localVarReturnValue, nil, reportError("eventRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsEventsVolumeListRequest struct { + ctx context.Context + ApiService *EventsAPIService + action *string + actions *[]string + brandName *string + clientIp *string + contextAuthorizedApp *string + contextModelApp *string + contextModelName *string + contextModelPk *string + historyDays *float32 + ordering *string + search *string + username *string +} + +func (r ApiEventsEventsVolumeListRequest) Action(action string) ApiEventsEventsVolumeListRequest { + r.action = &action + return r +} + +func (r ApiEventsEventsVolumeListRequest) Actions(actions []string) ApiEventsEventsVolumeListRequest { + r.actions = &actions + return r +} + +// Brand name +func (r ApiEventsEventsVolumeListRequest) BrandName(brandName string) ApiEventsEventsVolumeListRequest { + r.brandName = &brandName + return r +} + +func (r ApiEventsEventsVolumeListRequest) ClientIp(clientIp string) ApiEventsEventsVolumeListRequest { + r.clientIp = &clientIp + return r +} + +// Context Authorized application +func (r ApiEventsEventsVolumeListRequest) ContextAuthorizedApp(contextAuthorizedApp string) ApiEventsEventsVolumeListRequest { + r.contextAuthorizedApp = &contextAuthorizedApp + return r +} + +// Context Model App +func (r ApiEventsEventsVolumeListRequest) ContextModelApp(contextModelApp string) ApiEventsEventsVolumeListRequest { + r.contextModelApp = &contextModelApp + return r +} + +// Context Model Name +func (r ApiEventsEventsVolumeListRequest) ContextModelName(contextModelName string) ApiEventsEventsVolumeListRequest { + r.contextModelName = &contextModelName + return r +} + +// Context Model Primary Key +func (r ApiEventsEventsVolumeListRequest) ContextModelPk(contextModelPk string) ApiEventsEventsVolumeListRequest { + r.contextModelPk = &contextModelPk + return r +} + +func (r ApiEventsEventsVolumeListRequest) HistoryDays(historyDays float32) ApiEventsEventsVolumeListRequest { + r.historyDays = &historyDays + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsEventsVolumeListRequest) Ordering(ordering string) ApiEventsEventsVolumeListRequest { + r.ordering = &ordering + return r +} + +// A search term. +func (r ApiEventsEventsVolumeListRequest) Search(search string) ApiEventsEventsVolumeListRequest { + r.search = &search + return r +} + +// Username +func (r ApiEventsEventsVolumeListRequest) Username(username string) ApiEventsEventsVolumeListRequest { + r.username = &username + return r +} + +func (r ApiEventsEventsVolumeListRequest) Execute() ([]EventVolume, *http.Response, error) { + return r.ApiService.EventsEventsVolumeListExecute(r) +} + +/* +EventsEventsVolumeList Method for EventsEventsVolumeList + +Get event volume for specified filters and timeframe + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsEventsVolumeListRequest +*/ +func (a *EventsAPIService) EventsEventsVolumeList(ctx context.Context) ApiEventsEventsVolumeListRequest { + return ApiEventsEventsVolumeListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []EventVolume +func (a *EventsAPIService) EventsEventsVolumeListExecute(r ApiEventsEventsVolumeListRequest) ([]EventVolume, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []EventVolume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsVolumeList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/events/volume/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } + if r.actions != nil { + t := *r.actions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "actions", t, "form", "multi") + } + } + if r.brandName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "brand_name", r.brandName, "form", "") + } + if r.clientIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_ip", r.clientIp, "form", "") + } + if r.contextAuthorizedApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_authorized_app", r.contextAuthorizedApp, "form", "") + } + if r.contextModelApp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_app", r.contextModelApp, "form", "") + } + if r.contextModelName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_name", r.contextModelName, "form", "") + } + if r.contextModelPk != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "context_model_pk", r.contextModelPk, "form", "") + } + if r.historyDays != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "history_days", r.historyDays, "form", "") + } else { + var defaultValue float32 = 7 + parameterAddToHeaderOrQuery(localVarQueryParams, "history_days", defaultValue, "form", "") + r.historyDays = &defaultValue + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsNotificationsDestroyRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsNotificationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EventsNotificationsDestroyExecute(r) +} + +/* +EventsNotificationsDestroy Method for EventsNotificationsDestroy + +Notification Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification. + @return ApiEventsNotificationsDestroyRequest +*/ +func (a *EventsAPIService) EventsNotificationsDestroy(ctx context.Context, uuid string) ApiEventsNotificationsDestroyRequest { + return ApiEventsNotificationsDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *EventsAPIService) EventsNotificationsDestroyExecute(r ApiEventsNotificationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEventsNotificationsListRequest struct { + ctx context.Context + ApiService *EventsAPIService + body *string + created *time.Time + event *string + ordering *string + page *int32 + pageSize *int32 + search *string + seen *bool + severity *string + user *int32 +} + +func (r ApiEventsNotificationsListRequest) Body(body string) ApiEventsNotificationsListRequest { + r.body = &body + return r +} + +func (r ApiEventsNotificationsListRequest) Created(created time.Time) ApiEventsNotificationsListRequest { + r.created = &created + return r +} + +func (r ApiEventsNotificationsListRequest) Event(event string) ApiEventsNotificationsListRequest { + r.event = &event + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsNotificationsListRequest) Ordering(ordering string) ApiEventsNotificationsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEventsNotificationsListRequest) Page(page int32) ApiEventsNotificationsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEventsNotificationsListRequest) PageSize(pageSize int32) ApiEventsNotificationsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEventsNotificationsListRequest) Search(search string) ApiEventsNotificationsListRequest { + r.search = &search + return r +} + +func (r ApiEventsNotificationsListRequest) Seen(seen bool) ApiEventsNotificationsListRequest { + r.seen = &seen + return r +} + +func (r ApiEventsNotificationsListRequest) Severity(severity string) ApiEventsNotificationsListRequest { + r.severity = &severity + return r +} + +func (r ApiEventsNotificationsListRequest) User(user int32) ApiEventsNotificationsListRequest { + r.user = &user + return r +} + +func (r ApiEventsNotificationsListRequest) Execute() (*PaginatedNotificationList, *http.Response, error) { + return r.ApiService.EventsNotificationsListExecute(r) +} + +/* +EventsNotificationsList Method for EventsNotificationsList + +Notification Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsNotificationsListRequest +*/ +func (a *EventsAPIService) EventsNotificationsList(ctx context.Context) ApiEventsNotificationsListRequest { + return ApiEventsNotificationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedNotificationList +func (a *EventsAPIService) EventsNotificationsListExecute(r ApiEventsNotificationsListRequest) (*PaginatedNotificationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedNotificationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.body != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "body", r.body, "form", "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.event != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "event", r.event, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.seen != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "seen", r.seen, "form", "") + } + if r.severity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "severity", r.severity, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsNotificationsMarkAllSeenCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService +} + +func (r ApiEventsNotificationsMarkAllSeenCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.EventsNotificationsMarkAllSeenCreateExecute(r) +} + +/* +EventsNotificationsMarkAllSeenCreate Method for EventsNotificationsMarkAllSeenCreate + +Mark all the user's notifications as seen + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsNotificationsMarkAllSeenCreateRequest +*/ +func (a *EventsAPIService) EventsNotificationsMarkAllSeenCreate(ctx context.Context) ApiEventsNotificationsMarkAllSeenCreateRequest { + return ApiEventsNotificationsMarkAllSeenCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *EventsAPIService) EventsNotificationsMarkAllSeenCreateExecute(r ApiEventsNotificationsMarkAllSeenCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsMarkAllSeenCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/mark_all_seen/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEventsNotificationsPartialUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string + patchedNotificationRequest *PatchedNotificationRequest +} + +func (r ApiEventsNotificationsPartialUpdateRequest) PatchedNotificationRequest(patchedNotificationRequest PatchedNotificationRequest) ApiEventsNotificationsPartialUpdateRequest { + r.patchedNotificationRequest = &patchedNotificationRequest + return r +} + +func (r ApiEventsNotificationsPartialUpdateRequest) Execute() (*Notification, *http.Response, error) { + return r.ApiService.EventsNotificationsPartialUpdateExecute(r) +} + +/* +EventsNotificationsPartialUpdate Method for EventsNotificationsPartialUpdate + +Notification Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification. + @return ApiEventsNotificationsPartialUpdateRequest +*/ +func (a *EventsAPIService) EventsNotificationsPartialUpdate(ctx context.Context, uuid string) ApiEventsNotificationsPartialUpdateRequest { + return ApiEventsNotificationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Notification +func (a *EventsAPIService) EventsNotificationsPartialUpdateExecute(r ApiEventsNotificationsPartialUpdateRequest) (*Notification, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Notification + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedNotificationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsNotificationsRetrieveRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsNotificationsRetrieveRequest) Execute() (*Notification, *http.Response, error) { + return r.ApiService.EventsNotificationsRetrieveExecute(r) +} + +/* +EventsNotificationsRetrieve Method for EventsNotificationsRetrieve + +Notification Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification. + @return ApiEventsNotificationsRetrieveRequest +*/ +func (a *EventsAPIService) EventsNotificationsRetrieve(ctx context.Context, uuid string) ApiEventsNotificationsRetrieveRequest { + return ApiEventsNotificationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Notification +func (a *EventsAPIService) EventsNotificationsRetrieveExecute(r ApiEventsNotificationsRetrieveRequest) (*Notification, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Notification + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsNotificationsUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string + notificationRequest *NotificationRequest +} + +func (r ApiEventsNotificationsUpdateRequest) NotificationRequest(notificationRequest NotificationRequest) ApiEventsNotificationsUpdateRequest { + r.notificationRequest = ¬ificationRequest + return r +} + +func (r ApiEventsNotificationsUpdateRequest) Execute() (*Notification, *http.Response, error) { + return r.ApiService.EventsNotificationsUpdateExecute(r) +} + +/* +EventsNotificationsUpdate Method for EventsNotificationsUpdate + +Notification Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification. + @return ApiEventsNotificationsUpdateRequest +*/ +func (a *EventsAPIService) EventsNotificationsUpdate(ctx context.Context, uuid string) ApiEventsNotificationsUpdateRequest { + return ApiEventsNotificationsUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Notification +func (a *EventsAPIService) EventsNotificationsUpdateExecute(r ApiEventsNotificationsUpdateRequest) (*Notification, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Notification + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsNotificationsUsedByListRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsNotificationsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EventsNotificationsUsedByListExecute(r) +} + +/* +EventsNotificationsUsedByList Method for EventsNotificationsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification. + @return ApiEventsNotificationsUsedByListRequest +*/ +func (a *EventsAPIService) EventsNotificationsUsedByList(ctx context.Context, uuid string) ApiEventsNotificationsUsedByListRequest { + return ApiEventsNotificationsUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EventsAPIService) EventsNotificationsUsedByListExecute(r ApiEventsNotificationsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsNotificationsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/notifications/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService + notificationRuleRequest *NotificationRuleRequest +} + +func (r ApiEventsRulesCreateRequest) NotificationRuleRequest(notificationRuleRequest NotificationRuleRequest) ApiEventsRulesCreateRequest { + r.notificationRuleRequest = ¬ificationRuleRequest + return r +} + +func (r ApiEventsRulesCreateRequest) Execute() (*NotificationRule, *http.Response, error) { + return r.ApiService.EventsRulesCreateExecute(r) +} + +/* +EventsRulesCreate Method for EventsRulesCreate + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsRulesCreateRequest +*/ +func (a *EventsAPIService) EventsRulesCreate(ctx context.Context) ApiEventsRulesCreateRequest { + return ApiEventsRulesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return NotificationRule +func (a *EventsAPIService) EventsRulesCreateExecute(r ApiEventsRulesCreateRequest) (*NotificationRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationRuleRequest == nil { + return localVarReturnValue, nil, reportError("notificationRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesDestroyRequest struct { + ctx context.Context + ApiService *EventsAPIService + pbmUuid string +} + +func (r ApiEventsRulesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EventsRulesDestroyExecute(r) +} + +/* +EventsRulesDestroy Method for EventsRulesDestroy + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Notification Rule. + @return ApiEventsRulesDestroyRequest +*/ +func (a *EventsAPIService) EventsRulesDestroy(ctx context.Context, pbmUuid string) ApiEventsRulesDestroyRequest { + return ApiEventsRulesDestroyRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +func (a *EventsAPIService) EventsRulesDestroyExecute(r ApiEventsRulesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEventsRulesListRequest struct { + ctx context.Context + ApiService *EventsAPIService + destinationGroupName *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + severity *string +} + +func (r ApiEventsRulesListRequest) DestinationGroupName(destinationGroupName string) ApiEventsRulesListRequest { + r.destinationGroupName = &destinationGroupName + return r +} + +func (r ApiEventsRulesListRequest) Name(name string) ApiEventsRulesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsRulesListRequest) Ordering(ordering string) ApiEventsRulesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEventsRulesListRequest) Page(page int32) ApiEventsRulesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEventsRulesListRequest) PageSize(pageSize int32) ApiEventsRulesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEventsRulesListRequest) Search(search string) ApiEventsRulesListRequest { + r.search = &search + return r +} + +// Controls which severity level the created notifications will have. +func (r ApiEventsRulesListRequest) Severity(severity string) ApiEventsRulesListRequest { + r.severity = &severity + return r +} + +func (r ApiEventsRulesListRequest) Execute() (*PaginatedNotificationRuleList, *http.Response, error) { + return r.ApiService.EventsRulesListExecute(r) +} + +/* +EventsRulesList Method for EventsRulesList + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsRulesListRequest +*/ +func (a *EventsAPIService) EventsRulesList(ctx context.Context) ApiEventsRulesListRequest { + return ApiEventsRulesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedNotificationRuleList +func (a *EventsAPIService) EventsRulesListExecute(r ApiEventsRulesListRequest) (*PaginatedNotificationRuleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedNotificationRuleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.destinationGroupName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "destination_group__name", r.destinationGroupName, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.severity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "severity", r.severity, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesPartialUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + pbmUuid string + patchedNotificationRuleRequest *PatchedNotificationRuleRequest +} + +func (r ApiEventsRulesPartialUpdateRequest) PatchedNotificationRuleRequest(patchedNotificationRuleRequest PatchedNotificationRuleRequest) ApiEventsRulesPartialUpdateRequest { + r.patchedNotificationRuleRequest = &patchedNotificationRuleRequest + return r +} + +func (r ApiEventsRulesPartialUpdateRequest) Execute() (*NotificationRule, *http.Response, error) { + return r.ApiService.EventsRulesPartialUpdateExecute(r) +} + +/* +EventsRulesPartialUpdate Method for EventsRulesPartialUpdate + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Notification Rule. + @return ApiEventsRulesPartialUpdateRequest +*/ +func (a *EventsAPIService) EventsRulesPartialUpdate(ctx context.Context, pbmUuid string) ApiEventsRulesPartialUpdateRequest { + return ApiEventsRulesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return NotificationRule +func (a *EventsAPIService) EventsRulesPartialUpdateExecute(r ApiEventsRulesPartialUpdateRequest) (*NotificationRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedNotificationRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesRetrieveRequest struct { + ctx context.Context + ApiService *EventsAPIService + pbmUuid string +} + +func (r ApiEventsRulesRetrieveRequest) Execute() (*NotificationRule, *http.Response, error) { + return r.ApiService.EventsRulesRetrieveExecute(r) +} + +/* +EventsRulesRetrieve Method for EventsRulesRetrieve + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Notification Rule. + @return ApiEventsRulesRetrieveRequest +*/ +func (a *EventsAPIService) EventsRulesRetrieve(ctx context.Context, pbmUuid string) ApiEventsRulesRetrieveRequest { + return ApiEventsRulesRetrieveRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return NotificationRule +func (a *EventsAPIService) EventsRulesRetrieveExecute(r ApiEventsRulesRetrieveRequest) (*NotificationRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + pbmUuid string + notificationRuleRequest *NotificationRuleRequest +} + +func (r ApiEventsRulesUpdateRequest) NotificationRuleRequest(notificationRuleRequest NotificationRuleRequest) ApiEventsRulesUpdateRequest { + r.notificationRuleRequest = ¬ificationRuleRequest + return r +} + +func (r ApiEventsRulesUpdateRequest) Execute() (*NotificationRule, *http.Response, error) { + return r.ApiService.EventsRulesUpdateExecute(r) +} + +/* +EventsRulesUpdate Method for EventsRulesUpdate + +NotificationRule Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Notification Rule. + @return ApiEventsRulesUpdateRequest +*/ +func (a *EventsAPIService) EventsRulesUpdate(ctx context.Context, pbmUuid string) ApiEventsRulesUpdateRequest { + return ApiEventsRulesUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return NotificationRule +func (a *EventsAPIService) EventsRulesUpdateExecute(r ApiEventsRulesUpdateRequest) (*NotificationRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationRuleRequest == nil { + return localVarReturnValue, nil, reportError("notificationRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsRulesUsedByListRequest struct { + ctx context.Context + ApiService *EventsAPIService + pbmUuid string +} + +func (r ApiEventsRulesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EventsRulesUsedByListExecute(r) +} + +/* +EventsRulesUsedByList Method for EventsRulesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this Notification Rule. + @return ApiEventsRulesUsedByListRequest +*/ +func (a *EventsAPIService) EventsRulesUsedByList(ctx context.Context, pbmUuid string) ApiEventsRulesUsedByListRequest { + return ApiEventsRulesUsedByListRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EventsAPIService) EventsRulesUsedByListExecute(r ApiEventsRulesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsRulesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/rules/{pbm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService + notificationTransportRequest *NotificationTransportRequest +} + +func (r ApiEventsTransportsCreateRequest) NotificationTransportRequest(notificationTransportRequest NotificationTransportRequest) ApiEventsTransportsCreateRequest { + r.notificationTransportRequest = ¬ificationTransportRequest + return r +} + +func (r ApiEventsTransportsCreateRequest) Execute() (*NotificationTransport, *http.Response, error) { + return r.ApiService.EventsTransportsCreateExecute(r) +} + +/* +EventsTransportsCreate Method for EventsTransportsCreate + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsTransportsCreateRequest +*/ +func (a *EventsAPIService) EventsTransportsCreate(ctx context.Context) ApiEventsTransportsCreateRequest { + return ApiEventsTransportsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return NotificationTransport +func (a *EventsAPIService) EventsTransportsCreateExecute(r ApiEventsTransportsCreateRequest) (*NotificationTransport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationTransport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationTransportRequest == nil { + return localVarReturnValue, nil, reportError("notificationTransportRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationTransportRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsDestroyRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsTransportsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.EventsTransportsDestroyExecute(r) +} + +/* +EventsTransportsDestroy Method for EventsTransportsDestroy + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsDestroyRequest +*/ +func (a *EventsAPIService) EventsTransportsDestroy(ctx context.Context, uuid string) ApiEventsTransportsDestroyRequest { + return ApiEventsTransportsDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *EventsAPIService) EventsTransportsDestroyExecute(r ApiEventsTransportsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiEventsTransportsListRequest struct { + ctx context.Context + ApiService *EventsAPIService + mode *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + sendOnce *bool + webhookUrl *string +} + +func (r ApiEventsTransportsListRequest) Mode(mode string) ApiEventsTransportsListRequest { + r.mode = &mode + return r +} + +func (r ApiEventsTransportsListRequest) Name(name string) ApiEventsTransportsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiEventsTransportsListRequest) Ordering(ordering string) ApiEventsTransportsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiEventsTransportsListRequest) Page(page int32) ApiEventsTransportsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiEventsTransportsListRequest) PageSize(pageSize int32) ApiEventsTransportsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiEventsTransportsListRequest) Search(search string) ApiEventsTransportsListRequest { + r.search = &search + return r +} + +func (r ApiEventsTransportsListRequest) SendOnce(sendOnce bool) ApiEventsTransportsListRequest { + r.sendOnce = &sendOnce + return r +} + +func (r ApiEventsTransportsListRequest) WebhookUrl(webhookUrl string) ApiEventsTransportsListRequest { + r.webhookUrl = &webhookUrl + return r +} + +func (r ApiEventsTransportsListRequest) Execute() (*PaginatedNotificationTransportList, *http.Response, error) { + return r.ApiService.EventsTransportsListExecute(r) +} + +/* +EventsTransportsList Method for EventsTransportsList + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiEventsTransportsListRequest +*/ +func (a *EventsAPIService) EventsTransportsList(ctx context.Context) ApiEventsTransportsListRequest { + return ApiEventsTransportsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedNotificationTransportList +func (a *EventsAPIService) EventsTransportsListExecute(r ApiEventsTransportsListRequest) (*PaginatedNotificationTransportList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedNotificationTransportList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.mode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", r.mode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sendOnce != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "send_once", r.sendOnce, "form", "") + } + if r.webhookUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webhook_url", r.webhookUrl, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsPartialUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string + patchedNotificationTransportRequest *PatchedNotificationTransportRequest +} + +func (r ApiEventsTransportsPartialUpdateRequest) PatchedNotificationTransportRequest(patchedNotificationTransportRequest PatchedNotificationTransportRequest) ApiEventsTransportsPartialUpdateRequest { + r.patchedNotificationTransportRequest = &patchedNotificationTransportRequest + return r +} + +func (r ApiEventsTransportsPartialUpdateRequest) Execute() (*NotificationTransport, *http.Response, error) { + return r.ApiService.EventsTransportsPartialUpdateExecute(r) +} + +/* +EventsTransportsPartialUpdate Method for EventsTransportsPartialUpdate + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsPartialUpdateRequest +*/ +func (a *EventsAPIService) EventsTransportsPartialUpdate(ctx context.Context, uuid string) ApiEventsTransportsPartialUpdateRequest { + return ApiEventsTransportsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return NotificationTransport +func (a *EventsAPIService) EventsTransportsPartialUpdateExecute(r ApiEventsTransportsPartialUpdateRequest) (*NotificationTransport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationTransport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedNotificationTransportRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsRetrieveRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsTransportsRetrieveRequest) Execute() (*NotificationTransport, *http.Response, error) { + return r.ApiService.EventsTransportsRetrieveExecute(r) +} + +/* +EventsTransportsRetrieve Method for EventsTransportsRetrieve + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsRetrieveRequest +*/ +func (a *EventsAPIService) EventsTransportsRetrieve(ctx context.Context, uuid string) ApiEventsTransportsRetrieveRequest { + return ApiEventsTransportsRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return NotificationTransport +func (a *EventsAPIService) EventsTransportsRetrieveExecute(r ApiEventsTransportsRetrieveRequest) (*NotificationTransport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationTransport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsTestCreateRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsTransportsTestCreateRequest) Execute() (*NotificationTransportTest, *http.Response, error) { + return r.ApiService.EventsTransportsTestCreateExecute(r) +} + +/* +EventsTransportsTestCreate Method for EventsTransportsTestCreate + +Send example notification using selected transport. Requires +Modify permissions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsTestCreateRequest +*/ +func (a *EventsAPIService) EventsTransportsTestCreate(ctx context.Context, uuid string) ApiEventsTransportsTestCreateRequest { + return ApiEventsTransportsTestCreateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return NotificationTransportTest +func (a *EventsAPIService) EventsTransportsTestCreateExecute(r ApiEventsTransportsTestCreateRequest) (*NotificationTransportTest, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationTransportTest + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsTestCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/test/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsUpdateRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string + notificationTransportRequest *NotificationTransportRequest +} + +func (r ApiEventsTransportsUpdateRequest) NotificationTransportRequest(notificationTransportRequest NotificationTransportRequest) ApiEventsTransportsUpdateRequest { + r.notificationTransportRequest = ¬ificationTransportRequest + return r +} + +func (r ApiEventsTransportsUpdateRequest) Execute() (*NotificationTransport, *http.Response, error) { + return r.ApiService.EventsTransportsUpdateExecute(r) +} + +/* +EventsTransportsUpdate Method for EventsTransportsUpdate + +NotificationTransport Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsUpdateRequest +*/ +func (a *EventsAPIService) EventsTransportsUpdate(ctx context.Context, uuid string) ApiEventsTransportsUpdateRequest { + return ApiEventsTransportsUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return NotificationTransport +func (a *EventsAPIService) EventsTransportsUpdateExecute(r ApiEventsTransportsUpdateRequest) (*NotificationTransport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationTransport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationTransportRequest == nil { + return localVarReturnValue, nil, reportError("notificationTransportRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationTransportRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiEventsTransportsUsedByListRequest struct { + ctx context.Context + ApiService *EventsAPIService + uuid string +} + +func (r ApiEventsTransportsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.EventsTransportsUsedByListExecute(r) +} + +/* +EventsTransportsUsedByList Method for EventsTransportsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Notification Transport. + @return ApiEventsTransportsUsedByListRequest +*/ +func (a *EventsAPIService) EventsTransportsUsedByList(ctx context.Context, uuid string) ApiEventsTransportsUsedByListRequest { + return ApiEventsTransportsUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *EventsAPIService) EventsTransportsUsedByListExecute(r ApiEventsTransportsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsTransportsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/events/transports/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_flows.go b/packages/client-go/api_flows.go new file mode 100644 index 0000000000..bd92e98282 --- /dev/null +++ b/packages/client-go/api_flows.go @@ -0,0 +1,3150 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "reflect" + "strings" +) + +// FlowsAPIService FlowsAPI service +type FlowsAPIService service + +type ApiFlowsBindingsCreateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + flowStageBindingRequest *FlowStageBindingRequest +} + +func (r ApiFlowsBindingsCreateRequest) FlowStageBindingRequest(flowStageBindingRequest FlowStageBindingRequest) ApiFlowsBindingsCreateRequest { + r.flowStageBindingRequest = &flowStageBindingRequest + return r +} + +func (r ApiFlowsBindingsCreateRequest) Execute() (*FlowStageBinding, *http.Response, error) { + return r.ApiService.FlowsBindingsCreateExecute(r) +} + +/* +FlowsBindingsCreate Method for FlowsBindingsCreate + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsBindingsCreateRequest +*/ +func (a *FlowsAPIService) FlowsBindingsCreate(ctx context.Context) ApiFlowsBindingsCreateRequest { + return ApiFlowsBindingsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FlowStageBinding +func (a *FlowsAPIService) FlowsBindingsCreateExecute(r ApiFlowsBindingsCreateRequest) (*FlowStageBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowStageBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.flowStageBindingRequest == nil { + return localVarReturnValue, nil, reportError("flowStageBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowStageBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsBindingsDestroyRequest struct { + ctx context.Context + ApiService *FlowsAPIService + fsbUuid string +} + +func (r ApiFlowsBindingsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.FlowsBindingsDestroyExecute(r) +} + +/* +FlowsBindingsDestroy Method for FlowsBindingsDestroy + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fsbUuid A UUID string identifying this Flow Stage Binding. + @return ApiFlowsBindingsDestroyRequest +*/ +func (a *FlowsAPIService) FlowsBindingsDestroy(ctx context.Context, fsbUuid string) ApiFlowsBindingsDestroyRequest { + return ApiFlowsBindingsDestroyRequest{ + ApiService: a, + ctx: ctx, + fsbUuid: fsbUuid, + } +} + +// Execute executes the request +func (a *FlowsAPIService) FlowsBindingsDestroyExecute(r ApiFlowsBindingsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/{fsb_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"fsb_uuid"+"}", url.PathEscape(parameterValueToString(r.fsbUuid, "fsbUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFlowsBindingsListRequest struct { + ctx context.Context + ApiService *FlowsAPIService + evaluateOnPlan *bool + fsbUuid *string + invalidResponseAction *string + order *int32 + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + policies *[]string + policyEngineMode *string + reEvaluatePolicies *bool + search *string + stage *string + target *string +} + +func (r ApiFlowsBindingsListRequest) EvaluateOnPlan(evaluateOnPlan bool) ApiFlowsBindingsListRequest { + r.evaluateOnPlan = &evaluateOnPlan + return r +} + +func (r ApiFlowsBindingsListRequest) FsbUuid(fsbUuid string) ApiFlowsBindingsListRequest { + r.fsbUuid = &fsbUuid + return r +} + +// Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor. RESTART restarts the flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the current context. +func (r ApiFlowsBindingsListRequest) InvalidResponseAction(invalidResponseAction string) ApiFlowsBindingsListRequest { + r.invalidResponseAction = &invalidResponseAction + return r +} + +func (r ApiFlowsBindingsListRequest) Order(order int32) ApiFlowsBindingsListRequest { + r.order = &order + return r +} + +// Which field to use when ordering the results. +func (r ApiFlowsBindingsListRequest) Ordering(ordering string) ApiFlowsBindingsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiFlowsBindingsListRequest) Page(page int32) ApiFlowsBindingsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiFlowsBindingsListRequest) PageSize(pageSize int32) ApiFlowsBindingsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiFlowsBindingsListRequest) PbmUuid(pbmUuid string) ApiFlowsBindingsListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiFlowsBindingsListRequest) Policies(policies []string) ApiFlowsBindingsListRequest { + r.policies = &policies + return r +} + +func (r ApiFlowsBindingsListRequest) PolicyEngineMode(policyEngineMode string) ApiFlowsBindingsListRequest { + r.policyEngineMode = &policyEngineMode + return r +} + +func (r ApiFlowsBindingsListRequest) ReEvaluatePolicies(reEvaluatePolicies bool) ApiFlowsBindingsListRequest { + r.reEvaluatePolicies = &reEvaluatePolicies + return r +} + +// A search term. +func (r ApiFlowsBindingsListRequest) Search(search string) ApiFlowsBindingsListRequest { + r.search = &search + return r +} + +func (r ApiFlowsBindingsListRequest) Stage(stage string) ApiFlowsBindingsListRequest { + r.stage = &stage + return r +} + +func (r ApiFlowsBindingsListRequest) Target(target string) ApiFlowsBindingsListRequest { + r.target = &target + return r +} + +func (r ApiFlowsBindingsListRequest) Execute() (*PaginatedFlowStageBindingList, *http.Response, error) { + return r.ApiService.FlowsBindingsListExecute(r) +} + +/* +FlowsBindingsList Method for FlowsBindingsList + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsBindingsListRequest +*/ +func (a *FlowsAPIService) FlowsBindingsList(ctx context.Context) ApiFlowsBindingsListRequest { + return ApiFlowsBindingsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFlowStageBindingList +func (a *FlowsAPIService) FlowsBindingsListExecute(r ApiFlowsBindingsListRequest) (*PaginatedFlowStageBindingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFlowStageBindingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.evaluateOnPlan != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "evaluate_on_plan", r.evaluateOnPlan, "form", "") + } + if r.fsbUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "fsb_uuid", r.fsbUuid, "form", "") + } + if r.invalidResponseAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "invalid_response_action", r.invalidResponseAction, "form", "") + } + if r.order != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.policies != nil { + t := *r.policies + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "policies", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "policies", t, "form", "multi") + } + } + if r.policyEngineMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_engine_mode", r.policyEngineMode, "form", "") + } + if r.reEvaluatePolicies != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "re_evaluate_policies", r.reEvaluatePolicies, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage", r.stage, "form", "") + } + if r.target != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "target", r.target, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsBindingsPartialUpdateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + fsbUuid string + patchedFlowStageBindingRequest *PatchedFlowStageBindingRequest +} + +func (r ApiFlowsBindingsPartialUpdateRequest) PatchedFlowStageBindingRequest(patchedFlowStageBindingRequest PatchedFlowStageBindingRequest) ApiFlowsBindingsPartialUpdateRequest { + r.patchedFlowStageBindingRequest = &patchedFlowStageBindingRequest + return r +} + +func (r ApiFlowsBindingsPartialUpdateRequest) Execute() (*FlowStageBinding, *http.Response, error) { + return r.ApiService.FlowsBindingsPartialUpdateExecute(r) +} + +/* +FlowsBindingsPartialUpdate Method for FlowsBindingsPartialUpdate + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fsbUuid A UUID string identifying this Flow Stage Binding. + @return ApiFlowsBindingsPartialUpdateRequest +*/ +func (a *FlowsAPIService) FlowsBindingsPartialUpdate(ctx context.Context, fsbUuid string) ApiFlowsBindingsPartialUpdateRequest { + return ApiFlowsBindingsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + fsbUuid: fsbUuid, + } +} + +// Execute executes the request +// +// @return FlowStageBinding +func (a *FlowsAPIService) FlowsBindingsPartialUpdateExecute(r ApiFlowsBindingsPartialUpdateRequest) (*FlowStageBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowStageBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/{fsb_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"fsb_uuid"+"}", url.PathEscape(parameterValueToString(r.fsbUuid, "fsbUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedFlowStageBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsBindingsRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + fsbUuid string +} + +func (r ApiFlowsBindingsRetrieveRequest) Execute() (*FlowStageBinding, *http.Response, error) { + return r.ApiService.FlowsBindingsRetrieveExecute(r) +} + +/* +FlowsBindingsRetrieve Method for FlowsBindingsRetrieve + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fsbUuid A UUID string identifying this Flow Stage Binding. + @return ApiFlowsBindingsRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsBindingsRetrieve(ctx context.Context, fsbUuid string) ApiFlowsBindingsRetrieveRequest { + return ApiFlowsBindingsRetrieveRequest{ + ApiService: a, + ctx: ctx, + fsbUuid: fsbUuid, + } +} + +// Execute executes the request +// +// @return FlowStageBinding +func (a *FlowsAPIService) FlowsBindingsRetrieveExecute(r ApiFlowsBindingsRetrieveRequest) (*FlowStageBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowStageBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/{fsb_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"fsb_uuid"+"}", url.PathEscape(parameterValueToString(r.fsbUuid, "fsbUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsBindingsUpdateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + fsbUuid string + flowStageBindingRequest *FlowStageBindingRequest +} + +func (r ApiFlowsBindingsUpdateRequest) FlowStageBindingRequest(flowStageBindingRequest FlowStageBindingRequest) ApiFlowsBindingsUpdateRequest { + r.flowStageBindingRequest = &flowStageBindingRequest + return r +} + +func (r ApiFlowsBindingsUpdateRequest) Execute() (*FlowStageBinding, *http.Response, error) { + return r.ApiService.FlowsBindingsUpdateExecute(r) +} + +/* +FlowsBindingsUpdate Method for FlowsBindingsUpdate + +FlowStageBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fsbUuid A UUID string identifying this Flow Stage Binding. + @return ApiFlowsBindingsUpdateRequest +*/ +func (a *FlowsAPIService) FlowsBindingsUpdate(ctx context.Context, fsbUuid string) ApiFlowsBindingsUpdateRequest { + return ApiFlowsBindingsUpdateRequest{ + ApiService: a, + ctx: ctx, + fsbUuid: fsbUuid, + } +} + +// Execute executes the request +// +// @return FlowStageBinding +func (a *FlowsAPIService) FlowsBindingsUpdateExecute(r ApiFlowsBindingsUpdateRequest) (*FlowStageBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowStageBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/{fsb_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"fsb_uuid"+"}", url.PathEscape(parameterValueToString(r.fsbUuid, "fsbUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.flowStageBindingRequest == nil { + return localVarReturnValue, nil, reportError("flowStageBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowStageBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsBindingsUsedByListRequest struct { + ctx context.Context + ApiService *FlowsAPIService + fsbUuid string +} + +func (r ApiFlowsBindingsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.FlowsBindingsUsedByListExecute(r) +} + +/* +FlowsBindingsUsedByList Method for FlowsBindingsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param fsbUuid A UUID string identifying this Flow Stage Binding. + @return ApiFlowsBindingsUsedByListRequest +*/ +func (a *FlowsAPIService) FlowsBindingsUsedByList(ctx context.Context, fsbUuid string) ApiFlowsBindingsUsedByListRequest { + return ApiFlowsBindingsUsedByListRequest{ + ApiService: a, + ctx: ctx, + fsbUuid: fsbUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *FlowsAPIService) FlowsBindingsUsedByListExecute(r ApiFlowsBindingsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsBindingsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/bindings/{fsb_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"fsb_uuid"+"}", url.PathEscape(parameterValueToString(r.fsbUuid, "fsbUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsExecutorGetRequest struct { + ctx context.Context + ApiService *FlowsAPIService + flowSlug string + query *string +} + +// Querystring as received +func (r ApiFlowsExecutorGetRequest) Query(query string) ApiFlowsExecutorGetRequest { + r.query = &query + return r +} + +func (r ApiFlowsExecutorGetRequest) Execute() (*ChallengeTypes, *http.Response, error) { + return r.ApiService.FlowsExecutorGetExecute(r) +} + +/* +FlowsExecutorGet Method for FlowsExecutorGet + +Get the next pending challenge from the currently active flow. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param flowSlug + @return ApiFlowsExecutorGetRequest +*/ +func (a *FlowsAPIService) FlowsExecutorGet(ctx context.Context, flowSlug string) ApiFlowsExecutorGetRequest { + return ApiFlowsExecutorGetRequest{ + ApiService: a, + ctx: ctx, + flowSlug: flowSlug, + } +} + +// Execute executes the request +// +// @return ChallengeTypes +func (a *FlowsAPIService) FlowsExecutorGetExecute(r ApiFlowsExecutorGetRequest) (*ChallengeTypes, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChallengeTypes + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsExecutorGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/executor/{flow_slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"flow_slug"+"}", url.PathEscape(parameterValueToString(r.flowSlug, "flowSlug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.query == nil { + return localVarReturnValue, nil, reportError("query is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "query", r.query, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsExecutorSolveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + flowSlug string + query *string + flowChallengeResponseRequest *FlowChallengeResponseRequest +} + +// Querystring as received +func (r ApiFlowsExecutorSolveRequest) Query(query string) ApiFlowsExecutorSolveRequest { + r.query = &query + return r +} + +func (r ApiFlowsExecutorSolveRequest) FlowChallengeResponseRequest(flowChallengeResponseRequest FlowChallengeResponseRequest) ApiFlowsExecutorSolveRequest { + r.flowChallengeResponseRequest = &flowChallengeResponseRequest + return r +} + +func (r ApiFlowsExecutorSolveRequest) Execute() (*ChallengeTypes, *http.Response, error) { + return r.ApiService.FlowsExecutorSolveExecute(r) +} + +/* +FlowsExecutorSolve Method for FlowsExecutorSolve + +Solve the previously retrieved challenge and advanced to the next stage. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param flowSlug + @return ApiFlowsExecutorSolveRequest +*/ +func (a *FlowsAPIService) FlowsExecutorSolve(ctx context.Context, flowSlug string) ApiFlowsExecutorSolveRequest { + return ApiFlowsExecutorSolveRequest{ + ApiService: a, + ctx: ctx, + flowSlug: flowSlug, + } +} + +// Execute executes the request +// +// @return ChallengeTypes +func (a *FlowsAPIService) FlowsExecutorSolveExecute(r ApiFlowsExecutorSolveRequest) (*ChallengeTypes, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ChallengeTypes + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsExecutorSolve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/executor/{flow_slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"flow_slug"+"}", url.PathEscape(parameterValueToString(r.flowSlug, "flowSlug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.query == nil { + return localVarReturnValue, nil, reportError("query is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "query", r.query, "form", "") + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowChallengeResponseRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInspectorGetRequest struct { + ctx context.Context + ApiService *FlowsAPIService + flowSlug string +} + +func (r ApiFlowsInspectorGetRequest) Execute() (*FlowInspection, *http.Response, error) { + return r.ApiService.FlowsInspectorGetExecute(r) +} + +/* +FlowsInspectorGet Method for FlowsInspectorGet + +Get current flow state and record it + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param flowSlug + @return ApiFlowsInspectorGetRequest +*/ +func (a *FlowsAPIService) FlowsInspectorGet(ctx context.Context, flowSlug string) ApiFlowsInspectorGetRequest { + return ApiFlowsInspectorGetRequest{ + ApiService: a, + ctx: ctx, + flowSlug: flowSlug, + } +} + +// Execute executes the request +// +// @return FlowInspection +func (a *FlowsAPIService) FlowsInspectorGetExecute(r ApiFlowsInspectorGetRequest) (*FlowInspection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowInspection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInspectorGet") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/inspector/{flow_slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"flow_slug"+"}", url.PathEscape(parameterValueToString(r.flowSlug, "flowSlug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesCacheClearCreateRequest struct { + ctx context.Context + ApiService *FlowsAPIService +} + +func (r ApiFlowsInstancesCacheClearCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.FlowsInstancesCacheClearCreateExecute(r) +} + +/* +FlowsInstancesCacheClearCreate Method for FlowsInstancesCacheClearCreate + +Clear flow cache + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsInstancesCacheClearCreateRequest +*/ +func (a *FlowsAPIService) FlowsInstancesCacheClearCreate(ctx context.Context) ApiFlowsInstancesCacheClearCreateRequest { + return ApiFlowsInstancesCacheClearCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *FlowsAPIService) FlowsInstancesCacheClearCreateExecute(r ApiFlowsInstancesCacheClearCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesCacheClearCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/cache_clear/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFlowsInstancesCacheInfoRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService +} + +func (r ApiFlowsInstancesCacheInfoRetrieveRequest) Execute() (*Cache, *http.Response, error) { + return r.ApiService.FlowsInstancesCacheInfoRetrieveExecute(r) +} + +/* +FlowsInstancesCacheInfoRetrieve Method for FlowsInstancesCacheInfoRetrieve + +Info about cached flows + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsInstancesCacheInfoRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsInstancesCacheInfoRetrieve(ctx context.Context) ApiFlowsInstancesCacheInfoRetrieveRequest { + return ApiFlowsInstancesCacheInfoRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Cache +func (a *FlowsAPIService) FlowsInstancesCacheInfoRetrieveExecute(r ApiFlowsInstancesCacheInfoRetrieveRequest) (*Cache, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cache + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesCacheInfoRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/cache_info/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesCreateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + flowRequest *FlowRequest +} + +func (r ApiFlowsInstancesCreateRequest) FlowRequest(flowRequest FlowRequest) ApiFlowsInstancesCreateRequest { + r.flowRequest = &flowRequest + return r +} + +func (r ApiFlowsInstancesCreateRequest) Execute() (*Flow, *http.Response, error) { + return r.ApiService.FlowsInstancesCreateExecute(r) +} + +/* +FlowsInstancesCreate Method for FlowsInstancesCreate + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsInstancesCreateRequest +*/ +func (a *FlowsAPIService) FlowsInstancesCreate(ctx context.Context) ApiFlowsInstancesCreateRequest { + return ApiFlowsInstancesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Flow +func (a *FlowsAPIService) FlowsInstancesCreateExecute(r ApiFlowsInstancesCreateRequest) (*Flow, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Flow + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.flowRequest == nil { + return localVarReturnValue, nil, reportError("flowRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesDestroyRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.FlowsInstancesDestroyExecute(r) +} + +/* +FlowsInstancesDestroy Method for FlowsInstancesDestroy + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesDestroyRequest +*/ +func (a *FlowsAPIService) FlowsInstancesDestroy(ctx context.Context, slug string) ApiFlowsInstancesDestroyRequest { + return ApiFlowsInstancesDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *FlowsAPIService) FlowsInstancesDestroyExecute(r ApiFlowsInstancesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiFlowsInstancesDiagramRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesDiagramRetrieveRequest) Execute() (*FlowDiagram, *http.Response, error) { + return r.ApiService.FlowsInstancesDiagramRetrieveExecute(r) +} + +/* +FlowsInstancesDiagramRetrieve Method for FlowsInstancesDiagramRetrieve + +Return diagram for flow with slug `slug`, in the format used by flowchart.js + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesDiagramRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsInstancesDiagramRetrieve(ctx context.Context, slug string) ApiFlowsInstancesDiagramRetrieveRequest { + return ApiFlowsInstancesDiagramRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return FlowDiagram +func (a *FlowsAPIService) FlowsInstancesDiagramRetrieveExecute(r ApiFlowsInstancesDiagramRetrieveRequest) (*FlowDiagram, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowDiagram + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesDiagramRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/diagram/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesExecuteRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesExecuteRetrieveRequest) Execute() (*Link, *http.Response, error) { + return r.ApiService.FlowsInstancesExecuteRetrieveExecute(r) +} + +/* +FlowsInstancesExecuteRetrieve Method for FlowsInstancesExecuteRetrieve + +Execute flow for current user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesExecuteRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsInstancesExecuteRetrieve(ctx context.Context, slug string) ApiFlowsInstancesExecuteRetrieveRequest { + return ApiFlowsInstancesExecuteRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Link +func (a *FlowsAPIService) FlowsInstancesExecuteRetrieveExecute(r ApiFlowsInstancesExecuteRetrieveRequest) (*Link, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Link + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesExecuteRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/execute/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesExportRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesExportRetrieveRequest) Execute() (*os.File, *http.Response, error) { + return r.ApiService.FlowsInstancesExportRetrieveExecute(r) +} + +/* +FlowsInstancesExportRetrieve Method for FlowsInstancesExportRetrieve + +Export flow to .yaml file + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesExportRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsInstancesExportRetrieve(ctx context.Context, slug string) ApiFlowsInstancesExportRetrieveRequest { + return ApiFlowsInstancesExportRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return *os.File +func (a *FlowsAPIService) FlowsInstancesExportRetrieveExecute(r ApiFlowsInstancesExportRetrieveRequest) (*os.File, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *os.File + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesExportRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/export/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesImportCreateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + file *os.File + clear *bool +} + +func (r ApiFlowsInstancesImportCreateRequest) File(file *os.File) ApiFlowsInstancesImportCreateRequest { + r.file = file + return r +} + +func (r ApiFlowsInstancesImportCreateRequest) Clear(clear bool) ApiFlowsInstancesImportCreateRequest { + r.clear = &clear + return r +} + +func (r ApiFlowsInstancesImportCreateRequest) Execute() (*FlowImportResult, *http.Response, error) { + return r.ApiService.FlowsInstancesImportCreateExecute(r) +} + +/* +FlowsInstancesImportCreate Method for FlowsInstancesImportCreate + +Import flow from .yaml file + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsInstancesImportCreateRequest +*/ +func (a *FlowsAPIService) FlowsInstancesImportCreate(ctx context.Context) ApiFlowsInstancesImportCreateRequest { + return ApiFlowsInstancesImportCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return FlowImportResult +func (a *FlowsAPIService) FlowsInstancesImportCreateExecute(r ApiFlowsInstancesImportCreateRequest) (*FlowImportResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *FlowImportResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesImportCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/import/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + fileLocalVarFile := r.file + + if fileLocalVarFile != nil { + fbs, _ := io.ReadAll(fileLocalVarFile) + + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + } + if r.clear != nil { + parameterAddToHeaderOrQuery(localVarFormParams, "clear", r.clear, "", "") + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v FlowImportResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesListRequest struct { + ctx context.Context + ApiService *FlowsAPIService + deniedAction *string + designation *string + flowUuid *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + slug *string +} + +// Configure what should happen when a flow denies access to a user. +func (r ApiFlowsInstancesListRequest) DeniedAction(deniedAction string) ApiFlowsInstancesListRequest { + r.deniedAction = &deniedAction + return r +} + +// Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik. +func (r ApiFlowsInstancesListRequest) Designation(designation string) ApiFlowsInstancesListRequest { + r.designation = &designation + return r +} + +func (r ApiFlowsInstancesListRequest) FlowUuid(flowUuid string) ApiFlowsInstancesListRequest { + r.flowUuid = &flowUuid + return r +} + +func (r ApiFlowsInstancesListRequest) Name(name string) ApiFlowsInstancesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiFlowsInstancesListRequest) Ordering(ordering string) ApiFlowsInstancesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiFlowsInstancesListRequest) Page(page int32) ApiFlowsInstancesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiFlowsInstancesListRequest) PageSize(pageSize int32) ApiFlowsInstancesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiFlowsInstancesListRequest) Search(search string) ApiFlowsInstancesListRequest { + r.search = &search + return r +} + +func (r ApiFlowsInstancesListRequest) Slug(slug string) ApiFlowsInstancesListRequest { + r.slug = &slug + return r +} + +func (r ApiFlowsInstancesListRequest) Execute() (*PaginatedFlowList, *http.Response, error) { + return r.ApiService.FlowsInstancesListExecute(r) +} + +/* +FlowsInstancesList Method for FlowsInstancesList + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiFlowsInstancesListRequest +*/ +func (a *FlowsAPIService) FlowsInstancesList(ctx context.Context) ApiFlowsInstancesListRequest { + return ApiFlowsInstancesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedFlowList +func (a *FlowsAPIService) FlowsInstancesListExecute(r ApiFlowsInstancesListRequest) (*PaginatedFlowList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedFlowList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.deniedAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "denied_action", r.deniedAction, "form", "") + } + if r.designation != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "designation", r.designation, "form", "") + } + if r.flowUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow_uuid", r.flowUuid, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesPartialUpdateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string + patchedFlowRequest *PatchedFlowRequest +} + +func (r ApiFlowsInstancesPartialUpdateRequest) PatchedFlowRequest(patchedFlowRequest PatchedFlowRequest) ApiFlowsInstancesPartialUpdateRequest { + r.patchedFlowRequest = &patchedFlowRequest + return r +} + +func (r ApiFlowsInstancesPartialUpdateRequest) Execute() (*Flow, *http.Response, error) { + return r.ApiService.FlowsInstancesPartialUpdateExecute(r) +} + +/* +FlowsInstancesPartialUpdate Method for FlowsInstancesPartialUpdate + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesPartialUpdateRequest +*/ +func (a *FlowsAPIService) FlowsInstancesPartialUpdate(ctx context.Context, slug string) ApiFlowsInstancesPartialUpdateRequest { + return ApiFlowsInstancesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Flow +func (a *FlowsAPIService) FlowsInstancesPartialUpdateExecute(r ApiFlowsInstancesPartialUpdateRequest) (*Flow, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Flow + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedFlowRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesRetrieveRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesRetrieveRequest) Execute() (*Flow, *http.Response, error) { + return r.ApiService.FlowsInstancesRetrieveExecute(r) +} + +/* +FlowsInstancesRetrieve Method for FlowsInstancesRetrieve + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesRetrieveRequest +*/ +func (a *FlowsAPIService) FlowsInstancesRetrieve(ctx context.Context, slug string) ApiFlowsInstancesRetrieveRequest { + return ApiFlowsInstancesRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Flow +func (a *FlowsAPIService) FlowsInstancesRetrieveExecute(r ApiFlowsInstancesRetrieveRequest) (*Flow, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Flow + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesUpdateRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string + flowRequest *FlowRequest +} + +func (r ApiFlowsInstancesUpdateRequest) FlowRequest(flowRequest FlowRequest) ApiFlowsInstancesUpdateRequest { + r.flowRequest = &flowRequest + return r +} + +func (r ApiFlowsInstancesUpdateRequest) Execute() (*Flow, *http.Response, error) { + return r.ApiService.FlowsInstancesUpdateExecute(r) +} + +/* +FlowsInstancesUpdate Method for FlowsInstancesUpdate + +Flow Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesUpdateRequest +*/ +func (a *FlowsAPIService) FlowsInstancesUpdate(ctx context.Context, slug string) ApiFlowsInstancesUpdateRequest { + return ApiFlowsInstancesUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Flow +func (a *FlowsAPIService) FlowsInstancesUpdateExecute(r ApiFlowsInstancesUpdateRequest) (*Flow, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Flow + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.flowRequest == nil { + return localVarReturnValue, nil, reportError("flowRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.flowRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiFlowsInstancesUsedByListRequest struct { + ctx context.Context + ApiService *FlowsAPIService + slug string +} + +func (r ApiFlowsInstancesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.FlowsInstancesUsedByListExecute(r) +} + +/* +FlowsInstancesUsedByList Method for FlowsInstancesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiFlowsInstancesUsedByListRequest +*/ +func (a *FlowsAPIService) FlowsInstancesUsedByList(ctx context.Context, slug string) ApiFlowsInstancesUsedByListRequest { + return ApiFlowsInstancesUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *FlowsAPIService) FlowsInstancesUsedByListExecute(r ApiFlowsInstancesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FlowsAPIService.FlowsInstancesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/flows/instances/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_lifecycle.go b/packages/client-go/api_lifecycle.go new file mode 100644 index 0000000000..f83cee581b --- /dev/null +++ b/packages/client-go/api_lifecycle.go @@ -0,0 +1,1388 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// LifecycleAPIService LifecycleAPI service +type LifecycleAPIService service + +type ApiLifecycleIterationsCreateRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + lifecycleIterationRequest *LifecycleIterationRequest +} + +func (r ApiLifecycleIterationsCreateRequest) LifecycleIterationRequest(lifecycleIterationRequest LifecycleIterationRequest) ApiLifecycleIterationsCreateRequest { + r.lifecycleIterationRequest = &lifecycleIterationRequest + return r +} + +func (r ApiLifecycleIterationsCreateRequest) Execute() (*LifecycleIteration, *http.Response, error) { + return r.ApiService.LifecycleIterationsCreateExecute(r) +} + +/* +LifecycleIterationsCreate Method for LifecycleIterationsCreate + +Mixin to validate that a valid enterprise license +exists before allowing to save the object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLifecycleIterationsCreateRequest +*/ +func (a *LifecycleAPIService) LifecycleIterationsCreate(ctx context.Context) ApiLifecycleIterationsCreateRequest { + return ApiLifecycleIterationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LifecycleIteration +func (a *LifecycleAPIService) LifecycleIterationsCreateExecute(r ApiLifecycleIterationsCreateRequest) (*LifecycleIteration, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleIteration + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleIterationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/iterations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lifecycleIterationRequest == nil { + return localVarReturnValue, nil, reportError("lifecycleIterationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lifecycleIterationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleIterationsLatestRetrieveRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + contentType string + objectId string +} + +func (r ApiLifecycleIterationsLatestRetrieveRequest) Execute() (*LifecycleIteration, *http.Response, error) { + return r.ApiService.LifecycleIterationsLatestRetrieveExecute(r) +} + +/* +LifecycleIterationsLatestRetrieve Method for LifecycleIterationsLatestRetrieve + +Mixin to validate that a valid enterprise license +exists before allowing to save the object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param contentType + @param objectId + @return ApiLifecycleIterationsLatestRetrieveRequest +*/ +func (a *LifecycleAPIService) LifecycleIterationsLatestRetrieve(ctx context.Context, contentType string, objectId string) ApiLifecycleIterationsLatestRetrieveRequest { + return ApiLifecycleIterationsLatestRetrieveRequest{ + ApiService: a, + ctx: ctx, + contentType: contentType, + objectId: objectId, + } +} + +// Execute executes the request +// +// @return LifecycleIteration +func (a *LifecycleAPIService) LifecycleIterationsLatestRetrieveExecute(r ApiLifecycleIterationsLatestRetrieveRequest) (*LifecycleIteration, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleIteration + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleIterationsLatestRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/iterations/latest/{content_type}/{object_id}/" + localVarPath = strings.Replace(localVarPath, "{"+"content_type"+"}", url.PathEscape(parameterValueToString(r.contentType, "contentType")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"object_id"+"}", url.PathEscape(parameterValueToString(r.objectId, "objectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleIterationsListOpenRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + userIsReviewer *bool +} + +// Which field to use when ordering the results. +func (r ApiLifecycleIterationsListOpenRequest) Ordering(ordering string) ApiLifecycleIterationsListOpenRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiLifecycleIterationsListOpenRequest) Page(page int32) ApiLifecycleIterationsListOpenRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiLifecycleIterationsListOpenRequest) PageSize(pageSize int32) ApiLifecycleIterationsListOpenRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiLifecycleIterationsListOpenRequest) Search(search string) ApiLifecycleIterationsListOpenRequest { + r.search = &search + return r +} + +func (r ApiLifecycleIterationsListOpenRequest) UserIsReviewer(userIsReviewer bool) ApiLifecycleIterationsListOpenRequest { + r.userIsReviewer = &userIsReviewer + return r +} + +func (r ApiLifecycleIterationsListOpenRequest) Execute() (*PaginatedLifecycleIterationList, *http.Response, error) { + return r.ApiService.LifecycleIterationsListOpenExecute(r) +} + +/* +LifecycleIterationsListOpen Method for LifecycleIterationsListOpen + +Mixin to validate that a valid enterprise license +exists before allowing to save the object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLifecycleIterationsListOpenRequest +*/ +func (a *LifecycleAPIService) LifecycleIterationsListOpen(ctx context.Context) ApiLifecycleIterationsListOpenRequest { + return ApiLifecycleIterationsListOpenRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLifecycleIterationList +func (a *LifecycleAPIService) LifecycleIterationsListOpenExecute(r ApiLifecycleIterationsListOpenRequest) (*PaginatedLifecycleIterationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLifecycleIterationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleIterationsListOpen") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/iterations/open/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userIsReviewer != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_is_reviewer", r.userIsReviewer, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleReviewsCreateRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + reviewRequest *ReviewRequest +} + +func (r ApiLifecycleReviewsCreateRequest) ReviewRequest(reviewRequest ReviewRequest) ApiLifecycleReviewsCreateRequest { + r.reviewRequest = &reviewRequest + return r +} + +func (r ApiLifecycleReviewsCreateRequest) Execute() (*Review, *http.Response, error) { + return r.ApiService.LifecycleReviewsCreateExecute(r) +} + +/* +LifecycleReviewsCreate Method for LifecycleReviewsCreate + +Mixin to validate that a valid enterprise license +exists before allowing to save the object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLifecycleReviewsCreateRequest +*/ +func (a *LifecycleAPIService) LifecycleReviewsCreate(ctx context.Context) ApiLifecycleReviewsCreateRequest { + return ApiLifecycleReviewsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Review +func (a *LifecycleAPIService) LifecycleReviewsCreateExecute(r ApiLifecycleReviewsCreateRequest) (*Review, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Review + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleReviewsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/reviews/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.reviewRequest == nil { + return localVarReturnValue, nil, reportError("reviewRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.reviewRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleRulesCreateRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + lifecycleRuleRequest *LifecycleRuleRequest +} + +func (r ApiLifecycleRulesCreateRequest) LifecycleRuleRequest(lifecycleRuleRequest LifecycleRuleRequest) ApiLifecycleRulesCreateRequest { + r.lifecycleRuleRequest = &lifecycleRuleRequest + return r +} + +func (r ApiLifecycleRulesCreateRequest) Execute() (*LifecycleRule, *http.Response, error) { + return r.ApiService.LifecycleRulesCreateExecute(r) +} + +/* +LifecycleRulesCreate Method for LifecycleRulesCreate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLifecycleRulesCreateRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesCreate(ctx context.Context) ApiLifecycleRulesCreateRequest { + return ApiLifecycleRulesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LifecycleRule +func (a *LifecycleAPIService) LifecycleRulesCreateExecute(r ApiLifecycleRulesCreateRequest) (*LifecycleRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lifecycleRuleRequest == nil { + return localVarReturnValue, nil, reportError("lifecycleRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lifecycleRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleRulesDestroyRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + id string +} + +func (r ApiLifecycleRulesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.LifecycleRulesDestroyExecute(r) +} + +/* +LifecycleRulesDestroy Method for LifecycleRulesDestroy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this lifecycle rule. + @return ApiLifecycleRulesDestroyRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesDestroy(ctx context.Context, id string) ApiLifecycleRulesDestroyRequest { + return ApiLifecycleRulesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *LifecycleAPIService) LifecycleRulesDestroyExecute(r ApiLifecycleRulesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiLifecycleRulesListRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + contentTypeModel *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiLifecycleRulesListRequest) ContentTypeModel(contentTypeModel string) ApiLifecycleRulesListRequest { + r.contentTypeModel = &contentTypeModel + return r +} + +// Which field to use when ordering the results. +func (r ApiLifecycleRulesListRequest) Ordering(ordering string) ApiLifecycleRulesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiLifecycleRulesListRequest) Page(page int32) ApiLifecycleRulesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiLifecycleRulesListRequest) PageSize(pageSize int32) ApiLifecycleRulesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiLifecycleRulesListRequest) Search(search string) ApiLifecycleRulesListRequest { + r.search = &search + return r +} + +func (r ApiLifecycleRulesListRequest) Execute() (*PaginatedLifecycleRuleList, *http.Response, error) { + return r.ApiService.LifecycleRulesListExecute(r) +} + +/* +LifecycleRulesList Method for LifecycleRulesList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiLifecycleRulesListRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesList(ctx context.Context) ApiLifecycleRulesListRequest { + return ApiLifecycleRulesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLifecycleRuleList +func (a *LifecycleAPIService) LifecycleRulesListExecute(r ApiLifecycleRulesListRequest) (*PaginatedLifecycleRuleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLifecycleRuleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.contentTypeModel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type__model", r.contentTypeModel, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleRulesPartialUpdateRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + id string + patchedLifecycleRuleRequest *PatchedLifecycleRuleRequest +} + +func (r ApiLifecycleRulesPartialUpdateRequest) PatchedLifecycleRuleRequest(patchedLifecycleRuleRequest PatchedLifecycleRuleRequest) ApiLifecycleRulesPartialUpdateRequest { + r.patchedLifecycleRuleRequest = &patchedLifecycleRuleRequest + return r +} + +func (r ApiLifecycleRulesPartialUpdateRequest) Execute() (*LifecycleRule, *http.Response, error) { + return r.ApiService.LifecycleRulesPartialUpdateExecute(r) +} + +/* +LifecycleRulesPartialUpdate Method for LifecycleRulesPartialUpdate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this lifecycle rule. + @return ApiLifecycleRulesPartialUpdateRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesPartialUpdate(ctx context.Context, id string) ApiLifecycleRulesPartialUpdateRequest { + return ApiLifecycleRulesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LifecycleRule +func (a *LifecycleAPIService) LifecycleRulesPartialUpdateExecute(r ApiLifecycleRulesPartialUpdateRequest) (*LifecycleRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedLifecycleRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleRulesRetrieveRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + id string +} + +func (r ApiLifecycleRulesRetrieveRequest) Execute() (*LifecycleRule, *http.Response, error) { + return r.ApiService.LifecycleRulesRetrieveExecute(r) +} + +/* +LifecycleRulesRetrieve Method for LifecycleRulesRetrieve + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this lifecycle rule. + @return ApiLifecycleRulesRetrieveRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesRetrieve(ctx context.Context, id string) ApiLifecycleRulesRetrieveRequest { + return ApiLifecycleRulesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LifecycleRule +func (a *LifecycleAPIService) LifecycleRulesRetrieveExecute(r ApiLifecycleRulesRetrieveRequest) (*LifecycleRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiLifecycleRulesUpdateRequest struct { + ctx context.Context + ApiService *LifecycleAPIService + id string + lifecycleRuleRequest *LifecycleRuleRequest +} + +func (r ApiLifecycleRulesUpdateRequest) LifecycleRuleRequest(lifecycleRuleRequest LifecycleRuleRequest) ApiLifecycleRulesUpdateRequest { + r.lifecycleRuleRequest = &lifecycleRuleRequest + return r +} + +func (r ApiLifecycleRulesUpdateRequest) Execute() (*LifecycleRule, *http.Response, error) { + return r.ApiService.LifecycleRulesUpdateExecute(r) +} + +/* +LifecycleRulesUpdate Method for LifecycleRulesUpdate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this lifecycle rule. + @return ApiLifecycleRulesUpdateRequest +*/ +func (a *LifecycleAPIService) LifecycleRulesUpdate(ctx context.Context, id string) ApiLifecycleRulesUpdateRequest { + return ApiLifecycleRulesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LifecycleRule +func (a *LifecycleAPIService) LifecycleRulesUpdateExecute(r ApiLifecycleRulesUpdateRequest) (*LifecycleRule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LifecycleRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "LifecycleAPIService.LifecycleRulesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/lifecycle/rules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lifecycleRuleRequest == nil { + return localVarReturnValue, nil, reportError("lifecycleRuleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lifecycleRuleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_managed.go b/packages/client-go/api_managed.go new file mode 100644 index 0000000000..f51c48a92f --- /dev/null +++ b/packages/client-go/api_managed.go @@ -0,0 +1,1213 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// ManagedAPIService ManagedAPI service +type ManagedAPIService service + +type ApiManagedBlueprintsApplyCreateRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string +} + +func (r ApiManagedBlueprintsApplyCreateRequest) Execute() (*BlueprintInstance, *http.Response, error) { + return r.ApiService.ManagedBlueprintsApplyCreateExecute(r) +} + +/* +ManagedBlueprintsApplyCreate Method for ManagedBlueprintsApplyCreate + +Apply a blueprint + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsApplyCreateRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsApplyCreate(ctx context.Context, instanceUuid string) ApiManagedBlueprintsApplyCreateRequest { + return ApiManagedBlueprintsApplyCreateRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +// +// @return BlueprintInstance +func (a *ManagedAPIService) ManagedBlueprintsApplyCreateExecute(r ApiManagedBlueprintsApplyCreateRequest) (*BlueprintInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlueprintInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsApplyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/apply/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsAvailableListRequest struct { + ctx context.Context + ApiService *ManagedAPIService +} + +func (r ApiManagedBlueprintsAvailableListRequest) Execute() ([]BlueprintFile, *http.Response, error) { + return r.ApiService.ManagedBlueprintsAvailableListExecute(r) +} + +/* +ManagedBlueprintsAvailableList Method for ManagedBlueprintsAvailableList + +Get blueprints + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiManagedBlueprintsAvailableListRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsAvailableList(ctx context.Context) ApiManagedBlueprintsAvailableListRequest { + return ApiManagedBlueprintsAvailableListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []BlueprintFile +func (a *ManagedAPIService) ManagedBlueprintsAvailableListExecute(r ApiManagedBlueprintsAvailableListRequest) ([]BlueprintFile, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []BlueprintFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsAvailableList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/available/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsCreateRequest struct { + ctx context.Context + ApiService *ManagedAPIService + blueprintInstanceRequest *BlueprintInstanceRequest +} + +func (r ApiManagedBlueprintsCreateRequest) BlueprintInstanceRequest(blueprintInstanceRequest BlueprintInstanceRequest) ApiManagedBlueprintsCreateRequest { + r.blueprintInstanceRequest = &blueprintInstanceRequest + return r +} + +func (r ApiManagedBlueprintsCreateRequest) Execute() (*BlueprintInstance, *http.Response, error) { + return r.ApiService.ManagedBlueprintsCreateExecute(r) +} + +/* +ManagedBlueprintsCreate Method for ManagedBlueprintsCreate + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiManagedBlueprintsCreateRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsCreate(ctx context.Context) ApiManagedBlueprintsCreateRequest { + return ApiManagedBlueprintsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return BlueprintInstance +func (a *ManagedAPIService) ManagedBlueprintsCreateExecute(r ApiManagedBlueprintsCreateRequest) (*BlueprintInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlueprintInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.blueprintInstanceRequest == nil { + return localVarReturnValue, nil, reportError("blueprintInstanceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.blueprintInstanceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsDestroyRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string +} + +func (r ApiManagedBlueprintsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ManagedBlueprintsDestroyExecute(r) +} + +/* +ManagedBlueprintsDestroy Method for ManagedBlueprintsDestroy + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsDestroyRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsDestroy(ctx context.Context, instanceUuid string) ApiManagedBlueprintsDestroyRequest { + return ApiManagedBlueprintsDestroyRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +func (a *ManagedAPIService) ManagedBlueprintsDestroyExecute(r ApiManagedBlueprintsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsListRequest struct { + ctx context.Context + ApiService *ManagedAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + path *string + search *string +} + +func (r ApiManagedBlueprintsListRequest) Name(name string) ApiManagedBlueprintsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiManagedBlueprintsListRequest) Ordering(ordering string) ApiManagedBlueprintsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiManagedBlueprintsListRequest) Page(page int32) ApiManagedBlueprintsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiManagedBlueprintsListRequest) PageSize(pageSize int32) ApiManagedBlueprintsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiManagedBlueprintsListRequest) Path(path string) ApiManagedBlueprintsListRequest { + r.path = &path + return r +} + +// A search term. +func (r ApiManagedBlueprintsListRequest) Search(search string) ApiManagedBlueprintsListRequest { + r.search = &search + return r +} + +func (r ApiManagedBlueprintsListRequest) Execute() (*PaginatedBlueprintInstanceList, *http.Response, error) { + return r.ApiService.ManagedBlueprintsListExecute(r) +} + +/* +ManagedBlueprintsList Method for ManagedBlueprintsList + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiManagedBlueprintsListRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsList(ctx context.Context) ApiManagedBlueprintsListRequest { + return ApiManagedBlueprintsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedBlueprintInstanceList +func (a *ManagedAPIService) ManagedBlueprintsListExecute(r ApiManagedBlueprintsListRequest) (*PaginatedBlueprintInstanceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedBlueprintInstanceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.path != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "path", r.path, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsPartialUpdateRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string + patchedBlueprintInstanceRequest *PatchedBlueprintInstanceRequest +} + +func (r ApiManagedBlueprintsPartialUpdateRequest) PatchedBlueprintInstanceRequest(patchedBlueprintInstanceRequest PatchedBlueprintInstanceRequest) ApiManagedBlueprintsPartialUpdateRequest { + r.patchedBlueprintInstanceRequest = &patchedBlueprintInstanceRequest + return r +} + +func (r ApiManagedBlueprintsPartialUpdateRequest) Execute() (*BlueprintInstance, *http.Response, error) { + return r.ApiService.ManagedBlueprintsPartialUpdateExecute(r) +} + +/* +ManagedBlueprintsPartialUpdate Method for ManagedBlueprintsPartialUpdate + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsPartialUpdateRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsPartialUpdate(ctx context.Context, instanceUuid string) ApiManagedBlueprintsPartialUpdateRequest { + return ApiManagedBlueprintsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +// +// @return BlueprintInstance +func (a *ManagedAPIService) ManagedBlueprintsPartialUpdateExecute(r ApiManagedBlueprintsPartialUpdateRequest) (*BlueprintInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlueprintInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedBlueprintInstanceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsRetrieveRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string +} + +func (r ApiManagedBlueprintsRetrieveRequest) Execute() (*BlueprintInstance, *http.Response, error) { + return r.ApiService.ManagedBlueprintsRetrieveExecute(r) +} + +/* +ManagedBlueprintsRetrieve Method for ManagedBlueprintsRetrieve + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsRetrieveRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsRetrieve(ctx context.Context, instanceUuid string) ApiManagedBlueprintsRetrieveRequest { + return ApiManagedBlueprintsRetrieveRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +// +// @return BlueprintInstance +func (a *ManagedAPIService) ManagedBlueprintsRetrieveExecute(r ApiManagedBlueprintsRetrieveRequest) (*BlueprintInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlueprintInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsUpdateRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string + blueprintInstanceRequest *BlueprintInstanceRequest +} + +func (r ApiManagedBlueprintsUpdateRequest) BlueprintInstanceRequest(blueprintInstanceRequest BlueprintInstanceRequest) ApiManagedBlueprintsUpdateRequest { + r.blueprintInstanceRequest = &blueprintInstanceRequest + return r +} + +func (r ApiManagedBlueprintsUpdateRequest) Execute() (*BlueprintInstance, *http.Response, error) { + return r.ApiService.ManagedBlueprintsUpdateExecute(r) +} + +/* +ManagedBlueprintsUpdate Method for ManagedBlueprintsUpdate + +Blueprint instances + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsUpdateRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsUpdate(ctx context.Context, instanceUuid string) ApiManagedBlueprintsUpdateRequest { + return ApiManagedBlueprintsUpdateRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +// +// @return BlueprintInstance +func (a *ManagedAPIService) ManagedBlueprintsUpdateExecute(r ApiManagedBlueprintsUpdateRequest) (*BlueprintInstance, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BlueprintInstance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.blueprintInstanceRequest == nil { + return localVarReturnValue, nil, reportError("blueprintInstanceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.blueprintInstanceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiManagedBlueprintsUsedByListRequest struct { + ctx context.Context + ApiService *ManagedAPIService + instanceUuid string +} + +func (r ApiManagedBlueprintsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ManagedBlueprintsUsedByListExecute(r) +} + +/* +ManagedBlueprintsUsedByList Method for ManagedBlueprintsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceUuid A UUID string identifying this Blueprint Instance. + @return ApiManagedBlueprintsUsedByListRequest +*/ +func (a *ManagedAPIService) ManagedBlueprintsUsedByList(ctx context.Context, instanceUuid string) ApiManagedBlueprintsUsedByListRequest { + return ApiManagedBlueprintsUsedByListRequest{ + ApiService: a, + ctx: ctx, + instanceUuid: instanceUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ManagedAPIService) ManagedBlueprintsUsedByListExecute(r ApiManagedBlueprintsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/managed/blueprints/{instance_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"instance_uuid"+"}", url.PathEscape(parameterValueToString(r.instanceUuid, "instanceUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_oauth2.go b/packages/client-go/api_oauth2.go new file mode 100644 index 0000000000..84b18ff7d2 --- /dev/null +++ b/packages/client-go/api_oauth2.go @@ -0,0 +1,1650 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// Oauth2APIService Oauth2API service +type Oauth2APIService service + +type ApiOauth2AccessTokensDestroyRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AccessTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.Oauth2AccessTokensDestroyExecute(r) +} + +/* +Oauth2AccessTokensDestroy Method for Oauth2AccessTokensDestroy + +AccessToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Access Token. + @return ApiOauth2AccessTokensDestroyRequest +*/ +func (a *Oauth2APIService) Oauth2AccessTokensDestroy(ctx context.Context, id int32) ApiOauth2AccessTokensDestroyRequest { + return ApiOauth2AccessTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *Oauth2APIService) Oauth2AccessTokensDestroyExecute(r ApiOauth2AccessTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AccessTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/access_tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOauth2AccessTokensListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiOauth2AccessTokensListRequest) Ordering(ordering string) ApiOauth2AccessTokensListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOauth2AccessTokensListRequest) Page(page int32) ApiOauth2AccessTokensListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOauth2AccessTokensListRequest) PageSize(pageSize int32) ApiOauth2AccessTokensListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiOauth2AccessTokensListRequest) Provider(provider int32) ApiOauth2AccessTokensListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiOauth2AccessTokensListRequest) Search(search string) ApiOauth2AccessTokensListRequest { + r.search = &search + return r +} + +func (r ApiOauth2AccessTokensListRequest) User(user int32) ApiOauth2AccessTokensListRequest { + r.user = &user + return r +} + +func (r ApiOauth2AccessTokensListRequest) Execute() (*PaginatedTokenModelList, *http.Response, error) { + return r.ApiService.Oauth2AccessTokensListExecute(r) +} + +/* +Oauth2AccessTokensList Method for Oauth2AccessTokensList + +AccessToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOauth2AccessTokensListRequest +*/ +func (a *Oauth2APIService) Oauth2AccessTokensList(ctx context.Context) ApiOauth2AccessTokensListRequest { + return ApiOauth2AccessTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTokenModelList +func (a *Oauth2APIService) Oauth2AccessTokensListExecute(r ApiOauth2AccessTokensListRequest) (*PaginatedTokenModelList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTokenModelList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AccessTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/access_tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2AccessTokensRetrieveRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AccessTokensRetrieveRequest) Execute() (*TokenModel, *http.Response, error) { + return r.ApiService.Oauth2AccessTokensRetrieveExecute(r) +} + +/* +Oauth2AccessTokensRetrieve Method for Oauth2AccessTokensRetrieve + +AccessToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Access Token. + @return ApiOauth2AccessTokensRetrieveRequest +*/ +func (a *Oauth2APIService) Oauth2AccessTokensRetrieve(ctx context.Context, id int32) ApiOauth2AccessTokensRetrieveRequest { + return ApiOauth2AccessTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TokenModel +func (a *Oauth2APIService) Oauth2AccessTokensRetrieveExecute(r ApiOauth2AccessTokensRetrieveRequest) (*TokenModel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TokenModel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AccessTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/access_tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2AccessTokensUsedByListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AccessTokensUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.Oauth2AccessTokensUsedByListExecute(r) +} + +/* +Oauth2AccessTokensUsedByList Method for Oauth2AccessTokensUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Access Token. + @return ApiOauth2AccessTokensUsedByListRequest +*/ +func (a *Oauth2APIService) Oauth2AccessTokensUsedByList(ctx context.Context, id int32) ApiOauth2AccessTokensUsedByListRequest { + return ApiOauth2AccessTokensUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *Oauth2APIService) Oauth2AccessTokensUsedByListExecute(r ApiOauth2AccessTokensUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AccessTokensUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/access_tokens/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2AuthorizationCodesDestroyRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AuthorizationCodesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.Oauth2AuthorizationCodesDestroyExecute(r) +} + +/* +Oauth2AuthorizationCodesDestroy Method for Oauth2AuthorizationCodesDestroy + +AuthorizationCode Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Authorization Code. + @return ApiOauth2AuthorizationCodesDestroyRequest +*/ +func (a *Oauth2APIService) Oauth2AuthorizationCodesDestroy(ctx context.Context, id int32) ApiOauth2AuthorizationCodesDestroyRequest { + return ApiOauth2AuthorizationCodesDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *Oauth2APIService) Oauth2AuthorizationCodesDestroyExecute(r ApiOauth2AuthorizationCodesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AuthorizationCodesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/authorization_codes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOauth2AuthorizationCodesListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiOauth2AuthorizationCodesListRequest) Ordering(ordering string) ApiOauth2AuthorizationCodesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOauth2AuthorizationCodesListRequest) Page(page int32) ApiOauth2AuthorizationCodesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOauth2AuthorizationCodesListRequest) PageSize(pageSize int32) ApiOauth2AuthorizationCodesListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiOauth2AuthorizationCodesListRequest) Provider(provider int32) ApiOauth2AuthorizationCodesListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiOauth2AuthorizationCodesListRequest) Search(search string) ApiOauth2AuthorizationCodesListRequest { + r.search = &search + return r +} + +func (r ApiOauth2AuthorizationCodesListRequest) User(user int32) ApiOauth2AuthorizationCodesListRequest { + r.user = &user + return r +} + +func (r ApiOauth2AuthorizationCodesListRequest) Execute() (*PaginatedExpiringBaseGrantModelList, *http.Response, error) { + return r.ApiService.Oauth2AuthorizationCodesListExecute(r) +} + +/* +Oauth2AuthorizationCodesList Method for Oauth2AuthorizationCodesList + +AuthorizationCode Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOauth2AuthorizationCodesListRequest +*/ +func (a *Oauth2APIService) Oauth2AuthorizationCodesList(ctx context.Context) ApiOauth2AuthorizationCodesListRequest { + return ApiOauth2AuthorizationCodesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedExpiringBaseGrantModelList +func (a *Oauth2APIService) Oauth2AuthorizationCodesListExecute(r ApiOauth2AuthorizationCodesListRequest) (*PaginatedExpiringBaseGrantModelList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedExpiringBaseGrantModelList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AuthorizationCodesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/authorization_codes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2AuthorizationCodesRetrieveRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AuthorizationCodesRetrieveRequest) Execute() (*ExpiringBaseGrantModel, *http.Response, error) { + return r.ApiService.Oauth2AuthorizationCodesRetrieveExecute(r) +} + +/* +Oauth2AuthorizationCodesRetrieve Method for Oauth2AuthorizationCodesRetrieve + +AuthorizationCode Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Authorization Code. + @return ApiOauth2AuthorizationCodesRetrieveRequest +*/ +func (a *Oauth2APIService) Oauth2AuthorizationCodesRetrieve(ctx context.Context, id int32) ApiOauth2AuthorizationCodesRetrieveRequest { + return ApiOauth2AuthorizationCodesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ExpiringBaseGrantModel +func (a *Oauth2APIService) Oauth2AuthorizationCodesRetrieveExecute(r ApiOauth2AuthorizationCodesRetrieveRequest) (*ExpiringBaseGrantModel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExpiringBaseGrantModel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AuthorizationCodesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/authorization_codes/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2AuthorizationCodesUsedByListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2AuthorizationCodesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.Oauth2AuthorizationCodesUsedByListExecute(r) +} + +/* +Oauth2AuthorizationCodesUsedByList Method for Oauth2AuthorizationCodesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Authorization Code. + @return ApiOauth2AuthorizationCodesUsedByListRequest +*/ +func (a *Oauth2APIService) Oauth2AuthorizationCodesUsedByList(ctx context.Context, id int32) ApiOauth2AuthorizationCodesUsedByListRequest { + return ApiOauth2AuthorizationCodesUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *Oauth2APIService) Oauth2AuthorizationCodesUsedByListExecute(r ApiOauth2AuthorizationCodesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2AuthorizationCodesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/authorization_codes/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2RefreshTokensDestroyRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2RefreshTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.Oauth2RefreshTokensDestroyExecute(r) +} + +/* +Oauth2RefreshTokensDestroy Method for Oauth2RefreshTokensDestroy + +RefreshToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Refresh Token. + @return ApiOauth2RefreshTokensDestroyRequest +*/ +func (a *Oauth2APIService) Oauth2RefreshTokensDestroy(ctx context.Context, id int32) ApiOauth2RefreshTokensDestroyRequest { + return ApiOauth2RefreshTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *Oauth2APIService) Oauth2RefreshTokensDestroyExecute(r ApiOauth2RefreshTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2RefreshTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/refresh_tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOauth2RefreshTokensListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiOauth2RefreshTokensListRequest) Ordering(ordering string) ApiOauth2RefreshTokensListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOauth2RefreshTokensListRequest) Page(page int32) ApiOauth2RefreshTokensListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOauth2RefreshTokensListRequest) PageSize(pageSize int32) ApiOauth2RefreshTokensListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiOauth2RefreshTokensListRequest) Provider(provider int32) ApiOauth2RefreshTokensListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiOauth2RefreshTokensListRequest) Search(search string) ApiOauth2RefreshTokensListRequest { + r.search = &search + return r +} + +func (r ApiOauth2RefreshTokensListRequest) User(user int32) ApiOauth2RefreshTokensListRequest { + r.user = &user + return r +} + +func (r ApiOauth2RefreshTokensListRequest) Execute() (*PaginatedTokenModelList, *http.Response, error) { + return r.ApiService.Oauth2RefreshTokensListExecute(r) +} + +/* +Oauth2RefreshTokensList Method for Oauth2RefreshTokensList + +RefreshToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOauth2RefreshTokensListRequest +*/ +func (a *Oauth2APIService) Oauth2RefreshTokensList(ctx context.Context) ApiOauth2RefreshTokensListRequest { + return ApiOauth2RefreshTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTokenModelList +func (a *Oauth2APIService) Oauth2RefreshTokensListExecute(r ApiOauth2RefreshTokensListRequest) (*PaginatedTokenModelList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTokenModelList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2RefreshTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/refresh_tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2RefreshTokensRetrieveRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2RefreshTokensRetrieveRequest) Execute() (*TokenModel, *http.Response, error) { + return r.ApiService.Oauth2RefreshTokensRetrieveExecute(r) +} + +/* +Oauth2RefreshTokensRetrieve Method for Oauth2RefreshTokensRetrieve + +RefreshToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Refresh Token. + @return ApiOauth2RefreshTokensRetrieveRequest +*/ +func (a *Oauth2APIService) Oauth2RefreshTokensRetrieve(ctx context.Context, id int32) ApiOauth2RefreshTokensRetrieveRequest { + return ApiOauth2RefreshTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return TokenModel +func (a *Oauth2APIService) Oauth2RefreshTokensRetrieveExecute(r ApiOauth2RefreshTokensRetrieveRequest) (*TokenModel, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TokenModel + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2RefreshTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/refresh_tokens/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOauth2RefreshTokensUsedByListRequest struct { + ctx context.Context + ApiService *Oauth2APIService + id int32 +} + +func (r ApiOauth2RefreshTokensUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.Oauth2RefreshTokensUsedByListExecute(r) +} + +/* +Oauth2RefreshTokensUsedByList Method for Oauth2RefreshTokensUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2 Refresh Token. + @return ApiOauth2RefreshTokensUsedByListRequest +*/ +func (a *Oauth2APIService) Oauth2RefreshTokensUsedByList(ctx context.Context, id int32) ApiOauth2RefreshTokensUsedByListRequest { + return ApiOauth2RefreshTokensUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *Oauth2APIService) Oauth2RefreshTokensUsedByListExecute(r ApiOauth2RefreshTokensUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "Oauth2APIService.Oauth2RefreshTokensUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/oauth2/refresh_tokens/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_outposts.go b/packages/client-go/api_outposts.go new file mode 100644 index 0000000000..758cf0539c --- /dev/null +++ b/packages/client-go/api_outposts.go @@ -0,0 +1,4846 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// OutpostsAPIService OutpostsAPI service +type OutpostsAPIService service + +type ApiOutpostsInstancesCreateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + outpostRequest *OutpostRequest +} + +func (r ApiOutpostsInstancesCreateRequest) OutpostRequest(outpostRequest OutpostRequest) ApiOutpostsInstancesCreateRequest { + r.outpostRequest = &outpostRequest + return r +} + +func (r ApiOutpostsInstancesCreateRequest) Execute() (*Outpost, *http.Response, error) { + return r.ApiService.OutpostsInstancesCreateExecute(r) +} + +/* +OutpostsInstancesCreate Method for OutpostsInstancesCreate + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsInstancesCreateRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesCreate(ctx context.Context) ApiOutpostsInstancesCreateRequest { + return ApiOutpostsInstancesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Outpost +func (a *OutpostsAPIService) OutpostsInstancesCreateExecute(r ApiOutpostsInstancesCreateRequest) (*Outpost, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Outpost + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.outpostRequest == nil { + return localVarReturnValue, nil, reportError("outpostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.outpostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesDefaultSettingsRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService +} + +func (r ApiOutpostsInstancesDefaultSettingsRetrieveRequest) Execute() (*OutpostDefaultConfig, *http.Response, error) { + return r.ApiService.OutpostsInstancesDefaultSettingsRetrieveExecute(r) +} + +/* +OutpostsInstancesDefaultSettingsRetrieve Method for OutpostsInstancesDefaultSettingsRetrieve + +Global default outpost config + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsInstancesDefaultSettingsRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesDefaultSettingsRetrieve(ctx context.Context) ApiOutpostsInstancesDefaultSettingsRetrieveRequest { + return ApiOutpostsInstancesDefaultSettingsRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OutpostDefaultConfig +func (a *OutpostsAPIService) OutpostsInstancesDefaultSettingsRetrieveExecute(r ApiOutpostsInstancesDefaultSettingsRetrieveRequest) (*OutpostDefaultConfig, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OutpostDefaultConfig + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesDefaultSettingsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/default_settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesDestroyRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsInstancesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.OutpostsInstancesDestroyExecute(r) +} + +/* +OutpostsInstancesDestroy Method for OutpostsInstancesDestroy + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesDestroyRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesDestroy(ctx context.Context, uuid string) ApiOutpostsInstancesDestroyRequest { + return ApiOutpostsInstancesDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *OutpostsAPIService) OutpostsInstancesDestroyExecute(r ApiOutpostsInstancesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesHealthListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + managedIcontains *string + managedIexact *string + nameIcontains *string + nameIexact *string + ordering *string + providersIsnull *bool + providersByPk *[]int32 + search *string + serviceConnectionNameIcontains *string + serviceConnectionNameIexact *string +} + +func (r ApiOutpostsInstancesHealthListRequest) ManagedIcontains(managedIcontains string) ApiOutpostsInstancesHealthListRequest { + r.managedIcontains = &managedIcontains + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) ManagedIexact(managedIexact string) ApiOutpostsInstancesHealthListRequest { + r.managedIexact = &managedIexact + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) NameIcontains(nameIcontains string) ApiOutpostsInstancesHealthListRequest { + r.nameIcontains = &nameIcontains + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) NameIexact(nameIexact string) ApiOutpostsInstancesHealthListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsInstancesHealthListRequest) Ordering(ordering string) ApiOutpostsInstancesHealthListRequest { + r.ordering = &ordering + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) ProvidersIsnull(providersIsnull bool) ApiOutpostsInstancesHealthListRequest { + r.providersIsnull = &providersIsnull + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) ProvidersByPk(providersByPk []int32) ApiOutpostsInstancesHealthListRequest { + r.providersByPk = &providersByPk + return r +} + +// A search term. +func (r ApiOutpostsInstancesHealthListRequest) Search(search string) ApiOutpostsInstancesHealthListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) ServiceConnectionNameIcontains(serviceConnectionNameIcontains string) ApiOutpostsInstancesHealthListRequest { + r.serviceConnectionNameIcontains = &serviceConnectionNameIcontains + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) ServiceConnectionNameIexact(serviceConnectionNameIexact string) ApiOutpostsInstancesHealthListRequest { + r.serviceConnectionNameIexact = &serviceConnectionNameIexact + return r +} + +func (r ApiOutpostsInstancesHealthListRequest) Execute() ([]OutpostHealth, *http.Response, error) { + return r.ApiService.OutpostsInstancesHealthListExecute(r) +} + +/* +OutpostsInstancesHealthList Method for OutpostsInstancesHealthList + +Get outposts current health + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesHealthListRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesHealthList(ctx context.Context, uuid string) ApiOutpostsInstancesHealthListRequest { + return ApiOutpostsInstancesHealthListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []OutpostHealth +func (a *OutpostsAPIService) OutpostsInstancesHealthListExecute(r ApiOutpostsInstancesHealthListRequest) ([]OutpostHealth, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []OutpostHealth + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesHealthList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/health/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managedIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__icontains", r.managedIcontains, "form", "") + } + if r.managedIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__iexact", r.managedIexact, "form", "") + } + if r.nameIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__icontains", r.nameIcontains, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.providersIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers__isnull", r.providersIsnull, "form", "") + } + if r.providersByPk != nil { + t := *r.providersByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers_by_pk", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.serviceConnectionNameIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_connection__name__icontains", r.serviceConnectionNameIcontains, "form", "") + } + if r.serviceConnectionNameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_connection__name__iexact", r.serviceConnectionNameIexact, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + managedIcontains *string + managedIexact *string + nameIcontains *string + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + providersIsnull *bool + providersByPk *[]int32 + search *string + serviceConnectionNameIcontains *string + serviceConnectionNameIexact *string +} + +func (r ApiOutpostsInstancesListRequest) ManagedIcontains(managedIcontains string) ApiOutpostsInstancesListRequest { + r.managedIcontains = &managedIcontains + return r +} + +func (r ApiOutpostsInstancesListRequest) ManagedIexact(managedIexact string) ApiOutpostsInstancesListRequest { + r.managedIexact = &managedIexact + return r +} + +func (r ApiOutpostsInstancesListRequest) NameIcontains(nameIcontains string) ApiOutpostsInstancesListRequest { + r.nameIcontains = &nameIcontains + return r +} + +func (r ApiOutpostsInstancesListRequest) NameIexact(nameIexact string) ApiOutpostsInstancesListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsInstancesListRequest) Ordering(ordering string) ApiOutpostsInstancesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsInstancesListRequest) Page(page int32) ApiOutpostsInstancesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsInstancesListRequest) PageSize(pageSize int32) ApiOutpostsInstancesListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiOutpostsInstancesListRequest) ProvidersIsnull(providersIsnull bool) ApiOutpostsInstancesListRequest { + r.providersIsnull = &providersIsnull + return r +} + +func (r ApiOutpostsInstancesListRequest) ProvidersByPk(providersByPk []int32) ApiOutpostsInstancesListRequest { + r.providersByPk = &providersByPk + return r +} + +// A search term. +func (r ApiOutpostsInstancesListRequest) Search(search string) ApiOutpostsInstancesListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsInstancesListRequest) ServiceConnectionNameIcontains(serviceConnectionNameIcontains string) ApiOutpostsInstancesListRequest { + r.serviceConnectionNameIcontains = &serviceConnectionNameIcontains + return r +} + +func (r ApiOutpostsInstancesListRequest) ServiceConnectionNameIexact(serviceConnectionNameIexact string) ApiOutpostsInstancesListRequest { + r.serviceConnectionNameIexact = &serviceConnectionNameIexact + return r +} + +func (r ApiOutpostsInstancesListRequest) Execute() (*PaginatedOutpostList, *http.Response, error) { + return r.ApiService.OutpostsInstancesListExecute(r) +} + +/* +OutpostsInstancesList Method for OutpostsInstancesList + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsInstancesListRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesList(ctx context.Context) ApiOutpostsInstancesListRequest { + return ApiOutpostsInstancesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedOutpostList +func (a *OutpostsAPIService) OutpostsInstancesListExecute(r ApiOutpostsInstancesListRequest) (*PaginatedOutpostList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedOutpostList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managedIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__icontains", r.managedIcontains, "form", "") + } + if r.managedIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__iexact", r.managedIexact, "form", "") + } + if r.nameIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__icontains", r.nameIcontains, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providersIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers__isnull", r.providersIsnull, "form", "") + } + if r.providersByPk != nil { + t := *r.providersByPk + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers_by_pk", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "providers_by_pk", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.serviceConnectionNameIcontains != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_connection__name__icontains", r.serviceConnectionNameIcontains, "form", "") + } + if r.serviceConnectionNameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "service_connection__name__iexact", r.serviceConnectionNameIexact, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesPartialUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + patchedOutpostRequest *PatchedOutpostRequest +} + +func (r ApiOutpostsInstancesPartialUpdateRequest) PatchedOutpostRequest(patchedOutpostRequest PatchedOutpostRequest) ApiOutpostsInstancesPartialUpdateRequest { + r.patchedOutpostRequest = &patchedOutpostRequest + return r +} + +func (r ApiOutpostsInstancesPartialUpdateRequest) Execute() (*Outpost, *http.Response, error) { + return r.ApiService.OutpostsInstancesPartialUpdateExecute(r) +} + +/* +OutpostsInstancesPartialUpdate Method for OutpostsInstancesPartialUpdate + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesPartialUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesPartialUpdate(ctx context.Context, uuid string) ApiOutpostsInstancesPartialUpdateRequest { + return ApiOutpostsInstancesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Outpost +func (a *OutpostsAPIService) OutpostsInstancesPartialUpdateExecute(r ApiOutpostsInstancesPartialUpdateRequest) (*Outpost, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Outpost + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedOutpostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsInstancesRetrieveRequest) Execute() (*Outpost, *http.Response, error) { + return r.ApiService.OutpostsInstancesRetrieveExecute(r) +} + +/* +OutpostsInstancesRetrieve Method for OutpostsInstancesRetrieve + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesRetrieve(ctx context.Context, uuid string) ApiOutpostsInstancesRetrieveRequest { + return ApiOutpostsInstancesRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Outpost +func (a *OutpostsAPIService) OutpostsInstancesRetrieveExecute(r ApiOutpostsInstancesRetrieveRequest) (*Outpost, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Outpost + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + outpostRequest *OutpostRequest +} + +func (r ApiOutpostsInstancesUpdateRequest) OutpostRequest(outpostRequest OutpostRequest) ApiOutpostsInstancesUpdateRequest { + r.outpostRequest = &outpostRequest + return r +} + +func (r ApiOutpostsInstancesUpdateRequest) Execute() (*Outpost, *http.Response, error) { + return r.ApiService.OutpostsInstancesUpdateExecute(r) +} + +/* +OutpostsInstancesUpdate Method for OutpostsInstancesUpdate + +Outpost Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesUpdate(ctx context.Context, uuid string) ApiOutpostsInstancesUpdateRequest { + return ApiOutpostsInstancesUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Outpost +func (a *OutpostsAPIService) OutpostsInstancesUpdateExecute(r ApiOutpostsInstancesUpdateRequest) (*Outpost, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Outpost + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.outpostRequest == nil { + return localVarReturnValue, nil, reportError("outpostRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.outpostRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsInstancesUsedByListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsInstancesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.OutpostsInstancesUsedByListExecute(r) +} + +/* +OutpostsInstancesUsedByList Method for OutpostsInstancesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost. + @return ApiOutpostsInstancesUsedByListRequest +*/ +func (a *OutpostsAPIService) OutpostsInstancesUsedByList(ctx context.Context, uuid string) ApiOutpostsInstancesUsedByListRequest { + return ApiOutpostsInstancesUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *OutpostsAPIService) OutpostsInstancesUsedByListExecute(r ApiOutpostsInstancesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsInstancesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/instances/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsLdapAccessCheckRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + id int32 + appSlug *string +} + +func (r ApiOutpostsLdapAccessCheckRequest) AppSlug(appSlug string) ApiOutpostsLdapAccessCheckRequest { + r.appSlug = &appSlug + return r +} + +func (r ApiOutpostsLdapAccessCheckRequest) Execute() (*LDAPCheckAccess, *http.Response, error) { + return r.ApiService.OutpostsLdapAccessCheckExecute(r) +} + +/* +OutpostsLdapAccessCheck Method for OutpostsLdapAccessCheck + +Check access to a single application by slug + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiOutpostsLdapAccessCheckRequest +*/ +func (a *OutpostsAPIService) OutpostsLdapAccessCheck(ctx context.Context, id int32) ApiOutpostsLdapAccessCheckRequest { + return ApiOutpostsLdapAccessCheckRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LDAPCheckAccess +func (a *OutpostsAPIService) OutpostsLdapAccessCheckExecute(r ApiOutpostsLdapAccessCheckRequest) (*LDAPCheckAccess, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPCheckAccess + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsLdapAccessCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/ldap/{id}/check_access/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.appSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "app_slug", r.appSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsLdapListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiOutpostsLdapListRequest) Name(name string) ApiOutpostsLdapListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsLdapListRequest) Ordering(ordering string) ApiOutpostsLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsLdapListRequest) Page(page int32) ApiOutpostsLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsLdapListRequest) PageSize(pageSize int32) ApiOutpostsLdapListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsLdapListRequest) Search(search string) ApiOutpostsLdapListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsLdapListRequest) Execute() (*PaginatedLDAPOutpostConfigList, *http.Response, error) { + return r.ApiService.OutpostsLdapListExecute(r) +} + +/* +OutpostsLdapList Method for OutpostsLdapList + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsLdapListRequest +*/ +func (a *OutpostsAPIService) OutpostsLdapList(ctx context.Context) ApiOutpostsLdapListRequest { + return ApiOutpostsLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLDAPOutpostConfigList +func (a *OutpostsAPIService) OutpostsLdapListExecute(r ApiOutpostsLdapListRequest) (*PaginatedLDAPOutpostConfigList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLDAPOutpostConfigList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsProxyListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiOutpostsProxyListRequest) Name(name string) ApiOutpostsProxyListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsProxyListRequest) Ordering(ordering string) ApiOutpostsProxyListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsProxyListRequest) Page(page int32) ApiOutpostsProxyListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsProxyListRequest) PageSize(pageSize int32) ApiOutpostsProxyListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsProxyListRequest) Search(search string) ApiOutpostsProxyListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsProxyListRequest) Execute() (*PaginatedProxyOutpostConfigList, *http.Response, error) { + return r.ApiService.OutpostsProxyListExecute(r) +} + +/* +OutpostsProxyList Method for OutpostsProxyList + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsProxyListRequest +*/ +func (a *OutpostsAPIService) OutpostsProxyList(ctx context.Context) ApiOutpostsProxyListRequest { + return ApiOutpostsProxyListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProxyOutpostConfigList +func (a *OutpostsAPIService) OutpostsProxyListExecute(r ApiOutpostsProxyListRequest) (*PaginatedProxyOutpostConfigList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProxyOutpostConfigList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsProxyList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/proxy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsRadiusAccessCheckRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + id int32 + appSlug *string +} + +func (r ApiOutpostsRadiusAccessCheckRequest) AppSlug(appSlug string) ApiOutpostsRadiusAccessCheckRequest { + r.appSlug = &appSlug + return r +} + +func (r ApiOutpostsRadiusAccessCheckRequest) Execute() (*RadiusCheckAccess, *http.Response, error) { + return r.ApiService.OutpostsRadiusAccessCheckExecute(r) +} + +/* +OutpostsRadiusAccessCheck Method for OutpostsRadiusAccessCheck + +Check access to a single application by slug + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiOutpostsRadiusAccessCheckRequest +*/ +func (a *OutpostsAPIService) OutpostsRadiusAccessCheck(ctx context.Context, id int32) ApiOutpostsRadiusAccessCheckRequest { + return ApiOutpostsRadiusAccessCheckRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RadiusCheckAccess +func (a *OutpostsAPIService) OutpostsRadiusAccessCheckExecute(r ApiOutpostsRadiusAccessCheckRequest) (*RadiusCheckAccess, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusCheckAccess + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsRadiusAccessCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/radius/{id}/check_access/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.appSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "app_slug", r.appSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsRadiusListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiOutpostsRadiusListRequest) Name(name string) ApiOutpostsRadiusListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsRadiusListRequest) Ordering(ordering string) ApiOutpostsRadiusListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsRadiusListRequest) Page(page int32) ApiOutpostsRadiusListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsRadiusListRequest) PageSize(pageSize int32) ApiOutpostsRadiusListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsRadiusListRequest) Search(search string) ApiOutpostsRadiusListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsRadiusListRequest) Execute() (*PaginatedRadiusOutpostConfigList, *http.Response, error) { + return r.ApiService.OutpostsRadiusListExecute(r) +} + +/* +OutpostsRadiusList Method for OutpostsRadiusList + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsRadiusListRequest +*/ +func (a *OutpostsAPIService) OutpostsRadiusList(ctx context.Context) ApiOutpostsRadiusListRequest { + return ApiOutpostsRadiusListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRadiusOutpostConfigList +func (a *OutpostsAPIService) OutpostsRadiusListExecute(r ApiOutpostsRadiusListRequest) (*PaginatedRadiusOutpostConfigList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRadiusOutpostConfigList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsRadiusList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/radius/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllDestroyRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllDestroyExecute(r) +} + +/* +OutpostsServiceConnectionsAllDestroy Method for OutpostsServiceConnectionsAllDestroy + +ServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost Service-Connection. + @return ApiOutpostsServiceConnectionsAllDestroyRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllDestroy(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsAllDestroyRequest { + return ApiOutpostsServiceConnectionsAllDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllDestroyExecute(r ApiOutpostsServiceConnectionsAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiOutpostsServiceConnectionsAllListRequest) Name(name string) ApiOutpostsServiceConnectionsAllListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsServiceConnectionsAllListRequest) Ordering(ordering string) ApiOutpostsServiceConnectionsAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsServiceConnectionsAllListRequest) Page(page int32) ApiOutpostsServiceConnectionsAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsServiceConnectionsAllListRequest) PageSize(pageSize int32) ApiOutpostsServiceConnectionsAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsServiceConnectionsAllListRequest) Search(search string) ApiOutpostsServiceConnectionsAllListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsServiceConnectionsAllListRequest) Execute() (*PaginatedServiceConnectionList, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllListExecute(r) +} + +/* +OutpostsServiceConnectionsAllList Method for OutpostsServiceConnectionsAllList + +ServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsAllListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllList(ctx context.Context) ApiOutpostsServiceConnectionsAllListRequest { + return ApiOutpostsServiceConnectionsAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedServiceConnectionList +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllListExecute(r ApiOutpostsServiceConnectionsAllListRequest) (*PaginatedServiceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedServiceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsAllRetrieveRequest) Execute() (*ServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllRetrieveExecute(r) +} + +/* +OutpostsServiceConnectionsAllRetrieve Method for OutpostsServiceConnectionsAllRetrieve + +ServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost Service-Connection. + @return ApiOutpostsServiceConnectionsAllRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllRetrieve(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsAllRetrieveRequest { + return ApiOutpostsServiceConnectionsAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return ServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllRetrieveExecute(r ApiOutpostsServiceConnectionsAllRetrieveRequest) (*ServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllStateRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsAllStateRetrieveRequest) Execute() (*ServiceConnectionState, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllStateRetrieveExecute(r) +} + +/* +OutpostsServiceConnectionsAllStateRetrieve Method for OutpostsServiceConnectionsAllStateRetrieve + +Get the service connection's state + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost Service-Connection. + @return ApiOutpostsServiceConnectionsAllStateRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllStateRetrieve(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsAllStateRetrieveRequest { + return ApiOutpostsServiceConnectionsAllStateRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return ServiceConnectionState +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllStateRetrieveExecute(r ApiOutpostsServiceConnectionsAllStateRetrieveRequest) (*ServiceConnectionState, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceConnectionState + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllStateRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/{uuid}/state/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllTypesListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService +} + +func (r ApiOutpostsServiceConnectionsAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllTypesListExecute(r) +} + +/* +OutpostsServiceConnectionsAllTypesList Method for OutpostsServiceConnectionsAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsAllTypesListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllTypesList(ctx context.Context) ApiOutpostsServiceConnectionsAllTypesListRequest { + return ApiOutpostsServiceConnectionsAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllTypesListExecute(r ApiOutpostsServiceConnectionsAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsAllUsedByListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsAllUsedByListExecute(r) +} + +/* +OutpostsServiceConnectionsAllUsedByList Method for OutpostsServiceConnectionsAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Outpost Service-Connection. + @return ApiOutpostsServiceConnectionsAllUsedByListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllUsedByList(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsAllUsedByListRequest { + return ApiOutpostsServiceConnectionsAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *OutpostsAPIService) OutpostsServiceConnectionsAllUsedByListExecute(r ApiOutpostsServiceConnectionsAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/all/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerCreateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + dockerServiceConnectionRequest *DockerServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsDockerCreateRequest) DockerServiceConnectionRequest(dockerServiceConnectionRequest DockerServiceConnectionRequest) ApiOutpostsServiceConnectionsDockerCreateRequest { + r.dockerServiceConnectionRequest = &dockerServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsDockerCreateRequest) Execute() (*DockerServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerCreateExecute(r) +} + +/* +OutpostsServiceConnectionsDockerCreate Method for OutpostsServiceConnectionsDockerCreate + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsDockerCreateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerCreate(ctx context.Context) ApiOutpostsServiceConnectionsDockerCreateRequest { + return ApiOutpostsServiceConnectionsDockerCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DockerServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerCreateExecute(r ApiOutpostsServiceConnectionsDockerCreateRequest) (*DockerServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DockerServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dockerServiceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("dockerServiceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dockerServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerDestroyRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsDockerDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerDestroyExecute(r) +} + +/* +OutpostsServiceConnectionsDockerDestroy Method for OutpostsServiceConnectionsDockerDestroy + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Docker Service-Connection. + @return ApiOutpostsServiceConnectionsDockerDestroyRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerDestroy(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsDockerDestroyRequest { + return ApiOutpostsServiceConnectionsDockerDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerDestroyExecute(r ApiOutpostsServiceConnectionsDockerDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + local *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + tlsAuthentication *string + tlsVerification *string + url *string +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) Local(local bool) ApiOutpostsServiceConnectionsDockerListRequest { + r.local = &local + return r +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) Name(name string) ApiOutpostsServiceConnectionsDockerListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsServiceConnectionsDockerListRequest) Ordering(ordering string) ApiOutpostsServiceConnectionsDockerListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsServiceConnectionsDockerListRequest) Page(page int32) ApiOutpostsServiceConnectionsDockerListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsServiceConnectionsDockerListRequest) PageSize(pageSize int32) ApiOutpostsServiceConnectionsDockerListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsServiceConnectionsDockerListRequest) Search(search string) ApiOutpostsServiceConnectionsDockerListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) TlsAuthentication(tlsAuthentication string) ApiOutpostsServiceConnectionsDockerListRequest { + r.tlsAuthentication = &tlsAuthentication + return r +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) TlsVerification(tlsVerification string) ApiOutpostsServiceConnectionsDockerListRequest { + r.tlsVerification = &tlsVerification + return r +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) Url(url string) ApiOutpostsServiceConnectionsDockerListRequest { + r.url = &url + return r +} + +func (r ApiOutpostsServiceConnectionsDockerListRequest) Execute() (*PaginatedDockerServiceConnectionList, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerListExecute(r) +} + +/* +OutpostsServiceConnectionsDockerList Method for OutpostsServiceConnectionsDockerList + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsDockerListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerList(ctx context.Context) ApiOutpostsServiceConnectionsDockerListRequest { + return ApiOutpostsServiceConnectionsDockerListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDockerServiceConnectionList +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerListExecute(r ApiOutpostsServiceConnectionsDockerListRequest) (*PaginatedDockerServiceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDockerServiceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.local != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "local", r.local, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.tlsAuthentication != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tls_authentication", r.tlsAuthentication, "form", "") + } + if r.tlsVerification != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tls_verification", r.tlsVerification, "form", "") + } + if r.url != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "url", r.url, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerPartialUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + patchedDockerServiceConnectionRequest *PatchedDockerServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsDockerPartialUpdateRequest) PatchedDockerServiceConnectionRequest(patchedDockerServiceConnectionRequest PatchedDockerServiceConnectionRequest) ApiOutpostsServiceConnectionsDockerPartialUpdateRequest { + r.patchedDockerServiceConnectionRequest = &patchedDockerServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsDockerPartialUpdateRequest) Execute() (*DockerServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerPartialUpdateExecute(r) +} + +/* +OutpostsServiceConnectionsDockerPartialUpdate Method for OutpostsServiceConnectionsDockerPartialUpdate + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Docker Service-Connection. + @return ApiOutpostsServiceConnectionsDockerPartialUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerPartialUpdate(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsDockerPartialUpdateRequest { + return ApiOutpostsServiceConnectionsDockerPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return DockerServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerPartialUpdateExecute(r ApiOutpostsServiceConnectionsDockerPartialUpdateRequest) (*DockerServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DockerServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDockerServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsDockerRetrieveRequest) Execute() (*DockerServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerRetrieveExecute(r) +} + +/* +OutpostsServiceConnectionsDockerRetrieve Method for OutpostsServiceConnectionsDockerRetrieve + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Docker Service-Connection. + @return ApiOutpostsServiceConnectionsDockerRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerRetrieve(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsDockerRetrieveRequest { + return ApiOutpostsServiceConnectionsDockerRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return DockerServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerRetrieveExecute(r ApiOutpostsServiceConnectionsDockerRetrieveRequest) (*DockerServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DockerServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + dockerServiceConnectionRequest *DockerServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsDockerUpdateRequest) DockerServiceConnectionRequest(dockerServiceConnectionRequest DockerServiceConnectionRequest) ApiOutpostsServiceConnectionsDockerUpdateRequest { + r.dockerServiceConnectionRequest = &dockerServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsDockerUpdateRequest) Execute() (*DockerServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerUpdateExecute(r) +} + +/* +OutpostsServiceConnectionsDockerUpdate Method for OutpostsServiceConnectionsDockerUpdate + +DockerServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Docker Service-Connection. + @return ApiOutpostsServiceConnectionsDockerUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerUpdate(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsDockerUpdateRequest { + return ApiOutpostsServiceConnectionsDockerUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return DockerServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerUpdateExecute(r ApiOutpostsServiceConnectionsDockerUpdateRequest) (*DockerServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DockerServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dockerServiceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("dockerServiceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dockerServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsDockerUsedByListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsDockerUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsDockerUsedByListExecute(r) +} + +/* +OutpostsServiceConnectionsDockerUsedByList Method for OutpostsServiceConnectionsDockerUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Docker Service-Connection. + @return ApiOutpostsServiceConnectionsDockerUsedByListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerUsedByList(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsDockerUsedByListRequest { + return ApiOutpostsServiceConnectionsDockerUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *OutpostsAPIService) OutpostsServiceConnectionsDockerUsedByListExecute(r ApiOutpostsServiceConnectionsDockerUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsDockerUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/docker/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesCreateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + kubernetesServiceConnectionRequest *KubernetesServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsKubernetesCreateRequest) KubernetesServiceConnectionRequest(kubernetesServiceConnectionRequest KubernetesServiceConnectionRequest) ApiOutpostsServiceConnectionsKubernetesCreateRequest { + r.kubernetesServiceConnectionRequest = &kubernetesServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsKubernetesCreateRequest) Execute() (*KubernetesServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesCreateExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesCreate Method for OutpostsServiceConnectionsKubernetesCreate + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsKubernetesCreateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesCreate(ctx context.Context) ApiOutpostsServiceConnectionsKubernetesCreateRequest { + return ApiOutpostsServiceConnectionsKubernetesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KubernetesServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesCreateExecute(r ApiOutpostsServiceConnectionsKubernetesCreateRequest) (*KubernetesServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KubernetesServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kubernetesServiceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("kubernetesServiceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kubernetesServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesDestroyRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsKubernetesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesDestroyExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesDestroy Method for OutpostsServiceConnectionsKubernetesDestroy + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Kubernetes Service-Connection. + @return ApiOutpostsServiceConnectionsKubernetesDestroyRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesDestroy(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsKubernetesDestroyRequest { + return ApiOutpostsServiceConnectionsKubernetesDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesDestroyExecute(r ApiOutpostsServiceConnectionsKubernetesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + local *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Local(local bool) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.local = &local + return r +} + +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Name(name string) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Ordering(ordering string) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Page(page int32) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) PageSize(pageSize int32) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Search(search string) ApiOutpostsServiceConnectionsKubernetesListRequest { + r.search = &search + return r +} + +func (r ApiOutpostsServiceConnectionsKubernetesListRequest) Execute() (*PaginatedKubernetesServiceConnectionList, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesListExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesList Method for OutpostsServiceConnectionsKubernetesList + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiOutpostsServiceConnectionsKubernetesListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesList(ctx context.Context) ApiOutpostsServiceConnectionsKubernetesListRequest { + return ApiOutpostsServiceConnectionsKubernetesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedKubernetesServiceConnectionList +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesListExecute(r ApiOutpostsServiceConnectionsKubernetesListRequest) (*PaginatedKubernetesServiceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedKubernetesServiceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.local != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "local", r.local, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + patchedKubernetesServiceConnectionRequest *PatchedKubernetesServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest) PatchedKubernetesServiceConnectionRequest(patchedKubernetesServiceConnectionRequest PatchedKubernetesServiceConnectionRequest) ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest { + r.patchedKubernetesServiceConnectionRequest = &patchedKubernetesServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest) Execute() (*KubernetesServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesPartialUpdateExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesPartialUpdate Method for OutpostsServiceConnectionsKubernetesPartialUpdate + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Kubernetes Service-Connection. + @return ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesPartialUpdate(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest { + return ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return KubernetesServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesPartialUpdateExecute(r ApiOutpostsServiceConnectionsKubernetesPartialUpdateRequest) (*KubernetesServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KubernetesServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedKubernetesServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesRetrieveRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsKubernetesRetrieveRequest) Execute() (*KubernetesServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesRetrieveExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesRetrieve Method for OutpostsServiceConnectionsKubernetesRetrieve + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Kubernetes Service-Connection. + @return ApiOutpostsServiceConnectionsKubernetesRetrieveRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesRetrieve(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsKubernetesRetrieveRequest { + return ApiOutpostsServiceConnectionsKubernetesRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return KubernetesServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesRetrieveExecute(r ApiOutpostsServiceConnectionsKubernetesRetrieveRequest) (*KubernetesServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KubernetesServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesUpdateRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string + kubernetesServiceConnectionRequest *KubernetesServiceConnectionRequest +} + +func (r ApiOutpostsServiceConnectionsKubernetesUpdateRequest) KubernetesServiceConnectionRequest(kubernetesServiceConnectionRequest KubernetesServiceConnectionRequest) ApiOutpostsServiceConnectionsKubernetesUpdateRequest { + r.kubernetesServiceConnectionRequest = &kubernetesServiceConnectionRequest + return r +} + +func (r ApiOutpostsServiceConnectionsKubernetesUpdateRequest) Execute() (*KubernetesServiceConnection, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesUpdateExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesUpdate Method for OutpostsServiceConnectionsKubernetesUpdate + +KubernetesServiceConnection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Kubernetes Service-Connection. + @return ApiOutpostsServiceConnectionsKubernetesUpdateRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesUpdate(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsKubernetesUpdateRequest { + return ApiOutpostsServiceConnectionsKubernetesUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return KubernetesServiceConnection +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesUpdateExecute(r ApiOutpostsServiceConnectionsKubernetesUpdateRequest) (*KubernetesServiceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KubernetesServiceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kubernetesServiceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("kubernetesServiceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kubernetesServiceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiOutpostsServiceConnectionsKubernetesUsedByListRequest struct { + ctx context.Context + ApiService *OutpostsAPIService + uuid string +} + +func (r ApiOutpostsServiceConnectionsKubernetesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.OutpostsServiceConnectionsKubernetesUsedByListExecute(r) +} + +/* +OutpostsServiceConnectionsKubernetesUsedByList Method for OutpostsServiceConnectionsKubernetesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Kubernetes Service-Connection. + @return ApiOutpostsServiceConnectionsKubernetesUsedByListRequest +*/ +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesUsedByList(ctx context.Context, uuid string) ApiOutpostsServiceConnectionsKubernetesUsedByListRequest { + return ApiOutpostsServiceConnectionsKubernetesUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *OutpostsAPIService) OutpostsServiceConnectionsKubernetesUsedByListExecute(r ApiOutpostsServiceConnectionsKubernetesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "OutpostsAPIService.OutpostsServiceConnectionsKubernetesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/outposts/service_connections/kubernetes/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_policies.go b/packages/client-go/api_policies.go new file mode 100644 index 0000000000..c030231c67 --- /dev/null +++ b/packages/client-go/api_policies.go @@ -0,0 +1,10688 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// PoliciesAPIService PoliciesAPI service +type PoliciesAPIService service + +type ApiPoliciesAllCacheClearCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService +} + +func (r ApiPoliciesAllCacheClearCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesAllCacheClearCreateExecute(r) +} + +/* +PoliciesAllCacheClearCreate Method for PoliciesAllCacheClearCreate + +Clear policy cache + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesAllCacheClearCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesAllCacheClearCreate(ctx context.Context) ApiPoliciesAllCacheClearCreateRequest { + return ApiPoliciesAllCacheClearCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesAllCacheClearCreateExecute(r ApiPoliciesAllCacheClearCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllCacheClearCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/cache_clear/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesAllCacheInfoRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService +} + +func (r ApiPoliciesAllCacheInfoRetrieveRequest) Execute() (*Cache, *http.Response, error) { + return r.ApiService.PoliciesAllCacheInfoRetrieveExecute(r) +} + +/* +PoliciesAllCacheInfoRetrieve Method for PoliciesAllCacheInfoRetrieve + +Info about cached policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesAllCacheInfoRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesAllCacheInfoRetrieve(ctx context.Context) ApiPoliciesAllCacheInfoRetrieveRequest { + return ApiPoliciesAllCacheInfoRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Cache +func (a *PoliciesAPIService) PoliciesAllCacheInfoRetrieveExecute(r ApiPoliciesAllCacheInfoRetrieveRequest) (*Cache, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Cache + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllCacheInfoRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/cache_info/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesAllDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesAllDestroyExecute(r) +} + +/* +PoliciesAllDestroy Method for PoliciesAllDestroy + +Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Policy. + @return ApiPoliciesAllDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesAllDestroy(ctx context.Context, policyUuid string) ApiPoliciesAllDestroyRequest { + return ApiPoliciesAllDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesAllDestroyExecute(r ApiPoliciesAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesAllListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + bindingsIsnull *bool + ordering *string + page *int32 + pageSize *int32 + promptstageIsnull *bool + search *string +} + +func (r ApiPoliciesAllListRequest) BindingsIsnull(bindingsIsnull bool) ApiPoliciesAllListRequest { + r.bindingsIsnull = &bindingsIsnull + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesAllListRequest) Ordering(ordering string) ApiPoliciesAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesAllListRequest) Page(page int32) ApiPoliciesAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesAllListRequest) PageSize(pageSize int32) ApiPoliciesAllListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesAllListRequest) PromptstageIsnull(promptstageIsnull bool) ApiPoliciesAllListRequest { + r.promptstageIsnull = &promptstageIsnull + return r +} + +// A search term. +func (r ApiPoliciesAllListRequest) Search(search string) ApiPoliciesAllListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesAllListRequest) Execute() (*PaginatedPolicyList, *http.Response, error) { + return r.ApiService.PoliciesAllListExecute(r) +} + +/* +PoliciesAllList Method for PoliciesAllList + +Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesAllListRequest +*/ +func (a *PoliciesAPIService) PoliciesAllList(ctx context.Context) ApiPoliciesAllListRequest { + return ApiPoliciesAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPolicyList +func (a *PoliciesAPIService) PoliciesAllListExecute(r ApiPoliciesAllListRequest) (*PaginatedPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.bindingsIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bindings__isnull", r.bindingsIsnull, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.promptstageIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "promptstage__isnull", r.promptstageIsnull, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesAllRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesAllRetrieveRequest) Execute() (*Policy, *http.Response, error) { + return r.ApiService.PoliciesAllRetrieveExecute(r) +} + +/* +PoliciesAllRetrieve Method for PoliciesAllRetrieve + +Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Policy. + @return ApiPoliciesAllRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesAllRetrieve(ctx context.Context, policyUuid string) ApiPoliciesAllRetrieveRequest { + return ApiPoliciesAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return Policy +func (a *PoliciesAPIService) PoliciesAllRetrieveExecute(r ApiPoliciesAllRetrieveRequest) (*Policy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Policy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesAllTestCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + policyTestRequest *PolicyTestRequest +} + +func (r ApiPoliciesAllTestCreateRequest) PolicyTestRequest(policyTestRequest PolicyTestRequest) ApiPoliciesAllTestCreateRequest { + r.policyTestRequest = &policyTestRequest + return r +} + +func (r ApiPoliciesAllTestCreateRequest) Execute() (*PolicyTestResult, *http.Response, error) { + return r.ApiService.PoliciesAllTestCreateExecute(r) +} + +/* +PoliciesAllTestCreate Method for PoliciesAllTestCreate + +Test policy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Policy. + @return ApiPoliciesAllTestCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesAllTestCreate(ctx context.Context, policyUuid string) ApiPoliciesAllTestCreateRequest { + return ApiPoliciesAllTestCreateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PolicyTestResult +func (a *PoliciesAPIService) PoliciesAllTestCreateExecute(r ApiPoliciesAllTestCreateRequest) (*PolicyTestResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyTestResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllTestCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/{policy_uuid}/test/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.policyTestRequest == nil { + return localVarReturnValue, nil, reportError("policyTestRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.policyTestRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesAllTypesListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService +} + +func (r ApiPoliciesAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.PoliciesAllTypesListExecute(r) +} + +/* +PoliciesAllTypesList Method for PoliciesAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesAllTypesListRequest +*/ +func (a *PoliciesAPIService) PoliciesAllTypesList(ctx context.Context) ApiPoliciesAllTypesListRequest { + return ApiPoliciesAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *PoliciesAPIService) PoliciesAllTypesListExecute(r ApiPoliciesAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesAllUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesAllUsedByListExecute(r) +} + +/* +PoliciesAllUsedByList Method for PoliciesAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Policy. + @return ApiPoliciesAllUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesAllUsedByList(ctx context.Context, policyUuid string) ApiPoliciesAllUsedByListRequest { + return ApiPoliciesAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesAllUsedByListExecute(r ApiPoliciesAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/all/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingRequest *PolicyBindingRequest +} + +func (r ApiPoliciesBindingsCreateRequest) PolicyBindingRequest(policyBindingRequest PolicyBindingRequest) ApiPoliciesBindingsCreateRequest { + r.policyBindingRequest = &policyBindingRequest + return r +} + +func (r ApiPoliciesBindingsCreateRequest) Execute() (*PolicyBinding, *http.Response, error) { + return r.ApiService.PoliciesBindingsCreateExecute(r) +} + +/* +PoliciesBindingsCreate Method for PoliciesBindingsCreate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesBindingsCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsCreate(ctx context.Context) ApiPoliciesBindingsCreateRequest { + return ApiPoliciesBindingsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PolicyBinding +func (a *PoliciesAPIService) PoliciesBindingsCreateExecute(r ApiPoliciesBindingsCreateRequest) (*PolicyBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.policyBindingRequest == nil { + return localVarReturnValue, nil, reportError("policyBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.policyBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingUuid string +} + +func (r ApiPoliciesBindingsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesBindingsDestroyExecute(r) +} + +/* +PoliciesBindingsDestroy Method for PoliciesBindingsDestroy + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Policy Binding. + @return ApiPoliciesBindingsDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsDestroy(ctx context.Context, policyBindingUuid string) ApiPoliciesBindingsDestroyRequest { + return ApiPoliciesBindingsDestroyRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesBindingsDestroyExecute(r ApiPoliciesBindingsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + enabled *bool + order *int32 + ordering *string + page *int32 + pageSize *int32 + policy *string + policyIsnull *bool + search *string + target *string + targetIn *[]string + timeout *int32 +} + +func (r ApiPoliciesBindingsListRequest) Enabled(enabled bool) ApiPoliciesBindingsListRequest { + r.enabled = &enabled + return r +} + +func (r ApiPoliciesBindingsListRequest) Order(order int32) ApiPoliciesBindingsListRequest { + r.order = &order + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesBindingsListRequest) Ordering(ordering string) ApiPoliciesBindingsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesBindingsListRequest) Page(page int32) ApiPoliciesBindingsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesBindingsListRequest) PageSize(pageSize int32) ApiPoliciesBindingsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesBindingsListRequest) Policy(policy string) ApiPoliciesBindingsListRequest { + r.policy = &policy + return r +} + +func (r ApiPoliciesBindingsListRequest) PolicyIsnull(policyIsnull bool) ApiPoliciesBindingsListRequest { + r.policyIsnull = &policyIsnull + return r +} + +// A search term. +func (r ApiPoliciesBindingsListRequest) Search(search string) ApiPoliciesBindingsListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesBindingsListRequest) Target(target string) ApiPoliciesBindingsListRequest { + r.target = &target + return r +} + +func (r ApiPoliciesBindingsListRequest) TargetIn(targetIn []string) ApiPoliciesBindingsListRequest { + r.targetIn = &targetIn + return r +} + +func (r ApiPoliciesBindingsListRequest) Timeout(timeout int32) ApiPoliciesBindingsListRequest { + r.timeout = &timeout + return r +} + +func (r ApiPoliciesBindingsListRequest) Execute() (*PaginatedPolicyBindingList, *http.Response, error) { + return r.ApiService.PoliciesBindingsListExecute(r) +} + +/* +PoliciesBindingsList Method for PoliciesBindingsList + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesBindingsListRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsList(ctx context.Context) ApiPoliciesBindingsListRequest { + return ApiPoliciesBindingsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPolicyBindingList +func (a *PoliciesAPIService) PoliciesBindingsListExecute(r ApiPoliciesBindingsListRequest) (*PaginatedPolicyBindingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPolicyBindingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.order != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "order", r.order, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy", r.policy, "form", "") + } + if r.policyIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy__isnull", r.policyIsnull, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.target != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "target", r.target, "form", "") + } + if r.targetIn != nil { + t := *r.targetIn + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "target_in", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "target_in", t, "form", "multi") + } + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingUuid string + patchedPolicyBindingRequest *PatchedPolicyBindingRequest +} + +func (r ApiPoliciesBindingsPartialUpdateRequest) PatchedPolicyBindingRequest(patchedPolicyBindingRequest PatchedPolicyBindingRequest) ApiPoliciesBindingsPartialUpdateRequest { + r.patchedPolicyBindingRequest = &patchedPolicyBindingRequest + return r +} + +func (r ApiPoliciesBindingsPartialUpdateRequest) Execute() (*PolicyBinding, *http.Response, error) { + return r.ApiService.PoliciesBindingsPartialUpdateExecute(r) +} + +/* +PoliciesBindingsPartialUpdate Method for PoliciesBindingsPartialUpdate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Policy Binding. + @return ApiPoliciesBindingsPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsPartialUpdate(ctx context.Context, policyBindingUuid string) ApiPoliciesBindingsPartialUpdateRequest { + return ApiPoliciesBindingsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return PolicyBinding +func (a *PoliciesAPIService) PoliciesBindingsPartialUpdateExecute(r ApiPoliciesBindingsPartialUpdateRequest) (*PolicyBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPolicyBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingUuid string +} + +func (r ApiPoliciesBindingsRetrieveRequest) Execute() (*PolicyBinding, *http.Response, error) { + return r.ApiService.PoliciesBindingsRetrieveExecute(r) +} + +/* +PoliciesBindingsRetrieve Method for PoliciesBindingsRetrieve + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Policy Binding. + @return ApiPoliciesBindingsRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsRetrieve(ctx context.Context, policyBindingUuid string) ApiPoliciesBindingsRetrieveRequest { + return ApiPoliciesBindingsRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return PolicyBinding +func (a *PoliciesAPIService) PoliciesBindingsRetrieveExecute(r ApiPoliciesBindingsRetrieveRequest) (*PolicyBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingUuid string + policyBindingRequest *PolicyBindingRequest +} + +func (r ApiPoliciesBindingsUpdateRequest) PolicyBindingRequest(policyBindingRequest PolicyBindingRequest) ApiPoliciesBindingsUpdateRequest { + r.policyBindingRequest = &policyBindingRequest + return r +} + +func (r ApiPoliciesBindingsUpdateRequest) Execute() (*PolicyBinding, *http.Response, error) { + return r.ApiService.PoliciesBindingsUpdateExecute(r) +} + +/* +PoliciesBindingsUpdate Method for PoliciesBindingsUpdate + +PolicyBinding Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Policy Binding. + @return ApiPoliciesBindingsUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsUpdate(ctx context.Context, policyBindingUuid string) ApiPoliciesBindingsUpdateRequest { + return ApiPoliciesBindingsUpdateRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return PolicyBinding +func (a *PoliciesAPIService) PoliciesBindingsUpdateExecute(r ApiPoliciesBindingsUpdateRequest) (*PolicyBinding, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PolicyBinding + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/{policy_binding_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.policyBindingRequest == nil { + return localVarReturnValue, nil, reportError("policyBindingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.policyBindingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesBindingsUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyBindingUuid string +} + +func (r ApiPoliciesBindingsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesBindingsUsedByListExecute(r) +} + +/* +PoliciesBindingsUsedByList Method for PoliciesBindingsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyBindingUuid A UUID string identifying this Policy Binding. + @return ApiPoliciesBindingsUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesBindingsUsedByList(ctx context.Context, policyBindingUuid string) ApiPoliciesBindingsUsedByListRequest { + return ApiPoliciesBindingsUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyBindingUuid: policyBindingUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesBindingsUsedByListExecute(r ApiPoliciesBindingsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesBindingsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/bindings/{policy_binding_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_binding_uuid"+"}", url.PathEscape(parameterValueToString(r.policyBindingUuid, "policyBindingUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + dummyPolicyRequest *DummyPolicyRequest +} + +func (r ApiPoliciesDummyCreateRequest) DummyPolicyRequest(dummyPolicyRequest DummyPolicyRequest) ApiPoliciesDummyCreateRequest { + r.dummyPolicyRequest = &dummyPolicyRequest + return r +} + +func (r ApiPoliciesDummyCreateRequest) Execute() (*DummyPolicy, *http.Response, error) { + return r.ApiService.PoliciesDummyCreateExecute(r) +} + +/* +PoliciesDummyCreate Method for PoliciesDummyCreate + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesDummyCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyCreate(ctx context.Context) ApiPoliciesDummyCreateRequest { + return ApiPoliciesDummyCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DummyPolicy +func (a *PoliciesAPIService) PoliciesDummyCreateExecute(r ApiPoliciesDummyCreateRequest) (*DummyPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dummyPolicyRequest == nil { + return localVarReturnValue, nil, reportError("dummyPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dummyPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesDummyDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesDummyDestroyExecute(r) +} + +/* +PoliciesDummyDestroy Method for PoliciesDummyDestroy + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Dummy Policy. + @return ApiPoliciesDummyDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyDestroy(ctx context.Context, policyUuid string) ApiPoliciesDummyDestroyRequest { + return ApiPoliciesDummyDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesDummyDestroyExecute(r ApiPoliciesDummyDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesDummyListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + created *time.Time + executionLogging *bool + lastUpdated *time.Time + name *string + ordering *string + page *int32 + pageSize *int32 + policyUuid *string + result *bool + search *string + waitMax *int32 + waitMin *int32 +} + +func (r ApiPoliciesDummyListRequest) Created(created time.Time) ApiPoliciesDummyListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesDummyListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesDummyListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesDummyListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesDummyListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesDummyListRequest) Name(name string) ApiPoliciesDummyListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesDummyListRequest) Ordering(ordering string) ApiPoliciesDummyListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesDummyListRequest) Page(page int32) ApiPoliciesDummyListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesDummyListRequest) PageSize(pageSize int32) ApiPoliciesDummyListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesDummyListRequest) PolicyUuid(policyUuid string) ApiPoliciesDummyListRequest { + r.policyUuid = &policyUuid + return r +} + +func (r ApiPoliciesDummyListRequest) Result(result bool) ApiPoliciesDummyListRequest { + r.result = &result + return r +} + +// A search term. +func (r ApiPoliciesDummyListRequest) Search(search string) ApiPoliciesDummyListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesDummyListRequest) WaitMax(waitMax int32) ApiPoliciesDummyListRequest { + r.waitMax = &waitMax + return r +} + +func (r ApiPoliciesDummyListRequest) WaitMin(waitMin int32) ApiPoliciesDummyListRequest { + r.waitMin = &waitMin + return r +} + +func (r ApiPoliciesDummyListRequest) Execute() (*PaginatedDummyPolicyList, *http.Response, error) { + return r.ApiService.PoliciesDummyListExecute(r) +} + +/* +PoliciesDummyList Method for PoliciesDummyList + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesDummyListRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyList(ctx context.Context) ApiPoliciesDummyListRequest { + return ApiPoliciesDummyListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDummyPolicyList +func (a *PoliciesAPIService) PoliciesDummyListExecute(r ApiPoliciesDummyListRequest) (*PaginatedDummyPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDummyPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.result != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "result", r.result, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.waitMax != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "wait_max", r.waitMax, "form", "") + } + if r.waitMin != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "wait_min", r.waitMin, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedDummyPolicyRequest *PatchedDummyPolicyRequest +} + +func (r ApiPoliciesDummyPartialUpdateRequest) PatchedDummyPolicyRequest(patchedDummyPolicyRequest PatchedDummyPolicyRequest) ApiPoliciesDummyPartialUpdateRequest { + r.patchedDummyPolicyRequest = &patchedDummyPolicyRequest + return r +} + +func (r ApiPoliciesDummyPartialUpdateRequest) Execute() (*DummyPolicy, *http.Response, error) { + return r.ApiService.PoliciesDummyPartialUpdateExecute(r) +} + +/* +PoliciesDummyPartialUpdate Method for PoliciesDummyPartialUpdate + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Dummy Policy. + @return ApiPoliciesDummyPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesDummyPartialUpdateRequest { + return ApiPoliciesDummyPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return DummyPolicy +func (a *PoliciesAPIService) PoliciesDummyPartialUpdateExecute(r ApiPoliciesDummyPartialUpdateRequest) (*DummyPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDummyPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesDummyRetrieveRequest) Execute() (*DummyPolicy, *http.Response, error) { + return r.ApiService.PoliciesDummyRetrieveExecute(r) +} + +/* +PoliciesDummyRetrieve Method for PoliciesDummyRetrieve + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Dummy Policy. + @return ApiPoliciesDummyRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyRetrieve(ctx context.Context, policyUuid string) ApiPoliciesDummyRetrieveRequest { + return ApiPoliciesDummyRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return DummyPolicy +func (a *PoliciesAPIService) PoliciesDummyRetrieveExecute(r ApiPoliciesDummyRetrieveRequest) (*DummyPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + dummyPolicyRequest *DummyPolicyRequest +} + +func (r ApiPoliciesDummyUpdateRequest) DummyPolicyRequest(dummyPolicyRequest DummyPolicyRequest) ApiPoliciesDummyUpdateRequest { + r.dummyPolicyRequest = &dummyPolicyRequest + return r +} + +func (r ApiPoliciesDummyUpdateRequest) Execute() (*DummyPolicy, *http.Response, error) { + return r.ApiService.PoliciesDummyUpdateExecute(r) +} + +/* +PoliciesDummyUpdate Method for PoliciesDummyUpdate + +Dummy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Dummy Policy. + @return ApiPoliciesDummyUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyUpdate(ctx context.Context, policyUuid string) ApiPoliciesDummyUpdateRequest { + return ApiPoliciesDummyUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return DummyPolicy +func (a *PoliciesAPIService) PoliciesDummyUpdateExecute(r ApiPoliciesDummyUpdateRequest) (*DummyPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dummyPolicyRequest == nil { + return localVarReturnValue, nil, reportError("dummyPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dummyPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesDummyUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesDummyUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesDummyUsedByListExecute(r) +} + +/* +PoliciesDummyUsedByList Method for PoliciesDummyUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Dummy Policy. + @return ApiPoliciesDummyUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesDummyUsedByList(ctx context.Context, policyUuid string) ApiPoliciesDummyUsedByListRequest { + return ApiPoliciesDummyUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesDummyUsedByListExecute(r ApiPoliciesDummyUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesDummyUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/dummy/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + eventMatcherPolicyRequest *EventMatcherPolicyRequest +} + +func (r ApiPoliciesEventMatcherCreateRequest) EventMatcherPolicyRequest(eventMatcherPolicyRequest EventMatcherPolicyRequest) ApiPoliciesEventMatcherCreateRequest { + r.eventMatcherPolicyRequest = &eventMatcherPolicyRequest + return r +} + +func (r ApiPoliciesEventMatcherCreateRequest) Execute() (*EventMatcherPolicy, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherCreateExecute(r) +} + +/* +PoliciesEventMatcherCreate Method for PoliciesEventMatcherCreate + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesEventMatcherCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherCreate(ctx context.Context) ApiPoliciesEventMatcherCreateRequest { + return ApiPoliciesEventMatcherCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EventMatcherPolicy +func (a *PoliciesAPIService) PoliciesEventMatcherCreateExecute(r ApiPoliciesEventMatcherCreateRequest) (*EventMatcherPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventMatcherPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventMatcherPolicyRequest == nil { + return localVarReturnValue, nil, reportError("eventMatcherPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventMatcherPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesEventMatcherDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesEventMatcherDestroyExecute(r) +} + +/* +PoliciesEventMatcherDestroy Method for PoliciesEventMatcherDestroy + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Event Matcher Policy. + @return ApiPoliciesEventMatcherDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherDestroy(ctx context.Context, policyUuid string) ApiPoliciesEventMatcherDestroyRequest { + return ApiPoliciesEventMatcherDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesEventMatcherDestroyExecute(r ApiPoliciesEventMatcherDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + action *string + app *string + clientIp *string + created *time.Time + executionLogging *bool + lastUpdated *time.Time + model *string + name *string + ordering *string + page *int32 + pageSize *int32 + policyUuid *string + search *string +} + +// Match created events with this action type. When left empty, all action types will be matched. +func (r ApiPoliciesEventMatcherListRequest) Action(action string) ApiPoliciesEventMatcherListRequest { + r.action = &action + return r +} + +func (r ApiPoliciesEventMatcherListRequest) App(app string) ApiPoliciesEventMatcherListRequest { + r.app = &app + return r +} + +func (r ApiPoliciesEventMatcherListRequest) ClientIp(clientIp string) ApiPoliciesEventMatcherListRequest { + r.clientIp = &clientIp + return r +} + +func (r ApiPoliciesEventMatcherListRequest) Created(created time.Time) ApiPoliciesEventMatcherListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesEventMatcherListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesEventMatcherListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesEventMatcherListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesEventMatcherListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesEventMatcherListRequest) Model(model string) ApiPoliciesEventMatcherListRequest { + r.model = &model + return r +} + +func (r ApiPoliciesEventMatcherListRequest) Name(name string) ApiPoliciesEventMatcherListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesEventMatcherListRequest) Ordering(ordering string) ApiPoliciesEventMatcherListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesEventMatcherListRequest) Page(page int32) ApiPoliciesEventMatcherListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesEventMatcherListRequest) PageSize(pageSize int32) ApiPoliciesEventMatcherListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesEventMatcherListRequest) PolicyUuid(policyUuid string) ApiPoliciesEventMatcherListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesEventMatcherListRequest) Search(search string) ApiPoliciesEventMatcherListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesEventMatcherListRequest) Execute() (*PaginatedEventMatcherPolicyList, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherListExecute(r) +} + +/* +PoliciesEventMatcherList Method for PoliciesEventMatcherList + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesEventMatcherListRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherList(ctx context.Context) ApiPoliciesEventMatcherListRequest { + return ApiPoliciesEventMatcherListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEventMatcherPolicyList +func (a *PoliciesAPIService) PoliciesEventMatcherListExecute(r ApiPoliciesEventMatcherListRequest) (*PaginatedEventMatcherPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEventMatcherPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } + if r.app != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "app", r.app, "form", "") + } + if r.clientIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_ip", r.clientIp, "form", "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.model != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "model", r.model, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedEventMatcherPolicyRequest *PatchedEventMatcherPolicyRequest +} + +func (r ApiPoliciesEventMatcherPartialUpdateRequest) PatchedEventMatcherPolicyRequest(patchedEventMatcherPolicyRequest PatchedEventMatcherPolicyRequest) ApiPoliciesEventMatcherPartialUpdateRequest { + r.patchedEventMatcherPolicyRequest = &patchedEventMatcherPolicyRequest + return r +} + +func (r ApiPoliciesEventMatcherPartialUpdateRequest) Execute() (*EventMatcherPolicy, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherPartialUpdateExecute(r) +} + +/* +PoliciesEventMatcherPartialUpdate Method for PoliciesEventMatcherPartialUpdate + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Event Matcher Policy. + @return ApiPoliciesEventMatcherPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesEventMatcherPartialUpdateRequest { + return ApiPoliciesEventMatcherPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return EventMatcherPolicy +func (a *PoliciesAPIService) PoliciesEventMatcherPartialUpdateExecute(r ApiPoliciesEventMatcherPartialUpdateRequest) (*EventMatcherPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventMatcherPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEventMatcherPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesEventMatcherRetrieveRequest) Execute() (*EventMatcherPolicy, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherRetrieveExecute(r) +} + +/* +PoliciesEventMatcherRetrieve Method for PoliciesEventMatcherRetrieve + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Event Matcher Policy. + @return ApiPoliciesEventMatcherRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherRetrieve(ctx context.Context, policyUuid string) ApiPoliciesEventMatcherRetrieveRequest { + return ApiPoliciesEventMatcherRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return EventMatcherPolicy +func (a *PoliciesAPIService) PoliciesEventMatcherRetrieveExecute(r ApiPoliciesEventMatcherRetrieveRequest) (*EventMatcherPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventMatcherPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + eventMatcherPolicyRequest *EventMatcherPolicyRequest +} + +func (r ApiPoliciesEventMatcherUpdateRequest) EventMatcherPolicyRequest(eventMatcherPolicyRequest EventMatcherPolicyRequest) ApiPoliciesEventMatcherUpdateRequest { + r.eventMatcherPolicyRequest = &eventMatcherPolicyRequest + return r +} + +func (r ApiPoliciesEventMatcherUpdateRequest) Execute() (*EventMatcherPolicy, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherUpdateExecute(r) +} + +/* +PoliciesEventMatcherUpdate Method for PoliciesEventMatcherUpdate + +Event Matcher Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Event Matcher Policy. + @return ApiPoliciesEventMatcherUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherUpdate(ctx context.Context, policyUuid string) ApiPoliciesEventMatcherUpdateRequest { + return ApiPoliciesEventMatcherUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return EventMatcherPolicy +func (a *PoliciesAPIService) PoliciesEventMatcherUpdateExecute(r ApiPoliciesEventMatcherUpdateRequest) (*EventMatcherPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EventMatcherPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.eventMatcherPolicyRequest == nil { + return localVarReturnValue, nil, reportError("eventMatcherPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.eventMatcherPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesEventMatcherUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesEventMatcherUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesEventMatcherUsedByListExecute(r) +} + +/* +PoliciesEventMatcherUsedByList Method for PoliciesEventMatcherUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Event Matcher Policy. + @return ApiPoliciesEventMatcherUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesEventMatcherUsedByList(ctx context.Context, policyUuid string) ApiPoliciesEventMatcherUsedByListRequest { + return ApiPoliciesEventMatcherUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesEventMatcherUsedByListExecute(r ApiPoliciesEventMatcherUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesEventMatcherUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/event_matcher/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + expressionPolicyRequest *ExpressionPolicyRequest +} + +func (r ApiPoliciesExpressionCreateRequest) ExpressionPolicyRequest(expressionPolicyRequest ExpressionPolicyRequest) ApiPoliciesExpressionCreateRequest { + r.expressionPolicyRequest = &expressionPolicyRequest + return r +} + +func (r ApiPoliciesExpressionCreateRequest) Execute() (*ExpressionPolicy, *http.Response, error) { + return r.ApiService.PoliciesExpressionCreateExecute(r) +} + +/* +PoliciesExpressionCreate Method for PoliciesExpressionCreate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesExpressionCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionCreate(ctx context.Context) ApiPoliciesExpressionCreateRequest { + return ApiPoliciesExpressionCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ExpressionPolicy +func (a *PoliciesAPIService) PoliciesExpressionCreateExecute(r ApiPoliciesExpressionCreateRequest) (*ExpressionPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExpressionPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.expressionPolicyRequest == nil { + return localVarReturnValue, nil, reportError("expressionPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.expressionPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesExpressionDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesExpressionDestroyExecute(r) +} + +/* +PoliciesExpressionDestroy Method for PoliciesExpressionDestroy + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Expression Policy. + @return ApiPoliciesExpressionDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionDestroy(ctx context.Context, policyUuid string) ApiPoliciesExpressionDestroyRequest { + return ApiPoliciesExpressionDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesExpressionDestroyExecute(r ApiPoliciesExpressionDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + created *time.Time + executionLogging *bool + expression *string + lastUpdated *time.Time + name *string + ordering *string + page *int32 + pageSize *int32 + policyUuid *string + search *string +} + +func (r ApiPoliciesExpressionListRequest) Created(created time.Time) ApiPoliciesExpressionListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesExpressionListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesExpressionListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesExpressionListRequest) Expression(expression string) ApiPoliciesExpressionListRequest { + r.expression = &expression + return r +} + +func (r ApiPoliciesExpressionListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesExpressionListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesExpressionListRequest) Name(name string) ApiPoliciesExpressionListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesExpressionListRequest) Ordering(ordering string) ApiPoliciesExpressionListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesExpressionListRequest) Page(page int32) ApiPoliciesExpressionListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesExpressionListRequest) PageSize(pageSize int32) ApiPoliciesExpressionListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesExpressionListRequest) PolicyUuid(policyUuid string) ApiPoliciesExpressionListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesExpressionListRequest) Search(search string) ApiPoliciesExpressionListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesExpressionListRequest) Execute() (*PaginatedExpressionPolicyList, *http.Response, error) { + return r.ApiService.PoliciesExpressionListExecute(r) +} + +/* +PoliciesExpressionList Method for PoliciesExpressionList + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesExpressionListRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionList(ctx context.Context) ApiPoliciesExpressionListRequest { + return ApiPoliciesExpressionListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedExpressionPolicyList +func (a *PoliciesAPIService) PoliciesExpressionListExecute(r ApiPoliciesExpressionListRequest) (*PaginatedExpressionPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedExpressionPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.expression != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expression", r.expression, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedExpressionPolicyRequest *PatchedExpressionPolicyRequest +} + +func (r ApiPoliciesExpressionPartialUpdateRequest) PatchedExpressionPolicyRequest(patchedExpressionPolicyRequest PatchedExpressionPolicyRequest) ApiPoliciesExpressionPartialUpdateRequest { + r.patchedExpressionPolicyRequest = &patchedExpressionPolicyRequest + return r +} + +func (r ApiPoliciesExpressionPartialUpdateRequest) Execute() (*ExpressionPolicy, *http.Response, error) { + return r.ApiService.PoliciesExpressionPartialUpdateExecute(r) +} + +/* +PoliciesExpressionPartialUpdate Method for PoliciesExpressionPartialUpdate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Expression Policy. + @return ApiPoliciesExpressionPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesExpressionPartialUpdateRequest { + return ApiPoliciesExpressionPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ExpressionPolicy +func (a *PoliciesAPIService) PoliciesExpressionPartialUpdateExecute(r ApiPoliciesExpressionPartialUpdateRequest) (*ExpressionPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExpressionPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedExpressionPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesExpressionRetrieveRequest) Execute() (*ExpressionPolicy, *http.Response, error) { + return r.ApiService.PoliciesExpressionRetrieveExecute(r) +} + +/* +PoliciesExpressionRetrieve Method for PoliciesExpressionRetrieve + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Expression Policy. + @return ApiPoliciesExpressionRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionRetrieve(ctx context.Context, policyUuid string) ApiPoliciesExpressionRetrieveRequest { + return ApiPoliciesExpressionRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ExpressionPolicy +func (a *PoliciesAPIService) PoliciesExpressionRetrieveExecute(r ApiPoliciesExpressionRetrieveRequest) (*ExpressionPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExpressionPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + expressionPolicyRequest *ExpressionPolicyRequest +} + +func (r ApiPoliciesExpressionUpdateRequest) ExpressionPolicyRequest(expressionPolicyRequest ExpressionPolicyRequest) ApiPoliciesExpressionUpdateRequest { + r.expressionPolicyRequest = &expressionPolicyRequest + return r +} + +func (r ApiPoliciesExpressionUpdateRequest) Execute() (*ExpressionPolicy, *http.Response, error) { + return r.ApiService.PoliciesExpressionUpdateExecute(r) +} + +/* +PoliciesExpressionUpdate Method for PoliciesExpressionUpdate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Expression Policy. + @return ApiPoliciesExpressionUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionUpdate(ctx context.Context, policyUuid string) ApiPoliciesExpressionUpdateRequest { + return ApiPoliciesExpressionUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ExpressionPolicy +func (a *PoliciesAPIService) PoliciesExpressionUpdateExecute(r ApiPoliciesExpressionUpdateRequest) (*ExpressionPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ExpressionPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.expressionPolicyRequest == nil { + return localVarReturnValue, nil, reportError("expressionPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.expressionPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesExpressionUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesExpressionUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesExpressionUsedByListExecute(r) +} + +/* +PoliciesExpressionUsedByList Method for PoliciesExpressionUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Expression Policy. + @return ApiPoliciesExpressionUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesExpressionUsedByList(ctx context.Context, policyUuid string) ApiPoliciesExpressionUsedByListRequest { + return ApiPoliciesExpressionUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesExpressionUsedByListExecute(r ApiPoliciesExpressionUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesExpressionUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/expression/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + geoIPPolicyRequest *GeoIPPolicyRequest +} + +func (r ApiPoliciesGeoipCreateRequest) GeoIPPolicyRequest(geoIPPolicyRequest GeoIPPolicyRequest) ApiPoliciesGeoipCreateRequest { + r.geoIPPolicyRequest = &geoIPPolicyRequest + return r +} + +func (r ApiPoliciesGeoipCreateRequest) Execute() (*GeoIPPolicy, *http.Response, error) { + return r.ApiService.PoliciesGeoipCreateExecute(r) +} + +/* +PoliciesGeoipCreate Method for PoliciesGeoipCreate + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesGeoipCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipCreate(ctx context.Context) ApiPoliciesGeoipCreateRequest { + return ApiPoliciesGeoipCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GeoIPPolicy +func (a *PoliciesAPIService) PoliciesGeoipCreateExecute(r ApiPoliciesGeoipCreateRequest) (*GeoIPPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GeoIPPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.geoIPPolicyRequest == nil { + return localVarReturnValue, nil, reportError("geoIPPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.geoIPPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesGeoipDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesGeoipDestroyExecute(r) +} + +/* +PoliciesGeoipDestroy Method for PoliciesGeoipDestroy + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this GeoIP Policy. + @return ApiPoliciesGeoipDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipDestroy(ctx context.Context, policyUuid string) ApiPoliciesGeoipDestroyRequest { + return ApiPoliciesGeoipDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesGeoipDestroyExecute(r ApiPoliciesGeoipDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipIso3166ListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService +} + +func (r ApiPoliciesGeoipIso3166ListRequest) Execute() ([]DetailedCountry, *http.Response, error) { + return r.ApiService.PoliciesGeoipIso3166ListExecute(r) +} + +/* +PoliciesGeoipIso3166List Method for PoliciesGeoipIso3166List + +Get all countries in ISO-3166-1 + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesGeoipIso3166ListRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipIso3166List(ctx context.Context) ApiPoliciesGeoipIso3166ListRequest { + return ApiPoliciesGeoipIso3166ListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DetailedCountry +func (a *PoliciesAPIService) PoliciesGeoipIso3166ListExecute(r ApiPoliciesGeoipIso3166ListRequest) ([]DetailedCountry, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DetailedCountry + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipIso3166List") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip_iso3166/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPoliciesGeoipListRequest) Name(name string) ApiPoliciesGeoipListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesGeoipListRequest) Ordering(ordering string) ApiPoliciesGeoipListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesGeoipListRequest) Page(page int32) ApiPoliciesGeoipListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesGeoipListRequest) PageSize(pageSize int32) ApiPoliciesGeoipListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPoliciesGeoipListRequest) Search(search string) ApiPoliciesGeoipListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesGeoipListRequest) Execute() (*PaginatedGeoIPPolicyList, *http.Response, error) { + return r.ApiService.PoliciesGeoipListExecute(r) +} + +/* +PoliciesGeoipList Method for PoliciesGeoipList + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesGeoipListRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipList(ctx context.Context) ApiPoliciesGeoipListRequest { + return ApiPoliciesGeoipListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGeoIPPolicyList +func (a *PoliciesAPIService) PoliciesGeoipListExecute(r ApiPoliciesGeoipListRequest) (*PaginatedGeoIPPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGeoIPPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedGeoIPPolicyRequest *PatchedGeoIPPolicyRequest +} + +func (r ApiPoliciesGeoipPartialUpdateRequest) PatchedGeoIPPolicyRequest(patchedGeoIPPolicyRequest PatchedGeoIPPolicyRequest) ApiPoliciesGeoipPartialUpdateRequest { + r.patchedGeoIPPolicyRequest = &patchedGeoIPPolicyRequest + return r +} + +func (r ApiPoliciesGeoipPartialUpdateRequest) Execute() (*GeoIPPolicy, *http.Response, error) { + return r.ApiService.PoliciesGeoipPartialUpdateExecute(r) +} + +/* +PoliciesGeoipPartialUpdate Method for PoliciesGeoipPartialUpdate + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this GeoIP Policy. + @return ApiPoliciesGeoipPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesGeoipPartialUpdateRequest { + return ApiPoliciesGeoipPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return GeoIPPolicy +func (a *PoliciesAPIService) PoliciesGeoipPartialUpdateExecute(r ApiPoliciesGeoipPartialUpdateRequest) (*GeoIPPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GeoIPPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGeoIPPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesGeoipRetrieveRequest) Execute() (*GeoIPPolicy, *http.Response, error) { + return r.ApiService.PoliciesGeoipRetrieveExecute(r) +} + +/* +PoliciesGeoipRetrieve Method for PoliciesGeoipRetrieve + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this GeoIP Policy. + @return ApiPoliciesGeoipRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipRetrieve(ctx context.Context, policyUuid string) ApiPoliciesGeoipRetrieveRequest { + return ApiPoliciesGeoipRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return GeoIPPolicy +func (a *PoliciesAPIService) PoliciesGeoipRetrieveExecute(r ApiPoliciesGeoipRetrieveRequest) (*GeoIPPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GeoIPPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + geoIPPolicyRequest *GeoIPPolicyRequest +} + +func (r ApiPoliciesGeoipUpdateRequest) GeoIPPolicyRequest(geoIPPolicyRequest GeoIPPolicyRequest) ApiPoliciesGeoipUpdateRequest { + r.geoIPPolicyRequest = &geoIPPolicyRequest + return r +} + +func (r ApiPoliciesGeoipUpdateRequest) Execute() (*GeoIPPolicy, *http.Response, error) { + return r.ApiService.PoliciesGeoipUpdateExecute(r) +} + +/* +PoliciesGeoipUpdate Method for PoliciesGeoipUpdate + +GeoIP Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this GeoIP Policy. + @return ApiPoliciesGeoipUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipUpdate(ctx context.Context, policyUuid string) ApiPoliciesGeoipUpdateRequest { + return ApiPoliciesGeoipUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return GeoIPPolicy +func (a *PoliciesAPIService) PoliciesGeoipUpdateExecute(r ApiPoliciesGeoipUpdateRequest) (*GeoIPPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GeoIPPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.geoIPPolicyRequest == nil { + return localVarReturnValue, nil, reportError("geoIPPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.geoIPPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesGeoipUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesGeoipUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesGeoipUsedByListExecute(r) +} + +/* +PoliciesGeoipUsedByList Method for PoliciesGeoipUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this GeoIP Policy. + @return ApiPoliciesGeoipUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesGeoipUsedByList(ctx context.Context, policyUuid string) ApiPoliciesGeoipUsedByListRequest { + return ApiPoliciesGeoipUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesGeoipUsedByListExecute(r ApiPoliciesGeoipUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesGeoipUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/geoip/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + passwordPolicyRequest *PasswordPolicyRequest +} + +func (r ApiPoliciesPasswordCreateRequest) PasswordPolicyRequest(passwordPolicyRequest PasswordPolicyRequest) ApiPoliciesPasswordCreateRequest { + r.passwordPolicyRequest = &passwordPolicyRequest + return r +} + +func (r ApiPoliciesPasswordCreateRequest) Execute() (*PasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordCreateExecute(r) +} + +/* +PoliciesPasswordCreate Method for PoliciesPasswordCreate + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesPasswordCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordCreate(ctx context.Context) ApiPoliciesPasswordCreateRequest { + return ApiPoliciesPasswordCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PasswordPolicy +func (a *PoliciesAPIService) PoliciesPasswordCreateExecute(r ApiPoliciesPasswordCreateRequest) (*PasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordPolicyRequest == nil { + return localVarReturnValue, nil, reportError("passwordPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesPasswordDestroyExecute(r) +} + +/* +PoliciesPasswordDestroy Method for PoliciesPasswordDestroy + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Policy. + @return ApiPoliciesPasswordDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordDestroy(ctx context.Context, policyUuid string) ApiPoliciesPasswordDestroyRequest { + return ApiPoliciesPasswordDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesPasswordDestroyExecute(r ApiPoliciesPasswordDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + passwordExpiryPolicyRequest *PasswordExpiryPolicyRequest +} + +func (r ApiPoliciesPasswordExpiryCreateRequest) PasswordExpiryPolicyRequest(passwordExpiryPolicyRequest PasswordExpiryPolicyRequest) ApiPoliciesPasswordExpiryCreateRequest { + r.passwordExpiryPolicyRequest = &passwordExpiryPolicyRequest + return r +} + +func (r ApiPoliciesPasswordExpiryCreateRequest) Execute() (*PasswordExpiryPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryCreateExecute(r) +} + +/* +PoliciesPasswordExpiryCreate Method for PoliciesPasswordExpiryCreate + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesPasswordExpiryCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryCreate(ctx context.Context) ApiPoliciesPasswordExpiryCreateRequest { + return ApiPoliciesPasswordExpiryCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PasswordExpiryPolicy +func (a *PoliciesAPIService) PoliciesPasswordExpiryCreateExecute(r ApiPoliciesPasswordExpiryCreateRequest) (*PasswordExpiryPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordExpiryPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordExpiryPolicyRequest == nil { + return localVarReturnValue, nil, reportError("passwordExpiryPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordExpiryPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordExpiryDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryDestroyExecute(r) +} + +/* +PoliciesPasswordExpiryDestroy Method for PoliciesPasswordExpiryDestroy + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Expiry Policy. + @return ApiPoliciesPasswordExpiryDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryDestroy(ctx context.Context, policyUuid string) ApiPoliciesPasswordExpiryDestroyRequest { + return ApiPoliciesPasswordExpiryDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesPasswordExpiryDestroyExecute(r ApiPoliciesPasswordExpiryDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + created *time.Time + days *int32 + denyOnly *bool + executionLogging *bool + lastUpdated *time.Time + name *string + ordering *string + page *int32 + pageSize *int32 + policyUuid *string + search *string +} + +func (r ApiPoliciesPasswordExpiryListRequest) Created(created time.Time) ApiPoliciesPasswordExpiryListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) Days(days int32) ApiPoliciesPasswordExpiryListRequest { + r.days = &days + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) DenyOnly(denyOnly bool) ApiPoliciesPasswordExpiryListRequest { + r.denyOnly = &denyOnly + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesPasswordExpiryListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesPasswordExpiryListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) Name(name string) ApiPoliciesPasswordExpiryListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesPasswordExpiryListRequest) Ordering(ordering string) ApiPoliciesPasswordExpiryListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesPasswordExpiryListRequest) Page(page int32) ApiPoliciesPasswordExpiryListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesPasswordExpiryListRequest) PageSize(pageSize int32) ApiPoliciesPasswordExpiryListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) PolicyUuid(policyUuid string) ApiPoliciesPasswordExpiryListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesPasswordExpiryListRequest) Search(search string) ApiPoliciesPasswordExpiryListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesPasswordExpiryListRequest) Execute() (*PaginatedPasswordExpiryPolicyList, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryListExecute(r) +} + +/* +PoliciesPasswordExpiryList Method for PoliciesPasswordExpiryList + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesPasswordExpiryListRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryList(ctx context.Context) ApiPoliciesPasswordExpiryListRequest { + return ApiPoliciesPasswordExpiryListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPasswordExpiryPolicyList +func (a *PoliciesAPIService) PoliciesPasswordExpiryListExecute(r ApiPoliciesPasswordExpiryListRequest) (*PaginatedPasswordExpiryPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPasswordExpiryPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.days != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "days", r.days, "form", "") + } + if r.denyOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "deny_only", r.denyOnly, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedPasswordExpiryPolicyRequest *PatchedPasswordExpiryPolicyRequest +} + +func (r ApiPoliciesPasswordExpiryPartialUpdateRequest) PatchedPasswordExpiryPolicyRequest(patchedPasswordExpiryPolicyRequest PatchedPasswordExpiryPolicyRequest) ApiPoliciesPasswordExpiryPartialUpdateRequest { + r.patchedPasswordExpiryPolicyRequest = &patchedPasswordExpiryPolicyRequest + return r +} + +func (r ApiPoliciesPasswordExpiryPartialUpdateRequest) Execute() (*PasswordExpiryPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryPartialUpdateExecute(r) +} + +/* +PoliciesPasswordExpiryPartialUpdate Method for PoliciesPasswordExpiryPartialUpdate + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Expiry Policy. + @return ApiPoliciesPasswordExpiryPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesPasswordExpiryPartialUpdateRequest { + return ApiPoliciesPasswordExpiryPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordExpiryPolicy +func (a *PoliciesAPIService) PoliciesPasswordExpiryPartialUpdateExecute(r ApiPoliciesPasswordExpiryPartialUpdateRequest) (*PasswordExpiryPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordExpiryPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPasswordExpiryPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordExpiryRetrieveRequest) Execute() (*PasswordExpiryPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryRetrieveExecute(r) +} + +/* +PoliciesPasswordExpiryRetrieve Method for PoliciesPasswordExpiryRetrieve + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Expiry Policy. + @return ApiPoliciesPasswordExpiryRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryRetrieve(ctx context.Context, policyUuid string) ApiPoliciesPasswordExpiryRetrieveRequest { + return ApiPoliciesPasswordExpiryRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordExpiryPolicy +func (a *PoliciesAPIService) PoliciesPasswordExpiryRetrieveExecute(r ApiPoliciesPasswordExpiryRetrieveRequest) (*PasswordExpiryPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordExpiryPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + passwordExpiryPolicyRequest *PasswordExpiryPolicyRequest +} + +func (r ApiPoliciesPasswordExpiryUpdateRequest) PasswordExpiryPolicyRequest(passwordExpiryPolicyRequest PasswordExpiryPolicyRequest) ApiPoliciesPasswordExpiryUpdateRequest { + r.passwordExpiryPolicyRequest = &passwordExpiryPolicyRequest + return r +} + +func (r ApiPoliciesPasswordExpiryUpdateRequest) Execute() (*PasswordExpiryPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryUpdateExecute(r) +} + +/* +PoliciesPasswordExpiryUpdate Method for PoliciesPasswordExpiryUpdate + +Password Expiry Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Expiry Policy. + @return ApiPoliciesPasswordExpiryUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryUpdate(ctx context.Context, policyUuid string) ApiPoliciesPasswordExpiryUpdateRequest { + return ApiPoliciesPasswordExpiryUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordExpiryPolicy +func (a *PoliciesAPIService) PoliciesPasswordExpiryUpdateExecute(r ApiPoliciesPasswordExpiryUpdateRequest) (*PasswordExpiryPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordExpiryPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordExpiryPolicyRequest == nil { + return localVarReturnValue, nil, reportError("passwordExpiryPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordExpiryPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordExpiryUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordExpiryUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesPasswordExpiryUsedByListExecute(r) +} + +/* +PoliciesPasswordExpiryUsedByList Method for PoliciesPasswordExpiryUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Expiry Policy. + @return ApiPoliciesPasswordExpiryUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordExpiryUsedByList(ctx context.Context, policyUuid string) ApiPoliciesPasswordExpiryUsedByListRequest { + return ApiPoliciesPasswordExpiryUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesPasswordExpiryUsedByListExecute(r ApiPoliciesPasswordExpiryUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordExpiryUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password_expiry/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + amountDigits *int32 + amountLowercase *int32 + amountSymbols *int32 + amountUppercase *int32 + checkHaveIBeenPwned *bool + checkStaticRules *bool + checkZxcvbn *bool + created *time.Time + errorMessage *string + executionLogging *bool + hibpAllowedCount *int32 + lastUpdated *time.Time + lengthMin *int32 + name *string + ordering *string + page *int32 + pageSize *int32 + passwordField *string + policyUuid *string + search *string + symbolCharset *string + zxcvbnScoreThreshold *int32 +} + +func (r ApiPoliciesPasswordListRequest) AmountDigits(amountDigits int32) ApiPoliciesPasswordListRequest { + r.amountDigits = &amountDigits + return r +} + +func (r ApiPoliciesPasswordListRequest) AmountLowercase(amountLowercase int32) ApiPoliciesPasswordListRequest { + r.amountLowercase = &amountLowercase + return r +} + +func (r ApiPoliciesPasswordListRequest) AmountSymbols(amountSymbols int32) ApiPoliciesPasswordListRequest { + r.amountSymbols = &amountSymbols + return r +} + +func (r ApiPoliciesPasswordListRequest) AmountUppercase(amountUppercase int32) ApiPoliciesPasswordListRequest { + r.amountUppercase = &amountUppercase + return r +} + +func (r ApiPoliciesPasswordListRequest) CheckHaveIBeenPwned(checkHaveIBeenPwned bool) ApiPoliciesPasswordListRequest { + r.checkHaveIBeenPwned = &checkHaveIBeenPwned + return r +} + +func (r ApiPoliciesPasswordListRequest) CheckStaticRules(checkStaticRules bool) ApiPoliciesPasswordListRequest { + r.checkStaticRules = &checkStaticRules + return r +} + +func (r ApiPoliciesPasswordListRequest) CheckZxcvbn(checkZxcvbn bool) ApiPoliciesPasswordListRequest { + r.checkZxcvbn = &checkZxcvbn + return r +} + +func (r ApiPoliciesPasswordListRequest) Created(created time.Time) ApiPoliciesPasswordListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesPasswordListRequest) ErrorMessage(errorMessage string) ApiPoliciesPasswordListRequest { + r.errorMessage = &errorMessage + return r +} + +func (r ApiPoliciesPasswordListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesPasswordListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesPasswordListRequest) HibpAllowedCount(hibpAllowedCount int32) ApiPoliciesPasswordListRequest { + r.hibpAllowedCount = &hibpAllowedCount + return r +} + +func (r ApiPoliciesPasswordListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesPasswordListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesPasswordListRequest) LengthMin(lengthMin int32) ApiPoliciesPasswordListRequest { + r.lengthMin = &lengthMin + return r +} + +func (r ApiPoliciesPasswordListRequest) Name(name string) ApiPoliciesPasswordListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesPasswordListRequest) Ordering(ordering string) ApiPoliciesPasswordListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesPasswordListRequest) Page(page int32) ApiPoliciesPasswordListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesPasswordListRequest) PageSize(pageSize int32) ApiPoliciesPasswordListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesPasswordListRequest) PasswordField(passwordField string) ApiPoliciesPasswordListRequest { + r.passwordField = &passwordField + return r +} + +func (r ApiPoliciesPasswordListRequest) PolicyUuid(policyUuid string) ApiPoliciesPasswordListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesPasswordListRequest) Search(search string) ApiPoliciesPasswordListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesPasswordListRequest) SymbolCharset(symbolCharset string) ApiPoliciesPasswordListRequest { + r.symbolCharset = &symbolCharset + return r +} + +func (r ApiPoliciesPasswordListRequest) ZxcvbnScoreThreshold(zxcvbnScoreThreshold int32) ApiPoliciesPasswordListRequest { + r.zxcvbnScoreThreshold = &zxcvbnScoreThreshold + return r +} + +func (r ApiPoliciesPasswordListRequest) Execute() (*PaginatedPasswordPolicyList, *http.Response, error) { + return r.ApiService.PoliciesPasswordListExecute(r) +} + +/* +PoliciesPasswordList Method for PoliciesPasswordList + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesPasswordListRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordList(ctx context.Context) ApiPoliciesPasswordListRequest { + return ApiPoliciesPasswordListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPasswordPolicyList +func (a *PoliciesAPIService) PoliciesPasswordListExecute(r ApiPoliciesPasswordListRequest) (*PaginatedPasswordPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPasswordPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.amountDigits != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "amount_digits", r.amountDigits, "form", "") + } + if r.amountLowercase != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "amount_lowercase", r.amountLowercase, "form", "") + } + if r.amountSymbols != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "amount_symbols", r.amountSymbols, "form", "") + } + if r.amountUppercase != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "amount_uppercase", r.amountUppercase, "form", "") + } + if r.checkHaveIBeenPwned != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "check_have_i_been_pwned", r.checkHaveIBeenPwned, "form", "") + } + if r.checkStaticRules != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "check_static_rules", r.checkStaticRules, "form", "") + } + if r.checkZxcvbn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "check_zxcvbn", r.checkZxcvbn, "form", "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.errorMessage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "error_message", r.errorMessage, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.hibpAllowedCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "hibp_allowed_count", r.hibpAllowedCount, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.lengthMin != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length_min", r.lengthMin, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.passwordField != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password_field", r.passwordField, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.symbolCharset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "symbol_charset", r.symbolCharset, "form", "") + } + if r.zxcvbnScoreThreshold != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "zxcvbn_score_threshold", r.zxcvbnScoreThreshold, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedPasswordPolicyRequest *PatchedPasswordPolicyRequest +} + +func (r ApiPoliciesPasswordPartialUpdateRequest) PatchedPasswordPolicyRequest(patchedPasswordPolicyRequest PatchedPasswordPolicyRequest) ApiPoliciesPasswordPartialUpdateRequest { + r.patchedPasswordPolicyRequest = &patchedPasswordPolicyRequest + return r +} + +func (r ApiPoliciesPasswordPartialUpdateRequest) Execute() (*PasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordPartialUpdateExecute(r) +} + +/* +PoliciesPasswordPartialUpdate Method for PoliciesPasswordPartialUpdate + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Policy. + @return ApiPoliciesPasswordPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesPasswordPartialUpdateRequest { + return ApiPoliciesPasswordPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordPolicy +func (a *PoliciesAPIService) PoliciesPasswordPartialUpdateExecute(r ApiPoliciesPasswordPartialUpdateRequest) (*PasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPasswordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordRetrieveRequest) Execute() (*PasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordRetrieveExecute(r) +} + +/* +PoliciesPasswordRetrieve Method for PoliciesPasswordRetrieve + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Policy. + @return ApiPoliciesPasswordRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordRetrieve(ctx context.Context, policyUuid string) ApiPoliciesPasswordRetrieveRequest { + return ApiPoliciesPasswordRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordPolicy +func (a *PoliciesAPIService) PoliciesPasswordRetrieveExecute(r ApiPoliciesPasswordRetrieveRequest) (*PasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + passwordPolicyRequest *PasswordPolicyRequest +} + +func (r ApiPoliciesPasswordUpdateRequest) PasswordPolicyRequest(passwordPolicyRequest PasswordPolicyRequest) ApiPoliciesPasswordUpdateRequest { + r.passwordPolicyRequest = &passwordPolicyRequest + return r +} + +func (r ApiPoliciesPasswordUpdateRequest) Execute() (*PasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesPasswordUpdateExecute(r) +} + +/* +PoliciesPasswordUpdate Method for PoliciesPasswordUpdate + +Password Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Policy. + @return ApiPoliciesPasswordUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordUpdate(ctx context.Context, policyUuid string) ApiPoliciesPasswordUpdateRequest { + return ApiPoliciesPasswordUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return PasswordPolicy +func (a *PoliciesAPIService) PoliciesPasswordUpdateExecute(r ApiPoliciesPasswordUpdateRequest) (*PasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordPolicyRequest == nil { + return localVarReturnValue, nil, reportError("passwordPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesPasswordUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesPasswordUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesPasswordUsedByListExecute(r) +} + +/* +PoliciesPasswordUsedByList Method for PoliciesPasswordUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Policy. + @return ApiPoliciesPasswordUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesPasswordUsedByList(ctx context.Context, policyUuid string) ApiPoliciesPasswordUsedByListRequest { + return ApiPoliciesPasswordUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesPasswordUsedByListExecute(r ApiPoliciesPasswordUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesPasswordUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/password/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + reputationPolicyRequest *ReputationPolicyRequest +} + +func (r ApiPoliciesReputationCreateRequest) ReputationPolicyRequest(reputationPolicyRequest ReputationPolicyRequest) ApiPoliciesReputationCreateRequest { + r.reputationPolicyRequest = &reputationPolicyRequest + return r +} + +func (r ApiPoliciesReputationCreateRequest) Execute() (*ReputationPolicy, *http.Response, error) { + return r.ApiService.PoliciesReputationCreateExecute(r) +} + +/* +PoliciesReputationCreate Method for PoliciesReputationCreate + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesReputationCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationCreate(ctx context.Context) ApiPoliciesReputationCreateRequest { + return ApiPoliciesReputationCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ReputationPolicy +func (a *PoliciesAPIService) PoliciesReputationCreateExecute(r ApiPoliciesReputationCreateRequest) (*ReputationPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReputationPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.reputationPolicyRequest == nil { + return localVarReturnValue, nil, reportError("reputationPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.reputationPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesReputationDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesReputationDestroyExecute(r) +} + +/* +PoliciesReputationDestroy Method for PoliciesReputationDestroy + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Reputation Policy. + @return ApiPoliciesReputationDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationDestroy(ctx context.Context, policyUuid string) ApiPoliciesReputationDestroyRequest { + return ApiPoliciesReputationDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesReputationDestroyExecute(r ApiPoliciesReputationDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesReputationListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + checkIp *bool + checkUsername *bool + created *time.Time + executionLogging *bool + lastUpdated *time.Time + name *string + ordering *string + page *int32 + pageSize *int32 + policyUuid *string + search *string + threshold *int32 +} + +func (r ApiPoliciesReputationListRequest) CheckIp(checkIp bool) ApiPoliciesReputationListRequest { + r.checkIp = &checkIp + return r +} + +func (r ApiPoliciesReputationListRequest) CheckUsername(checkUsername bool) ApiPoliciesReputationListRequest { + r.checkUsername = &checkUsername + return r +} + +func (r ApiPoliciesReputationListRequest) Created(created time.Time) ApiPoliciesReputationListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesReputationListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesReputationListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesReputationListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesReputationListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesReputationListRequest) Name(name string) ApiPoliciesReputationListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesReputationListRequest) Ordering(ordering string) ApiPoliciesReputationListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesReputationListRequest) Page(page int32) ApiPoliciesReputationListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesReputationListRequest) PageSize(pageSize int32) ApiPoliciesReputationListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesReputationListRequest) PolicyUuid(policyUuid string) ApiPoliciesReputationListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesReputationListRequest) Search(search string) ApiPoliciesReputationListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesReputationListRequest) Threshold(threshold int32) ApiPoliciesReputationListRequest { + r.threshold = &threshold + return r +} + +func (r ApiPoliciesReputationListRequest) Execute() (*PaginatedReputationPolicyList, *http.Response, error) { + return r.ApiService.PoliciesReputationListExecute(r) +} + +/* +PoliciesReputationList Method for PoliciesReputationList + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesReputationListRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationList(ctx context.Context) ApiPoliciesReputationListRequest { + return ApiPoliciesReputationListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedReputationPolicyList +func (a *PoliciesAPIService) PoliciesReputationListExecute(r ApiPoliciesReputationListRequest) (*PaginatedReputationPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedReputationPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.checkIp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "check_ip", r.checkIp, "form", "") + } + if r.checkUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "check_username", r.checkUsername, "form", "") + } + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.threshold != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "threshold", r.threshold, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedReputationPolicyRequest *PatchedReputationPolicyRequest +} + +func (r ApiPoliciesReputationPartialUpdateRequest) PatchedReputationPolicyRequest(patchedReputationPolicyRequest PatchedReputationPolicyRequest) ApiPoliciesReputationPartialUpdateRequest { + r.patchedReputationPolicyRequest = &patchedReputationPolicyRequest + return r +} + +func (r ApiPoliciesReputationPartialUpdateRequest) Execute() (*ReputationPolicy, *http.Response, error) { + return r.ApiService.PoliciesReputationPartialUpdateExecute(r) +} + +/* +PoliciesReputationPartialUpdate Method for PoliciesReputationPartialUpdate + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Reputation Policy. + @return ApiPoliciesReputationPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesReputationPartialUpdateRequest { + return ApiPoliciesReputationPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ReputationPolicy +func (a *PoliciesAPIService) PoliciesReputationPartialUpdateExecute(r ApiPoliciesReputationPartialUpdateRequest) (*ReputationPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReputationPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedReputationPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesReputationRetrieveRequest) Execute() (*ReputationPolicy, *http.Response, error) { + return r.ApiService.PoliciesReputationRetrieveExecute(r) +} + +/* +PoliciesReputationRetrieve Method for PoliciesReputationRetrieve + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Reputation Policy. + @return ApiPoliciesReputationRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationRetrieve(ctx context.Context, policyUuid string) ApiPoliciesReputationRetrieveRequest { + return ApiPoliciesReputationRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ReputationPolicy +func (a *PoliciesAPIService) PoliciesReputationRetrieveExecute(r ApiPoliciesReputationRetrieveRequest) (*ReputationPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReputationPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationScoresDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + reputationUuid string +} + +func (r ApiPoliciesReputationScoresDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesReputationScoresDestroyExecute(r) +} + +/* +PoliciesReputationScoresDestroy Method for PoliciesReputationScoresDestroy + +Reputation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param reputationUuid A UUID string identifying this Reputation Score. + @return ApiPoliciesReputationScoresDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationScoresDestroy(ctx context.Context, reputationUuid string) ApiPoliciesReputationScoresDestroyRequest { + return ApiPoliciesReputationScoresDestroyRequest{ + ApiService: a, + ctx: ctx, + reputationUuid: reputationUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesReputationScoresDestroyExecute(r ApiPoliciesReputationScoresDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationScoresDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/scores/{reputation_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"reputation_uuid"+"}", url.PathEscape(parameterValueToString(r.reputationUuid, "reputationUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesReputationScoresListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + identifier *string + identifierIn *[]string + ip *string + ordering *string + page *int32 + pageSize *int32 + score *int32 + search *string +} + +func (r ApiPoliciesReputationScoresListRequest) Identifier(identifier string) ApiPoliciesReputationScoresListRequest { + r.identifier = &identifier + return r +} + +// Multiple values may be separated by commas. +func (r ApiPoliciesReputationScoresListRequest) IdentifierIn(identifierIn []string) ApiPoliciesReputationScoresListRequest { + r.identifierIn = &identifierIn + return r +} + +func (r ApiPoliciesReputationScoresListRequest) Ip(ip string) ApiPoliciesReputationScoresListRequest { + r.ip = &ip + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesReputationScoresListRequest) Ordering(ordering string) ApiPoliciesReputationScoresListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesReputationScoresListRequest) Page(page int32) ApiPoliciesReputationScoresListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesReputationScoresListRequest) PageSize(pageSize int32) ApiPoliciesReputationScoresListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesReputationScoresListRequest) Score(score int32) ApiPoliciesReputationScoresListRequest { + r.score = &score + return r +} + +// A search term. +func (r ApiPoliciesReputationScoresListRequest) Search(search string) ApiPoliciesReputationScoresListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesReputationScoresListRequest) Execute() (*PaginatedReputationList, *http.Response, error) { + return r.ApiService.PoliciesReputationScoresListExecute(r) +} + +/* +PoliciesReputationScoresList Method for PoliciesReputationScoresList + +Reputation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesReputationScoresListRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationScoresList(ctx context.Context) ApiPoliciesReputationScoresListRequest { + return ApiPoliciesReputationScoresListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedReputationList +func (a *PoliciesAPIService) PoliciesReputationScoresListExecute(r ApiPoliciesReputationScoresListRequest) (*PaginatedReputationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedReputationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationScoresList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/scores/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.identifier != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier", r.identifier, "form", "") + } + if r.identifierIn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "identifier_in", r.identifierIn, "form", "csv") + } + if r.ip != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ip", r.ip, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.score != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "score", r.score, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationScoresRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + reputationUuid string +} + +func (r ApiPoliciesReputationScoresRetrieveRequest) Execute() (*Reputation, *http.Response, error) { + return r.ApiService.PoliciesReputationScoresRetrieveExecute(r) +} + +/* +PoliciesReputationScoresRetrieve Method for PoliciesReputationScoresRetrieve + +Reputation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param reputationUuid A UUID string identifying this Reputation Score. + @return ApiPoliciesReputationScoresRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationScoresRetrieve(ctx context.Context, reputationUuid string) ApiPoliciesReputationScoresRetrieveRequest { + return ApiPoliciesReputationScoresRetrieveRequest{ + ApiService: a, + ctx: ctx, + reputationUuid: reputationUuid, + } +} + +// Execute executes the request +// +// @return Reputation +func (a *PoliciesAPIService) PoliciesReputationScoresRetrieveExecute(r ApiPoliciesReputationScoresRetrieveRequest) (*Reputation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Reputation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationScoresRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/scores/{reputation_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"reputation_uuid"+"}", url.PathEscape(parameterValueToString(r.reputationUuid, "reputationUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationScoresUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + reputationUuid string +} + +func (r ApiPoliciesReputationScoresUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesReputationScoresUsedByListExecute(r) +} + +/* +PoliciesReputationScoresUsedByList Method for PoliciesReputationScoresUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param reputationUuid A UUID string identifying this Reputation Score. + @return ApiPoliciesReputationScoresUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationScoresUsedByList(ctx context.Context, reputationUuid string) ApiPoliciesReputationScoresUsedByListRequest { + return ApiPoliciesReputationScoresUsedByListRequest{ + ApiService: a, + ctx: ctx, + reputationUuid: reputationUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesReputationScoresUsedByListExecute(r ApiPoliciesReputationScoresUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationScoresUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/scores/{reputation_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"reputation_uuid"+"}", url.PathEscape(parameterValueToString(r.reputationUuid, "reputationUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + reputationPolicyRequest *ReputationPolicyRequest +} + +func (r ApiPoliciesReputationUpdateRequest) ReputationPolicyRequest(reputationPolicyRequest ReputationPolicyRequest) ApiPoliciesReputationUpdateRequest { + r.reputationPolicyRequest = &reputationPolicyRequest + return r +} + +func (r ApiPoliciesReputationUpdateRequest) Execute() (*ReputationPolicy, *http.Response, error) { + return r.ApiService.PoliciesReputationUpdateExecute(r) +} + +/* +PoliciesReputationUpdate Method for PoliciesReputationUpdate + +Reputation Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Reputation Policy. + @return ApiPoliciesReputationUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationUpdate(ctx context.Context, policyUuid string) ApiPoliciesReputationUpdateRequest { + return ApiPoliciesReputationUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return ReputationPolicy +func (a *PoliciesAPIService) PoliciesReputationUpdateExecute(r ApiPoliciesReputationUpdateRequest) (*ReputationPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReputationPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.reputationPolicyRequest == nil { + return localVarReturnValue, nil, reportError("reputationPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.reputationPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesReputationUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesReputationUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesReputationUsedByListExecute(r) +} + +/* +PoliciesReputationUsedByList Method for PoliciesReputationUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Reputation Policy. + @return ApiPoliciesReputationUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesReputationUsedByList(ctx context.Context, policyUuid string) ApiPoliciesReputationUsedByListRequest { + return ApiPoliciesReputationUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesReputationUsedByListExecute(r ApiPoliciesReputationUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesReputationUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/reputation/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordCreateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + uniquePasswordPolicyRequest *UniquePasswordPolicyRequest +} + +func (r ApiPoliciesUniquePasswordCreateRequest) UniquePasswordPolicyRequest(uniquePasswordPolicyRequest UniquePasswordPolicyRequest) ApiPoliciesUniquePasswordCreateRequest { + r.uniquePasswordPolicyRequest = &uniquePasswordPolicyRequest + return r +} + +func (r ApiPoliciesUniquePasswordCreateRequest) Execute() (*UniquePasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordCreateExecute(r) +} + +/* +PoliciesUniquePasswordCreate Method for PoliciesUniquePasswordCreate + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesUniquePasswordCreateRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordCreate(ctx context.Context) ApiPoliciesUniquePasswordCreateRequest { + return ApiPoliciesUniquePasswordCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UniquePasswordPolicy +func (a *PoliciesAPIService) PoliciesUniquePasswordCreateExecute(r ApiPoliciesUniquePasswordCreateRequest) (*UniquePasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UniquePasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.uniquePasswordPolicyRequest == nil { + return localVarReturnValue, nil, reportError("uniquePasswordPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.uniquePasswordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordDestroyRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesUniquePasswordDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PoliciesUniquePasswordDestroyExecute(r) +} + +/* +PoliciesUniquePasswordDestroy Method for PoliciesUniquePasswordDestroy + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Uniqueness Policy. + @return ApiPoliciesUniquePasswordDestroyRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordDestroy(ctx context.Context, policyUuid string) ApiPoliciesUniquePasswordDestroyRequest { + return ApiPoliciesUniquePasswordDestroyRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +func (a *PoliciesAPIService) PoliciesUniquePasswordDestroyExecute(r ApiPoliciesUniquePasswordDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + created *time.Time + executionLogging *bool + lastUpdated *time.Time + name *string + numHistoricalPasswords *int32 + ordering *string + page *int32 + pageSize *int32 + passwordField *string + policyUuid *string + search *string +} + +func (r ApiPoliciesUniquePasswordListRequest) Created(created time.Time) ApiPoliciesUniquePasswordListRequest { + r.created = &created + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) ExecutionLogging(executionLogging bool) ApiPoliciesUniquePasswordListRequest { + r.executionLogging = &executionLogging + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) LastUpdated(lastUpdated time.Time) ApiPoliciesUniquePasswordListRequest { + r.lastUpdated = &lastUpdated + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) Name(name string) ApiPoliciesUniquePasswordListRequest { + r.name = &name + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) NumHistoricalPasswords(numHistoricalPasswords int32) ApiPoliciesUniquePasswordListRequest { + r.numHistoricalPasswords = &numHistoricalPasswords + return r +} + +// Which field to use when ordering the results. +func (r ApiPoliciesUniquePasswordListRequest) Ordering(ordering string) ApiPoliciesUniquePasswordListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPoliciesUniquePasswordListRequest) Page(page int32) ApiPoliciesUniquePasswordListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPoliciesUniquePasswordListRequest) PageSize(pageSize int32) ApiPoliciesUniquePasswordListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) PasswordField(passwordField string) ApiPoliciesUniquePasswordListRequest { + r.passwordField = &passwordField + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) PolicyUuid(policyUuid string) ApiPoliciesUniquePasswordListRequest { + r.policyUuid = &policyUuid + return r +} + +// A search term. +func (r ApiPoliciesUniquePasswordListRequest) Search(search string) ApiPoliciesUniquePasswordListRequest { + r.search = &search + return r +} + +func (r ApiPoliciesUniquePasswordListRequest) Execute() (*PaginatedUniquePasswordPolicyList, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordListExecute(r) +} + +/* +PoliciesUniquePasswordList Method for PoliciesUniquePasswordList + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPoliciesUniquePasswordListRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordList(ctx context.Context) ApiPoliciesUniquePasswordListRequest { + return ApiPoliciesUniquePasswordListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUniquePasswordPolicyList +func (a *PoliciesAPIService) PoliciesUniquePasswordListExecute(r ApiPoliciesUniquePasswordListRequest) (*PaginatedUniquePasswordPolicyList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUniquePasswordPolicyList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.created != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created", r.created, "form", "") + } + if r.executionLogging != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "execution_logging", r.executionLogging, "form", "") + } + if r.lastUpdated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "last_updated", r.lastUpdated, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.numHistoricalPasswords != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "num_historical_passwords", r.numHistoricalPasswords, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.passwordField != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password_field", r.passwordField, "form", "") + } + if r.policyUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_uuid", r.policyUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordPartialUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + patchedUniquePasswordPolicyRequest *PatchedUniquePasswordPolicyRequest +} + +func (r ApiPoliciesUniquePasswordPartialUpdateRequest) PatchedUniquePasswordPolicyRequest(patchedUniquePasswordPolicyRequest PatchedUniquePasswordPolicyRequest) ApiPoliciesUniquePasswordPartialUpdateRequest { + r.patchedUniquePasswordPolicyRequest = &patchedUniquePasswordPolicyRequest + return r +} + +func (r ApiPoliciesUniquePasswordPartialUpdateRequest) Execute() (*UniquePasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordPartialUpdateExecute(r) +} + +/* +PoliciesUniquePasswordPartialUpdate Method for PoliciesUniquePasswordPartialUpdate + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Uniqueness Policy. + @return ApiPoliciesUniquePasswordPartialUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordPartialUpdate(ctx context.Context, policyUuid string) ApiPoliciesUniquePasswordPartialUpdateRequest { + return ApiPoliciesUniquePasswordPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return UniquePasswordPolicy +func (a *PoliciesAPIService) PoliciesUniquePasswordPartialUpdateExecute(r ApiPoliciesUniquePasswordPartialUpdateRequest) (*UniquePasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UniquePasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUniquePasswordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordRetrieveRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesUniquePasswordRetrieveRequest) Execute() (*UniquePasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordRetrieveExecute(r) +} + +/* +PoliciesUniquePasswordRetrieve Method for PoliciesUniquePasswordRetrieve + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Uniqueness Policy. + @return ApiPoliciesUniquePasswordRetrieveRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordRetrieve(ctx context.Context, policyUuid string) ApiPoliciesUniquePasswordRetrieveRequest { + return ApiPoliciesUniquePasswordRetrieveRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return UniquePasswordPolicy +func (a *PoliciesAPIService) PoliciesUniquePasswordRetrieveExecute(r ApiPoliciesUniquePasswordRetrieveRequest) (*UniquePasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UniquePasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordUpdateRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string + uniquePasswordPolicyRequest *UniquePasswordPolicyRequest +} + +func (r ApiPoliciesUniquePasswordUpdateRequest) UniquePasswordPolicyRequest(uniquePasswordPolicyRequest UniquePasswordPolicyRequest) ApiPoliciesUniquePasswordUpdateRequest { + r.uniquePasswordPolicyRequest = &uniquePasswordPolicyRequest + return r +} + +func (r ApiPoliciesUniquePasswordUpdateRequest) Execute() (*UniquePasswordPolicy, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordUpdateExecute(r) +} + +/* +PoliciesUniquePasswordUpdate Method for PoliciesUniquePasswordUpdate + +Password Uniqueness Policy Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Uniqueness Policy. + @return ApiPoliciesUniquePasswordUpdateRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordUpdate(ctx context.Context, policyUuid string) ApiPoliciesUniquePasswordUpdateRequest { + return ApiPoliciesUniquePasswordUpdateRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return UniquePasswordPolicy +func (a *PoliciesAPIService) PoliciesUniquePasswordUpdateExecute(r ApiPoliciesUniquePasswordUpdateRequest) (*UniquePasswordPolicy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UniquePasswordPolicy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/{policy_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.uniquePasswordPolicyRequest == nil { + return localVarReturnValue, nil, reportError("uniquePasswordPolicyRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.uniquePasswordPolicyRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPoliciesUniquePasswordUsedByListRequest struct { + ctx context.Context + ApiService *PoliciesAPIService + policyUuid string +} + +func (r ApiPoliciesUniquePasswordUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PoliciesUniquePasswordUsedByListExecute(r) +} + +/* +PoliciesUniquePasswordUsedByList Method for PoliciesUniquePasswordUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param policyUuid A UUID string identifying this Password Uniqueness Policy. + @return ApiPoliciesUniquePasswordUsedByListRequest +*/ +func (a *PoliciesAPIService) PoliciesUniquePasswordUsedByList(ctx context.Context, policyUuid string) ApiPoliciesUniquePasswordUsedByListRequest { + return ApiPoliciesUniquePasswordUsedByListRequest{ + ApiService: a, + ctx: ctx, + policyUuid: policyUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PoliciesAPIService) PoliciesUniquePasswordUsedByListExecute(r ApiPoliciesUniquePasswordUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PoliciesAPIService.PoliciesUniquePasswordUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/policies/unique_password/{policy_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"policy_uuid"+"}", url.PathEscape(parameterValueToString(r.policyUuid, "policyUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_propertymappings.go b/packages/client-go/api_propertymappings.go new file mode 100644 index 0000000000..153c18b85e --- /dev/null +++ b/packages/client-go/api_propertymappings.go @@ -0,0 +1,15246 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// PropertymappingsAPIService PropertymappingsAPI service +type PropertymappingsAPIService service + +type ApiPropertymappingsAllDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsAllDestroyExecute(r) +} + +/* +PropertymappingsAllDestroy Method for PropertymappingsAllDestroy + +PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Property Mapping. + @return ApiPropertymappingsAllDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsAllDestroyRequest { + return ApiPropertymappingsAllDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsAllDestroyExecute(r ApiPropertymappingsAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsAllListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsAllListRequest) Managed(managed []string) ApiPropertymappingsAllListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsAllListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsAllListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsAllListRequest) Name(name string) ApiPropertymappingsAllListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsAllListRequest) Ordering(ordering string) ApiPropertymappingsAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsAllListRequest) Page(page int32) ApiPropertymappingsAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsAllListRequest) PageSize(pageSize int32) ApiPropertymappingsAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsAllListRequest) Search(search string) ApiPropertymappingsAllListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsAllListRequest) Execute() (*PaginatedPropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsAllListExecute(r) +} + +/* +PropertymappingsAllList Method for PropertymappingsAllList + +PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsAllListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllList(ctx context.Context) ApiPropertymappingsAllListRequest { + return ApiPropertymappingsAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsAllListExecute(r ApiPropertymappingsAllListRequest) (*PaginatedPropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsAllRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsAllRetrieveRequest) Execute() (*PropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsAllRetrieveExecute(r) +} + +/* +PropertymappingsAllRetrieve Method for PropertymappingsAllRetrieve + +PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Property Mapping. + @return ApiPropertymappingsAllRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsAllRetrieveRequest { + return ApiPropertymappingsAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return PropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsAllRetrieveExecute(r ApiPropertymappingsAllRetrieveRequest) (*PropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsAllTestCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + formatResult *bool + propertyMappingTestRequest *PropertyMappingTestRequest +} + +func (r ApiPropertymappingsAllTestCreateRequest) FormatResult(formatResult bool) ApiPropertymappingsAllTestCreateRequest { + r.formatResult = &formatResult + return r +} + +func (r ApiPropertymappingsAllTestCreateRequest) PropertyMappingTestRequest(propertyMappingTestRequest PropertyMappingTestRequest) ApiPropertymappingsAllTestCreateRequest { + r.propertyMappingTestRequest = &propertyMappingTestRequest + return r +} + +func (r ApiPropertymappingsAllTestCreateRequest) Execute() (*PropertyMappingTestResult, *http.Response, error) { + return r.ApiService.PropertymappingsAllTestCreateExecute(r) +} + +/* +PropertymappingsAllTestCreate Method for PropertymappingsAllTestCreate + +Test Property Mapping + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Property Mapping. + @return ApiPropertymappingsAllTestCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllTestCreate(ctx context.Context, pmUuid string) ApiPropertymappingsAllTestCreateRequest { + return ApiPropertymappingsAllTestCreateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return PropertyMappingTestResult +func (a *PropertymappingsAPIService) PropertymappingsAllTestCreateExecute(r ApiPropertymappingsAllTestCreateRequest) (*PropertyMappingTestResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PropertyMappingTestResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllTestCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/{pm_uuid}/test/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.formatResult != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format_result", r.formatResult, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.propertyMappingTestRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsAllTypesListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService +} + +func (r ApiPropertymappingsAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.PropertymappingsAllTypesListExecute(r) +} + +/* +PropertymappingsAllTypesList Method for PropertymappingsAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsAllTypesListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllTypesList(ctx context.Context) ApiPropertymappingsAllTypesListRequest { + return ApiPropertymappingsAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *PropertymappingsAPIService) PropertymappingsAllTypesListExecute(r ApiPropertymappingsAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsAllUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsAllUsedByListExecute(r) +} + +/* +PropertymappingsAllUsedByList Method for PropertymappingsAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Property Mapping. + @return ApiPropertymappingsAllUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsAllUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsAllUsedByListRequest { + return ApiPropertymappingsAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsAllUsedByListExecute(r ApiPropertymappingsAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/all/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + notificationWebhookMappingRequest *NotificationWebhookMappingRequest +} + +func (r ApiPropertymappingsNotificationCreateRequest) NotificationWebhookMappingRequest(notificationWebhookMappingRequest NotificationWebhookMappingRequest) ApiPropertymappingsNotificationCreateRequest { + r.notificationWebhookMappingRequest = ¬ificationWebhookMappingRequest + return r +} + +func (r ApiPropertymappingsNotificationCreateRequest) Execute() (*NotificationWebhookMapping, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationCreateExecute(r) +} + +/* +PropertymappingsNotificationCreate Method for PropertymappingsNotificationCreate + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsNotificationCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationCreate(ctx context.Context) ApiPropertymappingsNotificationCreateRequest { + return ApiPropertymappingsNotificationCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return NotificationWebhookMapping +func (a *PropertymappingsAPIService) PropertymappingsNotificationCreateExecute(r ApiPropertymappingsNotificationCreateRequest) (*NotificationWebhookMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationWebhookMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationWebhookMappingRequest == nil { + return localVarReturnValue, nil, reportError("notificationWebhookMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationWebhookMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsNotificationDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsNotificationDestroyExecute(r) +} + +/* +PropertymappingsNotificationDestroy Method for PropertymappingsNotificationDestroy + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Webhook Mapping. + @return ApiPropertymappingsNotificationDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsNotificationDestroyRequest { + return ApiPropertymappingsNotificationDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsNotificationDestroyExecute(r ApiPropertymappingsNotificationDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsNotificationListRequest) Name(name string) ApiPropertymappingsNotificationListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsNotificationListRequest) Ordering(ordering string) ApiPropertymappingsNotificationListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsNotificationListRequest) Page(page int32) ApiPropertymappingsNotificationListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsNotificationListRequest) PageSize(pageSize int32) ApiPropertymappingsNotificationListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsNotificationListRequest) Search(search string) ApiPropertymappingsNotificationListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsNotificationListRequest) Execute() (*PaginatedNotificationWebhookMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationListExecute(r) +} + +/* +PropertymappingsNotificationList Method for PropertymappingsNotificationList + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsNotificationListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationList(ctx context.Context) ApiPropertymappingsNotificationListRequest { + return ApiPropertymappingsNotificationListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedNotificationWebhookMappingList +func (a *PropertymappingsAPIService) PropertymappingsNotificationListExecute(r ApiPropertymappingsNotificationListRequest) (*PaginatedNotificationWebhookMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedNotificationWebhookMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedNotificationWebhookMappingRequest *PatchedNotificationWebhookMappingRequest +} + +func (r ApiPropertymappingsNotificationPartialUpdateRequest) PatchedNotificationWebhookMappingRequest(patchedNotificationWebhookMappingRequest PatchedNotificationWebhookMappingRequest) ApiPropertymappingsNotificationPartialUpdateRequest { + r.patchedNotificationWebhookMappingRequest = &patchedNotificationWebhookMappingRequest + return r +} + +func (r ApiPropertymappingsNotificationPartialUpdateRequest) Execute() (*NotificationWebhookMapping, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationPartialUpdateExecute(r) +} + +/* +PropertymappingsNotificationPartialUpdate Method for PropertymappingsNotificationPartialUpdate + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Webhook Mapping. + @return ApiPropertymappingsNotificationPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsNotificationPartialUpdateRequest { + return ApiPropertymappingsNotificationPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return NotificationWebhookMapping +func (a *PropertymappingsAPIService) PropertymappingsNotificationPartialUpdateExecute(r ApiPropertymappingsNotificationPartialUpdateRequest) (*NotificationWebhookMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationWebhookMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedNotificationWebhookMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsNotificationRetrieveRequest) Execute() (*NotificationWebhookMapping, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationRetrieveExecute(r) +} + +/* +PropertymappingsNotificationRetrieve Method for PropertymappingsNotificationRetrieve + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Webhook Mapping. + @return ApiPropertymappingsNotificationRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsNotificationRetrieveRequest { + return ApiPropertymappingsNotificationRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return NotificationWebhookMapping +func (a *PropertymappingsAPIService) PropertymappingsNotificationRetrieveExecute(r ApiPropertymappingsNotificationRetrieveRequest) (*NotificationWebhookMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationWebhookMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + notificationWebhookMappingRequest *NotificationWebhookMappingRequest +} + +func (r ApiPropertymappingsNotificationUpdateRequest) NotificationWebhookMappingRequest(notificationWebhookMappingRequest NotificationWebhookMappingRequest) ApiPropertymappingsNotificationUpdateRequest { + r.notificationWebhookMappingRequest = ¬ificationWebhookMappingRequest + return r +} + +func (r ApiPropertymappingsNotificationUpdateRequest) Execute() (*NotificationWebhookMapping, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationUpdateExecute(r) +} + +/* +PropertymappingsNotificationUpdate Method for PropertymappingsNotificationUpdate + +NotificationWebhookMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Webhook Mapping. + @return ApiPropertymappingsNotificationUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsNotificationUpdateRequest { + return ApiPropertymappingsNotificationUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return NotificationWebhookMapping +func (a *PropertymappingsAPIService) PropertymappingsNotificationUpdateExecute(r ApiPropertymappingsNotificationUpdateRequest) (*NotificationWebhookMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NotificationWebhookMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.notificationWebhookMappingRequest == nil { + return localVarReturnValue, nil, reportError("notificationWebhookMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.notificationWebhookMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsNotificationUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsNotificationUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsNotificationUsedByListExecute(r) +} + +/* +PropertymappingsNotificationUsedByList Method for PropertymappingsNotificationUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Webhook Mapping. + @return ApiPropertymappingsNotificationUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsNotificationUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsNotificationUsedByListRequest { + return ApiPropertymappingsNotificationUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsNotificationUsedByListExecute(r ApiPropertymappingsNotificationUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsNotificationUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/notification/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + googleWorkspaceProviderMappingRequest *GoogleWorkspaceProviderMappingRequest +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceCreateRequest) GoogleWorkspaceProviderMappingRequest(googleWorkspaceProviderMappingRequest GoogleWorkspaceProviderMappingRequest) ApiPropertymappingsProviderGoogleWorkspaceCreateRequest { + r.googleWorkspaceProviderMappingRequest = &googleWorkspaceProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceCreateRequest) Execute() (*GoogleWorkspaceProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceCreateExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceCreate Method for PropertymappingsProviderGoogleWorkspaceCreate + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderGoogleWorkspaceCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceCreate(ctx context.Context) ApiPropertymappingsProviderGoogleWorkspaceCreateRequest { + return ApiPropertymappingsProviderGoogleWorkspaceCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceCreateExecute(r ApiPropertymappingsProviderGoogleWorkspaceCreateRequest) (*GoogleWorkspaceProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderMappingRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceDestroyExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceDestroy Method for PropertymappingsProviderGoogleWorkspaceDestroy + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Google Workspace Provider Mapping. + @return ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest { + return ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceDestroyExecute(r ApiPropertymappingsProviderGoogleWorkspaceDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + expression *string + managed *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + pmUuid *string + search *string +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Expression(expression string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.expression = &expression + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Managed(managed []string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Name(name string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Ordering(ordering string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Page(page int32) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) PmUuid(pmUuid string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.pmUuid = &pmUuid + return r +} + +// A search term. +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Search(search string) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceListRequest) Execute() (*PaginatedGoogleWorkspaceProviderMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceListExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceList Method for PropertymappingsProviderGoogleWorkspaceList + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderGoogleWorkspaceListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceList(ctx context.Context) ApiPropertymappingsProviderGoogleWorkspaceListRequest { + return ApiPropertymappingsProviderGoogleWorkspaceListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleWorkspaceProviderMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceListExecute(r ApiPropertymappingsProviderGoogleWorkspaceListRequest) (*PaginatedGoogleWorkspaceProviderMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleWorkspaceProviderMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.expression != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expression", r.expression, "form", "") + } + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pm_uuid", r.pmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedGoogleWorkspaceProviderMappingRequest *PatchedGoogleWorkspaceProviderMappingRequest +} + +func (r ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest) PatchedGoogleWorkspaceProviderMappingRequest(patchedGoogleWorkspaceProviderMappingRequest PatchedGoogleWorkspaceProviderMappingRequest) ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest { + r.patchedGoogleWorkspaceProviderMappingRequest = &patchedGoogleWorkspaceProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest) Execute() (*GoogleWorkspaceProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspacePartialUpdateExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspacePartialUpdate Method for PropertymappingsProviderGoogleWorkspacePartialUpdate + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Google Workspace Provider Mapping. + @return ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspacePartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest { + return ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspacePartialUpdateExecute(r ApiPropertymappingsProviderGoogleWorkspacePartialUpdateRequest) (*GoogleWorkspaceProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspacePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGoogleWorkspaceProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest) Execute() (*GoogleWorkspaceProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceRetrieveExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceRetrieve Method for PropertymappingsProviderGoogleWorkspaceRetrieve + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Google Workspace Provider Mapping. + @return ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest { + return ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceRetrieveExecute(r ApiPropertymappingsProviderGoogleWorkspaceRetrieveRequest) (*GoogleWorkspaceProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + googleWorkspaceProviderMappingRequest *GoogleWorkspaceProviderMappingRequest +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest) GoogleWorkspaceProviderMappingRequest(googleWorkspaceProviderMappingRequest GoogleWorkspaceProviderMappingRequest) ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest { + r.googleWorkspaceProviderMappingRequest = &googleWorkspaceProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest) Execute() (*GoogleWorkspaceProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceUpdateExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceUpdate Method for PropertymappingsProviderGoogleWorkspaceUpdate + +GoogleWorkspaceProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Google Workspace Provider Mapping. + @return ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest { + return ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceUpdateExecute(r ApiPropertymappingsProviderGoogleWorkspaceUpdateRequest) (*GoogleWorkspaceProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderMappingRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderGoogleWorkspaceUsedByListExecute(r) +} + +/* +PropertymappingsProviderGoogleWorkspaceUsedByList Method for PropertymappingsProviderGoogleWorkspaceUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Google Workspace Provider Mapping. + @return ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest { + return ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderGoogleWorkspaceUsedByListExecute(r ApiPropertymappingsProviderGoogleWorkspaceUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderGoogleWorkspaceUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/google_workspace/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + microsoftEntraProviderMappingRequest *MicrosoftEntraProviderMappingRequest +} + +func (r ApiPropertymappingsProviderMicrosoftEntraCreateRequest) MicrosoftEntraProviderMappingRequest(microsoftEntraProviderMappingRequest MicrosoftEntraProviderMappingRequest) ApiPropertymappingsProviderMicrosoftEntraCreateRequest { + r.microsoftEntraProviderMappingRequest = µsoftEntraProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraCreateRequest) Execute() (*MicrosoftEntraProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraCreateExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraCreate Method for PropertymappingsProviderMicrosoftEntraCreate + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderMicrosoftEntraCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraCreate(ctx context.Context) ApiPropertymappingsProviderMicrosoftEntraCreateRequest { + return ApiPropertymappingsProviderMicrosoftEntraCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraCreateExecute(r ApiPropertymappingsProviderMicrosoftEntraCreateRequest) (*MicrosoftEntraProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderMappingRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderMicrosoftEntraDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraDestroyExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraDestroy Method for PropertymappingsProviderMicrosoftEntraDestroy + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Microsoft Entra Provider Mapping. + @return ApiPropertymappingsProviderMicrosoftEntraDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderMicrosoftEntraDestroyRequest { + return ApiPropertymappingsProviderMicrosoftEntraDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraDestroyExecute(r ApiPropertymappingsProviderMicrosoftEntraDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + expression *string + managed *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + pmUuid *string + search *string +} + +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Expression(expression string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.expression = &expression + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Managed(managed []string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Name(name string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Ordering(ordering string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Page(page int32) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) PmUuid(pmUuid string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.pmUuid = &pmUuid + return r +} + +// A search term. +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Search(search string) ApiPropertymappingsProviderMicrosoftEntraListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraListRequest) Execute() (*PaginatedMicrosoftEntraProviderMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraListExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraList Method for PropertymappingsProviderMicrosoftEntraList + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderMicrosoftEntraListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraList(ctx context.Context) ApiPropertymappingsProviderMicrosoftEntraListRequest { + return ApiPropertymappingsProviderMicrosoftEntraListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedMicrosoftEntraProviderMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraListExecute(r ApiPropertymappingsProviderMicrosoftEntraListRequest) (*PaginatedMicrosoftEntraProviderMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedMicrosoftEntraProviderMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.expression != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expression", r.expression, "form", "") + } + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pm_uuid", r.pmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedMicrosoftEntraProviderMappingRequest *PatchedMicrosoftEntraProviderMappingRequest +} + +func (r ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest) PatchedMicrosoftEntraProviderMappingRequest(patchedMicrosoftEntraProviderMappingRequest PatchedMicrosoftEntraProviderMappingRequest) ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest { + r.patchedMicrosoftEntraProviderMappingRequest = &patchedMicrosoftEntraProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest) Execute() (*MicrosoftEntraProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraPartialUpdateExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraPartialUpdate Method for PropertymappingsProviderMicrosoftEntraPartialUpdate + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Microsoft Entra Provider Mapping. + @return ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest { + return ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraPartialUpdateExecute(r ApiPropertymappingsProviderMicrosoftEntraPartialUpdateRequest) (*MicrosoftEntraProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedMicrosoftEntraProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest) Execute() (*MicrosoftEntraProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraRetrieveExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraRetrieve Method for PropertymappingsProviderMicrosoftEntraRetrieve + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Microsoft Entra Provider Mapping. + @return ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest { + return ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraRetrieveExecute(r ApiPropertymappingsProviderMicrosoftEntraRetrieveRequest) (*MicrosoftEntraProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + microsoftEntraProviderMappingRequest *MicrosoftEntraProviderMappingRequest +} + +func (r ApiPropertymappingsProviderMicrosoftEntraUpdateRequest) MicrosoftEntraProviderMappingRequest(microsoftEntraProviderMappingRequest MicrosoftEntraProviderMappingRequest) ApiPropertymappingsProviderMicrosoftEntraUpdateRequest { + r.microsoftEntraProviderMappingRequest = µsoftEntraProviderMappingRequest + return r +} + +func (r ApiPropertymappingsProviderMicrosoftEntraUpdateRequest) Execute() (*MicrosoftEntraProviderMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraUpdateExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraUpdate Method for PropertymappingsProviderMicrosoftEntraUpdate + +MicrosoftEntraProviderMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Microsoft Entra Provider Mapping. + @return ApiPropertymappingsProviderMicrosoftEntraUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderMicrosoftEntraUpdateRequest { + return ApiPropertymappingsProviderMicrosoftEntraUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraUpdateExecute(r ApiPropertymappingsProviderMicrosoftEntraUpdateRequest) (*MicrosoftEntraProviderMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderMappingRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderMicrosoftEntraUsedByListExecute(r) +} + +/* +PropertymappingsProviderMicrosoftEntraUsedByList Method for PropertymappingsProviderMicrosoftEntraUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Microsoft Entra Provider Mapping. + @return ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest { + return ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderMicrosoftEntraUsedByListExecute(r ApiPropertymappingsProviderMicrosoftEntraUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderMicrosoftEntraUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/microsoft_entra/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + rACPropertyMappingRequest *RACPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRacCreateRequest) RACPropertyMappingRequest(rACPropertyMappingRequest RACPropertyMappingRequest) ApiPropertymappingsProviderRacCreateRequest { + r.rACPropertyMappingRequest = &rACPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRacCreateRequest) Execute() (*RACPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacCreateExecute(r) +} + +/* +PropertymappingsProviderRacCreate Method for PropertymappingsProviderRacCreate + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderRacCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacCreate(ctx context.Context) ApiPropertymappingsProviderRacCreateRequest { + return ApiPropertymappingsProviderRacCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RACPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRacCreateExecute(r ApiPropertymappingsProviderRacCreateRequest) (*RACPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rACPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("rACPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rACPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRacDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderRacDestroyExecute(r) +} + +/* +PropertymappingsProviderRacDestroy Method for PropertymappingsProviderRacDestroy + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this RAC Provider Property Mapping. + @return ApiPropertymappingsProviderRacDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRacDestroyRequest { + return ApiPropertymappingsProviderRacDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderRacDestroyExecute(r ApiPropertymappingsProviderRacDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsProviderRacListRequest) Managed(managed []string) ApiPropertymappingsProviderRacListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderRacListRequest) Name(name string) ApiPropertymappingsProviderRacListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderRacListRequest) Ordering(ordering string) ApiPropertymappingsProviderRacListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderRacListRequest) Page(page int32) ApiPropertymappingsProviderRacListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderRacListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderRacListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsProviderRacListRequest) Search(search string) ApiPropertymappingsProviderRacListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderRacListRequest) Execute() (*PaginatedRACPropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacListExecute(r) +} + +/* +PropertymappingsProviderRacList Method for PropertymappingsProviderRacList + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderRacListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacList(ctx context.Context) ApiPropertymappingsProviderRacListRequest { + return ApiPropertymappingsProviderRacListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRACPropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderRacListExecute(r ApiPropertymappingsProviderRacListRequest) (*PaginatedRACPropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRACPropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedRACPropertyMappingRequest *PatchedRACPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRacPartialUpdateRequest) PatchedRACPropertyMappingRequest(patchedRACPropertyMappingRequest PatchedRACPropertyMappingRequest) ApiPropertymappingsProviderRacPartialUpdateRequest { + r.patchedRACPropertyMappingRequest = &patchedRACPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRacPartialUpdateRequest) Execute() (*RACPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacPartialUpdateExecute(r) +} + +/* +PropertymappingsProviderRacPartialUpdate Method for PropertymappingsProviderRacPartialUpdate + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this RAC Provider Property Mapping. + @return ApiPropertymappingsProviderRacPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRacPartialUpdateRequest { + return ApiPropertymappingsProviderRacPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RACPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRacPartialUpdateExecute(r ApiPropertymappingsProviderRacPartialUpdateRequest) (*RACPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRACPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRacRetrieveRequest) Execute() (*RACPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacRetrieveExecute(r) +} + +/* +PropertymappingsProviderRacRetrieve Method for PropertymappingsProviderRacRetrieve + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this RAC Provider Property Mapping. + @return ApiPropertymappingsProviderRacRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRacRetrieveRequest { + return ApiPropertymappingsProviderRacRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RACPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRacRetrieveExecute(r ApiPropertymappingsProviderRacRetrieveRequest) (*RACPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + rACPropertyMappingRequest *RACPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRacUpdateRequest) RACPropertyMappingRequest(rACPropertyMappingRequest RACPropertyMappingRequest) ApiPropertymappingsProviderRacUpdateRequest { + r.rACPropertyMappingRequest = &rACPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRacUpdateRequest) Execute() (*RACPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacUpdateExecute(r) +} + +/* +PropertymappingsProviderRacUpdate Method for PropertymappingsProviderRacUpdate + +RACPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this RAC Provider Property Mapping. + @return ApiPropertymappingsProviderRacUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRacUpdateRequest { + return ApiPropertymappingsProviderRacUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RACPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRacUpdateExecute(r ApiPropertymappingsProviderRacUpdateRequest) (*RACPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rACPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("rACPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rACPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRacUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRacUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRacUsedByListExecute(r) +} + +/* +PropertymappingsProviderRacUsedByList Method for PropertymappingsProviderRacUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this RAC Provider Property Mapping. + @return ApiPropertymappingsProviderRacUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRacUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRacUsedByListRequest { + return ApiPropertymappingsProviderRacUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderRacUsedByListExecute(r ApiPropertymappingsProviderRacUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRacUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/rac/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + radiusProviderPropertyMappingRequest *RadiusProviderPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRadiusCreateRequest) RadiusProviderPropertyMappingRequest(radiusProviderPropertyMappingRequest RadiusProviderPropertyMappingRequest) ApiPropertymappingsProviderRadiusCreateRequest { + r.radiusProviderPropertyMappingRequest = &radiusProviderPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRadiusCreateRequest) Execute() (*RadiusProviderPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusCreateExecute(r) +} + +/* +PropertymappingsProviderRadiusCreate Method for PropertymappingsProviderRadiusCreate + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderRadiusCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusCreate(ctx context.Context) ApiPropertymappingsProviderRadiusCreateRequest { + return ApiPropertymappingsProviderRadiusCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RadiusProviderPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusCreateExecute(r ApiPropertymappingsProviderRadiusCreateRequest) (*RadiusProviderPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProviderPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.radiusProviderPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("radiusProviderPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.radiusProviderPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRadiusDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusDestroyExecute(r) +} + +/* +PropertymappingsProviderRadiusDestroy Method for PropertymappingsProviderRadiusDestroy + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Radius Provider Property Mapping. + @return ApiPropertymappingsProviderRadiusDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRadiusDestroyRequest { + return ApiPropertymappingsProviderRadiusDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusDestroyExecute(r ApiPropertymappingsProviderRadiusDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsProviderRadiusListRequest) Managed(managed []string) ApiPropertymappingsProviderRadiusListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderRadiusListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsProviderRadiusListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsProviderRadiusListRequest) Name(name string) ApiPropertymappingsProviderRadiusListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderRadiusListRequest) Ordering(ordering string) ApiPropertymappingsProviderRadiusListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderRadiusListRequest) Page(page int32) ApiPropertymappingsProviderRadiusListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderRadiusListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderRadiusListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsProviderRadiusListRequest) Search(search string) ApiPropertymappingsProviderRadiusListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderRadiusListRequest) Execute() (*PaginatedRadiusProviderPropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusListExecute(r) +} + +/* +PropertymappingsProviderRadiusList Method for PropertymappingsProviderRadiusList + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderRadiusListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusList(ctx context.Context) ApiPropertymappingsProviderRadiusListRequest { + return ApiPropertymappingsProviderRadiusListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRadiusProviderPropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusListExecute(r ApiPropertymappingsProviderRadiusListRequest) (*PaginatedRadiusProviderPropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRadiusProviderPropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedRadiusProviderPropertyMappingRequest *PatchedRadiusProviderPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRadiusPartialUpdateRequest) PatchedRadiusProviderPropertyMappingRequest(patchedRadiusProviderPropertyMappingRequest PatchedRadiusProviderPropertyMappingRequest) ApiPropertymappingsProviderRadiusPartialUpdateRequest { + r.patchedRadiusProviderPropertyMappingRequest = &patchedRadiusProviderPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRadiusPartialUpdateRequest) Execute() (*RadiusProviderPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusPartialUpdateExecute(r) +} + +/* +PropertymappingsProviderRadiusPartialUpdate Method for PropertymappingsProviderRadiusPartialUpdate + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Radius Provider Property Mapping. + @return ApiPropertymappingsProviderRadiusPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRadiusPartialUpdateRequest { + return ApiPropertymappingsProviderRadiusPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RadiusProviderPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusPartialUpdateExecute(r ApiPropertymappingsProviderRadiusPartialUpdateRequest) (*RadiusProviderPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProviderPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRadiusProviderPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRadiusRetrieveRequest) Execute() (*RadiusProviderPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusRetrieveExecute(r) +} + +/* +PropertymappingsProviderRadiusRetrieve Method for PropertymappingsProviderRadiusRetrieve + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Radius Provider Property Mapping. + @return ApiPropertymappingsProviderRadiusRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRadiusRetrieveRequest { + return ApiPropertymappingsProviderRadiusRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RadiusProviderPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusRetrieveExecute(r ApiPropertymappingsProviderRadiusRetrieveRequest) (*RadiusProviderPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProviderPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + radiusProviderPropertyMappingRequest *RadiusProviderPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderRadiusUpdateRequest) RadiusProviderPropertyMappingRequest(radiusProviderPropertyMappingRequest RadiusProviderPropertyMappingRequest) ApiPropertymappingsProviderRadiusUpdateRequest { + r.radiusProviderPropertyMappingRequest = &radiusProviderPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderRadiusUpdateRequest) Execute() (*RadiusProviderPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusUpdateExecute(r) +} + +/* +PropertymappingsProviderRadiusUpdate Method for PropertymappingsProviderRadiusUpdate + +RadiusProviderPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Radius Provider Property Mapping. + @return ApiPropertymappingsProviderRadiusUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRadiusUpdateRequest { + return ApiPropertymappingsProviderRadiusUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return RadiusProviderPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusUpdateExecute(r ApiPropertymappingsProviderRadiusUpdateRequest) (*RadiusProviderPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProviderPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.radiusProviderPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("radiusProviderPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.radiusProviderPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderRadiusUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderRadiusUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderRadiusUsedByListExecute(r) +} + +/* +PropertymappingsProviderRadiusUsedByList Method for PropertymappingsProviderRadiusUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Radius Provider Property Mapping. + @return ApiPropertymappingsProviderRadiusUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderRadiusUsedByListRequest { + return ApiPropertymappingsProviderRadiusUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderRadiusUsedByListExecute(r ApiPropertymappingsProviderRadiusUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderRadiusUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/radius/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + sAMLPropertyMappingRequest *SAMLPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderSamlCreateRequest) SAMLPropertyMappingRequest(sAMLPropertyMappingRequest SAMLPropertyMappingRequest) ApiPropertymappingsProviderSamlCreateRequest { + r.sAMLPropertyMappingRequest = &sAMLPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderSamlCreateRequest) Execute() (*SAMLPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlCreateExecute(r) +} + +/* +PropertymappingsProviderSamlCreate Method for PropertymappingsProviderSamlCreate + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderSamlCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlCreate(ctx context.Context) ApiPropertymappingsProviderSamlCreateRequest { + return ApiPropertymappingsProviderSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SAMLPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlCreateExecute(r ApiPropertymappingsProviderSamlCreateRequest) (*SAMLPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sAMLPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlDestroyExecute(r) +} + +/* +PropertymappingsProviderSamlDestroy Method for PropertymappingsProviderSamlDestroy + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Provider Property Mapping. + @return ApiPropertymappingsProviderSamlDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderSamlDestroyRequest { + return ApiPropertymappingsProviderSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlDestroyExecute(r ApiPropertymappingsProviderSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + friendlyName *string + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + samlName *string + search *string +} + +func (r ApiPropertymappingsProviderSamlListRequest) FriendlyName(friendlyName string) ApiPropertymappingsProviderSamlListRequest { + r.friendlyName = &friendlyName + return r +} + +func (r ApiPropertymappingsProviderSamlListRequest) Managed(managed []string) ApiPropertymappingsProviderSamlListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderSamlListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsProviderSamlListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsProviderSamlListRequest) Name(name string) ApiPropertymappingsProviderSamlListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderSamlListRequest) Ordering(ordering string) ApiPropertymappingsProviderSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderSamlListRequest) Page(page int32) ApiPropertymappingsProviderSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderSamlListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderSamlListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPropertymappingsProviderSamlListRequest) SamlName(samlName string) ApiPropertymappingsProviderSamlListRequest { + r.samlName = &samlName + return r +} + +// A search term. +func (r ApiPropertymappingsProviderSamlListRequest) Search(search string) ApiPropertymappingsProviderSamlListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderSamlListRequest) Execute() (*PaginatedSAMLPropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlListExecute(r) +} + +/* +PropertymappingsProviderSamlList Method for PropertymappingsProviderSamlList + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderSamlListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlList(ctx context.Context) ApiPropertymappingsProviderSamlListRequest { + return ApiPropertymappingsProviderSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSAMLPropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlListExecute(r ApiPropertymappingsProviderSamlListRequest) (*PaginatedSAMLPropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSAMLPropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.friendlyName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "friendly_name", r.friendlyName, "form", "") + } + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.samlName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "saml_name", r.samlName, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedSAMLPropertyMappingRequest *PatchedSAMLPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderSamlPartialUpdateRequest) PatchedSAMLPropertyMappingRequest(patchedSAMLPropertyMappingRequest PatchedSAMLPropertyMappingRequest) ApiPropertymappingsProviderSamlPartialUpdateRequest { + r.patchedSAMLPropertyMappingRequest = &patchedSAMLPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderSamlPartialUpdateRequest) Execute() (*SAMLPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlPartialUpdateExecute(r) +} + +/* +PropertymappingsProviderSamlPartialUpdate Method for PropertymappingsProviderSamlPartialUpdate + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Provider Property Mapping. + @return ApiPropertymappingsProviderSamlPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderSamlPartialUpdateRequest { + return ApiPropertymappingsProviderSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlPartialUpdateExecute(r ApiPropertymappingsProviderSamlPartialUpdateRequest) (*SAMLPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSAMLPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderSamlRetrieveRequest) Execute() (*SAMLPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlRetrieveExecute(r) +} + +/* +PropertymappingsProviderSamlRetrieve Method for PropertymappingsProviderSamlRetrieve + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Provider Property Mapping. + @return ApiPropertymappingsProviderSamlRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderSamlRetrieveRequest { + return ApiPropertymappingsProviderSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlRetrieveExecute(r ApiPropertymappingsProviderSamlRetrieveRequest) (*SAMLPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + sAMLPropertyMappingRequest *SAMLPropertyMappingRequest +} + +func (r ApiPropertymappingsProviderSamlUpdateRequest) SAMLPropertyMappingRequest(sAMLPropertyMappingRequest SAMLPropertyMappingRequest) ApiPropertymappingsProviderSamlUpdateRequest { + r.sAMLPropertyMappingRequest = &sAMLPropertyMappingRequest + return r +} + +func (r ApiPropertymappingsProviderSamlUpdateRequest) Execute() (*SAMLPropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlUpdateExecute(r) +} + +/* +PropertymappingsProviderSamlUpdate Method for PropertymappingsProviderSamlUpdate + +SAMLPropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Provider Property Mapping. + @return ApiPropertymappingsProviderSamlUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderSamlUpdateRequest { + return ApiPropertymappingsProviderSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLPropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlUpdateExecute(r ApiPropertymappingsProviderSamlUpdateRequest) (*SAMLPropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLPropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLPropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sAMLPropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLPropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderSamlUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderSamlUsedByListExecute(r) +} + +/* +PropertymappingsProviderSamlUsedByList Method for PropertymappingsProviderSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Provider Property Mapping. + @return ApiPropertymappingsProviderSamlUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderSamlUsedByListRequest { + return ApiPropertymappingsProviderSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderSamlUsedByListExecute(r ApiPropertymappingsProviderSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/saml/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + sCIMMappingRequest *SCIMMappingRequest +} + +func (r ApiPropertymappingsProviderScimCreateRequest) SCIMMappingRequest(sCIMMappingRequest SCIMMappingRequest) ApiPropertymappingsProviderScimCreateRequest { + r.sCIMMappingRequest = &sCIMMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScimCreateRequest) Execute() (*SCIMMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimCreateExecute(r) +} + +/* +PropertymappingsProviderScimCreate Method for PropertymappingsProviderScimCreate + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderScimCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimCreate(ctx context.Context) ApiPropertymappingsProviderScimCreateRequest { + return ApiPropertymappingsProviderScimCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScimCreateExecute(r ApiPropertymappingsProviderScimCreateRequest) (*SCIMMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMMappingRequest == nil { + return localVarReturnValue, nil, reportError("sCIMMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScimDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderScimDestroyExecute(r) +} + +/* +PropertymappingsProviderScimDestroy Method for PropertymappingsProviderScimDestroy + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Provider Mapping. + @return ApiPropertymappingsProviderScimDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScimDestroyRequest { + return ApiPropertymappingsProviderScimDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderScimDestroyExecute(r ApiPropertymappingsProviderScimDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsProviderScimListRequest) Managed(managed []string) ApiPropertymappingsProviderScimListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderScimListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsProviderScimListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsProviderScimListRequest) Name(name string) ApiPropertymappingsProviderScimListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderScimListRequest) Ordering(ordering string) ApiPropertymappingsProviderScimListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderScimListRequest) Page(page int32) ApiPropertymappingsProviderScimListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderScimListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderScimListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsProviderScimListRequest) Search(search string) ApiPropertymappingsProviderScimListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderScimListRequest) Execute() (*PaginatedSCIMMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimListExecute(r) +} + +/* +PropertymappingsProviderScimList Method for PropertymappingsProviderScimList + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderScimListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimList(ctx context.Context) ApiPropertymappingsProviderScimListRequest { + return ApiPropertymappingsProviderScimListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderScimListExecute(r ApiPropertymappingsProviderScimListRequest) (*PaginatedSCIMMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedSCIMMappingRequest *PatchedSCIMMappingRequest +} + +func (r ApiPropertymappingsProviderScimPartialUpdateRequest) PatchedSCIMMappingRequest(patchedSCIMMappingRequest PatchedSCIMMappingRequest) ApiPropertymappingsProviderScimPartialUpdateRequest { + r.patchedSCIMMappingRequest = &patchedSCIMMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScimPartialUpdateRequest) Execute() (*SCIMMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimPartialUpdateExecute(r) +} + +/* +PropertymappingsProviderScimPartialUpdate Method for PropertymappingsProviderScimPartialUpdate + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Provider Mapping. + @return ApiPropertymappingsProviderScimPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScimPartialUpdateRequest { + return ApiPropertymappingsProviderScimPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScimPartialUpdateExecute(r ApiPropertymappingsProviderScimPartialUpdateRequest) (*SCIMMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScimRetrieveRequest) Execute() (*SCIMMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimRetrieveExecute(r) +} + +/* +PropertymappingsProviderScimRetrieve Method for PropertymappingsProviderScimRetrieve + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Provider Mapping. + @return ApiPropertymappingsProviderScimRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScimRetrieveRequest { + return ApiPropertymappingsProviderScimRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScimRetrieveExecute(r ApiPropertymappingsProviderScimRetrieveRequest) (*SCIMMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + sCIMMappingRequest *SCIMMappingRequest +} + +func (r ApiPropertymappingsProviderScimUpdateRequest) SCIMMappingRequest(sCIMMappingRequest SCIMMappingRequest) ApiPropertymappingsProviderScimUpdateRequest { + r.sCIMMappingRequest = &sCIMMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScimUpdateRequest) Execute() (*SCIMMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimUpdateExecute(r) +} + +/* +PropertymappingsProviderScimUpdate Method for PropertymappingsProviderScimUpdate + +SCIMMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Provider Mapping. + @return ApiPropertymappingsProviderScimUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScimUpdateRequest { + return ApiPropertymappingsProviderScimUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScimUpdateExecute(r ApiPropertymappingsProviderScimUpdateRequest) (*SCIMMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMMappingRequest == nil { + return localVarReturnValue, nil, reportError("sCIMMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScimUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScimUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScimUsedByListExecute(r) +} + +/* +PropertymappingsProviderScimUsedByList Method for PropertymappingsProviderScimUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Provider Mapping. + @return ApiPropertymappingsProviderScimUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScimUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScimUsedByListRequest { + return ApiPropertymappingsProviderScimUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderScimUsedByListExecute(r ApiPropertymappingsProviderScimUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScimUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scim/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + scopeMappingRequest *ScopeMappingRequest +} + +func (r ApiPropertymappingsProviderScopeCreateRequest) ScopeMappingRequest(scopeMappingRequest ScopeMappingRequest) ApiPropertymappingsProviderScopeCreateRequest { + r.scopeMappingRequest = &scopeMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScopeCreateRequest) Execute() (*ScopeMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeCreateExecute(r) +} + +/* +PropertymappingsProviderScopeCreate Method for PropertymappingsProviderScopeCreate + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderScopeCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeCreate(ctx context.Context) ApiPropertymappingsProviderScopeCreateRequest { + return ApiPropertymappingsProviderScopeCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ScopeMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeCreateExecute(r ApiPropertymappingsProviderScopeCreateRequest) (*ScopeMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScopeMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.scopeMappingRequest == nil { + return localVarReturnValue, nil, reportError("scopeMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.scopeMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScopeDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeDestroyExecute(r) +} + +/* +PropertymappingsProviderScopeDestroy Method for PropertymappingsProviderScopeDestroy + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Scope Mapping. + @return ApiPropertymappingsProviderScopeDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScopeDestroyRequest { + return ApiPropertymappingsProviderScopeDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeDestroyExecute(r ApiPropertymappingsProviderScopeDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + scopeName *string + search *string +} + +func (r ApiPropertymappingsProviderScopeListRequest) Managed(managed []string) ApiPropertymappingsProviderScopeListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsProviderScopeListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsProviderScopeListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsProviderScopeListRequest) Name(name string) ApiPropertymappingsProviderScopeListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsProviderScopeListRequest) Ordering(ordering string) ApiPropertymappingsProviderScopeListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsProviderScopeListRequest) Page(page int32) ApiPropertymappingsProviderScopeListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsProviderScopeListRequest) PageSize(pageSize int32) ApiPropertymappingsProviderScopeListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiPropertymappingsProviderScopeListRequest) ScopeName(scopeName string) ApiPropertymappingsProviderScopeListRequest { + r.scopeName = &scopeName + return r +} + +// A search term. +func (r ApiPropertymappingsProviderScopeListRequest) Search(search string) ApiPropertymappingsProviderScopeListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsProviderScopeListRequest) Execute() (*PaginatedScopeMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeListExecute(r) +} + +/* +PropertymappingsProviderScopeList Method for PropertymappingsProviderScopeList + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsProviderScopeListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeList(ctx context.Context) ApiPropertymappingsProviderScopeListRequest { + return ApiPropertymappingsProviderScopeListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedScopeMappingList +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeListExecute(r ApiPropertymappingsProviderScopeListRequest) (*PaginatedScopeMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedScopeMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.scopeName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "scope_name", r.scopeName, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopePartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedScopeMappingRequest *PatchedScopeMappingRequest +} + +func (r ApiPropertymappingsProviderScopePartialUpdateRequest) PatchedScopeMappingRequest(patchedScopeMappingRequest PatchedScopeMappingRequest) ApiPropertymappingsProviderScopePartialUpdateRequest { + r.patchedScopeMappingRequest = &patchedScopeMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScopePartialUpdateRequest) Execute() (*ScopeMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopePartialUpdateExecute(r) +} + +/* +PropertymappingsProviderScopePartialUpdate Method for PropertymappingsProviderScopePartialUpdate + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Scope Mapping. + @return ApiPropertymappingsProviderScopePartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopePartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScopePartialUpdateRequest { + return ApiPropertymappingsProviderScopePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return ScopeMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScopePartialUpdateExecute(r ApiPropertymappingsProviderScopePartialUpdateRequest) (*ScopeMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScopeMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedScopeMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScopeRetrieveRequest) Execute() (*ScopeMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeRetrieveExecute(r) +} + +/* +PropertymappingsProviderScopeRetrieve Method for PropertymappingsProviderScopeRetrieve + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Scope Mapping. + @return ApiPropertymappingsProviderScopeRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScopeRetrieveRequest { + return ApiPropertymappingsProviderScopeRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return ScopeMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeRetrieveExecute(r ApiPropertymappingsProviderScopeRetrieveRequest) (*ScopeMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScopeMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + scopeMappingRequest *ScopeMappingRequest +} + +func (r ApiPropertymappingsProviderScopeUpdateRequest) ScopeMappingRequest(scopeMappingRequest ScopeMappingRequest) ApiPropertymappingsProviderScopeUpdateRequest { + r.scopeMappingRequest = &scopeMappingRequest + return r +} + +func (r ApiPropertymappingsProviderScopeUpdateRequest) Execute() (*ScopeMapping, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeUpdateExecute(r) +} + +/* +PropertymappingsProviderScopeUpdate Method for PropertymappingsProviderScopeUpdate + +ScopeMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Scope Mapping. + @return ApiPropertymappingsProviderScopeUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScopeUpdateRequest { + return ApiPropertymappingsProviderScopeUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return ScopeMapping +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeUpdateExecute(r ApiPropertymappingsProviderScopeUpdateRequest) (*ScopeMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ScopeMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.scopeMappingRequest == nil { + return localVarReturnValue, nil, reportError("scopeMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.scopeMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsProviderScopeUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsProviderScopeUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsProviderScopeUsedByListExecute(r) +} + +/* +PropertymappingsProviderScopeUsedByList Method for PropertymappingsProviderScopeUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Scope Mapping. + @return ApiPropertymappingsProviderScopeUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsProviderScopeUsedByListRequest { + return ApiPropertymappingsProviderScopeUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsProviderScopeUsedByListExecute(r ApiPropertymappingsProviderScopeUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsProviderScopeUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/provider/scope/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + kerberosSourcePropertyMappingRequest *KerberosSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceKerberosCreateRequest) KerberosSourcePropertyMappingRequest(kerberosSourcePropertyMappingRequest KerberosSourcePropertyMappingRequest) ApiPropertymappingsSourceKerberosCreateRequest { + r.kerberosSourcePropertyMappingRequest = &kerberosSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceKerberosCreateRequest) Execute() (*KerberosSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosCreateExecute(r) +} + +/* +PropertymappingsSourceKerberosCreate Method for PropertymappingsSourceKerberosCreate + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceKerberosCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosCreate(ctx context.Context) ApiPropertymappingsSourceKerberosCreateRequest { + return ApiPropertymappingsSourceKerberosCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KerberosSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosCreateExecute(r ApiPropertymappingsSourceKerberosCreateRequest) (*KerberosSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kerberosSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("kerberosSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kerberosSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceKerberosDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosDestroyExecute(r) +} + +/* +PropertymappingsSourceKerberosDestroy Method for PropertymappingsSourceKerberosDestroy + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Kerberos Source Property Mapping. + @return ApiPropertymappingsSourceKerberosDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceKerberosDestroyRequest { + return ApiPropertymappingsSourceKerberosDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosDestroyExecute(r ApiPropertymappingsSourceKerberosDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceKerberosListRequest) Managed(managed []string) ApiPropertymappingsSourceKerberosListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceKerberosListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceKerberosListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceKerberosListRequest) Name(name string) ApiPropertymappingsSourceKerberosListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceKerberosListRequest) Ordering(ordering string) ApiPropertymappingsSourceKerberosListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceKerberosListRequest) Page(page int32) ApiPropertymappingsSourceKerberosListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceKerberosListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceKerberosListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceKerberosListRequest) Search(search string) ApiPropertymappingsSourceKerberosListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceKerberosListRequest) Execute() (*PaginatedKerberosSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosListExecute(r) +} + +/* +PropertymappingsSourceKerberosList Method for PropertymappingsSourceKerberosList + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceKerberosListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosList(ctx context.Context) ApiPropertymappingsSourceKerberosListRequest { + return ApiPropertymappingsSourceKerberosListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedKerberosSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosListExecute(r ApiPropertymappingsSourceKerberosListRequest) (*PaginatedKerberosSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedKerberosSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedKerberosSourcePropertyMappingRequest *PatchedKerberosSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceKerberosPartialUpdateRequest) PatchedKerberosSourcePropertyMappingRequest(patchedKerberosSourcePropertyMappingRequest PatchedKerberosSourcePropertyMappingRequest) ApiPropertymappingsSourceKerberosPartialUpdateRequest { + r.patchedKerberosSourcePropertyMappingRequest = &patchedKerberosSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceKerberosPartialUpdateRequest) Execute() (*KerberosSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceKerberosPartialUpdate Method for PropertymappingsSourceKerberosPartialUpdate + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Kerberos Source Property Mapping. + @return ApiPropertymappingsSourceKerberosPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceKerberosPartialUpdateRequest { + return ApiPropertymappingsSourceKerberosPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return KerberosSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosPartialUpdateExecute(r ApiPropertymappingsSourceKerberosPartialUpdateRequest) (*KerberosSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedKerberosSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceKerberosRetrieveRequest) Execute() (*KerberosSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosRetrieveExecute(r) +} + +/* +PropertymappingsSourceKerberosRetrieve Method for PropertymappingsSourceKerberosRetrieve + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Kerberos Source Property Mapping. + @return ApiPropertymappingsSourceKerberosRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceKerberosRetrieveRequest { + return ApiPropertymappingsSourceKerberosRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return KerberosSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosRetrieveExecute(r ApiPropertymappingsSourceKerberosRetrieveRequest) (*KerberosSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + kerberosSourcePropertyMappingRequest *KerberosSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceKerberosUpdateRequest) KerberosSourcePropertyMappingRequest(kerberosSourcePropertyMappingRequest KerberosSourcePropertyMappingRequest) ApiPropertymappingsSourceKerberosUpdateRequest { + r.kerberosSourcePropertyMappingRequest = &kerberosSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceKerberosUpdateRequest) Execute() (*KerberosSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosUpdateExecute(r) +} + +/* +PropertymappingsSourceKerberosUpdate Method for PropertymappingsSourceKerberosUpdate + +KerberosSource PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Kerberos Source Property Mapping. + @return ApiPropertymappingsSourceKerberosUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceKerberosUpdateRequest { + return ApiPropertymappingsSourceKerberosUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return KerberosSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosUpdateExecute(r ApiPropertymappingsSourceKerberosUpdateRequest) (*KerberosSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kerberosSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("kerberosSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kerberosSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceKerberosUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceKerberosUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceKerberosUsedByListExecute(r) +} + +/* +PropertymappingsSourceKerberosUsedByList Method for PropertymappingsSourceKerberosUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Kerberos Source Property Mapping. + @return ApiPropertymappingsSourceKerberosUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceKerberosUsedByListRequest { + return ApiPropertymappingsSourceKerberosUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceKerberosUsedByListExecute(r ApiPropertymappingsSourceKerberosUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceKerberosUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/kerberos/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + lDAPSourcePropertyMappingRequest *LDAPSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceLdapCreateRequest) LDAPSourcePropertyMappingRequest(lDAPSourcePropertyMappingRequest LDAPSourcePropertyMappingRequest) ApiPropertymappingsSourceLdapCreateRequest { + r.lDAPSourcePropertyMappingRequest = &lDAPSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceLdapCreateRequest) Execute() (*LDAPSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapCreateExecute(r) +} + +/* +PropertymappingsSourceLdapCreate Method for PropertymappingsSourceLdapCreate + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceLdapCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapCreate(ctx context.Context) ApiPropertymappingsSourceLdapCreateRequest { + return ApiPropertymappingsSourceLdapCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LDAPSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapCreateExecute(r ApiPropertymappingsSourceLdapCreateRequest) (*LDAPSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("lDAPSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceLdapDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapDestroyExecute(r) +} + +/* +PropertymappingsSourceLdapDestroy Method for PropertymappingsSourceLdapDestroy + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this LDAP Source Property Mapping. + @return ApiPropertymappingsSourceLdapDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceLdapDestroyRequest { + return ApiPropertymappingsSourceLdapDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapDestroyExecute(r ApiPropertymappingsSourceLdapDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceLdapListRequest) Managed(managed []string) ApiPropertymappingsSourceLdapListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceLdapListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceLdapListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceLdapListRequest) Name(name string) ApiPropertymappingsSourceLdapListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceLdapListRequest) Ordering(ordering string) ApiPropertymappingsSourceLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceLdapListRequest) Page(page int32) ApiPropertymappingsSourceLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceLdapListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceLdapListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceLdapListRequest) Search(search string) ApiPropertymappingsSourceLdapListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceLdapListRequest) Execute() (*PaginatedLDAPSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapListExecute(r) +} + +/* +PropertymappingsSourceLdapList Method for PropertymappingsSourceLdapList + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceLdapListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapList(ctx context.Context) ApiPropertymappingsSourceLdapListRequest { + return ApiPropertymappingsSourceLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLDAPSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapListExecute(r ApiPropertymappingsSourceLdapListRequest) (*PaginatedLDAPSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLDAPSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedLDAPSourcePropertyMappingRequest *PatchedLDAPSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceLdapPartialUpdateRequest) PatchedLDAPSourcePropertyMappingRequest(patchedLDAPSourcePropertyMappingRequest PatchedLDAPSourcePropertyMappingRequest) ApiPropertymappingsSourceLdapPartialUpdateRequest { + r.patchedLDAPSourcePropertyMappingRequest = &patchedLDAPSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceLdapPartialUpdateRequest) Execute() (*LDAPSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceLdapPartialUpdate Method for PropertymappingsSourceLdapPartialUpdate + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this LDAP Source Property Mapping. + @return ApiPropertymappingsSourceLdapPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceLdapPartialUpdateRequest { + return ApiPropertymappingsSourceLdapPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return LDAPSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapPartialUpdateExecute(r ApiPropertymappingsSourceLdapPartialUpdateRequest) (*LDAPSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedLDAPSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceLdapRetrieveRequest) Execute() (*LDAPSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapRetrieveExecute(r) +} + +/* +PropertymappingsSourceLdapRetrieve Method for PropertymappingsSourceLdapRetrieve + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this LDAP Source Property Mapping. + @return ApiPropertymappingsSourceLdapRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceLdapRetrieveRequest { + return ApiPropertymappingsSourceLdapRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return LDAPSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapRetrieveExecute(r ApiPropertymappingsSourceLdapRetrieveRequest) (*LDAPSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + lDAPSourcePropertyMappingRequest *LDAPSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceLdapUpdateRequest) LDAPSourcePropertyMappingRequest(lDAPSourcePropertyMappingRequest LDAPSourcePropertyMappingRequest) ApiPropertymappingsSourceLdapUpdateRequest { + r.lDAPSourcePropertyMappingRequest = &lDAPSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceLdapUpdateRequest) Execute() (*LDAPSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapUpdateExecute(r) +} + +/* +PropertymappingsSourceLdapUpdate Method for PropertymappingsSourceLdapUpdate + +LDAP PropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this LDAP Source Property Mapping. + @return ApiPropertymappingsSourceLdapUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceLdapUpdateRequest { + return ApiPropertymappingsSourceLdapUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return LDAPSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapUpdateExecute(r ApiPropertymappingsSourceLdapUpdateRequest) (*LDAPSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("lDAPSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceLdapUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceLdapUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceLdapUsedByListExecute(r) +} + +/* +PropertymappingsSourceLdapUsedByList Method for PropertymappingsSourceLdapUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this LDAP Source Property Mapping. + @return ApiPropertymappingsSourceLdapUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceLdapUsedByListRequest { + return ApiPropertymappingsSourceLdapUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceLdapUsedByListExecute(r ApiPropertymappingsSourceLdapUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceLdapUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/ldap/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + oAuthSourcePropertyMappingRequest *OAuthSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceOauthCreateRequest) OAuthSourcePropertyMappingRequest(oAuthSourcePropertyMappingRequest OAuthSourcePropertyMappingRequest) ApiPropertymappingsSourceOauthCreateRequest { + r.oAuthSourcePropertyMappingRequest = &oAuthSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceOauthCreateRequest) Execute() (*OAuthSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthCreateExecute(r) +} + +/* +PropertymappingsSourceOauthCreate Method for PropertymappingsSourceOauthCreate + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceOauthCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthCreate(ctx context.Context) ApiPropertymappingsSourceOauthCreateRequest { + return ApiPropertymappingsSourceOauthCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OAuthSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthCreateExecute(r ApiPropertymappingsSourceOauthCreateRequest) (*OAuthSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuthSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("oAuthSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuthSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceOauthDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthDestroyExecute(r) +} + +/* +PropertymappingsSourceOauthDestroy Method for PropertymappingsSourceOauthDestroy + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this OAuth Source Property Mapping. + @return ApiPropertymappingsSourceOauthDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceOauthDestroyRequest { + return ApiPropertymappingsSourceOauthDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthDestroyExecute(r ApiPropertymappingsSourceOauthDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceOauthListRequest) Managed(managed []string) ApiPropertymappingsSourceOauthListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceOauthListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceOauthListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceOauthListRequest) Name(name string) ApiPropertymappingsSourceOauthListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceOauthListRequest) Ordering(ordering string) ApiPropertymappingsSourceOauthListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceOauthListRequest) Page(page int32) ApiPropertymappingsSourceOauthListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceOauthListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceOauthListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceOauthListRequest) Search(search string) ApiPropertymappingsSourceOauthListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceOauthListRequest) Execute() (*PaginatedOAuthSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthListExecute(r) +} + +/* +PropertymappingsSourceOauthList Method for PropertymappingsSourceOauthList + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceOauthListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthList(ctx context.Context) ApiPropertymappingsSourceOauthListRequest { + return ApiPropertymappingsSourceOauthListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedOAuthSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthListExecute(r ApiPropertymappingsSourceOauthListRequest) (*PaginatedOAuthSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedOAuthSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedOAuthSourcePropertyMappingRequest *PatchedOAuthSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceOauthPartialUpdateRequest) PatchedOAuthSourcePropertyMappingRequest(patchedOAuthSourcePropertyMappingRequest PatchedOAuthSourcePropertyMappingRequest) ApiPropertymappingsSourceOauthPartialUpdateRequest { + r.patchedOAuthSourcePropertyMappingRequest = &patchedOAuthSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceOauthPartialUpdateRequest) Execute() (*OAuthSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceOauthPartialUpdate Method for PropertymappingsSourceOauthPartialUpdate + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this OAuth Source Property Mapping. + @return ApiPropertymappingsSourceOauthPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceOauthPartialUpdateRequest { + return ApiPropertymappingsSourceOauthPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return OAuthSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthPartialUpdateExecute(r ApiPropertymappingsSourceOauthPartialUpdateRequest) (*OAuthSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedOAuthSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceOauthRetrieveRequest) Execute() (*OAuthSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthRetrieveExecute(r) +} + +/* +PropertymappingsSourceOauthRetrieve Method for PropertymappingsSourceOauthRetrieve + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this OAuth Source Property Mapping. + @return ApiPropertymappingsSourceOauthRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceOauthRetrieveRequest { + return ApiPropertymappingsSourceOauthRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return OAuthSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthRetrieveExecute(r ApiPropertymappingsSourceOauthRetrieveRequest) (*OAuthSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + oAuthSourcePropertyMappingRequest *OAuthSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceOauthUpdateRequest) OAuthSourcePropertyMappingRequest(oAuthSourcePropertyMappingRequest OAuthSourcePropertyMappingRequest) ApiPropertymappingsSourceOauthUpdateRequest { + r.oAuthSourcePropertyMappingRequest = &oAuthSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceOauthUpdateRequest) Execute() (*OAuthSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthUpdateExecute(r) +} + +/* +PropertymappingsSourceOauthUpdate Method for PropertymappingsSourceOauthUpdate + +OAuthSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this OAuth Source Property Mapping. + @return ApiPropertymappingsSourceOauthUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceOauthUpdateRequest { + return ApiPropertymappingsSourceOauthUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return OAuthSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthUpdateExecute(r ApiPropertymappingsSourceOauthUpdateRequest) (*OAuthSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuthSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("oAuthSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuthSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceOauthUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceOauthUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceOauthUsedByListExecute(r) +} + +/* +PropertymappingsSourceOauthUsedByList Method for PropertymappingsSourceOauthUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this OAuth Source Property Mapping. + @return ApiPropertymappingsSourceOauthUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceOauthUsedByListRequest { + return ApiPropertymappingsSourceOauthUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceOauthUsedByListExecute(r ApiPropertymappingsSourceOauthUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceOauthUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/oauth/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + plexSourcePropertyMappingRequest *PlexSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourcePlexCreateRequest) PlexSourcePropertyMappingRequest(plexSourcePropertyMappingRequest PlexSourcePropertyMappingRequest) ApiPropertymappingsSourcePlexCreateRequest { + r.plexSourcePropertyMappingRequest = &plexSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourcePlexCreateRequest) Execute() (*PlexSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexCreateExecute(r) +} + +/* +PropertymappingsSourcePlexCreate Method for PropertymappingsSourcePlexCreate + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourcePlexCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexCreate(ctx context.Context) ApiPropertymappingsSourcePlexCreateRequest { + return ApiPropertymappingsSourcePlexCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PlexSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexCreateExecute(r ApiPropertymappingsSourcePlexCreateRequest) (*PlexSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("plexSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourcePlexDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexDestroyExecute(r) +} + +/* +PropertymappingsSourcePlexDestroy Method for PropertymappingsSourcePlexDestroy + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Plex Source Property Mapping. + @return ApiPropertymappingsSourcePlexDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourcePlexDestroyRequest { + return ApiPropertymappingsSourcePlexDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexDestroyExecute(r ApiPropertymappingsSourcePlexDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourcePlexListRequest) Managed(managed []string) ApiPropertymappingsSourcePlexListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourcePlexListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourcePlexListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourcePlexListRequest) Name(name string) ApiPropertymappingsSourcePlexListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourcePlexListRequest) Ordering(ordering string) ApiPropertymappingsSourcePlexListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourcePlexListRequest) Page(page int32) ApiPropertymappingsSourcePlexListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourcePlexListRequest) PageSize(pageSize int32) ApiPropertymappingsSourcePlexListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourcePlexListRequest) Search(search string) ApiPropertymappingsSourcePlexListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourcePlexListRequest) Execute() (*PaginatedPlexSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexListExecute(r) +} + +/* +PropertymappingsSourcePlexList Method for PropertymappingsSourcePlexList + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourcePlexListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexList(ctx context.Context) ApiPropertymappingsSourcePlexListRequest { + return ApiPropertymappingsSourcePlexListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPlexSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexListExecute(r ApiPropertymappingsSourcePlexListRequest) (*PaginatedPlexSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPlexSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedPlexSourcePropertyMappingRequest *PatchedPlexSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourcePlexPartialUpdateRequest) PatchedPlexSourcePropertyMappingRequest(patchedPlexSourcePropertyMappingRequest PatchedPlexSourcePropertyMappingRequest) ApiPropertymappingsSourcePlexPartialUpdateRequest { + r.patchedPlexSourcePropertyMappingRequest = &patchedPlexSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourcePlexPartialUpdateRequest) Execute() (*PlexSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexPartialUpdateExecute(r) +} + +/* +PropertymappingsSourcePlexPartialUpdate Method for PropertymappingsSourcePlexPartialUpdate + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Plex Source Property Mapping. + @return ApiPropertymappingsSourcePlexPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourcePlexPartialUpdateRequest { + return ApiPropertymappingsSourcePlexPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return PlexSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexPartialUpdateExecute(r ApiPropertymappingsSourcePlexPartialUpdateRequest) (*PlexSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPlexSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourcePlexRetrieveRequest) Execute() (*PlexSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexRetrieveExecute(r) +} + +/* +PropertymappingsSourcePlexRetrieve Method for PropertymappingsSourcePlexRetrieve + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Plex Source Property Mapping. + @return ApiPropertymappingsSourcePlexRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourcePlexRetrieveRequest { + return ApiPropertymappingsSourcePlexRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return PlexSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexRetrieveExecute(r ApiPropertymappingsSourcePlexRetrieveRequest) (*PlexSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + plexSourcePropertyMappingRequest *PlexSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourcePlexUpdateRequest) PlexSourcePropertyMappingRequest(plexSourcePropertyMappingRequest PlexSourcePropertyMappingRequest) ApiPropertymappingsSourcePlexUpdateRequest { + r.plexSourcePropertyMappingRequest = &plexSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourcePlexUpdateRequest) Execute() (*PlexSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexUpdateExecute(r) +} + +/* +PropertymappingsSourcePlexUpdate Method for PropertymappingsSourcePlexUpdate + +PlexSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Plex Source Property Mapping. + @return ApiPropertymappingsSourcePlexUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourcePlexUpdateRequest { + return ApiPropertymappingsSourcePlexUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return PlexSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexUpdateExecute(r ApiPropertymappingsSourcePlexUpdateRequest) (*PlexSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("plexSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourcePlexUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourcePlexUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourcePlexUsedByListExecute(r) +} + +/* +PropertymappingsSourcePlexUsedByList Method for PropertymappingsSourcePlexUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Plex Source Property Mapping. + @return ApiPropertymappingsSourcePlexUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourcePlexUsedByListRequest { + return ApiPropertymappingsSourcePlexUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourcePlexUsedByListExecute(r ApiPropertymappingsSourcePlexUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourcePlexUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/plex/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + sAMLSourcePropertyMappingRequest *SAMLSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceSamlCreateRequest) SAMLSourcePropertyMappingRequest(sAMLSourcePropertyMappingRequest SAMLSourcePropertyMappingRequest) ApiPropertymappingsSourceSamlCreateRequest { + r.sAMLSourcePropertyMappingRequest = &sAMLSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceSamlCreateRequest) Execute() (*SAMLSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlCreateExecute(r) +} + +/* +PropertymappingsSourceSamlCreate Method for PropertymappingsSourceSamlCreate + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceSamlCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlCreate(ctx context.Context) ApiPropertymappingsSourceSamlCreateRequest { + return ApiPropertymappingsSourceSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SAMLSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlCreateExecute(r ApiPropertymappingsSourceSamlCreateRequest) (*SAMLSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sAMLSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlDestroyExecute(r) +} + +/* +PropertymappingsSourceSamlDestroy Method for PropertymappingsSourceSamlDestroy + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Source Property Mapping. + @return ApiPropertymappingsSourceSamlDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceSamlDestroyRequest { + return ApiPropertymappingsSourceSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlDestroyExecute(r ApiPropertymappingsSourceSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceSamlListRequest) Managed(managed []string) ApiPropertymappingsSourceSamlListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceSamlListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceSamlListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceSamlListRequest) Name(name string) ApiPropertymappingsSourceSamlListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceSamlListRequest) Ordering(ordering string) ApiPropertymappingsSourceSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceSamlListRequest) Page(page int32) ApiPropertymappingsSourceSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceSamlListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceSamlListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceSamlListRequest) Search(search string) ApiPropertymappingsSourceSamlListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceSamlListRequest) Execute() (*PaginatedSAMLSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlListExecute(r) +} + +/* +PropertymappingsSourceSamlList Method for PropertymappingsSourceSamlList + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceSamlListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlList(ctx context.Context) ApiPropertymappingsSourceSamlListRequest { + return ApiPropertymappingsSourceSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSAMLSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlListExecute(r ApiPropertymappingsSourceSamlListRequest) (*PaginatedSAMLSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSAMLSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedSAMLSourcePropertyMappingRequest *PatchedSAMLSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceSamlPartialUpdateRequest) PatchedSAMLSourcePropertyMappingRequest(patchedSAMLSourcePropertyMappingRequest PatchedSAMLSourcePropertyMappingRequest) ApiPropertymappingsSourceSamlPartialUpdateRequest { + r.patchedSAMLSourcePropertyMappingRequest = &patchedSAMLSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceSamlPartialUpdateRequest) Execute() (*SAMLSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceSamlPartialUpdate Method for PropertymappingsSourceSamlPartialUpdate + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Source Property Mapping. + @return ApiPropertymappingsSourceSamlPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceSamlPartialUpdateRequest { + return ApiPropertymappingsSourceSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlPartialUpdateExecute(r ApiPropertymappingsSourceSamlPartialUpdateRequest) (*SAMLSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSAMLSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceSamlRetrieveRequest) Execute() (*SAMLSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlRetrieveExecute(r) +} + +/* +PropertymappingsSourceSamlRetrieve Method for PropertymappingsSourceSamlRetrieve + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Source Property Mapping. + @return ApiPropertymappingsSourceSamlRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceSamlRetrieveRequest { + return ApiPropertymappingsSourceSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlRetrieveExecute(r ApiPropertymappingsSourceSamlRetrieveRequest) (*SAMLSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + sAMLSourcePropertyMappingRequest *SAMLSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceSamlUpdateRequest) SAMLSourcePropertyMappingRequest(sAMLSourcePropertyMappingRequest SAMLSourcePropertyMappingRequest) ApiPropertymappingsSourceSamlUpdateRequest { + r.sAMLSourcePropertyMappingRequest = &sAMLSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceSamlUpdateRequest) Execute() (*SAMLSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlUpdateExecute(r) +} + +/* +PropertymappingsSourceSamlUpdate Method for PropertymappingsSourceSamlUpdate + +SAMLSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Source Property Mapping. + @return ApiPropertymappingsSourceSamlUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceSamlUpdateRequest { + return ApiPropertymappingsSourceSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SAMLSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlUpdateExecute(r ApiPropertymappingsSourceSamlUpdateRequest) (*SAMLSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sAMLSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceSamlUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceSamlUsedByListExecute(r) +} + +/* +PropertymappingsSourceSamlUsedByList Method for PropertymappingsSourceSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SAML Source Property Mapping. + @return ApiPropertymappingsSourceSamlUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceSamlUsedByListRequest { + return ApiPropertymappingsSourceSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceSamlUsedByListExecute(r ApiPropertymappingsSourceSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/saml/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + sCIMSourcePropertyMappingRequest *SCIMSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceScimCreateRequest) SCIMSourcePropertyMappingRequest(sCIMSourcePropertyMappingRequest SCIMSourcePropertyMappingRequest) ApiPropertymappingsSourceScimCreateRequest { + r.sCIMSourcePropertyMappingRequest = &sCIMSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceScimCreateRequest) Execute() (*SCIMSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimCreateExecute(r) +} + +/* +PropertymappingsSourceScimCreate Method for PropertymappingsSourceScimCreate + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceScimCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimCreate(ctx context.Context) ApiPropertymappingsSourceScimCreateRequest { + return ApiPropertymappingsSourceScimCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceScimCreateExecute(r ApiPropertymappingsSourceScimCreateRequest) (*SCIMSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceScimDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceScimDestroyExecute(r) +} + +/* +PropertymappingsSourceScimDestroy Method for PropertymappingsSourceScimDestroy + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Source Property Mapping. + @return ApiPropertymappingsSourceScimDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceScimDestroyRequest { + return ApiPropertymappingsSourceScimDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceScimDestroyExecute(r ApiPropertymappingsSourceScimDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceScimListRequest) Managed(managed []string) ApiPropertymappingsSourceScimListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceScimListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceScimListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceScimListRequest) Name(name string) ApiPropertymappingsSourceScimListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceScimListRequest) Ordering(ordering string) ApiPropertymappingsSourceScimListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceScimListRequest) Page(page int32) ApiPropertymappingsSourceScimListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceScimListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceScimListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceScimListRequest) Search(search string) ApiPropertymappingsSourceScimListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceScimListRequest) Execute() (*PaginatedSCIMSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimListExecute(r) +} + +/* +PropertymappingsSourceScimList Method for PropertymappingsSourceScimList + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceScimListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimList(ctx context.Context) ApiPropertymappingsSourceScimListRequest { + return ApiPropertymappingsSourceScimListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceScimListExecute(r ApiPropertymappingsSourceScimListRequest) (*PaginatedSCIMSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedSCIMSourcePropertyMappingRequest *PatchedSCIMSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceScimPartialUpdateRequest) PatchedSCIMSourcePropertyMappingRequest(patchedSCIMSourcePropertyMappingRequest PatchedSCIMSourcePropertyMappingRequest) ApiPropertymappingsSourceScimPartialUpdateRequest { + r.patchedSCIMSourcePropertyMappingRequest = &patchedSCIMSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceScimPartialUpdateRequest) Execute() (*SCIMSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceScimPartialUpdate Method for PropertymappingsSourceScimPartialUpdate + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Source Property Mapping. + @return ApiPropertymappingsSourceScimPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceScimPartialUpdateRequest { + return ApiPropertymappingsSourceScimPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceScimPartialUpdateExecute(r ApiPropertymappingsSourceScimPartialUpdateRequest) (*SCIMSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceScimRetrieveRequest) Execute() (*SCIMSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimRetrieveExecute(r) +} + +/* +PropertymappingsSourceScimRetrieve Method for PropertymappingsSourceScimRetrieve + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Source Property Mapping. + @return ApiPropertymappingsSourceScimRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceScimRetrieveRequest { + return ApiPropertymappingsSourceScimRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceScimRetrieveExecute(r ApiPropertymappingsSourceScimRetrieveRequest) (*SCIMSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + sCIMSourcePropertyMappingRequest *SCIMSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceScimUpdateRequest) SCIMSourcePropertyMappingRequest(sCIMSourcePropertyMappingRequest SCIMSourcePropertyMappingRequest) ApiPropertymappingsSourceScimUpdateRequest { + r.sCIMSourcePropertyMappingRequest = &sCIMSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceScimUpdateRequest) Execute() (*SCIMSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimUpdateExecute(r) +} + +/* +PropertymappingsSourceScimUpdate Method for PropertymappingsSourceScimUpdate + +SCIMSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Source Property Mapping. + @return ApiPropertymappingsSourceScimUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceScimUpdateRequest { + return ApiPropertymappingsSourceScimUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return SCIMSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceScimUpdateExecute(r ApiPropertymappingsSourceScimUpdateRequest) (*SCIMSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceScimUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceScimUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceScimUsedByListExecute(r) +} + +/* +PropertymappingsSourceScimUsedByList Method for PropertymappingsSourceScimUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this SCIM Source Property Mapping. + @return ApiPropertymappingsSourceScimUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceScimUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceScimUsedByListRequest { + return ApiPropertymappingsSourceScimUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceScimUsedByListExecute(r ApiPropertymappingsSourceScimUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceScimUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/scim/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramCreateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + telegramSourcePropertyMappingRequest *TelegramSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceTelegramCreateRequest) TelegramSourcePropertyMappingRequest(telegramSourcePropertyMappingRequest TelegramSourcePropertyMappingRequest) ApiPropertymappingsSourceTelegramCreateRequest { + r.telegramSourcePropertyMappingRequest = &telegramSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceTelegramCreateRequest) Execute() (*TelegramSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramCreateExecute(r) +} + +/* +PropertymappingsSourceTelegramCreate Method for PropertymappingsSourceTelegramCreate + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceTelegramCreateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramCreate(ctx context.Context) ApiPropertymappingsSourceTelegramCreateRequest { + return ApiPropertymappingsSourceTelegramCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TelegramSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramCreateExecute(r ApiPropertymappingsSourceTelegramCreateRequest) (*TelegramSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.telegramSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("telegramSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.telegramSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramDestroyRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceTelegramDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramDestroyExecute(r) +} + +/* +PropertymappingsSourceTelegramDestroy Method for PropertymappingsSourceTelegramDestroy + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Telegram Source Property Mapping. + @return ApiPropertymappingsSourceTelegramDestroyRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramDestroy(ctx context.Context, pmUuid string) ApiPropertymappingsSourceTelegramDestroyRequest { + return ApiPropertymappingsSourceTelegramDestroyRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramDestroyExecute(r ApiPropertymappingsSourceTelegramDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiPropertymappingsSourceTelegramListRequest) Managed(managed []string) ApiPropertymappingsSourceTelegramListRequest { + r.managed = &managed + return r +} + +func (r ApiPropertymappingsSourceTelegramListRequest) ManagedIsnull(managedIsnull bool) ApiPropertymappingsSourceTelegramListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiPropertymappingsSourceTelegramListRequest) Name(name string) ApiPropertymappingsSourceTelegramListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiPropertymappingsSourceTelegramListRequest) Ordering(ordering string) ApiPropertymappingsSourceTelegramListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiPropertymappingsSourceTelegramListRequest) Page(page int32) ApiPropertymappingsSourceTelegramListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiPropertymappingsSourceTelegramListRequest) PageSize(pageSize int32) ApiPropertymappingsSourceTelegramListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiPropertymappingsSourceTelegramListRequest) Search(search string) ApiPropertymappingsSourceTelegramListRequest { + r.search = &search + return r +} + +func (r ApiPropertymappingsSourceTelegramListRequest) Execute() (*PaginatedTelegramSourcePropertyMappingList, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramListExecute(r) +} + +/* +PropertymappingsSourceTelegramList Method for PropertymappingsSourceTelegramList + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiPropertymappingsSourceTelegramListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramList(ctx context.Context) ApiPropertymappingsSourceTelegramListRequest { + return ApiPropertymappingsSourceTelegramListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTelegramSourcePropertyMappingList +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramListExecute(r ApiPropertymappingsSourceTelegramListRequest) (*PaginatedTelegramSourcePropertyMappingList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTelegramSourcePropertyMappingList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramPartialUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + patchedTelegramSourcePropertyMappingRequest *PatchedTelegramSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceTelegramPartialUpdateRequest) PatchedTelegramSourcePropertyMappingRequest(patchedTelegramSourcePropertyMappingRequest PatchedTelegramSourcePropertyMappingRequest) ApiPropertymappingsSourceTelegramPartialUpdateRequest { + r.patchedTelegramSourcePropertyMappingRequest = &patchedTelegramSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceTelegramPartialUpdateRequest) Execute() (*TelegramSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramPartialUpdateExecute(r) +} + +/* +PropertymappingsSourceTelegramPartialUpdate Method for PropertymappingsSourceTelegramPartialUpdate + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Telegram Source Property Mapping. + @return ApiPropertymappingsSourceTelegramPartialUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramPartialUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceTelegramPartialUpdateRequest { + return ApiPropertymappingsSourceTelegramPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return TelegramSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramPartialUpdateExecute(r ApiPropertymappingsSourceTelegramPartialUpdateRequest) (*TelegramSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTelegramSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramRetrieveRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceTelegramRetrieveRequest) Execute() (*TelegramSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramRetrieveExecute(r) +} + +/* +PropertymappingsSourceTelegramRetrieve Method for PropertymappingsSourceTelegramRetrieve + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Telegram Source Property Mapping. + @return ApiPropertymappingsSourceTelegramRetrieveRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramRetrieve(ctx context.Context, pmUuid string) ApiPropertymappingsSourceTelegramRetrieveRequest { + return ApiPropertymappingsSourceTelegramRetrieveRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return TelegramSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramRetrieveExecute(r ApiPropertymappingsSourceTelegramRetrieveRequest) (*TelegramSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramUpdateRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string + telegramSourcePropertyMappingRequest *TelegramSourcePropertyMappingRequest +} + +func (r ApiPropertymappingsSourceTelegramUpdateRequest) TelegramSourcePropertyMappingRequest(telegramSourcePropertyMappingRequest TelegramSourcePropertyMappingRequest) ApiPropertymappingsSourceTelegramUpdateRequest { + r.telegramSourcePropertyMappingRequest = &telegramSourcePropertyMappingRequest + return r +} + +func (r ApiPropertymappingsSourceTelegramUpdateRequest) Execute() (*TelegramSourcePropertyMapping, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramUpdateExecute(r) +} + +/* +PropertymappingsSourceTelegramUpdate Method for PropertymappingsSourceTelegramUpdate + +TelegramSourcePropertyMapping Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Telegram Source Property Mapping. + @return ApiPropertymappingsSourceTelegramUpdateRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramUpdate(ctx context.Context, pmUuid string) ApiPropertymappingsSourceTelegramUpdateRequest { + return ApiPropertymappingsSourceTelegramUpdateRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return TelegramSourcePropertyMapping +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramUpdateExecute(r ApiPropertymappingsSourceTelegramUpdateRequest) (*TelegramSourcePropertyMapping, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSourcePropertyMapping + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/{pm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.telegramSourcePropertyMappingRequest == nil { + return localVarReturnValue, nil, reportError("telegramSourcePropertyMappingRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.telegramSourcePropertyMappingRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiPropertymappingsSourceTelegramUsedByListRequest struct { + ctx context.Context + ApiService *PropertymappingsAPIService + pmUuid string +} + +func (r ApiPropertymappingsSourceTelegramUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.PropertymappingsSourceTelegramUsedByListExecute(r) +} + +/* +PropertymappingsSourceTelegramUsedByList Method for PropertymappingsSourceTelegramUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pmUuid A UUID string identifying this Telegram Source Property Mapping. + @return ApiPropertymappingsSourceTelegramUsedByListRequest +*/ +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramUsedByList(ctx context.Context, pmUuid string) ApiPropertymappingsSourceTelegramUsedByListRequest { + return ApiPropertymappingsSourceTelegramUsedByListRequest{ + ApiService: a, + ctx: ctx, + pmUuid: pmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *PropertymappingsAPIService) PropertymappingsSourceTelegramUsedByListExecute(r ApiPropertymappingsSourceTelegramUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PropertymappingsAPIService.PropertymappingsSourceTelegramUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/propertymappings/source/telegram/{pm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pm_uuid"+"}", url.PathEscape(parameterValueToString(r.pmUuid, "pmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_providers.go b/packages/client-go/api_providers.go new file mode 100644 index 0000000000..ef5a65d618 --- /dev/null +++ b/packages/client-go/api_providers.go @@ -0,0 +1,17788 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "os" + "reflect" + "strings" +) + +// ProvidersAPIService ProvidersAPI service +type ProvidersAPIService service + +type ApiProvidersAllDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersAllDestroyExecute(r) +} + +/* +ProvidersAllDestroy Method for ProvidersAllDestroy + +Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiProvidersAllDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersAllDestroy(ctx context.Context, id int32) ApiProvidersAllDestroyRequest { + return ApiProvidersAllDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersAllDestroyExecute(r ApiProvidersAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersAllListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + backchannel *bool + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersAllListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersAllListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +// When not set all providers are returned. When set to true, only backchannel providers are returned. When set to false, backchannel providers are excluded +func (r ApiProvidersAllListRequest) Backchannel(backchannel bool) ApiProvidersAllListRequest { + r.backchannel = &backchannel + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersAllListRequest) Ordering(ordering string) ApiProvidersAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersAllListRequest) Page(page int32) ApiProvidersAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersAllListRequest) PageSize(pageSize int32) ApiProvidersAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersAllListRequest) Search(search string) ApiProvidersAllListRequest { + r.search = &search + return r +} + +func (r ApiProvidersAllListRequest) Execute() (*PaginatedProviderList, *http.Response, error) { + return r.ApiService.ProvidersAllListExecute(r) +} + +/* +ProvidersAllList Method for ProvidersAllList + +Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersAllListRequest +*/ +func (a *ProvidersAPIService) ProvidersAllList(ctx context.Context) ApiProvidersAllListRequest { + return ApiProvidersAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProviderList +func (a *ProvidersAPIService) ProvidersAllListExecute(r ApiProvidersAllListRequest) (*PaginatedProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.backchannel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backchannel", r.backchannel, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersAllRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersAllRetrieveRequest) Execute() (*Provider, *http.Response, error) { + return r.ApiService.ProvidersAllRetrieveExecute(r) +} + +/* +ProvidersAllRetrieve Method for ProvidersAllRetrieve + +Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiProvidersAllRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersAllRetrieve(ctx context.Context, id int32) ApiProvidersAllRetrieveRequest { + return ApiProvidersAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Provider +func (a *ProvidersAPIService) ProvidersAllRetrieveExecute(r ApiProvidersAllRetrieveRequest) (*Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersAllTypesListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService +} + +func (r ApiProvidersAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.ProvidersAllTypesListExecute(r) +} + +/* +ProvidersAllTypesList Method for ProvidersAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersAllTypesListRequest +*/ +func (a *ProvidersAPIService) ProvidersAllTypesList(ctx context.Context) ApiProvidersAllTypesListRequest { + return ApiProvidersAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *ProvidersAPIService) ProvidersAllTypesListExecute(r ApiProvidersAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersAllUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersAllUsedByListExecute(r) +} + +/* +ProvidersAllUsedByList Method for ProvidersAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this provider. + @return ApiProvidersAllUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersAllUsedByList(ctx context.Context, id int32) ApiProvidersAllUsedByListRequest { + return ApiProvidersAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersAllUsedByListExecute(r ApiProvidersAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/all/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + googleWorkspaceProviderRequest *GoogleWorkspaceProviderRequest +} + +func (r ApiProvidersGoogleWorkspaceCreateRequest) GoogleWorkspaceProviderRequest(googleWorkspaceProviderRequest GoogleWorkspaceProviderRequest) ApiProvidersGoogleWorkspaceCreateRequest { + r.googleWorkspaceProviderRequest = &googleWorkspaceProviderRequest + return r +} + +func (r ApiProvidersGoogleWorkspaceCreateRequest) Execute() (*GoogleWorkspaceProvider, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceCreateExecute(r) +} + +/* +ProvidersGoogleWorkspaceCreate Method for ProvidersGoogleWorkspaceCreate + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceCreate(ctx context.Context) ApiProvidersGoogleWorkspaceCreateRequest { + return ApiProvidersGoogleWorkspaceCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProvider +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceCreateExecute(r ApiProvidersGoogleWorkspaceCreateRequest) (*GoogleWorkspaceProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersGoogleWorkspaceDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceDestroyExecute(r) +} + +/* +ProvidersGoogleWorkspaceDestroy Method for ProvidersGoogleWorkspaceDestroy + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceDestroy(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceDestroyRequest { + return ApiProvidersGoogleWorkspaceDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceDestroyExecute(r ApiProvidersGoogleWorkspaceDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceGroupsCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + googleWorkspaceProviderGroupRequest *GoogleWorkspaceProviderGroupRequest +} + +func (r ApiProvidersGoogleWorkspaceGroupsCreateRequest) GoogleWorkspaceProviderGroupRequest(googleWorkspaceProviderGroupRequest GoogleWorkspaceProviderGroupRequest) ApiProvidersGoogleWorkspaceGroupsCreateRequest { + r.googleWorkspaceProviderGroupRequest = &googleWorkspaceProviderGroupRequest + return r +} + +func (r ApiProvidersGoogleWorkspaceGroupsCreateRequest) Execute() (*GoogleWorkspaceProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceGroupsCreateExecute(r) +} + +/* +ProvidersGoogleWorkspaceGroupsCreate Method for ProvidersGoogleWorkspaceGroupsCreate + +GoogleWorkspaceProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceGroupsCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsCreate(ctx context.Context) ApiProvidersGoogleWorkspaceGroupsCreateRequest { + return ApiProvidersGoogleWorkspaceGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderGroup +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsCreateExecute(r ApiProvidersGoogleWorkspaceGroupsCreateRequest) (*GoogleWorkspaceProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderGroupRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceGroupsDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceGroupsDestroyExecute(r) +} + +/* +ProvidersGoogleWorkspaceGroupsDestroy Method for ProvidersGoogleWorkspaceGroupsDestroy + +GoogleWorkspaceProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider Group. + @return ApiProvidersGoogleWorkspaceGroupsDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsDestroy(ctx context.Context, id string) ApiProvidersGoogleWorkspaceGroupsDestroyRequest { + return ApiProvidersGoogleWorkspaceGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsDestroyExecute(r ApiProvidersGoogleWorkspaceGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceGroupsListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + groupGroupUuid *string + groupName *string + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string +} + +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) GroupGroupUuid(groupGroupUuid string) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.groupGroupUuid = &groupGroupUuid + return r +} + +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) GroupName(groupName string) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.groupName = &groupName + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) Ordering(ordering string) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) Page(page int32) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) PageSize(pageSize int32) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) ProviderId(providerId int32) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) Search(search string) ApiProvidersGoogleWorkspaceGroupsListRequest { + r.search = &search + return r +} + +func (r ApiProvidersGoogleWorkspaceGroupsListRequest) Execute() (*PaginatedGoogleWorkspaceProviderGroupList, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceGroupsListExecute(r) +} + +/* +ProvidersGoogleWorkspaceGroupsList Method for ProvidersGoogleWorkspaceGroupsList + +GoogleWorkspaceProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceGroupsListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsList(ctx context.Context) ApiProvidersGoogleWorkspaceGroupsListRequest { + return ApiProvidersGoogleWorkspaceGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleWorkspaceProviderGroupList +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsListExecute(r ApiProvidersGoogleWorkspaceGroupsListRequest) (*PaginatedGoogleWorkspaceProviderGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleWorkspaceProviderGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.groupGroupUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__group_uuid", r.groupGroupUuid, "form", "") + } + if r.groupName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__name", r.groupName, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceGroupsRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceGroupsRetrieveRequest) Execute() (*GoogleWorkspaceProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceGroupsRetrieveExecute(r) +} + +/* +ProvidersGoogleWorkspaceGroupsRetrieve Method for ProvidersGoogleWorkspaceGroupsRetrieve + +GoogleWorkspaceProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider Group. + @return ApiProvidersGoogleWorkspaceGroupsRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsRetrieve(ctx context.Context, id string) ApiProvidersGoogleWorkspaceGroupsRetrieveRequest { + return ApiProvidersGoogleWorkspaceGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderGroup +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsRetrieveExecute(r ApiProvidersGoogleWorkspaceGroupsRetrieveRequest) (*GoogleWorkspaceProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceGroupsUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceGroupsUsedByListExecute(r) +} + +/* +ProvidersGoogleWorkspaceGroupsUsedByList Method for ProvidersGoogleWorkspaceGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider Group. + @return ApiProvidersGoogleWorkspaceGroupsUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsUsedByList(ctx context.Context, id string) ApiProvidersGoogleWorkspaceGroupsUsedByListRequest { + return ApiProvidersGoogleWorkspaceGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceGroupsUsedByListExecute(r ApiProvidersGoogleWorkspaceGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_groups/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + delegatedSubject *string + excludeUsersServiceAccount *bool + filterGroup *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersGoogleWorkspaceListRequest) DelegatedSubject(delegatedSubject string) ApiProvidersGoogleWorkspaceListRequest { + r.delegatedSubject = &delegatedSubject + return r +} + +func (r ApiProvidersGoogleWorkspaceListRequest) ExcludeUsersServiceAccount(excludeUsersServiceAccount bool) ApiProvidersGoogleWorkspaceListRequest { + r.excludeUsersServiceAccount = &excludeUsersServiceAccount + return r +} + +func (r ApiProvidersGoogleWorkspaceListRequest) FilterGroup(filterGroup string) ApiProvidersGoogleWorkspaceListRequest { + r.filterGroup = &filterGroup + return r +} + +func (r ApiProvidersGoogleWorkspaceListRequest) Name(name string) ApiProvidersGoogleWorkspaceListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersGoogleWorkspaceListRequest) Ordering(ordering string) ApiProvidersGoogleWorkspaceListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersGoogleWorkspaceListRequest) Page(page int32) ApiProvidersGoogleWorkspaceListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersGoogleWorkspaceListRequest) PageSize(pageSize int32) ApiProvidersGoogleWorkspaceListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersGoogleWorkspaceListRequest) Search(search string) ApiProvidersGoogleWorkspaceListRequest { + r.search = &search + return r +} + +func (r ApiProvidersGoogleWorkspaceListRequest) Execute() (*PaginatedGoogleWorkspaceProviderList, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceListExecute(r) +} + +/* +ProvidersGoogleWorkspaceList Method for ProvidersGoogleWorkspaceList + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceList(ctx context.Context) ApiProvidersGoogleWorkspaceListRequest { + return ApiProvidersGoogleWorkspaceListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleWorkspaceProviderList +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceListExecute(r ApiProvidersGoogleWorkspaceListRequest) (*PaginatedGoogleWorkspaceProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleWorkspaceProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.delegatedSubject != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delegated_subject", r.delegatedSubject, "form", "") + } + if r.excludeUsersServiceAccount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude_users_service_account", r.excludeUsersServiceAccount, "form", "") + } + if r.filterGroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter_group", r.filterGroup, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspacePartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedGoogleWorkspaceProviderRequest *PatchedGoogleWorkspaceProviderRequest +} + +func (r ApiProvidersGoogleWorkspacePartialUpdateRequest) PatchedGoogleWorkspaceProviderRequest(patchedGoogleWorkspaceProviderRequest PatchedGoogleWorkspaceProviderRequest) ApiProvidersGoogleWorkspacePartialUpdateRequest { + r.patchedGoogleWorkspaceProviderRequest = &patchedGoogleWorkspaceProviderRequest + return r +} + +func (r ApiProvidersGoogleWorkspacePartialUpdateRequest) Execute() (*GoogleWorkspaceProvider, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspacePartialUpdateExecute(r) +} + +/* +ProvidersGoogleWorkspacePartialUpdate Method for ProvidersGoogleWorkspacePartialUpdate + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspacePartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspacePartialUpdate(ctx context.Context, id int32) ApiProvidersGoogleWorkspacePartialUpdateRequest { + return ApiProvidersGoogleWorkspacePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProvider +func (a *ProvidersAPIService) ProvidersGoogleWorkspacePartialUpdateExecute(r ApiProvidersGoogleWorkspacePartialUpdateRequest) (*GoogleWorkspaceProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspacePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGoogleWorkspaceProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersGoogleWorkspaceRetrieveRequest) Execute() (*GoogleWorkspaceProvider, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceRetrieveExecute(r) +} + +/* +ProvidersGoogleWorkspaceRetrieve Method for ProvidersGoogleWorkspaceRetrieve + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceRetrieve(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceRetrieveRequest { + return ApiProvidersGoogleWorkspaceRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProvider +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceRetrieveExecute(r ApiProvidersGoogleWorkspaceRetrieveRequest) (*GoogleWorkspaceProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceSyncObjectCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + syncObjectRequest *SyncObjectRequest +} + +func (r ApiProvidersGoogleWorkspaceSyncObjectCreateRequest) SyncObjectRequest(syncObjectRequest SyncObjectRequest) ApiProvidersGoogleWorkspaceSyncObjectCreateRequest { + r.syncObjectRequest = &syncObjectRequest + return r +} + +func (r ApiProvidersGoogleWorkspaceSyncObjectCreateRequest) Execute() (*SyncObjectResult, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceSyncObjectCreateExecute(r) +} + +/* +ProvidersGoogleWorkspaceSyncObjectCreate Method for ProvidersGoogleWorkspaceSyncObjectCreate + +Sync/Re-sync a single user/group object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceSyncObjectCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceSyncObjectCreate(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceSyncObjectCreateRequest { + return ApiProvidersGoogleWorkspaceSyncObjectCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncObjectResult +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceSyncObjectCreateExecute(r ApiProvidersGoogleWorkspaceSyncObjectCreateRequest) (*SyncObjectResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncObjectResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceSyncObjectCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/sync/object/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.syncObjectRequest == nil { + return localVarReturnValue, nil, reportError("syncObjectRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.syncObjectRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest) Execute() (*SyncStatus, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceSyncStatusRetrieveExecute(r) +} + +/* +ProvidersGoogleWorkspaceSyncStatusRetrieve Method for ProvidersGoogleWorkspaceSyncStatusRetrieve + +Get provider's sync status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceSyncStatusRetrieve(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest { + return ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncStatus +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceSyncStatusRetrieveExecute(r ApiProvidersGoogleWorkspaceSyncStatusRetrieveRequest) (*SyncStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceSyncStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/sync/status/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + googleWorkspaceProviderRequest *GoogleWorkspaceProviderRequest +} + +func (r ApiProvidersGoogleWorkspaceUpdateRequest) GoogleWorkspaceProviderRequest(googleWorkspaceProviderRequest GoogleWorkspaceProviderRequest) ApiProvidersGoogleWorkspaceUpdateRequest { + r.googleWorkspaceProviderRequest = &googleWorkspaceProviderRequest + return r +} + +func (r ApiProvidersGoogleWorkspaceUpdateRequest) Execute() (*GoogleWorkspaceProvider, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUpdateExecute(r) +} + +/* +ProvidersGoogleWorkspaceUpdate Method for ProvidersGoogleWorkspaceUpdate + +GoogleWorkspaceProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUpdate(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceUpdateRequest { + return ApiProvidersGoogleWorkspaceUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProvider +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUpdateExecute(r ApiProvidersGoogleWorkspaceUpdateRequest) (*GoogleWorkspaceProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersGoogleWorkspaceUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsedByListExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsedByList Method for ProvidersGoogleWorkspaceUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Google Workspace Provider. + @return ApiProvidersGoogleWorkspaceUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsedByList(ctx context.Context, id int32) ApiProvidersGoogleWorkspaceUsedByListRequest { + return ApiProvidersGoogleWorkspaceUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsedByListExecute(r ApiProvidersGoogleWorkspaceUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsersCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + googleWorkspaceProviderUserRequest *GoogleWorkspaceProviderUserRequest +} + +func (r ApiProvidersGoogleWorkspaceUsersCreateRequest) GoogleWorkspaceProviderUserRequest(googleWorkspaceProviderUserRequest GoogleWorkspaceProviderUserRequest) ApiProvidersGoogleWorkspaceUsersCreateRequest { + r.googleWorkspaceProviderUserRequest = &googleWorkspaceProviderUserRequest + return r +} + +func (r ApiProvidersGoogleWorkspaceUsersCreateRequest) Execute() (*GoogleWorkspaceProviderUser, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsersCreateExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsersCreate Method for ProvidersGoogleWorkspaceUsersCreate + +GoogleWorkspaceProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceUsersCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersCreate(ctx context.Context) ApiProvidersGoogleWorkspaceUsersCreateRequest { + return ApiProvidersGoogleWorkspaceUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderUser +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersCreateExecute(r ApiProvidersGoogleWorkspaceUsersCreateRequest) (*GoogleWorkspaceProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.googleWorkspaceProviderUserRequest == nil { + return localVarReturnValue, nil, reportError("googleWorkspaceProviderUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.googleWorkspaceProviderUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsersDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsersDestroyExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsersDestroy Method for ProvidersGoogleWorkspaceUsersDestroy + +GoogleWorkspaceProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider User. + @return ApiProvidersGoogleWorkspaceUsersDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersDestroy(ctx context.Context, id string) ApiProvidersGoogleWorkspaceUsersDestroyRequest { + return ApiProvidersGoogleWorkspaceUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersDestroyExecute(r ApiProvidersGoogleWorkspaceUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsersListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string + userId *int32 + userUsername *string +} + +// Which field to use when ordering the results. +func (r ApiProvidersGoogleWorkspaceUsersListRequest) Ordering(ordering string) ApiProvidersGoogleWorkspaceUsersListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersGoogleWorkspaceUsersListRequest) Page(page int32) ApiProvidersGoogleWorkspaceUsersListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersGoogleWorkspaceUsersListRequest) PageSize(pageSize int32) ApiProvidersGoogleWorkspaceUsersListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersGoogleWorkspaceUsersListRequest) ProviderId(providerId int32) ApiProvidersGoogleWorkspaceUsersListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersGoogleWorkspaceUsersListRequest) Search(search string) ApiProvidersGoogleWorkspaceUsersListRequest { + r.search = &search + return r +} + +func (r ApiProvidersGoogleWorkspaceUsersListRequest) UserId(userId int32) ApiProvidersGoogleWorkspaceUsersListRequest { + r.userId = &userId + return r +} + +func (r ApiProvidersGoogleWorkspaceUsersListRequest) UserUsername(userUsername string) ApiProvidersGoogleWorkspaceUsersListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiProvidersGoogleWorkspaceUsersListRequest) Execute() (*PaginatedGoogleWorkspaceProviderUserList, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsersListExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsersList Method for ProvidersGoogleWorkspaceUsersList + +GoogleWorkspaceProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersGoogleWorkspaceUsersListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersList(ctx context.Context) ApiProvidersGoogleWorkspaceUsersListRequest { + return ApiProvidersGoogleWorkspaceUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGoogleWorkspaceProviderUserList +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersListExecute(r ApiProvidersGoogleWorkspaceUsersListRequest) (*PaginatedGoogleWorkspaceProviderUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGoogleWorkspaceProviderUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__id", r.userId, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsersRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceUsersRetrieveRequest) Execute() (*GoogleWorkspaceProviderUser, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsersRetrieveExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsersRetrieve Method for ProvidersGoogleWorkspaceUsersRetrieve + +GoogleWorkspaceProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider User. + @return ApiProvidersGoogleWorkspaceUsersRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersRetrieve(ctx context.Context, id string) ApiProvidersGoogleWorkspaceUsersRetrieveRequest { + return ApiProvidersGoogleWorkspaceUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GoogleWorkspaceProviderUser +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersRetrieveExecute(r ApiProvidersGoogleWorkspaceUsersRetrieveRequest) (*GoogleWorkspaceProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GoogleWorkspaceProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersGoogleWorkspaceUsersUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersGoogleWorkspaceUsersUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersGoogleWorkspaceUsersUsedByListExecute(r) +} + +/* +ProvidersGoogleWorkspaceUsersUsedByList Method for ProvidersGoogleWorkspaceUsersUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Google Workspace Provider User. + @return ApiProvidersGoogleWorkspaceUsersUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersUsedByList(ctx context.Context, id string) ApiProvidersGoogleWorkspaceUsersUsedByListRequest { + return ApiProvidersGoogleWorkspaceUsersUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersGoogleWorkspaceUsersUsedByListExecute(r ApiProvidersGoogleWorkspaceUsersUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersGoogleWorkspaceUsersUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/google_workspace_users/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + lDAPProviderRequest *LDAPProviderRequest +} + +func (r ApiProvidersLdapCreateRequest) LDAPProviderRequest(lDAPProviderRequest LDAPProviderRequest) ApiProvidersLdapCreateRequest { + r.lDAPProviderRequest = &lDAPProviderRequest + return r +} + +func (r ApiProvidersLdapCreateRequest) Execute() (*LDAPProvider, *http.Response, error) { + return r.ApiService.ProvidersLdapCreateExecute(r) +} + +/* +ProvidersLdapCreate Method for ProvidersLdapCreate + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersLdapCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapCreate(ctx context.Context) ApiProvidersLdapCreateRequest { + return ApiProvidersLdapCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LDAPProvider +func (a *ProvidersAPIService) ProvidersLdapCreateExecute(r ApiProvidersLdapCreateRequest) (*LDAPProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPProviderRequest == nil { + return localVarReturnValue, nil, reportError("lDAPProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersLdapDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersLdapDestroyExecute(r) +} + +/* +ProvidersLdapDestroy Method for ProvidersLdapDestroy + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiProvidersLdapDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapDestroy(ctx context.Context, id int32) ApiProvidersLdapDestroyRequest { + return ApiProvidersLdapDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersLdapDestroyExecute(r ApiProvidersLdapDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersLdapListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + authorizationFlowSlugIexact *string + baseDnIexact *string + certificateKpUuidIexact *string + certificateNameIexact *string + gidStartNumberIexact *int32 + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + search *string + tlsServerNameIexact *string + uidStartNumberIexact *int32 +} + +func (r ApiProvidersLdapListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersLdapListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +func (r ApiProvidersLdapListRequest) AuthorizationFlowSlugIexact(authorizationFlowSlugIexact string) ApiProvidersLdapListRequest { + r.authorizationFlowSlugIexact = &authorizationFlowSlugIexact + return r +} + +func (r ApiProvidersLdapListRequest) BaseDnIexact(baseDnIexact string) ApiProvidersLdapListRequest { + r.baseDnIexact = &baseDnIexact + return r +} + +func (r ApiProvidersLdapListRequest) CertificateKpUuidIexact(certificateKpUuidIexact string) ApiProvidersLdapListRequest { + r.certificateKpUuidIexact = &certificateKpUuidIexact + return r +} + +func (r ApiProvidersLdapListRequest) CertificateNameIexact(certificateNameIexact string) ApiProvidersLdapListRequest { + r.certificateNameIexact = &certificateNameIexact + return r +} + +func (r ApiProvidersLdapListRequest) GidStartNumberIexact(gidStartNumberIexact int32) ApiProvidersLdapListRequest { + r.gidStartNumberIexact = &gidStartNumberIexact + return r +} + +func (r ApiProvidersLdapListRequest) NameIexact(nameIexact string) ApiProvidersLdapListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersLdapListRequest) Ordering(ordering string) ApiProvidersLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersLdapListRequest) Page(page int32) ApiProvidersLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersLdapListRequest) PageSize(pageSize int32) ApiProvidersLdapListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersLdapListRequest) Search(search string) ApiProvidersLdapListRequest { + r.search = &search + return r +} + +func (r ApiProvidersLdapListRequest) TlsServerNameIexact(tlsServerNameIexact string) ApiProvidersLdapListRequest { + r.tlsServerNameIexact = &tlsServerNameIexact + return r +} + +func (r ApiProvidersLdapListRequest) UidStartNumberIexact(uidStartNumberIexact int32) ApiProvidersLdapListRequest { + r.uidStartNumberIexact = &uidStartNumberIexact + return r +} + +func (r ApiProvidersLdapListRequest) Execute() (*PaginatedLDAPProviderList, *http.Response, error) { + return r.ApiService.ProvidersLdapListExecute(r) +} + +/* +ProvidersLdapList Method for ProvidersLdapList + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersLdapListRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapList(ctx context.Context) ApiProvidersLdapListRequest { + return ApiProvidersLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLDAPProviderList +func (a *ProvidersAPIService) ProvidersLdapListExecute(r ApiProvidersLdapListRequest) (*PaginatedLDAPProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLDAPProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.authorizationFlowSlugIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow__slug__iexact", r.authorizationFlowSlugIexact, "form", "") + } + if r.baseDnIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "base_dn__iexact", r.baseDnIexact, "form", "") + } + if r.certificateKpUuidIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate__kp_uuid__iexact", r.certificateKpUuidIexact, "form", "") + } + if r.certificateNameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate__name__iexact", r.certificateNameIexact, "form", "") + } + if r.gidStartNumberIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "gid_start_number__iexact", r.gidStartNumberIexact, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.tlsServerNameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "tls_server_name__iexact", r.tlsServerNameIexact, "form", "") + } + if r.uidStartNumberIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "uid_start_number__iexact", r.uidStartNumberIexact, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedLDAPProviderRequest *PatchedLDAPProviderRequest +} + +func (r ApiProvidersLdapPartialUpdateRequest) PatchedLDAPProviderRequest(patchedLDAPProviderRequest PatchedLDAPProviderRequest) ApiProvidersLdapPartialUpdateRequest { + r.patchedLDAPProviderRequest = &patchedLDAPProviderRequest + return r +} + +func (r ApiProvidersLdapPartialUpdateRequest) Execute() (*LDAPProvider, *http.Response, error) { + return r.ApiService.ProvidersLdapPartialUpdateExecute(r) +} + +/* +ProvidersLdapPartialUpdate Method for ProvidersLdapPartialUpdate + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiProvidersLdapPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapPartialUpdate(ctx context.Context, id int32) ApiProvidersLdapPartialUpdateRequest { + return ApiProvidersLdapPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LDAPProvider +func (a *ProvidersAPIService) ProvidersLdapPartialUpdateExecute(r ApiProvidersLdapPartialUpdateRequest) (*LDAPProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedLDAPProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersLdapRetrieveRequest) Execute() (*LDAPProvider, *http.Response, error) { + return r.ApiService.ProvidersLdapRetrieveExecute(r) +} + +/* +ProvidersLdapRetrieve Method for ProvidersLdapRetrieve + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiProvidersLdapRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapRetrieve(ctx context.Context, id int32) ApiProvidersLdapRetrieveRequest { + return ApiProvidersLdapRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LDAPProvider +func (a *ProvidersAPIService) ProvidersLdapRetrieveExecute(r ApiProvidersLdapRetrieveRequest) (*LDAPProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + lDAPProviderRequest *LDAPProviderRequest +} + +func (r ApiProvidersLdapUpdateRequest) LDAPProviderRequest(lDAPProviderRequest LDAPProviderRequest) ApiProvidersLdapUpdateRequest { + r.lDAPProviderRequest = &lDAPProviderRequest + return r +} + +func (r ApiProvidersLdapUpdateRequest) Execute() (*LDAPProvider, *http.Response, error) { + return r.ApiService.ProvidersLdapUpdateExecute(r) +} + +/* +ProvidersLdapUpdate Method for ProvidersLdapUpdate + +LDAPProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiProvidersLdapUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapUpdate(ctx context.Context, id int32) ApiProvidersLdapUpdateRequest { + return ApiProvidersLdapUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return LDAPProvider +func (a *ProvidersAPIService) ProvidersLdapUpdateExecute(r ApiProvidersLdapUpdateRequest) (*LDAPProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPProviderRequest == nil { + return localVarReturnValue, nil, reportError("lDAPProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersLdapUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersLdapUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersLdapUsedByListExecute(r) +} + +/* +ProvidersLdapUsedByList Method for ProvidersLdapUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this LDAP Provider. + @return ApiProvidersLdapUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersLdapUsedByList(ctx context.Context, id int32) ApiProvidersLdapUsedByListRequest { + return ApiProvidersLdapUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersLdapUsedByListExecute(r ApiProvidersLdapUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersLdapUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ldap/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + microsoftEntraProviderRequest *MicrosoftEntraProviderRequest +} + +func (r ApiProvidersMicrosoftEntraCreateRequest) MicrosoftEntraProviderRequest(microsoftEntraProviderRequest MicrosoftEntraProviderRequest) ApiProvidersMicrosoftEntraCreateRequest { + r.microsoftEntraProviderRequest = µsoftEntraProviderRequest + return r +} + +func (r ApiProvidersMicrosoftEntraCreateRequest) Execute() (*MicrosoftEntraProvider, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraCreateExecute(r) +} + +/* +ProvidersMicrosoftEntraCreate Method for ProvidersMicrosoftEntraCreate + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraCreate(ctx context.Context) ApiProvidersMicrosoftEntraCreateRequest { + return ApiProvidersMicrosoftEntraCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProvider +func (a *ProvidersAPIService) ProvidersMicrosoftEntraCreateExecute(r ApiProvidersMicrosoftEntraCreateRequest) (*MicrosoftEntraProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersMicrosoftEntraDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraDestroyExecute(r) +} + +/* +ProvidersMicrosoftEntraDestroy Method for ProvidersMicrosoftEntraDestroy + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraDestroy(ctx context.Context, id int32) ApiProvidersMicrosoftEntraDestroyRequest { + return ApiProvidersMicrosoftEntraDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersMicrosoftEntraDestroyExecute(r ApiProvidersMicrosoftEntraDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraGroupsCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + microsoftEntraProviderGroupRequest *MicrosoftEntraProviderGroupRequest +} + +func (r ApiProvidersMicrosoftEntraGroupsCreateRequest) MicrosoftEntraProviderGroupRequest(microsoftEntraProviderGroupRequest MicrosoftEntraProviderGroupRequest) ApiProvidersMicrosoftEntraGroupsCreateRequest { + r.microsoftEntraProviderGroupRequest = µsoftEntraProviderGroupRequest + return r +} + +func (r ApiProvidersMicrosoftEntraGroupsCreateRequest) Execute() (*MicrosoftEntraProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraGroupsCreateExecute(r) +} + +/* +ProvidersMicrosoftEntraGroupsCreate Method for ProvidersMicrosoftEntraGroupsCreate + +MicrosoftEntraProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraGroupsCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsCreate(ctx context.Context) ApiProvidersMicrosoftEntraGroupsCreateRequest { + return ApiProvidersMicrosoftEntraGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderGroup +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsCreateExecute(r ApiProvidersMicrosoftEntraGroupsCreateRequest) (*MicrosoftEntraProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderGroupRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraGroupsDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraGroupsDestroyExecute(r) +} + +/* +ProvidersMicrosoftEntraGroupsDestroy Method for ProvidersMicrosoftEntraGroupsDestroy + +MicrosoftEntraProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider Group. + @return ApiProvidersMicrosoftEntraGroupsDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsDestroy(ctx context.Context, id string) ApiProvidersMicrosoftEntraGroupsDestroyRequest { + return ApiProvidersMicrosoftEntraGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsDestroyExecute(r ApiProvidersMicrosoftEntraGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraGroupsListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + groupGroupUuid *string + groupName *string + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string +} + +func (r ApiProvidersMicrosoftEntraGroupsListRequest) GroupGroupUuid(groupGroupUuid string) ApiProvidersMicrosoftEntraGroupsListRequest { + r.groupGroupUuid = &groupGroupUuid + return r +} + +func (r ApiProvidersMicrosoftEntraGroupsListRequest) GroupName(groupName string) ApiProvidersMicrosoftEntraGroupsListRequest { + r.groupName = &groupName + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersMicrosoftEntraGroupsListRequest) Ordering(ordering string) ApiProvidersMicrosoftEntraGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersMicrosoftEntraGroupsListRequest) Page(page int32) ApiProvidersMicrosoftEntraGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersMicrosoftEntraGroupsListRequest) PageSize(pageSize int32) ApiProvidersMicrosoftEntraGroupsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersMicrosoftEntraGroupsListRequest) ProviderId(providerId int32) ApiProvidersMicrosoftEntraGroupsListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersMicrosoftEntraGroupsListRequest) Search(search string) ApiProvidersMicrosoftEntraGroupsListRequest { + r.search = &search + return r +} + +func (r ApiProvidersMicrosoftEntraGroupsListRequest) Execute() (*PaginatedMicrosoftEntraProviderGroupList, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraGroupsListExecute(r) +} + +/* +ProvidersMicrosoftEntraGroupsList Method for ProvidersMicrosoftEntraGroupsList + +MicrosoftEntraProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraGroupsListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsList(ctx context.Context) ApiProvidersMicrosoftEntraGroupsListRequest { + return ApiProvidersMicrosoftEntraGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedMicrosoftEntraProviderGroupList +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsListExecute(r ApiProvidersMicrosoftEntraGroupsListRequest) (*PaginatedMicrosoftEntraProviderGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedMicrosoftEntraProviderGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.groupGroupUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__group_uuid", r.groupGroupUuid, "form", "") + } + if r.groupName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__name", r.groupName, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraGroupsRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraGroupsRetrieveRequest) Execute() (*MicrosoftEntraProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraGroupsRetrieveExecute(r) +} + +/* +ProvidersMicrosoftEntraGroupsRetrieve Method for ProvidersMicrosoftEntraGroupsRetrieve + +MicrosoftEntraProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider Group. + @return ApiProvidersMicrosoftEntraGroupsRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsRetrieve(ctx context.Context, id string) ApiProvidersMicrosoftEntraGroupsRetrieveRequest { + return ApiProvidersMicrosoftEntraGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderGroup +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsRetrieveExecute(r ApiProvidersMicrosoftEntraGroupsRetrieveRequest) (*MicrosoftEntraProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraGroupsUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraGroupsUsedByListExecute(r) +} + +/* +ProvidersMicrosoftEntraGroupsUsedByList Method for ProvidersMicrosoftEntraGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider Group. + @return ApiProvidersMicrosoftEntraGroupsUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsUsedByList(ctx context.Context, id string) ApiProvidersMicrosoftEntraGroupsUsedByListRequest { + return ApiProvidersMicrosoftEntraGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersMicrosoftEntraGroupsUsedByListExecute(r ApiProvidersMicrosoftEntraGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_groups/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + excludeUsersServiceAccount *bool + filterGroup *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersMicrosoftEntraListRequest) ExcludeUsersServiceAccount(excludeUsersServiceAccount bool) ApiProvidersMicrosoftEntraListRequest { + r.excludeUsersServiceAccount = &excludeUsersServiceAccount + return r +} + +func (r ApiProvidersMicrosoftEntraListRequest) FilterGroup(filterGroup string) ApiProvidersMicrosoftEntraListRequest { + r.filterGroup = &filterGroup + return r +} + +func (r ApiProvidersMicrosoftEntraListRequest) Name(name string) ApiProvidersMicrosoftEntraListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersMicrosoftEntraListRequest) Ordering(ordering string) ApiProvidersMicrosoftEntraListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersMicrosoftEntraListRequest) Page(page int32) ApiProvidersMicrosoftEntraListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersMicrosoftEntraListRequest) PageSize(pageSize int32) ApiProvidersMicrosoftEntraListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersMicrosoftEntraListRequest) Search(search string) ApiProvidersMicrosoftEntraListRequest { + r.search = &search + return r +} + +func (r ApiProvidersMicrosoftEntraListRequest) Execute() (*PaginatedMicrosoftEntraProviderList, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraListExecute(r) +} + +/* +ProvidersMicrosoftEntraList Method for ProvidersMicrosoftEntraList + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraList(ctx context.Context) ApiProvidersMicrosoftEntraListRequest { + return ApiProvidersMicrosoftEntraListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedMicrosoftEntraProviderList +func (a *ProvidersAPIService) ProvidersMicrosoftEntraListExecute(r ApiProvidersMicrosoftEntraListRequest) (*PaginatedMicrosoftEntraProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedMicrosoftEntraProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.excludeUsersServiceAccount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude_users_service_account", r.excludeUsersServiceAccount, "form", "") + } + if r.filterGroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter_group", r.filterGroup, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedMicrosoftEntraProviderRequest *PatchedMicrosoftEntraProviderRequest +} + +func (r ApiProvidersMicrosoftEntraPartialUpdateRequest) PatchedMicrosoftEntraProviderRequest(patchedMicrosoftEntraProviderRequest PatchedMicrosoftEntraProviderRequest) ApiProvidersMicrosoftEntraPartialUpdateRequest { + r.patchedMicrosoftEntraProviderRequest = &patchedMicrosoftEntraProviderRequest + return r +} + +func (r ApiProvidersMicrosoftEntraPartialUpdateRequest) Execute() (*MicrosoftEntraProvider, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraPartialUpdateExecute(r) +} + +/* +ProvidersMicrosoftEntraPartialUpdate Method for ProvidersMicrosoftEntraPartialUpdate + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraPartialUpdate(ctx context.Context, id int32) ApiProvidersMicrosoftEntraPartialUpdateRequest { + return ApiProvidersMicrosoftEntraPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProvider +func (a *ProvidersAPIService) ProvidersMicrosoftEntraPartialUpdateExecute(r ApiProvidersMicrosoftEntraPartialUpdateRequest) (*MicrosoftEntraProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedMicrosoftEntraProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersMicrosoftEntraRetrieveRequest) Execute() (*MicrosoftEntraProvider, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraRetrieveExecute(r) +} + +/* +ProvidersMicrosoftEntraRetrieve Method for ProvidersMicrosoftEntraRetrieve + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraRetrieve(ctx context.Context, id int32) ApiProvidersMicrosoftEntraRetrieveRequest { + return ApiProvidersMicrosoftEntraRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProvider +func (a *ProvidersAPIService) ProvidersMicrosoftEntraRetrieveExecute(r ApiProvidersMicrosoftEntraRetrieveRequest) (*MicrosoftEntraProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraSyncObjectCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + syncObjectRequest *SyncObjectRequest +} + +func (r ApiProvidersMicrosoftEntraSyncObjectCreateRequest) SyncObjectRequest(syncObjectRequest SyncObjectRequest) ApiProvidersMicrosoftEntraSyncObjectCreateRequest { + r.syncObjectRequest = &syncObjectRequest + return r +} + +func (r ApiProvidersMicrosoftEntraSyncObjectCreateRequest) Execute() (*SyncObjectResult, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraSyncObjectCreateExecute(r) +} + +/* +ProvidersMicrosoftEntraSyncObjectCreate Method for ProvidersMicrosoftEntraSyncObjectCreate + +Sync/Re-sync a single user/group object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraSyncObjectCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraSyncObjectCreate(ctx context.Context, id int32) ApiProvidersMicrosoftEntraSyncObjectCreateRequest { + return ApiProvidersMicrosoftEntraSyncObjectCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncObjectResult +func (a *ProvidersAPIService) ProvidersMicrosoftEntraSyncObjectCreateExecute(r ApiProvidersMicrosoftEntraSyncObjectCreateRequest) (*SyncObjectResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncObjectResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraSyncObjectCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/sync/object/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.syncObjectRequest == nil { + return localVarReturnValue, nil, reportError("syncObjectRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.syncObjectRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest) Execute() (*SyncStatus, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraSyncStatusRetrieveExecute(r) +} + +/* +ProvidersMicrosoftEntraSyncStatusRetrieve Method for ProvidersMicrosoftEntraSyncStatusRetrieve + +Get provider's sync status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraSyncStatusRetrieve(ctx context.Context, id int32) ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest { + return ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncStatus +func (a *ProvidersAPIService) ProvidersMicrosoftEntraSyncStatusRetrieveExecute(r ApiProvidersMicrosoftEntraSyncStatusRetrieveRequest) (*SyncStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraSyncStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/sync/status/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + microsoftEntraProviderRequest *MicrosoftEntraProviderRequest +} + +func (r ApiProvidersMicrosoftEntraUpdateRequest) MicrosoftEntraProviderRequest(microsoftEntraProviderRequest MicrosoftEntraProviderRequest) ApiProvidersMicrosoftEntraUpdateRequest { + r.microsoftEntraProviderRequest = µsoftEntraProviderRequest + return r +} + +func (r ApiProvidersMicrosoftEntraUpdateRequest) Execute() (*MicrosoftEntraProvider, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUpdateExecute(r) +} + +/* +ProvidersMicrosoftEntraUpdate Method for ProvidersMicrosoftEntraUpdate + +MicrosoftEntraProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUpdate(ctx context.Context, id int32) ApiProvidersMicrosoftEntraUpdateRequest { + return ApiProvidersMicrosoftEntraUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProvider +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUpdateExecute(r ApiProvidersMicrosoftEntraUpdateRequest) (*MicrosoftEntraProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersMicrosoftEntraUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsedByListExecute(r) +} + +/* +ProvidersMicrosoftEntraUsedByList Method for ProvidersMicrosoftEntraUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Microsoft Entra Provider. + @return ApiProvidersMicrosoftEntraUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsedByList(ctx context.Context, id int32) ApiProvidersMicrosoftEntraUsedByListRequest { + return ApiProvidersMicrosoftEntraUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsedByListExecute(r ApiProvidersMicrosoftEntraUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsersCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + microsoftEntraProviderUserRequest *MicrosoftEntraProviderUserRequest +} + +func (r ApiProvidersMicrosoftEntraUsersCreateRequest) MicrosoftEntraProviderUserRequest(microsoftEntraProviderUserRequest MicrosoftEntraProviderUserRequest) ApiProvidersMicrosoftEntraUsersCreateRequest { + r.microsoftEntraProviderUserRequest = µsoftEntraProviderUserRequest + return r +} + +func (r ApiProvidersMicrosoftEntraUsersCreateRequest) Execute() (*MicrosoftEntraProviderUser, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsersCreateExecute(r) +} + +/* +ProvidersMicrosoftEntraUsersCreate Method for ProvidersMicrosoftEntraUsersCreate + +MicrosoftEntraProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraUsersCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersCreate(ctx context.Context) ApiProvidersMicrosoftEntraUsersCreateRequest { + return ApiProvidersMicrosoftEntraUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderUser +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersCreateExecute(r ApiProvidersMicrosoftEntraUsersCreateRequest) (*MicrosoftEntraProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.microsoftEntraProviderUserRequest == nil { + return localVarReturnValue, nil, reportError("microsoftEntraProviderUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.microsoftEntraProviderUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsersDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsersDestroyExecute(r) +} + +/* +ProvidersMicrosoftEntraUsersDestroy Method for ProvidersMicrosoftEntraUsersDestroy + +MicrosoftEntraProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider User. + @return ApiProvidersMicrosoftEntraUsersDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersDestroy(ctx context.Context, id string) ApiProvidersMicrosoftEntraUsersDestroyRequest { + return ApiProvidersMicrosoftEntraUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersDestroyExecute(r ApiProvidersMicrosoftEntraUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsersListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string + userId *int32 + userUsername *string +} + +// Which field to use when ordering the results. +func (r ApiProvidersMicrosoftEntraUsersListRequest) Ordering(ordering string) ApiProvidersMicrosoftEntraUsersListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersMicrosoftEntraUsersListRequest) Page(page int32) ApiProvidersMicrosoftEntraUsersListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersMicrosoftEntraUsersListRequest) PageSize(pageSize int32) ApiProvidersMicrosoftEntraUsersListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersMicrosoftEntraUsersListRequest) ProviderId(providerId int32) ApiProvidersMicrosoftEntraUsersListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersMicrosoftEntraUsersListRequest) Search(search string) ApiProvidersMicrosoftEntraUsersListRequest { + r.search = &search + return r +} + +func (r ApiProvidersMicrosoftEntraUsersListRequest) UserId(userId int32) ApiProvidersMicrosoftEntraUsersListRequest { + r.userId = &userId + return r +} + +func (r ApiProvidersMicrosoftEntraUsersListRequest) UserUsername(userUsername string) ApiProvidersMicrosoftEntraUsersListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiProvidersMicrosoftEntraUsersListRequest) Execute() (*PaginatedMicrosoftEntraProviderUserList, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsersListExecute(r) +} + +/* +ProvidersMicrosoftEntraUsersList Method for ProvidersMicrosoftEntraUsersList + +MicrosoftEntraProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersMicrosoftEntraUsersListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersList(ctx context.Context) ApiProvidersMicrosoftEntraUsersListRequest { + return ApiProvidersMicrosoftEntraUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedMicrosoftEntraProviderUserList +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersListExecute(r ApiProvidersMicrosoftEntraUsersListRequest) (*PaginatedMicrosoftEntraProviderUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedMicrosoftEntraProviderUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__id", r.userId, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsersRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraUsersRetrieveRequest) Execute() (*MicrosoftEntraProviderUser, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsersRetrieveExecute(r) +} + +/* +ProvidersMicrosoftEntraUsersRetrieve Method for ProvidersMicrosoftEntraUsersRetrieve + +MicrosoftEntraProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider User. + @return ApiProvidersMicrosoftEntraUsersRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersRetrieve(ctx context.Context, id string) ApiProvidersMicrosoftEntraUsersRetrieveRequest { + return ApiProvidersMicrosoftEntraUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return MicrosoftEntraProviderUser +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersRetrieveExecute(r ApiProvidersMicrosoftEntraUsersRetrieveRequest) (*MicrosoftEntraProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MicrosoftEntraProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersMicrosoftEntraUsersUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersMicrosoftEntraUsersUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersMicrosoftEntraUsersUsedByListExecute(r) +} + +/* +ProvidersMicrosoftEntraUsersUsedByList Method for ProvidersMicrosoftEntraUsersUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Microsoft Entra Provider User. + @return ApiProvidersMicrosoftEntraUsersUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersUsedByList(ctx context.Context, id string) ApiProvidersMicrosoftEntraUsersUsedByListRequest { + return ApiProvidersMicrosoftEntraUsersUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersMicrosoftEntraUsersUsedByListExecute(r ApiProvidersMicrosoftEntraUsersUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersMicrosoftEntraUsersUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/microsoft_entra_users/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2CreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + oAuth2ProviderRequest *OAuth2ProviderRequest +} + +func (r ApiProvidersOauth2CreateRequest) OAuth2ProviderRequest(oAuth2ProviderRequest OAuth2ProviderRequest) ApiProvidersOauth2CreateRequest { + r.oAuth2ProviderRequest = &oAuth2ProviderRequest + return r +} + +func (r ApiProvidersOauth2CreateRequest) Execute() (*OAuth2Provider, *http.Response, error) { + return r.ApiService.ProvidersOauth2CreateExecute(r) +} + +/* +ProvidersOauth2Create Method for ProvidersOauth2Create + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersOauth2CreateRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2Create(ctx context.Context) ApiProvidersOauth2CreateRequest { + return ApiProvidersOauth2CreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OAuth2Provider +func (a *ProvidersAPIService) ProvidersOauth2CreateExecute(r ApiProvidersOauth2CreateRequest) (*OAuth2Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuth2Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2Create") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuth2ProviderRequest == nil { + return localVarReturnValue, nil, reportError("oAuth2ProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuth2ProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2DestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersOauth2DestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersOauth2DestroyExecute(r) +} + +/* +ProvidersOauth2Destroy Method for ProvidersOauth2Destroy + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2DestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2Destroy(ctx context.Context, id int32) ApiProvidersOauth2DestroyRequest { + return ApiProvidersOauth2DestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersOauth2DestroyExecute(r ApiProvidersOauth2DestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2Destroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersOauth2ListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + accessCodeValidity *string + accessTokenValidity *string + application *string + authorizationFlow *string + clientId *string + clientType *string + includeClaimsInIdToken *bool + issuerMode *string + name *string + ordering *string + page *int32 + pageSize *int32 + propertyMappings *[]string + refreshTokenValidity *string + search *string + signingKey *string + subMode *string +} + +func (r ApiProvidersOauth2ListRequest) AccessCodeValidity(accessCodeValidity string) ApiProvidersOauth2ListRequest { + r.accessCodeValidity = &accessCodeValidity + return r +} + +func (r ApiProvidersOauth2ListRequest) AccessTokenValidity(accessTokenValidity string) ApiProvidersOauth2ListRequest { + r.accessTokenValidity = &accessTokenValidity + return r +} + +func (r ApiProvidersOauth2ListRequest) Application(application string) ApiProvidersOauth2ListRequest { + r.application = &application + return r +} + +func (r ApiProvidersOauth2ListRequest) AuthorizationFlow(authorizationFlow string) ApiProvidersOauth2ListRequest { + r.authorizationFlow = &authorizationFlow + return r +} + +func (r ApiProvidersOauth2ListRequest) ClientId(clientId string) ApiProvidersOauth2ListRequest { + r.clientId = &clientId + return r +} + +// Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable +func (r ApiProvidersOauth2ListRequest) ClientType(clientType string) ApiProvidersOauth2ListRequest { + r.clientType = &clientType + return r +} + +func (r ApiProvidersOauth2ListRequest) IncludeClaimsInIdToken(includeClaimsInIdToken bool) ApiProvidersOauth2ListRequest { + r.includeClaimsInIdToken = &includeClaimsInIdToken + return r +} + +// Configure how the issuer field of the ID Token should be filled. +func (r ApiProvidersOauth2ListRequest) IssuerMode(issuerMode string) ApiProvidersOauth2ListRequest { + r.issuerMode = &issuerMode + return r +} + +func (r ApiProvidersOauth2ListRequest) Name(name string) ApiProvidersOauth2ListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersOauth2ListRequest) Ordering(ordering string) ApiProvidersOauth2ListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersOauth2ListRequest) Page(page int32) ApiProvidersOauth2ListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersOauth2ListRequest) PageSize(pageSize int32) ApiProvidersOauth2ListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersOauth2ListRequest) PropertyMappings(propertyMappings []string) ApiProvidersOauth2ListRequest { + r.propertyMappings = &propertyMappings + return r +} + +func (r ApiProvidersOauth2ListRequest) RefreshTokenValidity(refreshTokenValidity string) ApiProvidersOauth2ListRequest { + r.refreshTokenValidity = &refreshTokenValidity + return r +} + +// A search term. +func (r ApiProvidersOauth2ListRequest) Search(search string) ApiProvidersOauth2ListRequest { + r.search = &search + return r +} + +func (r ApiProvidersOauth2ListRequest) SigningKey(signingKey string) ApiProvidersOauth2ListRequest { + r.signingKey = &signingKey + return r +} + +// Configure what data should be used as unique User Identifier. For most cases, the default should be fine. +func (r ApiProvidersOauth2ListRequest) SubMode(subMode string) ApiProvidersOauth2ListRequest { + r.subMode = &subMode + return r +} + +func (r ApiProvidersOauth2ListRequest) Execute() (*PaginatedOAuth2ProviderList, *http.Response, error) { + return r.ApiService.ProvidersOauth2ListExecute(r) +} + +/* +ProvidersOauth2List Method for ProvidersOauth2List + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersOauth2ListRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2List(ctx context.Context) ApiProvidersOauth2ListRequest { + return ApiProvidersOauth2ListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedOAuth2ProviderList +func (a *ProvidersAPIService) ProvidersOauth2ListExecute(r ApiProvidersOauth2ListRequest) (*PaginatedOAuth2ProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedOAuth2ProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2List") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.accessCodeValidity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "access_code_validity", r.accessCodeValidity, "form", "") + } + if r.accessTokenValidity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "access_token_validity", r.accessTokenValidity, "form", "") + } + if r.application != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application", r.application, "form", "") + } + if r.authorizationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow", r.authorizationFlow, "form", "") + } + if r.clientId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_id", r.clientId, "form", "") + } + if r.clientType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_type", r.clientType, "form", "") + } + if r.includeClaimsInIdToken != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "include_claims_in_id_token", r.includeClaimsInIdToken, "form", "") + } + if r.issuerMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "issuer_mode", r.issuerMode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.propertyMappings != nil { + t := *r.propertyMappings + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", t, "form", "multi") + } + } + if r.refreshTokenValidity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "refresh_token_validity", r.refreshTokenValidity, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.signingKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signing_key", r.signingKey, "form", "") + } + if r.subMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sub_mode", r.subMode, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2PartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedOAuth2ProviderRequest *PatchedOAuth2ProviderRequest +} + +func (r ApiProvidersOauth2PartialUpdateRequest) PatchedOAuth2ProviderRequest(patchedOAuth2ProviderRequest PatchedOAuth2ProviderRequest) ApiProvidersOauth2PartialUpdateRequest { + r.patchedOAuth2ProviderRequest = &patchedOAuth2ProviderRequest + return r +} + +func (r ApiProvidersOauth2PartialUpdateRequest) Execute() (*OAuth2Provider, *http.Response, error) { + return r.ApiService.ProvidersOauth2PartialUpdateExecute(r) +} + +/* +ProvidersOauth2PartialUpdate Method for ProvidersOauth2PartialUpdate + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2PartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2PartialUpdate(ctx context.Context, id int32) ApiProvidersOauth2PartialUpdateRequest { + return ApiProvidersOauth2PartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return OAuth2Provider +func (a *ProvidersAPIService) ProvidersOauth2PartialUpdateExecute(r ApiProvidersOauth2PartialUpdateRequest) (*OAuth2Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuth2Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2PartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedOAuth2ProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2PreviewUserRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + forUser *int32 +} + +func (r ApiProvidersOauth2PreviewUserRetrieveRequest) ForUser(forUser int32) ApiProvidersOauth2PreviewUserRetrieveRequest { + r.forUser = &forUser + return r +} + +func (r ApiProvidersOauth2PreviewUserRetrieveRequest) Execute() (*PropertyMappingPreview, *http.Response, error) { + return r.ApiService.ProvidersOauth2PreviewUserRetrieveExecute(r) +} + +/* +ProvidersOauth2PreviewUserRetrieve Method for ProvidersOauth2PreviewUserRetrieve + +Preview user data for provider + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2PreviewUserRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2PreviewUserRetrieve(ctx context.Context, id int32) ApiProvidersOauth2PreviewUserRetrieveRequest { + return ApiProvidersOauth2PreviewUserRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PropertyMappingPreview +func (a *ProvidersAPIService) ProvidersOauth2PreviewUserRetrieveExecute(r ApiProvidersOauth2PreviewUserRetrieveRequest) (*PropertyMappingPreview, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PropertyMappingPreview + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2PreviewUserRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/preview_user/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_user", r.forUser, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2RetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersOauth2RetrieveRequest) Execute() (*OAuth2Provider, *http.Response, error) { + return r.ApiService.ProvidersOauth2RetrieveExecute(r) +} + +/* +ProvidersOauth2Retrieve Method for ProvidersOauth2Retrieve + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2RetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2Retrieve(ctx context.Context, id int32) ApiProvidersOauth2RetrieveRequest { + return ApiProvidersOauth2RetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return OAuth2Provider +func (a *ProvidersAPIService) ProvidersOauth2RetrieveExecute(r ApiProvidersOauth2RetrieveRequest) (*OAuth2Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuth2Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2Retrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2SetupUrlsRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersOauth2SetupUrlsRetrieveRequest) Execute() (*OAuth2ProviderSetupURLs, *http.Response, error) { + return r.ApiService.ProvidersOauth2SetupUrlsRetrieveExecute(r) +} + +/* +ProvidersOauth2SetupUrlsRetrieve Method for ProvidersOauth2SetupUrlsRetrieve + +Get Providers setup URLs + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2SetupUrlsRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2SetupUrlsRetrieve(ctx context.Context, id int32) ApiProvidersOauth2SetupUrlsRetrieveRequest { + return ApiProvidersOauth2SetupUrlsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return OAuth2ProviderSetupURLs +func (a *ProvidersAPIService) ProvidersOauth2SetupUrlsRetrieveExecute(r ApiProvidersOauth2SetupUrlsRetrieveRequest) (*OAuth2ProviderSetupURLs, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuth2ProviderSetupURLs + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2SetupUrlsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/setup_urls/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2UpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + oAuth2ProviderRequest *OAuth2ProviderRequest +} + +func (r ApiProvidersOauth2UpdateRequest) OAuth2ProviderRequest(oAuth2ProviderRequest OAuth2ProviderRequest) ApiProvidersOauth2UpdateRequest { + r.oAuth2ProviderRequest = &oAuth2ProviderRequest + return r +} + +func (r ApiProvidersOauth2UpdateRequest) Execute() (*OAuth2Provider, *http.Response, error) { + return r.ApiService.ProvidersOauth2UpdateExecute(r) +} + +/* +ProvidersOauth2Update Method for ProvidersOauth2Update + +OAuth2Provider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2UpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2Update(ctx context.Context, id int32) ApiProvidersOauth2UpdateRequest { + return ApiProvidersOauth2UpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return OAuth2Provider +func (a *ProvidersAPIService) ProvidersOauth2UpdateExecute(r ApiProvidersOauth2UpdateRequest) (*OAuth2Provider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuth2Provider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2Update") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuth2ProviderRequest == nil { + return localVarReturnValue, nil, reportError("oAuth2ProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuth2ProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersOauth2UsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersOauth2UsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersOauth2UsedByListExecute(r) +} + +/* +ProvidersOauth2UsedByList Method for ProvidersOauth2UsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this OAuth2/OpenID Provider. + @return ApiProvidersOauth2UsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersOauth2UsedByList(ctx context.Context, id int32) ApiProvidersOauth2UsedByListRequest { + return ApiProvidersOauth2UsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersOauth2UsedByListExecute(r ApiProvidersOauth2UsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersOauth2UsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/oauth2/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + proxyProviderRequest *ProxyProviderRequest +} + +func (r ApiProvidersProxyCreateRequest) ProxyProviderRequest(proxyProviderRequest ProxyProviderRequest) ApiProvidersProxyCreateRequest { + r.proxyProviderRequest = &proxyProviderRequest + return r +} + +func (r ApiProvidersProxyCreateRequest) Execute() (*ProxyProvider, *http.Response, error) { + return r.ApiService.ProvidersProxyCreateExecute(r) +} + +/* +ProvidersProxyCreate Method for ProvidersProxyCreate + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersProxyCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyCreate(ctx context.Context) ApiProvidersProxyCreateRequest { + return ApiProvidersProxyCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ProxyProvider +func (a *ProvidersAPIService) ProvidersProxyCreateExecute(r ApiProvidersProxyCreateRequest) (*ProxyProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProxyProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.proxyProviderRequest == nil { + return localVarReturnValue, nil, reportError("proxyProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.proxyProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersProxyDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersProxyDestroyExecute(r) +} + +/* +ProvidersProxyDestroy Method for ProvidersProxyDestroy + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Proxy Provider. + @return ApiProvidersProxyDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyDestroy(ctx context.Context, id int32) ApiProvidersProxyDestroyRequest { + return ApiProvidersProxyDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersProxyDestroyExecute(r ApiProvidersProxyDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersProxyListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + authorizationFlowSlugIexact *string + basicAuthEnabledIexact *bool + basicAuthPasswordAttributeIexact *string + basicAuthUserAttributeIexact *string + certificateKpUuidIexact *string + certificateNameIexact *string + cookieDomainIexact *string + externalHostIexact *string + internalHostIexact *string + internalHostSslValidationIexact *bool + modeIexact *string + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + propertyMappingsIexact *[]string + search *string + skipPathRegexIexact *string +} + +func (r ApiProvidersProxyListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersProxyListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +func (r ApiProvidersProxyListRequest) AuthorizationFlowSlugIexact(authorizationFlowSlugIexact string) ApiProvidersProxyListRequest { + r.authorizationFlowSlugIexact = &authorizationFlowSlugIexact + return r +} + +func (r ApiProvidersProxyListRequest) BasicAuthEnabledIexact(basicAuthEnabledIexact bool) ApiProvidersProxyListRequest { + r.basicAuthEnabledIexact = &basicAuthEnabledIexact + return r +} + +func (r ApiProvidersProxyListRequest) BasicAuthPasswordAttributeIexact(basicAuthPasswordAttributeIexact string) ApiProvidersProxyListRequest { + r.basicAuthPasswordAttributeIexact = &basicAuthPasswordAttributeIexact + return r +} + +func (r ApiProvidersProxyListRequest) BasicAuthUserAttributeIexact(basicAuthUserAttributeIexact string) ApiProvidersProxyListRequest { + r.basicAuthUserAttributeIexact = &basicAuthUserAttributeIexact + return r +} + +func (r ApiProvidersProxyListRequest) CertificateKpUuidIexact(certificateKpUuidIexact string) ApiProvidersProxyListRequest { + r.certificateKpUuidIexact = &certificateKpUuidIexact + return r +} + +func (r ApiProvidersProxyListRequest) CertificateNameIexact(certificateNameIexact string) ApiProvidersProxyListRequest { + r.certificateNameIexact = &certificateNameIexact + return r +} + +func (r ApiProvidersProxyListRequest) CookieDomainIexact(cookieDomainIexact string) ApiProvidersProxyListRequest { + r.cookieDomainIexact = &cookieDomainIexact + return r +} + +func (r ApiProvidersProxyListRequest) ExternalHostIexact(externalHostIexact string) ApiProvidersProxyListRequest { + r.externalHostIexact = &externalHostIexact + return r +} + +func (r ApiProvidersProxyListRequest) InternalHostIexact(internalHostIexact string) ApiProvidersProxyListRequest { + r.internalHostIexact = &internalHostIexact + return r +} + +func (r ApiProvidersProxyListRequest) InternalHostSslValidationIexact(internalHostSslValidationIexact bool) ApiProvidersProxyListRequest { + r.internalHostSslValidationIexact = &internalHostSslValidationIexact + return r +} + +func (r ApiProvidersProxyListRequest) ModeIexact(modeIexact string) ApiProvidersProxyListRequest { + r.modeIexact = &modeIexact + return r +} + +func (r ApiProvidersProxyListRequest) NameIexact(nameIexact string) ApiProvidersProxyListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersProxyListRequest) Ordering(ordering string) ApiProvidersProxyListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersProxyListRequest) Page(page int32) ApiProvidersProxyListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersProxyListRequest) PageSize(pageSize int32) ApiProvidersProxyListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersProxyListRequest) PropertyMappingsIexact(propertyMappingsIexact []string) ApiProvidersProxyListRequest { + r.propertyMappingsIexact = &propertyMappingsIexact + return r +} + +// A search term. +func (r ApiProvidersProxyListRequest) Search(search string) ApiProvidersProxyListRequest { + r.search = &search + return r +} + +func (r ApiProvidersProxyListRequest) SkipPathRegexIexact(skipPathRegexIexact string) ApiProvidersProxyListRequest { + r.skipPathRegexIexact = &skipPathRegexIexact + return r +} + +func (r ApiProvidersProxyListRequest) Execute() (*PaginatedProxyProviderList, *http.Response, error) { + return r.ApiService.ProvidersProxyListExecute(r) +} + +/* +ProvidersProxyList Method for ProvidersProxyList + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersProxyListRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyList(ctx context.Context) ApiProvidersProxyListRequest { + return ApiProvidersProxyListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedProxyProviderList +func (a *ProvidersAPIService) ProvidersProxyListExecute(r ApiProvidersProxyListRequest) (*PaginatedProxyProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedProxyProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.authorizationFlowSlugIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow__slug__iexact", r.authorizationFlowSlugIexact, "form", "") + } + if r.basicAuthEnabledIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "basic_auth_enabled__iexact", r.basicAuthEnabledIexact, "form", "") + } + if r.basicAuthPasswordAttributeIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "basic_auth_password_attribute__iexact", r.basicAuthPasswordAttributeIexact, "form", "") + } + if r.basicAuthUserAttributeIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "basic_auth_user_attribute__iexact", r.basicAuthUserAttributeIexact, "form", "") + } + if r.certificateKpUuidIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate__kp_uuid__iexact", r.certificateKpUuidIexact, "form", "") + } + if r.certificateNameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate__name__iexact", r.certificateNameIexact, "form", "") + } + if r.cookieDomainIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cookie_domain__iexact", r.cookieDomainIexact, "form", "") + } + if r.externalHostIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "external_host__iexact", r.externalHostIexact, "form", "") + } + if r.internalHostIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "internal_host__iexact", r.internalHostIexact, "form", "") + } + if r.internalHostSslValidationIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "internal_host_ssl_validation__iexact", r.internalHostSslValidationIexact, "form", "") + } + if r.modeIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode__iexact", r.modeIexact, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.propertyMappingsIexact != nil { + t := *r.propertyMappingsIexact + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings__iexact", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings__iexact", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.skipPathRegexIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "skip_path_regex__iexact", r.skipPathRegexIexact, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedProxyProviderRequest *PatchedProxyProviderRequest +} + +func (r ApiProvidersProxyPartialUpdateRequest) PatchedProxyProviderRequest(patchedProxyProviderRequest PatchedProxyProviderRequest) ApiProvidersProxyPartialUpdateRequest { + r.patchedProxyProviderRequest = &patchedProxyProviderRequest + return r +} + +func (r ApiProvidersProxyPartialUpdateRequest) Execute() (*ProxyProvider, *http.Response, error) { + return r.ApiService.ProvidersProxyPartialUpdateExecute(r) +} + +/* +ProvidersProxyPartialUpdate Method for ProvidersProxyPartialUpdate + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Proxy Provider. + @return ApiProvidersProxyPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyPartialUpdate(ctx context.Context, id int32) ApiProvidersProxyPartialUpdateRequest { + return ApiProvidersProxyPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProxyProvider +func (a *ProvidersAPIService) ProvidersProxyPartialUpdateExecute(r ApiProvidersProxyPartialUpdateRequest) (*ProxyProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProxyProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedProxyProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersProxyRetrieveRequest) Execute() (*ProxyProvider, *http.Response, error) { + return r.ApiService.ProvidersProxyRetrieveExecute(r) +} + +/* +ProvidersProxyRetrieve Method for ProvidersProxyRetrieve + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Proxy Provider. + @return ApiProvidersProxyRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyRetrieve(ctx context.Context, id int32) ApiProvidersProxyRetrieveRequest { + return ApiProvidersProxyRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProxyProvider +func (a *ProvidersAPIService) ProvidersProxyRetrieveExecute(r ApiProvidersProxyRetrieveRequest) (*ProxyProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProxyProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + proxyProviderRequest *ProxyProviderRequest +} + +func (r ApiProvidersProxyUpdateRequest) ProxyProviderRequest(proxyProviderRequest ProxyProviderRequest) ApiProvidersProxyUpdateRequest { + r.proxyProviderRequest = &proxyProviderRequest + return r +} + +func (r ApiProvidersProxyUpdateRequest) Execute() (*ProxyProvider, *http.Response, error) { + return r.ApiService.ProvidersProxyUpdateExecute(r) +} + +/* +ProvidersProxyUpdate Method for ProvidersProxyUpdate + +ProxyProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Proxy Provider. + @return ApiProvidersProxyUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyUpdate(ctx context.Context, id int32) ApiProvidersProxyUpdateRequest { + return ApiProvidersProxyUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return ProxyProvider +func (a *ProvidersAPIService) ProvidersProxyUpdateExecute(r ApiProvidersProxyUpdateRequest) (*ProxyProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProxyProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.proxyProviderRequest == nil { + return localVarReturnValue, nil, reportError("proxyProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.proxyProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersProxyUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersProxyUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersProxyUsedByListExecute(r) +} + +/* +ProvidersProxyUsedByList Method for ProvidersProxyUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Proxy Provider. + @return ApiProvidersProxyUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersProxyUsedByList(ctx context.Context, id int32) ApiProvidersProxyUsedByListRequest { + return ApiProvidersProxyUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersProxyUsedByListExecute(r ApiProvidersProxyUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersProxyUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/proxy/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + rACProviderRequest *RACProviderRequest +} + +func (r ApiProvidersRacCreateRequest) RACProviderRequest(rACProviderRequest RACProviderRequest) ApiProvidersRacCreateRequest { + r.rACProviderRequest = &rACProviderRequest + return r +} + +func (r ApiProvidersRacCreateRequest) Execute() (*RACProvider, *http.Response, error) { + return r.ApiService.ProvidersRacCreateExecute(r) +} + +/* +ProvidersRacCreate Method for ProvidersRacCreate + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersRacCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersRacCreate(ctx context.Context) ApiProvidersRacCreateRequest { + return ApiProvidersRacCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RACProvider +func (a *ProvidersAPIService) ProvidersRacCreateExecute(r ApiProvidersRacCreateRequest) (*RACProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rACProviderRequest == nil { + return localVarReturnValue, nil, reportError("rACProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rACProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRacDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersRacDestroyExecute(r) +} + +/* +ProvidersRacDestroy Method for ProvidersRacDestroy + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RAC Provider. + @return ApiProvidersRacDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersRacDestroy(ctx context.Context, id int32) ApiProvidersRacDestroyRequest { + return ApiProvidersRacDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersRacDestroyExecute(r ApiProvidersRacDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersRacListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersRacListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersRacListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +func (r ApiProvidersRacListRequest) NameIexact(nameIexact string) ApiProvidersRacListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersRacListRequest) Ordering(ordering string) ApiProvidersRacListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersRacListRequest) Page(page int32) ApiProvidersRacListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersRacListRequest) PageSize(pageSize int32) ApiProvidersRacListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersRacListRequest) Search(search string) ApiProvidersRacListRequest { + r.search = &search + return r +} + +func (r ApiProvidersRacListRequest) Execute() (*PaginatedRACProviderList, *http.Response, error) { + return r.ApiService.ProvidersRacListExecute(r) +} + +/* +ProvidersRacList Method for ProvidersRacList + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersRacListRequest +*/ +func (a *ProvidersAPIService) ProvidersRacList(ctx context.Context) ApiProvidersRacListRequest { + return ApiProvidersRacListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRACProviderList +func (a *ProvidersAPIService) ProvidersRacListExecute(r ApiProvidersRacListRequest) (*PaginatedRACProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRACProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedRACProviderRequest *PatchedRACProviderRequest +} + +func (r ApiProvidersRacPartialUpdateRequest) PatchedRACProviderRequest(patchedRACProviderRequest PatchedRACProviderRequest) ApiProvidersRacPartialUpdateRequest { + r.patchedRACProviderRequest = &patchedRACProviderRequest + return r +} + +func (r ApiProvidersRacPartialUpdateRequest) Execute() (*RACProvider, *http.Response, error) { + return r.ApiService.ProvidersRacPartialUpdateExecute(r) +} + +/* +ProvidersRacPartialUpdate Method for ProvidersRacPartialUpdate + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RAC Provider. + @return ApiProvidersRacPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersRacPartialUpdate(ctx context.Context, id int32) ApiProvidersRacPartialUpdateRequest { + return ApiProvidersRacPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RACProvider +func (a *ProvidersAPIService) ProvidersRacPartialUpdateExecute(r ApiProvidersRacPartialUpdateRequest) (*RACProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRACProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRacRetrieveRequest) Execute() (*RACProvider, *http.Response, error) { + return r.ApiService.ProvidersRacRetrieveExecute(r) +} + +/* +ProvidersRacRetrieve Method for ProvidersRacRetrieve + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RAC Provider. + @return ApiProvidersRacRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersRacRetrieve(ctx context.Context, id int32) ApiProvidersRacRetrieveRequest { + return ApiProvidersRacRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RACProvider +func (a *ProvidersAPIService) ProvidersRacRetrieveExecute(r ApiProvidersRacRetrieveRequest) (*RACProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + rACProviderRequest *RACProviderRequest +} + +func (r ApiProvidersRacUpdateRequest) RACProviderRequest(rACProviderRequest RACProviderRequest) ApiProvidersRacUpdateRequest { + r.rACProviderRequest = &rACProviderRequest + return r +} + +func (r ApiProvidersRacUpdateRequest) Execute() (*RACProvider, *http.Response, error) { + return r.ApiService.ProvidersRacUpdateExecute(r) +} + +/* +ProvidersRacUpdate Method for ProvidersRacUpdate + +RACProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RAC Provider. + @return ApiProvidersRacUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersRacUpdate(ctx context.Context, id int32) ApiProvidersRacUpdateRequest { + return ApiProvidersRacUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RACProvider +func (a *ProvidersAPIService) ProvidersRacUpdateExecute(r ApiProvidersRacUpdateRequest) (*RACProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RACProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.rACProviderRequest == nil { + return localVarReturnValue, nil, reportError("rACProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rACProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRacUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRacUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersRacUsedByListExecute(r) +} + +/* +ProvidersRacUsedByList Method for ProvidersRacUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this RAC Provider. + @return ApiProvidersRacUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersRacUsedByList(ctx context.Context, id int32) ApiProvidersRacUsedByListRequest { + return ApiProvidersRacUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersRacUsedByListExecute(r ApiProvidersRacUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRacUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/rac/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + radiusProviderRequest *RadiusProviderRequest +} + +func (r ApiProvidersRadiusCreateRequest) RadiusProviderRequest(radiusProviderRequest RadiusProviderRequest) ApiProvidersRadiusCreateRequest { + r.radiusProviderRequest = &radiusProviderRequest + return r +} + +func (r ApiProvidersRadiusCreateRequest) Execute() (*RadiusProvider, *http.Response, error) { + return r.ApiService.ProvidersRadiusCreateExecute(r) +} + +/* +ProvidersRadiusCreate Method for ProvidersRadiusCreate + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersRadiusCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusCreate(ctx context.Context) ApiProvidersRadiusCreateRequest { + return ApiProvidersRadiusCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RadiusProvider +func (a *ProvidersAPIService) ProvidersRadiusCreateExecute(r ApiProvidersRadiusCreateRequest) (*RadiusProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.radiusProviderRequest == nil { + return localVarReturnValue, nil, reportError("radiusProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.radiusProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRadiusDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersRadiusDestroyExecute(r) +} + +/* +ProvidersRadiusDestroy Method for ProvidersRadiusDestroy + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiProvidersRadiusDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusDestroy(ctx context.Context, id int32) ApiProvidersRadiusDestroyRequest { + return ApiProvidersRadiusDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersRadiusDestroyExecute(r ApiProvidersRadiusDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersRadiusListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + authorizationFlowSlugIexact *string + clientNetworksIexact *string + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersRadiusListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersRadiusListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +func (r ApiProvidersRadiusListRequest) AuthorizationFlowSlugIexact(authorizationFlowSlugIexact string) ApiProvidersRadiusListRequest { + r.authorizationFlowSlugIexact = &authorizationFlowSlugIexact + return r +} + +func (r ApiProvidersRadiusListRequest) ClientNetworksIexact(clientNetworksIexact string) ApiProvidersRadiusListRequest { + r.clientNetworksIexact = &clientNetworksIexact + return r +} + +func (r ApiProvidersRadiusListRequest) NameIexact(nameIexact string) ApiProvidersRadiusListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersRadiusListRequest) Ordering(ordering string) ApiProvidersRadiusListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersRadiusListRequest) Page(page int32) ApiProvidersRadiusListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersRadiusListRequest) PageSize(pageSize int32) ApiProvidersRadiusListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersRadiusListRequest) Search(search string) ApiProvidersRadiusListRequest { + r.search = &search + return r +} + +func (r ApiProvidersRadiusListRequest) Execute() (*PaginatedRadiusProviderList, *http.Response, error) { + return r.ApiService.ProvidersRadiusListExecute(r) +} + +/* +ProvidersRadiusList Method for ProvidersRadiusList + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersRadiusListRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusList(ctx context.Context) ApiProvidersRadiusListRequest { + return ApiProvidersRadiusListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRadiusProviderList +func (a *ProvidersAPIService) ProvidersRadiusListExecute(r ApiProvidersRadiusListRequest) (*PaginatedRadiusProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRadiusProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.authorizationFlowSlugIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow__slug__iexact", r.authorizationFlowSlugIexact, "form", "") + } + if r.clientNetworksIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_networks__iexact", r.clientNetworksIexact, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedRadiusProviderRequest *PatchedRadiusProviderRequest +} + +func (r ApiProvidersRadiusPartialUpdateRequest) PatchedRadiusProviderRequest(patchedRadiusProviderRequest PatchedRadiusProviderRequest) ApiProvidersRadiusPartialUpdateRequest { + r.patchedRadiusProviderRequest = &patchedRadiusProviderRequest + return r +} + +func (r ApiProvidersRadiusPartialUpdateRequest) Execute() (*RadiusProvider, *http.Response, error) { + return r.ApiService.ProvidersRadiusPartialUpdateExecute(r) +} + +/* +ProvidersRadiusPartialUpdate Method for ProvidersRadiusPartialUpdate + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiProvidersRadiusPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusPartialUpdate(ctx context.Context, id int32) ApiProvidersRadiusPartialUpdateRequest { + return ApiProvidersRadiusPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RadiusProvider +func (a *ProvidersAPIService) ProvidersRadiusPartialUpdateExecute(r ApiProvidersRadiusPartialUpdateRequest) (*RadiusProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRadiusProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRadiusRetrieveRequest) Execute() (*RadiusProvider, *http.Response, error) { + return r.ApiService.ProvidersRadiusRetrieveExecute(r) +} + +/* +ProvidersRadiusRetrieve Method for ProvidersRadiusRetrieve + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiProvidersRadiusRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusRetrieve(ctx context.Context, id int32) ApiProvidersRadiusRetrieveRequest { + return ApiProvidersRadiusRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RadiusProvider +func (a *ProvidersAPIService) ProvidersRadiusRetrieveExecute(r ApiProvidersRadiusRetrieveRequest) (*RadiusProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + radiusProviderRequest *RadiusProviderRequest +} + +func (r ApiProvidersRadiusUpdateRequest) RadiusProviderRequest(radiusProviderRequest RadiusProviderRequest) ApiProvidersRadiusUpdateRequest { + r.radiusProviderRequest = &radiusProviderRequest + return r +} + +func (r ApiProvidersRadiusUpdateRequest) Execute() (*RadiusProvider, *http.Response, error) { + return r.ApiService.ProvidersRadiusUpdateExecute(r) +} + +/* +ProvidersRadiusUpdate Method for ProvidersRadiusUpdate + +RadiusProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiProvidersRadiusUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusUpdate(ctx context.Context, id int32) ApiProvidersRadiusUpdateRequest { + return ApiProvidersRadiusUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return RadiusProvider +func (a *ProvidersAPIService) ProvidersRadiusUpdateExecute(r ApiProvidersRadiusUpdateRequest) (*RadiusProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RadiusProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.radiusProviderRequest == nil { + return localVarReturnValue, nil, reportError("radiusProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.radiusProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersRadiusUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersRadiusUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersRadiusUsedByListExecute(r) +} + +/* +ProvidersRadiusUsedByList Method for ProvidersRadiusUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Radius Provider. + @return ApiProvidersRadiusUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersRadiusUsedByList(ctx context.Context, id int32) ApiProvidersRadiusUsedByListRequest { + return ApiProvidersRadiusUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersRadiusUsedByListExecute(r ApiProvidersRadiusUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersRadiusUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/radius/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + sAMLProviderRequest *SAMLProviderRequest +} + +func (r ApiProvidersSamlCreateRequest) SAMLProviderRequest(sAMLProviderRequest SAMLProviderRequest) ApiProvidersSamlCreateRequest { + r.sAMLProviderRequest = &sAMLProviderRequest + return r +} + +func (r ApiProvidersSamlCreateRequest) Execute() (*SAMLProvider, *http.Response, error) { + return r.ApiService.ProvidersSamlCreateExecute(r) +} + +/* +ProvidersSamlCreate Method for ProvidersSamlCreate + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersSamlCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlCreate(ctx context.Context) ApiProvidersSamlCreateRequest { + return ApiProvidersSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SAMLProvider +func (a *ProvidersAPIService) ProvidersSamlCreateExecute(r ApiProvidersSamlCreateRequest) (*SAMLProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLProviderRequest == nil { + return localVarReturnValue, nil, reportError("sAMLProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersSamlDestroyExecute(r) +} + +/* +ProvidersSamlDestroy Method for ProvidersSamlDestroy + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlDestroy(ctx context.Context, id int32) ApiProvidersSamlDestroyRequest { + return ApiProvidersSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersSamlDestroyExecute(r ApiProvidersSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersSamlImportMetadataCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + name *string + authorizationFlow *string + invalidationFlow *string + file *os.File +} + +func (r ApiProvidersSamlImportMetadataCreateRequest) Name(name string) ApiProvidersSamlImportMetadataCreateRequest { + r.name = &name + return r +} + +func (r ApiProvidersSamlImportMetadataCreateRequest) AuthorizationFlow(authorizationFlow string) ApiProvidersSamlImportMetadataCreateRequest { + r.authorizationFlow = &authorizationFlow + return r +} + +func (r ApiProvidersSamlImportMetadataCreateRequest) InvalidationFlow(invalidationFlow string) ApiProvidersSamlImportMetadataCreateRequest { + r.invalidationFlow = &invalidationFlow + return r +} + +func (r ApiProvidersSamlImportMetadataCreateRequest) File(file *os.File) ApiProvidersSamlImportMetadataCreateRequest { + r.file = file + return r +} + +func (r ApiProvidersSamlImportMetadataCreateRequest) Execute() (*SAMLProvider, *http.Response, error) { + return r.ApiService.ProvidersSamlImportMetadataCreateExecute(r) +} + +/* +ProvidersSamlImportMetadataCreate Method for ProvidersSamlImportMetadataCreate + +Create provider from SAML Metadata + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersSamlImportMetadataCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlImportMetadataCreate(ctx context.Context) ApiProvidersSamlImportMetadataCreateRequest { + return ApiProvidersSamlImportMetadataCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SAMLProvider +func (a *ProvidersAPIService) ProvidersSamlImportMetadataCreateExecute(r ApiProvidersSamlImportMetadataCreateRequest) (*SAMLProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlImportMetadataCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/import_metadata/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.name == nil { + return localVarReturnValue, nil, reportError("name is required and must be specified") + } + if strlen(*r.name) < 1 { + return localVarReturnValue, nil, reportError("name must have at least 1 elements") + } + if r.authorizationFlow == nil { + return localVarReturnValue, nil, reportError("authorizationFlow is required and must be specified") + } + if r.invalidationFlow == nil { + return localVarReturnValue, nil, reportError("invalidationFlow is required and must be specified") + } + if r.file == nil { + return localVarReturnValue, nil, reportError("file is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + parameterAddToHeaderOrQuery(localVarFormParams, "name", r.name, "", "") + parameterAddToHeaderOrQuery(localVarFormParams, "authorization_flow", r.authorizationFlow, "", "") + parameterAddToHeaderOrQuery(localVarFormParams, "invalidation_flow", r.invalidationFlow, "", "") + var fileLocalVarFormFileName string + var fileLocalVarFileName string + var fileLocalVarFileBytes []byte + + fileLocalVarFormFileName = "file" + fileLocalVarFile := r.file + + if fileLocalVarFile != nil { + fbs, _ := io.ReadAll(fileLocalVarFile) + + fileLocalVarFileBytes = fbs + fileLocalVarFileName = fileLocalVarFile.Name() + fileLocalVarFile.Close() + formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + acsUrl *string + assertionValidNotBefore *string + assertionValidNotOnOrAfter *string + audience *string + authenticationFlow *string + authnContextClassRefMapping *string + authorizationFlow *string + backchannelApplication *string + defaultNameIdPolicy *string + defaultRelayState *string + digestAlgorithm *string + encryptionKp *string + invalidationFlow *string + isBackchannel *bool + issuer *string + logoutMethod *string + name *string + nameIdMapping *string + ordering *string + page *int32 + pageSize *int32 + propertyMappings *[]string + search *string + sessionValidNotOnOrAfter *string + signAssertion *bool + signLogoutRequest *bool + signLogoutResponse *bool + signResponse *bool + signatureAlgorithm *string + signingKp *string + slsBinding *string + slsUrl *string + spBinding *string + verificationKp *string +} + +func (r ApiProvidersSamlListRequest) AcsUrl(acsUrl string) ApiProvidersSamlListRequest { + r.acsUrl = &acsUrl + return r +} + +func (r ApiProvidersSamlListRequest) AssertionValidNotBefore(assertionValidNotBefore string) ApiProvidersSamlListRequest { + r.assertionValidNotBefore = &assertionValidNotBefore + return r +} + +func (r ApiProvidersSamlListRequest) AssertionValidNotOnOrAfter(assertionValidNotOnOrAfter string) ApiProvidersSamlListRequest { + r.assertionValidNotOnOrAfter = &assertionValidNotOnOrAfter + return r +} + +func (r ApiProvidersSamlListRequest) Audience(audience string) ApiProvidersSamlListRequest { + r.audience = &audience + return r +} + +func (r ApiProvidersSamlListRequest) AuthenticationFlow(authenticationFlow string) ApiProvidersSamlListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiProvidersSamlListRequest) AuthnContextClassRefMapping(authnContextClassRefMapping string) ApiProvidersSamlListRequest { + r.authnContextClassRefMapping = &authnContextClassRefMapping + return r +} + +func (r ApiProvidersSamlListRequest) AuthorizationFlow(authorizationFlow string) ApiProvidersSamlListRequest { + r.authorizationFlow = &authorizationFlow + return r +} + +func (r ApiProvidersSamlListRequest) BackchannelApplication(backchannelApplication string) ApiProvidersSamlListRequest { + r.backchannelApplication = &backchannelApplication + return r +} + +func (r ApiProvidersSamlListRequest) DefaultNameIdPolicy(defaultNameIdPolicy string) ApiProvidersSamlListRequest { + r.defaultNameIdPolicy = &defaultNameIdPolicy + return r +} + +func (r ApiProvidersSamlListRequest) DefaultRelayState(defaultRelayState string) ApiProvidersSamlListRequest { + r.defaultRelayState = &defaultRelayState + return r +} + +func (r ApiProvidersSamlListRequest) DigestAlgorithm(digestAlgorithm string) ApiProvidersSamlListRequest { + r.digestAlgorithm = &digestAlgorithm + return r +} + +func (r ApiProvidersSamlListRequest) EncryptionKp(encryptionKp string) ApiProvidersSamlListRequest { + r.encryptionKp = &encryptionKp + return r +} + +func (r ApiProvidersSamlListRequest) InvalidationFlow(invalidationFlow string) ApiProvidersSamlListRequest { + r.invalidationFlow = &invalidationFlow + return r +} + +func (r ApiProvidersSamlListRequest) IsBackchannel(isBackchannel bool) ApiProvidersSamlListRequest { + r.isBackchannel = &isBackchannel + return r +} + +func (r ApiProvidersSamlListRequest) Issuer(issuer string) ApiProvidersSamlListRequest { + r.issuer = &issuer + return r +} + +// Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in hidden iframes. Front-channel native uses your active browser tab to send post requests and redirect to providers. Back-channel sends logout requests directly from the server without user interaction (requires POST SLS binding). +func (r ApiProvidersSamlListRequest) LogoutMethod(logoutMethod string) ApiProvidersSamlListRequest { + r.logoutMethod = &logoutMethod + return r +} + +func (r ApiProvidersSamlListRequest) Name(name string) ApiProvidersSamlListRequest { + r.name = &name + return r +} + +func (r ApiProvidersSamlListRequest) NameIdMapping(nameIdMapping string) ApiProvidersSamlListRequest { + r.nameIdMapping = &nameIdMapping + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersSamlListRequest) Ordering(ordering string) ApiProvidersSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersSamlListRequest) Page(page int32) ApiProvidersSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersSamlListRequest) PageSize(pageSize int32) ApiProvidersSamlListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersSamlListRequest) PropertyMappings(propertyMappings []string) ApiProvidersSamlListRequest { + r.propertyMappings = &propertyMappings + return r +} + +// A search term. +func (r ApiProvidersSamlListRequest) Search(search string) ApiProvidersSamlListRequest { + r.search = &search + return r +} + +func (r ApiProvidersSamlListRequest) SessionValidNotOnOrAfter(sessionValidNotOnOrAfter string) ApiProvidersSamlListRequest { + r.sessionValidNotOnOrAfter = &sessionValidNotOnOrAfter + return r +} + +func (r ApiProvidersSamlListRequest) SignAssertion(signAssertion bool) ApiProvidersSamlListRequest { + r.signAssertion = &signAssertion + return r +} + +func (r ApiProvidersSamlListRequest) SignLogoutRequest(signLogoutRequest bool) ApiProvidersSamlListRequest { + r.signLogoutRequest = &signLogoutRequest + return r +} + +func (r ApiProvidersSamlListRequest) SignLogoutResponse(signLogoutResponse bool) ApiProvidersSamlListRequest { + r.signLogoutResponse = &signLogoutResponse + return r +} + +func (r ApiProvidersSamlListRequest) SignResponse(signResponse bool) ApiProvidersSamlListRequest { + r.signResponse = &signResponse + return r +} + +func (r ApiProvidersSamlListRequest) SignatureAlgorithm(signatureAlgorithm string) ApiProvidersSamlListRequest { + r.signatureAlgorithm = &signatureAlgorithm + return r +} + +func (r ApiProvidersSamlListRequest) SigningKp(signingKp string) ApiProvidersSamlListRequest { + r.signingKp = &signingKp + return r +} + +// This determines how authentik sends the logout response back to the Service Provider. +func (r ApiProvidersSamlListRequest) SlsBinding(slsBinding string) ApiProvidersSamlListRequest { + r.slsBinding = &slsBinding + return r +} + +func (r ApiProvidersSamlListRequest) SlsUrl(slsUrl string) ApiProvidersSamlListRequest { + r.slsUrl = &slsUrl + return r +} + +// This determines how authentik sends the response back to the Service Provider. +func (r ApiProvidersSamlListRequest) SpBinding(spBinding string) ApiProvidersSamlListRequest { + r.spBinding = &spBinding + return r +} + +func (r ApiProvidersSamlListRequest) VerificationKp(verificationKp string) ApiProvidersSamlListRequest { + r.verificationKp = &verificationKp + return r +} + +func (r ApiProvidersSamlListRequest) Execute() (*PaginatedSAMLProviderList, *http.Response, error) { + return r.ApiService.ProvidersSamlListExecute(r) +} + +/* +ProvidersSamlList Method for ProvidersSamlList + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersSamlListRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlList(ctx context.Context) ApiProvidersSamlListRequest { + return ApiProvidersSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSAMLProviderList +func (a *ProvidersAPIService) ProvidersSamlListExecute(r ApiProvidersSamlListRequest) (*PaginatedSAMLProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSAMLProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.acsUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "acs_url", r.acsUrl, "form", "") + } + if r.assertionValidNotBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assertion_valid_not_before", r.assertionValidNotBefore, "form", "") + } + if r.assertionValidNotOnOrAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assertion_valid_not_on_or_after", r.assertionValidNotOnOrAfter, "form", "") + } + if r.audience != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "audience", r.audience, "form", "") + } + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.authnContextClassRefMapping != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authn_context_class_ref_mapping", r.authnContextClassRefMapping, "form", "") + } + if r.authorizationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow", r.authorizationFlow, "form", "") + } + if r.backchannelApplication != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backchannel_application", r.backchannelApplication, "form", "") + } + if r.defaultNameIdPolicy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_name_id_policy", r.defaultNameIdPolicy, "form", "") + } + if r.defaultRelayState != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_relay_state", r.defaultRelayState, "form", "") + } + if r.digestAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "digest_algorithm", r.digestAlgorithm, "form", "") + } + if r.encryptionKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_kp", r.encryptionKp, "form", "") + } + if r.invalidationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "invalidation_flow", r.invalidationFlow, "form", "") + } + if r.isBackchannel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_backchannel", r.isBackchannel, "form", "") + } + if r.issuer != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "issuer", r.issuer, "form", "") + } + if r.logoutMethod != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "logout_method", r.logoutMethod, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.nameIdMapping != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name_id_mapping", r.nameIdMapping, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.propertyMappings != nil { + t := *r.propertyMappings + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sessionValidNotOnOrAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session_valid_not_on_or_after", r.sessionValidNotOnOrAfter, "form", "") + } + if r.signAssertion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_assertion", r.signAssertion, "form", "") + } + if r.signLogoutRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_logout_request", r.signLogoutRequest, "form", "") + } + if r.signLogoutResponse != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_logout_response", r.signLogoutResponse, "form", "") + } + if r.signResponse != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_response", r.signResponse, "form", "") + } + if r.signatureAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature_algorithm", r.signatureAlgorithm, "form", "") + } + if r.signingKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signing_kp", r.signingKp, "form", "") + } + if r.slsBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sls_binding", r.slsBinding, "form", "") + } + if r.slsUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sls_url", r.slsUrl, "form", "") + } + if r.spBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sp_binding", r.spBinding, "form", "") + } + if r.verificationKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "verification_kp", r.verificationKp, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlMetadataRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + download *bool + forceBinding *string +} + +func (r ApiProvidersSamlMetadataRetrieveRequest) Download(download bool) ApiProvidersSamlMetadataRetrieveRequest { + r.download = &download + return r +} + +// Optionally force the metadata to only include one binding. +func (r ApiProvidersSamlMetadataRetrieveRequest) ForceBinding(forceBinding string) ApiProvidersSamlMetadataRetrieveRequest { + r.forceBinding = &forceBinding + return r +} + +func (r ApiProvidersSamlMetadataRetrieveRequest) Execute() (*SAMLMetadata, *http.Response, error) { + return r.ApiService.ProvidersSamlMetadataRetrieveExecute(r) +} + +/* +ProvidersSamlMetadataRetrieve Method for ProvidersSamlMetadataRetrieve + +Return metadata as XML string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlMetadataRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlMetadataRetrieve(ctx context.Context, id int32) ApiProvidersSamlMetadataRetrieveRequest { + return ApiProvidersSamlMetadataRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SAMLMetadata +func (a *ProvidersAPIService) ProvidersSamlMetadataRetrieveExecute(r ApiProvidersSamlMetadataRetrieveRequest) (*SAMLMetadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLMetadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlMetadataRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/metadata/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.forceBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force_binding", r.forceBinding, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedSAMLProviderRequest *PatchedSAMLProviderRequest +} + +func (r ApiProvidersSamlPartialUpdateRequest) PatchedSAMLProviderRequest(patchedSAMLProviderRequest PatchedSAMLProviderRequest) ApiProvidersSamlPartialUpdateRequest { + r.patchedSAMLProviderRequest = &patchedSAMLProviderRequest + return r +} + +func (r ApiProvidersSamlPartialUpdateRequest) Execute() (*SAMLProvider, *http.Response, error) { + return r.ApiService.ProvidersSamlPartialUpdateExecute(r) +} + +/* +ProvidersSamlPartialUpdate Method for ProvidersSamlPartialUpdate + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlPartialUpdate(ctx context.Context, id int32) ApiProvidersSamlPartialUpdateRequest { + return ApiProvidersSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SAMLProvider +func (a *ProvidersAPIService) ProvidersSamlPartialUpdateExecute(r ApiProvidersSamlPartialUpdateRequest) (*SAMLProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSAMLProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlPreviewUserRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + forUser *int32 +} + +func (r ApiProvidersSamlPreviewUserRetrieveRequest) ForUser(forUser int32) ApiProvidersSamlPreviewUserRetrieveRequest { + r.forUser = &forUser + return r +} + +func (r ApiProvidersSamlPreviewUserRetrieveRequest) Execute() (*PropertyMappingPreview, *http.Response, error) { + return r.ApiService.ProvidersSamlPreviewUserRetrieveExecute(r) +} + +/* +ProvidersSamlPreviewUserRetrieve Method for ProvidersSamlPreviewUserRetrieve + +Preview user data for provider + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlPreviewUserRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlPreviewUserRetrieve(ctx context.Context, id int32) ApiProvidersSamlPreviewUserRetrieveRequest { + return ApiProvidersSamlPreviewUserRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PropertyMappingPreview +func (a *ProvidersAPIService) ProvidersSamlPreviewUserRetrieveExecute(r ApiProvidersSamlPreviewUserRetrieveRequest) (*PropertyMappingPreview, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PropertyMappingPreview + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlPreviewUserRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/preview_user/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_user", r.forUser, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSamlRetrieveRequest) Execute() (*SAMLProvider, *http.Response, error) { + return r.ApiService.ProvidersSamlRetrieveExecute(r) +} + +/* +ProvidersSamlRetrieve Method for ProvidersSamlRetrieve + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlRetrieve(ctx context.Context, id int32) ApiProvidersSamlRetrieveRequest { + return ApiProvidersSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SAMLProvider +func (a *ProvidersAPIService) ProvidersSamlRetrieveExecute(r ApiProvidersSamlRetrieveRequest) (*SAMLProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + sAMLProviderRequest *SAMLProviderRequest +} + +func (r ApiProvidersSamlUpdateRequest) SAMLProviderRequest(sAMLProviderRequest SAMLProviderRequest) ApiProvidersSamlUpdateRequest { + r.sAMLProviderRequest = &sAMLProviderRequest + return r +} + +func (r ApiProvidersSamlUpdateRequest) Execute() (*SAMLProvider, *http.Response, error) { + return r.ApiService.ProvidersSamlUpdateExecute(r) +} + +/* +ProvidersSamlUpdate Method for ProvidersSamlUpdate + +SAMLProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlUpdate(ctx context.Context, id int32) ApiProvidersSamlUpdateRequest { + return ApiProvidersSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SAMLProvider +func (a *ProvidersAPIService) ProvidersSamlUpdateExecute(r ApiProvidersSamlUpdateRequest) (*SAMLProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLProviderRequest == nil { + return localVarReturnValue, nil, reportError("sAMLProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSamlUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersSamlUsedByListExecute(r) +} + +/* +ProvidersSamlUsedByList Method for ProvidersSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SAML Provider. + @return ApiProvidersSamlUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersSamlUsedByList(ctx context.Context, id int32) ApiProvidersSamlUsedByListRequest { + return ApiProvidersSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersSamlUsedByListExecute(r ApiProvidersSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/saml/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + sCIMProviderRequest *SCIMProviderRequest +} + +func (r ApiProvidersScimCreateRequest) SCIMProviderRequest(sCIMProviderRequest SCIMProviderRequest) ApiProvidersScimCreateRequest { + r.sCIMProviderRequest = &sCIMProviderRequest + return r +} + +func (r ApiProvidersScimCreateRequest) Execute() (*SCIMProvider, *http.Response, error) { + return r.ApiService.ProvidersScimCreateExecute(r) +} + +/* +ProvidersScimCreate Method for ProvidersScimCreate + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimCreate(ctx context.Context) ApiProvidersScimCreateRequest { + return ApiProvidersScimCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMProvider +func (a *ProvidersAPIService) ProvidersScimCreateExecute(r ApiProvidersScimCreateRequest) (*SCIMProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMProviderRequest == nil { + return localVarReturnValue, nil, reportError("sCIMProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersScimDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersScimDestroyExecute(r) +} + +/* +ProvidersScimDestroy Method for ProvidersScimDestroy + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersScimDestroy(ctx context.Context, id int32) ApiProvidersScimDestroyRequest { + return ApiProvidersScimDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersScimDestroyExecute(r ApiProvidersScimDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersScimGroupsCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + sCIMProviderGroupRequest *SCIMProviderGroupRequest +} + +func (r ApiProvidersScimGroupsCreateRequest) SCIMProviderGroupRequest(sCIMProviderGroupRequest SCIMProviderGroupRequest) ApiProvidersScimGroupsCreateRequest { + r.sCIMProviderGroupRequest = &sCIMProviderGroupRequest + return r +} + +func (r ApiProvidersScimGroupsCreateRequest) Execute() (*SCIMProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersScimGroupsCreateExecute(r) +} + +/* +ProvidersScimGroupsCreate Method for ProvidersScimGroupsCreate + +SCIMProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimGroupsCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimGroupsCreate(ctx context.Context) ApiProvidersScimGroupsCreateRequest { + return ApiProvidersScimGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMProviderGroup +func (a *ProvidersAPIService) ProvidersScimGroupsCreateExecute(r ApiProvidersScimGroupsCreateRequest) (*SCIMProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMProviderGroupRequest == nil { + return localVarReturnValue, nil, reportError("sCIMProviderGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMProviderGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimGroupsDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersScimGroupsDestroyExecute(r) +} + +/* +ProvidersScimGroupsDestroy Method for ProvidersScimGroupsDestroy + +SCIMProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider group. + @return ApiProvidersScimGroupsDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersScimGroupsDestroy(ctx context.Context, id string) ApiProvidersScimGroupsDestroyRequest { + return ApiProvidersScimGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersScimGroupsDestroyExecute(r ApiProvidersScimGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersScimGroupsListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + groupGroupUuid *string + groupName *string + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string +} + +func (r ApiProvidersScimGroupsListRequest) GroupGroupUuid(groupGroupUuid string) ApiProvidersScimGroupsListRequest { + r.groupGroupUuid = &groupGroupUuid + return r +} + +func (r ApiProvidersScimGroupsListRequest) GroupName(groupName string) ApiProvidersScimGroupsListRequest { + r.groupName = &groupName + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersScimGroupsListRequest) Ordering(ordering string) ApiProvidersScimGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersScimGroupsListRequest) Page(page int32) ApiProvidersScimGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersScimGroupsListRequest) PageSize(pageSize int32) ApiProvidersScimGroupsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersScimGroupsListRequest) ProviderId(providerId int32) ApiProvidersScimGroupsListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersScimGroupsListRequest) Search(search string) ApiProvidersScimGroupsListRequest { + r.search = &search + return r +} + +func (r ApiProvidersScimGroupsListRequest) Execute() (*PaginatedSCIMProviderGroupList, *http.Response, error) { + return r.ApiService.ProvidersScimGroupsListExecute(r) +} + +/* +ProvidersScimGroupsList Method for ProvidersScimGroupsList + +SCIMProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimGroupsListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimGroupsList(ctx context.Context) ApiProvidersScimGroupsListRequest { + return ApiProvidersScimGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMProviderGroupList +func (a *ProvidersAPIService) ProvidersScimGroupsListExecute(r ApiProvidersScimGroupsListRequest) (*PaginatedSCIMProviderGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMProviderGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.groupGroupUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__group_uuid", r.groupGroupUuid, "form", "") + } + if r.groupName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__name", r.groupName, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimGroupsRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimGroupsRetrieveRequest) Execute() (*SCIMProviderGroup, *http.Response, error) { + return r.ApiService.ProvidersScimGroupsRetrieveExecute(r) +} + +/* +ProvidersScimGroupsRetrieve Method for ProvidersScimGroupsRetrieve + +SCIMProviderGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider group. + @return ApiProvidersScimGroupsRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersScimGroupsRetrieve(ctx context.Context, id string) ApiProvidersScimGroupsRetrieveRequest { + return ApiProvidersScimGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMProviderGroup +func (a *ProvidersAPIService) ProvidersScimGroupsRetrieveExecute(r ApiProvidersScimGroupsRetrieveRequest) (*SCIMProviderGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProviderGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimGroupsUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersScimGroupsUsedByListExecute(r) +} + +/* +ProvidersScimGroupsUsedByList Method for ProvidersScimGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider group. + @return ApiProvidersScimGroupsUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimGroupsUsedByList(ctx context.Context, id string) ApiProvidersScimGroupsUsedByListRequest { + return ApiProvidersScimGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersScimGroupsUsedByListExecute(r ApiProvidersScimGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_groups/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + excludeUsersServiceAccount *bool + groupFilters *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + url *string +} + +func (r ApiProvidersScimListRequest) ExcludeUsersServiceAccount(excludeUsersServiceAccount bool) ApiProvidersScimListRequest { + r.excludeUsersServiceAccount = &excludeUsersServiceAccount + return r +} + +func (r ApiProvidersScimListRequest) GroupFilters(groupFilters []string) ApiProvidersScimListRequest { + r.groupFilters = &groupFilters + return r +} + +func (r ApiProvidersScimListRequest) Name(name string) ApiProvidersScimListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersScimListRequest) Ordering(ordering string) ApiProvidersScimListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersScimListRequest) Page(page int32) ApiProvidersScimListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersScimListRequest) PageSize(pageSize int32) ApiProvidersScimListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersScimListRequest) Search(search string) ApiProvidersScimListRequest { + r.search = &search + return r +} + +func (r ApiProvidersScimListRequest) Url(url string) ApiProvidersScimListRequest { + r.url = &url + return r +} + +func (r ApiProvidersScimListRequest) Execute() (*PaginatedSCIMProviderList, *http.Response, error) { + return r.ApiService.ProvidersScimListExecute(r) +} + +/* +ProvidersScimList Method for ProvidersScimList + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimList(ctx context.Context) ApiProvidersScimListRequest { + return ApiProvidersScimListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMProviderList +func (a *ProvidersAPIService) ProvidersScimListExecute(r ApiProvidersScimListRequest) (*PaginatedSCIMProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.excludeUsersServiceAccount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "exclude_users_service_account", r.excludeUsersServiceAccount, "form", "") + } + if r.groupFilters != nil { + t := *r.groupFilters + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_filters", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_filters", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.url != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "url", r.url, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedSCIMProviderRequest *PatchedSCIMProviderRequest +} + +func (r ApiProvidersScimPartialUpdateRequest) PatchedSCIMProviderRequest(patchedSCIMProviderRequest PatchedSCIMProviderRequest) ApiProvidersScimPartialUpdateRequest { + r.patchedSCIMProviderRequest = &patchedSCIMProviderRequest + return r +} + +func (r ApiProvidersScimPartialUpdateRequest) Execute() (*SCIMProvider, *http.Response, error) { + return r.ApiService.ProvidersScimPartialUpdateExecute(r) +} + +/* +ProvidersScimPartialUpdate Method for ProvidersScimPartialUpdate + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimPartialUpdate(ctx context.Context, id int32) ApiProvidersScimPartialUpdateRequest { + return ApiProvidersScimPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMProvider +func (a *ProvidersAPIService) ProvidersScimPartialUpdateExecute(r ApiProvidersScimPartialUpdateRequest) (*SCIMProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersScimRetrieveRequest) Execute() (*SCIMProvider, *http.Response, error) { + return r.ApiService.ProvidersScimRetrieveExecute(r) +} + +/* +ProvidersScimRetrieve Method for ProvidersScimRetrieve + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersScimRetrieve(ctx context.Context, id int32) ApiProvidersScimRetrieveRequest { + return ApiProvidersScimRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMProvider +func (a *ProvidersAPIService) ProvidersScimRetrieveExecute(r ApiProvidersScimRetrieveRequest) (*SCIMProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimSyncObjectCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + syncObjectRequest *SyncObjectRequest +} + +func (r ApiProvidersScimSyncObjectCreateRequest) SyncObjectRequest(syncObjectRequest SyncObjectRequest) ApiProvidersScimSyncObjectCreateRequest { + r.syncObjectRequest = &syncObjectRequest + return r +} + +func (r ApiProvidersScimSyncObjectCreateRequest) Execute() (*SyncObjectResult, *http.Response, error) { + return r.ApiService.ProvidersScimSyncObjectCreateExecute(r) +} + +/* +ProvidersScimSyncObjectCreate Method for ProvidersScimSyncObjectCreate + +Sync/Re-sync a single user/group object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimSyncObjectCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimSyncObjectCreate(ctx context.Context, id int32) ApiProvidersScimSyncObjectCreateRequest { + return ApiProvidersScimSyncObjectCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncObjectResult +func (a *ProvidersAPIService) ProvidersScimSyncObjectCreateExecute(r ApiProvidersScimSyncObjectCreateRequest) (*SyncObjectResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncObjectResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimSyncObjectCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/sync/object/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.syncObjectRequest == nil { + return localVarReturnValue, nil, reportError("syncObjectRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.syncObjectRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimSyncStatusRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersScimSyncStatusRetrieveRequest) Execute() (*SyncStatus, *http.Response, error) { + return r.ApiService.ProvidersScimSyncStatusRetrieveExecute(r) +} + +/* +ProvidersScimSyncStatusRetrieve Method for ProvidersScimSyncStatusRetrieve + +Get provider's sync status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimSyncStatusRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersScimSyncStatusRetrieve(ctx context.Context, id int32) ApiProvidersScimSyncStatusRetrieveRequest { + return ApiProvidersScimSyncStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SyncStatus +func (a *ProvidersAPIService) ProvidersScimSyncStatusRetrieveExecute(r ApiProvidersScimSyncStatusRetrieveRequest) (*SyncStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimSyncStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/sync/status/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + sCIMProviderRequest *SCIMProviderRequest +} + +func (r ApiProvidersScimUpdateRequest) SCIMProviderRequest(sCIMProviderRequest SCIMProviderRequest) ApiProvidersScimUpdateRequest { + r.sCIMProviderRequest = &sCIMProviderRequest + return r +} + +func (r ApiProvidersScimUpdateRequest) Execute() (*SCIMProvider, *http.Response, error) { + return r.ApiService.ProvidersScimUpdateExecute(r) +} + +/* +ProvidersScimUpdate Method for ProvidersScimUpdate + +SCIMProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUpdate(ctx context.Context, id int32) ApiProvidersScimUpdateRequest { + return ApiProvidersScimUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMProvider +func (a *ProvidersAPIService) ProvidersScimUpdateExecute(r ApiProvidersScimUpdateRequest) (*SCIMProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMProviderRequest == nil { + return localVarReturnValue, nil, reportError("sCIMProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersScimUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersScimUsedByListExecute(r) +} + +/* +ProvidersScimUsedByList Method for ProvidersScimUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this SCIM Provider. + @return ApiProvidersScimUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsedByList(ctx context.Context, id int32) ApiProvidersScimUsedByListRequest { + return ApiProvidersScimUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersScimUsedByListExecute(r ApiProvidersScimUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUsersCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + sCIMProviderUserRequest *SCIMProviderUserRequest +} + +func (r ApiProvidersScimUsersCreateRequest) SCIMProviderUserRequest(sCIMProviderUserRequest SCIMProviderUserRequest) ApiProvidersScimUsersCreateRequest { + r.sCIMProviderUserRequest = &sCIMProviderUserRequest + return r +} + +func (r ApiProvidersScimUsersCreateRequest) Execute() (*SCIMProviderUser, *http.Response, error) { + return r.ApiService.ProvidersScimUsersCreateExecute(r) +} + +/* +ProvidersScimUsersCreate Method for ProvidersScimUsersCreate + +SCIMProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimUsersCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsersCreate(ctx context.Context) ApiProvidersScimUsersCreateRequest { + return ApiProvidersScimUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMProviderUser +func (a *ProvidersAPIService) ProvidersScimUsersCreateExecute(r ApiProvidersScimUsersCreateRequest) (*SCIMProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMProviderUserRequest == nil { + return localVarReturnValue, nil, reportError("sCIMProviderUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMProviderUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUsersDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersScimUsersDestroyExecute(r) +} + +/* +ProvidersScimUsersDestroy Method for ProvidersScimUsersDestroy + +SCIMProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider user. + @return ApiProvidersScimUsersDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsersDestroy(ctx context.Context, id string) ApiProvidersScimUsersDestroyRequest { + return ApiProvidersScimUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersScimUsersDestroyExecute(r ApiProvidersScimUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersScimUsersListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + ordering *string + page *int32 + pageSize *int32 + providerId *int32 + search *string + userId *int32 + userUsername *string +} + +// Which field to use when ordering the results. +func (r ApiProvidersScimUsersListRequest) Ordering(ordering string) ApiProvidersScimUsersListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersScimUsersListRequest) Page(page int32) ApiProvidersScimUsersListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersScimUsersListRequest) PageSize(pageSize int32) ApiProvidersScimUsersListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersScimUsersListRequest) ProviderId(providerId int32) ApiProvidersScimUsersListRequest { + r.providerId = &providerId + return r +} + +// A search term. +func (r ApiProvidersScimUsersListRequest) Search(search string) ApiProvidersScimUsersListRequest { + r.search = &search + return r +} + +func (r ApiProvidersScimUsersListRequest) UserId(userId int32) ApiProvidersScimUsersListRequest { + r.userId = &userId + return r +} + +func (r ApiProvidersScimUsersListRequest) UserUsername(userUsername string) ApiProvidersScimUsersListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiProvidersScimUsersListRequest) Execute() (*PaginatedSCIMProviderUserList, *http.Response, error) { + return r.ApiService.ProvidersScimUsersListExecute(r) +} + +/* +ProvidersScimUsersList Method for ProvidersScimUsersList + +SCIMProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersScimUsersListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsersList(ctx context.Context) ApiProvidersScimUsersListRequest { + return ApiProvidersScimUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMProviderUserList +func (a *ProvidersAPIService) ProvidersScimUsersListExecute(r ApiProvidersScimUsersListRequest) (*PaginatedSCIMProviderUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMProviderUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.providerId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider__id", r.providerId, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__id", r.userId, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUsersRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimUsersRetrieveRequest) Execute() (*SCIMProviderUser, *http.Response, error) { + return r.ApiService.ProvidersScimUsersRetrieveExecute(r) +} + +/* +ProvidersScimUsersRetrieve Method for ProvidersScimUsersRetrieve + +SCIMProviderUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider user. + @return ApiProvidersScimUsersRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsersRetrieve(ctx context.Context, id string) ApiProvidersScimUsersRetrieveRequest { + return ApiProvidersScimUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMProviderUser +func (a *ProvidersAPIService) ProvidersScimUsersRetrieveExecute(r ApiProvidersScimUsersRetrieveRequest) (*SCIMProviderUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMProviderUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersScimUsersUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id string +} + +func (r ApiProvidersScimUsersUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersScimUsersUsedByListExecute(r) +} + +/* +ProvidersScimUsersUsedByList Method for ProvidersScimUsersUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this scim provider user. + @return ApiProvidersScimUsersUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersScimUsersUsedByList(ctx context.Context, id string) ApiProvidersScimUsersUsedByListRequest { + return ApiProvidersScimUsersUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersScimUsersUsedByListExecute(r ApiProvidersScimUsersUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersScimUsersUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/scim_users/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + sSFProviderRequest *SSFProviderRequest +} + +func (r ApiProvidersSsfCreateRequest) SSFProviderRequest(sSFProviderRequest SSFProviderRequest) ApiProvidersSsfCreateRequest { + r.sSFProviderRequest = &sSFProviderRequest + return r +} + +func (r ApiProvidersSsfCreateRequest) Execute() (*SSFProvider, *http.Response, error) { + return r.ApiService.ProvidersSsfCreateExecute(r) +} + +/* +ProvidersSsfCreate Method for ProvidersSsfCreate + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersSsfCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfCreate(ctx context.Context) ApiProvidersSsfCreateRequest { + return ApiProvidersSsfCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SSFProvider +func (a *ProvidersAPIService) ProvidersSsfCreateExecute(r ApiProvidersSsfCreateRequest) (*SSFProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSFProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sSFProviderRequest == nil { + return localVarReturnValue, nil, reportError("sSFProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sSFProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSsfDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersSsfDestroyExecute(r) +} + +/* +ProvidersSsfDestroy Method for ProvidersSsfDestroy + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Shared Signals Framework Provider. + @return ApiProvidersSsfDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfDestroy(ctx context.Context, id int32) ApiProvidersSsfDestroyRequest { + return ApiProvidersSsfDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersSsfDestroyExecute(r ApiProvidersSsfDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersSsfListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + applicationIsnull *bool + nameIexact *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiProvidersSsfListRequest) ApplicationIsnull(applicationIsnull bool) ApiProvidersSsfListRequest { + r.applicationIsnull = &applicationIsnull + return r +} + +func (r ApiProvidersSsfListRequest) NameIexact(nameIexact string) ApiProvidersSsfListRequest { + r.nameIexact = &nameIexact + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersSsfListRequest) Ordering(ordering string) ApiProvidersSsfListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersSsfListRequest) Page(page int32) ApiProvidersSsfListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersSsfListRequest) PageSize(pageSize int32) ApiProvidersSsfListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiProvidersSsfListRequest) Search(search string) ApiProvidersSsfListRequest { + r.search = &search + return r +} + +func (r ApiProvidersSsfListRequest) Execute() (*PaginatedSSFProviderList, *http.Response, error) { + return r.ApiService.ProvidersSsfListExecute(r) +} + +/* +ProvidersSsfList Method for ProvidersSsfList + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersSsfListRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfList(ctx context.Context) ApiProvidersSsfListRequest { + return ApiProvidersSsfListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSSFProviderList +func (a *ProvidersAPIService) ProvidersSsfListExecute(r ApiProvidersSsfListRequest) (*PaginatedSSFProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSSFProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.applicationIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "application__isnull", r.applicationIsnull, "form", "") + } + if r.nameIexact != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name__iexact", r.nameIexact, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedSSFProviderRequest *PatchedSSFProviderRequest +} + +func (r ApiProvidersSsfPartialUpdateRequest) PatchedSSFProviderRequest(patchedSSFProviderRequest PatchedSSFProviderRequest) ApiProvidersSsfPartialUpdateRequest { + r.patchedSSFProviderRequest = &patchedSSFProviderRequest + return r +} + +func (r ApiProvidersSsfPartialUpdateRequest) Execute() (*SSFProvider, *http.Response, error) { + return r.ApiService.ProvidersSsfPartialUpdateExecute(r) +} + +/* +ProvidersSsfPartialUpdate Method for ProvidersSsfPartialUpdate + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Shared Signals Framework Provider. + @return ApiProvidersSsfPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfPartialUpdate(ctx context.Context, id int32) ApiProvidersSsfPartialUpdateRequest { + return ApiProvidersSsfPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSFProvider +func (a *ProvidersAPIService) ProvidersSsfPartialUpdateExecute(r ApiProvidersSsfPartialUpdateRequest) (*SSFProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSFProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSSFProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSsfRetrieveRequest) Execute() (*SSFProvider, *http.Response, error) { + return r.ApiService.ProvidersSsfRetrieveExecute(r) +} + +/* +ProvidersSsfRetrieve Method for ProvidersSsfRetrieve + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Shared Signals Framework Provider. + @return ApiProvidersSsfRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfRetrieve(ctx context.Context, id int32) ApiProvidersSsfRetrieveRequest { + return ApiProvidersSsfRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSFProvider +func (a *ProvidersAPIService) ProvidersSsfRetrieveExecute(r ApiProvidersSsfRetrieveRequest) (*SSFProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSFProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + sSFProviderRequest *SSFProviderRequest +} + +func (r ApiProvidersSsfUpdateRequest) SSFProviderRequest(sSFProviderRequest SSFProviderRequest) ApiProvidersSsfUpdateRequest { + r.sSFProviderRequest = &sSFProviderRequest + return r +} + +func (r ApiProvidersSsfUpdateRequest) Execute() (*SSFProvider, *http.Response, error) { + return r.ApiService.ProvidersSsfUpdateExecute(r) +} + +/* +ProvidersSsfUpdate Method for ProvidersSsfUpdate + +SSFProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Shared Signals Framework Provider. + @return ApiProvidersSsfUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfUpdate(ctx context.Context, id int32) ApiProvidersSsfUpdateRequest { + return ApiProvidersSsfUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SSFProvider +func (a *ProvidersAPIService) ProvidersSsfUpdateExecute(r ApiProvidersSsfUpdateRequest) (*SSFProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSFProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sSFProviderRequest == nil { + return localVarReturnValue, nil, reportError("sSFProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sSFProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersSsfUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersSsfUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersSsfUsedByListExecute(r) +} + +/* +ProvidersSsfUsedByList Method for ProvidersSsfUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Shared Signals Framework Provider. + @return ApiProvidersSsfUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersSsfUsedByList(ctx context.Context, id int32) ApiProvidersSsfUsedByListRequest { + return ApiProvidersSsfUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersSsfUsedByListExecute(r ApiProvidersSsfUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersSsfUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/ssf/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedCreateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + wSFederationProviderRequest *WSFederationProviderRequest +} + +func (r ApiProvidersWsfedCreateRequest) WSFederationProviderRequest(wSFederationProviderRequest WSFederationProviderRequest) ApiProvidersWsfedCreateRequest { + r.wSFederationProviderRequest = &wSFederationProviderRequest + return r +} + +func (r ApiProvidersWsfedCreateRequest) Execute() (*WSFederationProvider, *http.Response, error) { + return r.ApiService.ProvidersWsfedCreateExecute(r) +} + +/* +ProvidersWsfedCreate Method for ProvidersWsfedCreate + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersWsfedCreateRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedCreate(ctx context.Context) ApiProvidersWsfedCreateRequest { + return ApiProvidersWsfedCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return WSFederationProvider +func (a *ProvidersAPIService) ProvidersWsfedCreateExecute(r ApiProvidersWsfedCreateRequest) (*WSFederationProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WSFederationProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wSFederationProviderRequest == nil { + return localVarReturnValue, nil, reportError("wSFederationProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wSFederationProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedDestroyRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersWsfedDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ProvidersWsfedDestroyExecute(r) +} + +/* +ProvidersWsfedDestroy Method for ProvidersWsfedDestroy + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedDestroyRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedDestroy(ctx context.Context, id int32) ApiProvidersWsfedDestroyRequest { + return ApiProvidersWsfedDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ProvidersAPIService) ProvidersWsfedDestroyExecute(r ApiProvidersWsfedDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiProvidersWsfedListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + acsUrl *string + assertionValidNotBefore *string + assertionValidNotOnOrAfter *string + audience *string + authenticationFlow *string + authnContextClassRefMapping *string + authorizationFlow *string + backchannelApplication *string + defaultNameIdPolicy *string + defaultRelayState *string + digestAlgorithm *string + encryptionKp *string + invalidationFlow *string + isBackchannel *bool + issuer *string + logoutMethod *string + name *string + nameIdMapping *string + ordering *string + page *int32 + pageSize *int32 + propertyMappings *[]string + search *string + sessionValidNotOnOrAfter *string + signAssertion *bool + signLogoutRequest *bool + signLogoutResponse *bool + signResponse *bool + signatureAlgorithm *string + signingKp *string + slsBinding *string + slsUrl *string + spBinding *string + verificationKp *string +} + +func (r ApiProvidersWsfedListRequest) AcsUrl(acsUrl string) ApiProvidersWsfedListRequest { + r.acsUrl = &acsUrl + return r +} + +func (r ApiProvidersWsfedListRequest) AssertionValidNotBefore(assertionValidNotBefore string) ApiProvidersWsfedListRequest { + r.assertionValidNotBefore = &assertionValidNotBefore + return r +} + +func (r ApiProvidersWsfedListRequest) AssertionValidNotOnOrAfter(assertionValidNotOnOrAfter string) ApiProvidersWsfedListRequest { + r.assertionValidNotOnOrAfter = &assertionValidNotOnOrAfter + return r +} + +func (r ApiProvidersWsfedListRequest) Audience(audience string) ApiProvidersWsfedListRequest { + r.audience = &audience + return r +} + +func (r ApiProvidersWsfedListRequest) AuthenticationFlow(authenticationFlow string) ApiProvidersWsfedListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiProvidersWsfedListRequest) AuthnContextClassRefMapping(authnContextClassRefMapping string) ApiProvidersWsfedListRequest { + r.authnContextClassRefMapping = &authnContextClassRefMapping + return r +} + +func (r ApiProvidersWsfedListRequest) AuthorizationFlow(authorizationFlow string) ApiProvidersWsfedListRequest { + r.authorizationFlow = &authorizationFlow + return r +} + +func (r ApiProvidersWsfedListRequest) BackchannelApplication(backchannelApplication string) ApiProvidersWsfedListRequest { + r.backchannelApplication = &backchannelApplication + return r +} + +func (r ApiProvidersWsfedListRequest) DefaultNameIdPolicy(defaultNameIdPolicy string) ApiProvidersWsfedListRequest { + r.defaultNameIdPolicy = &defaultNameIdPolicy + return r +} + +func (r ApiProvidersWsfedListRequest) DefaultRelayState(defaultRelayState string) ApiProvidersWsfedListRequest { + r.defaultRelayState = &defaultRelayState + return r +} + +func (r ApiProvidersWsfedListRequest) DigestAlgorithm(digestAlgorithm string) ApiProvidersWsfedListRequest { + r.digestAlgorithm = &digestAlgorithm + return r +} + +func (r ApiProvidersWsfedListRequest) EncryptionKp(encryptionKp string) ApiProvidersWsfedListRequest { + r.encryptionKp = &encryptionKp + return r +} + +func (r ApiProvidersWsfedListRequest) InvalidationFlow(invalidationFlow string) ApiProvidersWsfedListRequest { + r.invalidationFlow = &invalidationFlow + return r +} + +func (r ApiProvidersWsfedListRequest) IsBackchannel(isBackchannel bool) ApiProvidersWsfedListRequest { + r.isBackchannel = &isBackchannel + return r +} + +func (r ApiProvidersWsfedListRequest) Issuer(issuer string) ApiProvidersWsfedListRequest { + r.issuer = &issuer + return r +} + +// Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in hidden iframes. Front-channel native uses your active browser tab to send post requests and redirect to providers. Back-channel sends logout requests directly from the server without user interaction (requires POST SLS binding). +func (r ApiProvidersWsfedListRequest) LogoutMethod(logoutMethod string) ApiProvidersWsfedListRequest { + r.logoutMethod = &logoutMethod + return r +} + +func (r ApiProvidersWsfedListRequest) Name(name string) ApiProvidersWsfedListRequest { + r.name = &name + return r +} + +func (r ApiProvidersWsfedListRequest) NameIdMapping(nameIdMapping string) ApiProvidersWsfedListRequest { + r.nameIdMapping = &nameIdMapping + return r +} + +// Which field to use when ordering the results. +func (r ApiProvidersWsfedListRequest) Ordering(ordering string) ApiProvidersWsfedListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiProvidersWsfedListRequest) Page(page int32) ApiProvidersWsfedListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiProvidersWsfedListRequest) PageSize(pageSize int32) ApiProvidersWsfedListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiProvidersWsfedListRequest) PropertyMappings(propertyMappings []string) ApiProvidersWsfedListRequest { + r.propertyMappings = &propertyMappings + return r +} + +// A search term. +func (r ApiProvidersWsfedListRequest) Search(search string) ApiProvidersWsfedListRequest { + r.search = &search + return r +} + +func (r ApiProvidersWsfedListRequest) SessionValidNotOnOrAfter(sessionValidNotOnOrAfter string) ApiProvidersWsfedListRequest { + r.sessionValidNotOnOrAfter = &sessionValidNotOnOrAfter + return r +} + +func (r ApiProvidersWsfedListRequest) SignAssertion(signAssertion bool) ApiProvidersWsfedListRequest { + r.signAssertion = &signAssertion + return r +} + +func (r ApiProvidersWsfedListRequest) SignLogoutRequest(signLogoutRequest bool) ApiProvidersWsfedListRequest { + r.signLogoutRequest = &signLogoutRequest + return r +} + +func (r ApiProvidersWsfedListRequest) SignLogoutResponse(signLogoutResponse bool) ApiProvidersWsfedListRequest { + r.signLogoutResponse = &signLogoutResponse + return r +} + +func (r ApiProvidersWsfedListRequest) SignResponse(signResponse bool) ApiProvidersWsfedListRequest { + r.signResponse = &signResponse + return r +} + +func (r ApiProvidersWsfedListRequest) SignatureAlgorithm(signatureAlgorithm string) ApiProvidersWsfedListRequest { + r.signatureAlgorithm = &signatureAlgorithm + return r +} + +func (r ApiProvidersWsfedListRequest) SigningKp(signingKp string) ApiProvidersWsfedListRequest { + r.signingKp = &signingKp + return r +} + +// This determines how authentik sends the logout response back to the Service Provider. +func (r ApiProvidersWsfedListRequest) SlsBinding(slsBinding string) ApiProvidersWsfedListRequest { + r.slsBinding = &slsBinding + return r +} + +func (r ApiProvidersWsfedListRequest) SlsUrl(slsUrl string) ApiProvidersWsfedListRequest { + r.slsUrl = &slsUrl + return r +} + +// This determines how authentik sends the response back to the Service Provider. +func (r ApiProvidersWsfedListRequest) SpBinding(spBinding string) ApiProvidersWsfedListRequest { + r.spBinding = &spBinding + return r +} + +func (r ApiProvidersWsfedListRequest) VerificationKp(verificationKp string) ApiProvidersWsfedListRequest { + r.verificationKp = &verificationKp + return r +} + +func (r ApiProvidersWsfedListRequest) Execute() (*PaginatedWSFederationProviderList, *http.Response, error) { + return r.ApiService.ProvidersWsfedListExecute(r) +} + +/* +ProvidersWsfedList Method for ProvidersWsfedList + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiProvidersWsfedListRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedList(ctx context.Context) ApiProvidersWsfedListRequest { + return ApiProvidersWsfedListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWSFederationProviderList +func (a *ProvidersAPIService) ProvidersWsfedListExecute(r ApiProvidersWsfedListRequest) (*PaginatedWSFederationProviderList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWSFederationProviderList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.acsUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "acs_url", r.acsUrl, "form", "") + } + if r.assertionValidNotBefore != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assertion_valid_not_before", r.assertionValidNotBefore, "form", "") + } + if r.assertionValidNotOnOrAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "assertion_valid_not_on_or_after", r.assertionValidNotOnOrAfter, "form", "") + } + if r.audience != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "audience", r.audience, "form", "") + } + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.authnContextClassRefMapping != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authn_context_class_ref_mapping", r.authnContextClassRefMapping, "form", "") + } + if r.authorizationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_flow", r.authorizationFlow, "form", "") + } + if r.backchannelApplication != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "backchannel_application", r.backchannelApplication, "form", "") + } + if r.defaultNameIdPolicy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_name_id_policy", r.defaultNameIdPolicy, "form", "") + } + if r.defaultRelayState != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "default_relay_state", r.defaultRelayState, "form", "") + } + if r.digestAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "digest_algorithm", r.digestAlgorithm, "form", "") + } + if r.encryptionKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "encryption_kp", r.encryptionKp, "form", "") + } + if r.invalidationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "invalidation_flow", r.invalidationFlow, "form", "") + } + if r.isBackchannel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "is_backchannel", r.isBackchannel, "form", "") + } + if r.issuer != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "issuer", r.issuer, "form", "") + } + if r.logoutMethod != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "logout_method", r.logoutMethod, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.nameIdMapping != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name_id_mapping", r.nameIdMapping, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.propertyMappings != nil { + t := *r.propertyMappings + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "property_mappings", t, "form", "multi") + } + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sessionValidNotOnOrAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session_valid_not_on_or_after", r.sessionValidNotOnOrAfter, "form", "") + } + if r.signAssertion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_assertion", r.signAssertion, "form", "") + } + if r.signLogoutRequest != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_logout_request", r.signLogoutRequest, "form", "") + } + if r.signLogoutResponse != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_logout_response", r.signLogoutResponse, "form", "") + } + if r.signResponse != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sign_response", r.signResponse, "form", "") + } + if r.signatureAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature_algorithm", r.signatureAlgorithm, "form", "") + } + if r.signingKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signing_kp", r.signingKp, "form", "") + } + if r.slsBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sls_binding", r.slsBinding, "form", "") + } + if r.slsUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sls_url", r.slsUrl, "form", "") + } + if r.spBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sp_binding", r.spBinding, "form", "") + } + if r.verificationKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "verification_kp", r.verificationKp, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedMetadataRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + download *bool + forceBinding *string +} + +func (r ApiProvidersWsfedMetadataRetrieveRequest) Download(download bool) ApiProvidersWsfedMetadataRetrieveRequest { + r.download = &download + return r +} + +// Optionally force the metadata to only include one binding. +func (r ApiProvidersWsfedMetadataRetrieveRequest) ForceBinding(forceBinding string) ApiProvidersWsfedMetadataRetrieveRequest { + r.forceBinding = &forceBinding + return r +} + +func (r ApiProvidersWsfedMetadataRetrieveRequest) Execute() (*SAMLMetadata, *http.Response, error) { + return r.ApiService.ProvidersWsfedMetadataRetrieveExecute(r) +} + +/* +ProvidersWsfedMetadataRetrieve Method for ProvidersWsfedMetadataRetrieve + +Return metadata as XML string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedMetadataRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedMetadataRetrieve(ctx context.Context, id int32) ApiProvidersWsfedMetadataRetrieveRequest { + return ApiProvidersWsfedMetadataRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SAMLMetadata +func (a *ProvidersAPIService) ProvidersWsfedMetadataRetrieveExecute(r ApiProvidersWsfedMetadataRetrieveRequest) (*SAMLMetadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLMetadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedMetadataRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/metadata/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.download != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "download", r.download, "form", "") + } + if r.forceBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force_binding", r.forceBinding, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json", "application/xml"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedPartialUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + patchedWSFederationProviderRequest *PatchedWSFederationProviderRequest +} + +func (r ApiProvidersWsfedPartialUpdateRequest) PatchedWSFederationProviderRequest(patchedWSFederationProviderRequest PatchedWSFederationProviderRequest) ApiProvidersWsfedPartialUpdateRequest { + r.patchedWSFederationProviderRequest = &patchedWSFederationProviderRequest + return r +} + +func (r ApiProvidersWsfedPartialUpdateRequest) Execute() (*WSFederationProvider, *http.Response, error) { + return r.ApiService.ProvidersWsfedPartialUpdateExecute(r) +} + +/* +ProvidersWsfedPartialUpdate Method for ProvidersWsfedPartialUpdate + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedPartialUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedPartialUpdate(ctx context.Context, id int32) ApiProvidersWsfedPartialUpdateRequest { + return ApiProvidersWsfedPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WSFederationProvider +func (a *ProvidersAPIService) ProvidersWsfedPartialUpdateExecute(r ApiProvidersWsfedPartialUpdateRequest) (*WSFederationProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WSFederationProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedWSFederationProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedPreviewUserRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + forUser *int32 +} + +func (r ApiProvidersWsfedPreviewUserRetrieveRequest) ForUser(forUser int32) ApiProvidersWsfedPreviewUserRetrieveRequest { + r.forUser = &forUser + return r +} + +func (r ApiProvidersWsfedPreviewUserRetrieveRequest) Execute() (*PropertyMappingPreview, *http.Response, error) { + return r.ApiService.ProvidersWsfedPreviewUserRetrieveExecute(r) +} + +/* +ProvidersWsfedPreviewUserRetrieve Method for ProvidersWsfedPreviewUserRetrieve + +Preview user data for provider + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedPreviewUserRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedPreviewUserRetrieve(ctx context.Context, id int32) ApiProvidersWsfedPreviewUserRetrieveRequest { + return ApiProvidersWsfedPreviewUserRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return PropertyMappingPreview +func (a *ProvidersAPIService) ProvidersWsfedPreviewUserRetrieveExecute(r ApiProvidersWsfedPreviewUserRetrieveRequest) (*PropertyMappingPreview, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PropertyMappingPreview + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedPreviewUserRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/preview_user/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.forUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "for_user", r.forUser, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedRetrieveRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersWsfedRetrieveRequest) Execute() (*WSFederationProvider, *http.Response, error) { + return r.ApiService.ProvidersWsfedRetrieveExecute(r) +} + +/* +ProvidersWsfedRetrieve Method for ProvidersWsfedRetrieve + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedRetrieveRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedRetrieve(ctx context.Context, id int32) ApiProvidersWsfedRetrieveRequest { + return ApiProvidersWsfedRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WSFederationProvider +func (a *ProvidersAPIService) ProvidersWsfedRetrieveExecute(r ApiProvidersWsfedRetrieveRequest) (*WSFederationProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WSFederationProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedUpdateRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 + wSFederationProviderRequest *WSFederationProviderRequest +} + +func (r ApiProvidersWsfedUpdateRequest) WSFederationProviderRequest(wSFederationProviderRequest WSFederationProviderRequest) ApiProvidersWsfedUpdateRequest { + r.wSFederationProviderRequest = &wSFederationProviderRequest + return r +} + +func (r ApiProvidersWsfedUpdateRequest) Execute() (*WSFederationProvider, *http.Response, error) { + return r.ApiService.ProvidersWsfedUpdateExecute(r) +} + +/* +ProvidersWsfedUpdate Method for ProvidersWsfedUpdate + +WSFederationProvider Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedUpdateRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedUpdate(ctx context.Context, id int32) ApiProvidersWsfedUpdateRequest { + return ApiProvidersWsfedUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return WSFederationProvider +func (a *ProvidersAPIService) ProvidersWsfedUpdateExecute(r ApiProvidersWsfedUpdateRequest) (*WSFederationProvider, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WSFederationProvider + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.wSFederationProviderRequest == nil { + return localVarReturnValue, nil, reportError("wSFederationProviderRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.wSFederationProviderRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiProvidersWsfedUsedByListRequest struct { + ctx context.Context + ApiService *ProvidersAPIService + id int32 +} + +func (r ApiProvidersWsfedUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.ProvidersWsfedUsedByListExecute(r) +} + +/* +ProvidersWsfedUsedByList Method for ProvidersWsfedUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this WS-Federation Provider. + @return ApiProvidersWsfedUsedByListRequest +*/ +func (a *ProvidersAPIService) ProvidersWsfedUsedByList(ctx context.Context, id int32) ApiProvidersWsfedUsedByListRequest { + return ApiProvidersWsfedUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *ProvidersAPIService) ProvidersWsfedUsedByListExecute(r ApiProvidersWsfedUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ProvidersAPIService.ProvidersWsfedUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/providers/wsfed/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_rac.go b/packages/client-go/api_rac.go new file mode 100644 index 0000000000..d534acfcbc --- /dev/null +++ b/packages/client-go/api_rac.go @@ -0,0 +1,1785 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// RacAPIService RacAPI service +type RacAPIService service + +type ApiRacConnectionTokensDestroyRequest struct { + ctx context.Context + ApiService *RacAPIService + connectionTokenUuid string +} + +func (r ApiRacConnectionTokensDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.RacConnectionTokensDestroyExecute(r) +} + +/* +RacConnectionTokensDestroy Method for RacConnectionTokensDestroy + +ConnectionToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionTokenUuid A UUID string identifying this RAC Connection token. + @return ApiRacConnectionTokensDestroyRequest +*/ +func (a *RacAPIService) RacConnectionTokensDestroy(ctx context.Context, connectionTokenUuid string) ApiRacConnectionTokensDestroyRequest { + return ApiRacConnectionTokensDestroyRequest{ + ApiService: a, + ctx: ctx, + connectionTokenUuid: connectionTokenUuid, + } +} + +// Execute executes the request +func (a *RacAPIService) RacConnectionTokensDestroyExecute(r ApiRacConnectionTokensDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/{connection_token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connection_token_uuid"+"}", url.PathEscape(parameterValueToString(r.connectionTokenUuid, "connectionTokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRacConnectionTokensListRequest struct { + ctx context.Context + ApiService *RacAPIService + endpoint *string + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string + sessionUser *int32 +} + +func (r ApiRacConnectionTokensListRequest) Endpoint(endpoint string) ApiRacConnectionTokensListRequest { + r.endpoint = &endpoint + return r +} + +// Which field to use when ordering the results. +func (r ApiRacConnectionTokensListRequest) Ordering(ordering string) ApiRacConnectionTokensListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRacConnectionTokensListRequest) Page(page int32) ApiRacConnectionTokensListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRacConnectionTokensListRequest) PageSize(pageSize int32) ApiRacConnectionTokensListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiRacConnectionTokensListRequest) Provider(provider int32) ApiRacConnectionTokensListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiRacConnectionTokensListRequest) Search(search string) ApiRacConnectionTokensListRequest { + r.search = &search + return r +} + +func (r ApiRacConnectionTokensListRequest) SessionUser(sessionUser int32) ApiRacConnectionTokensListRequest { + r.sessionUser = &sessionUser + return r +} + +func (r ApiRacConnectionTokensListRequest) Execute() (*PaginatedConnectionTokenList, *http.Response, error) { + return r.ApiService.RacConnectionTokensListExecute(r) +} + +/* +RacConnectionTokensList Method for RacConnectionTokensList + +ConnectionToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRacConnectionTokensListRequest +*/ +func (a *RacAPIService) RacConnectionTokensList(ctx context.Context) ApiRacConnectionTokensListRequest { + return ApiRacConnectionTokensListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConnectionTokenList +func (a *RacAPIService) RacConnectionTokensListExecute(r ApiRacConnectionTokensListRequest) (*PaginatedConnectionTokenList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConnectionTokenList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.endpoint != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint", r.endpoint, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sessionUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session__user", r.sessionUser, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacConnectionTokensPartialUpdateRequest struct { + ctx context.Context + ApiService *RacAPIService + connectionTokenUuid string + patchedConnectionTokenRequest *PatchedConnectionTokenRequest +} + +func (r ApiRacConnectionTokensPartialUpdateRequest) PatchedConnectionTokenRequest(patchedConnectionTokenRequest PatchedConnectionTokenRequest) ApiRacConnectionTokensPartialUpdateRequest { + r.patchedConnectionTokenRequest = &patchedConnectionTokenRequest + return r +} + +func (r ApiRacConnectionTokensPartialUpdateRequest) Execute() (*ConnectionToken, *http.Response, error) { + return r.ApiService.RacConnectionTokensPartialUpdateExecute(r) +} + +/* +RacConnectionTokensPartialUpdate Method for RacConnectionTokensPartialUpdate + +ConnectionToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionTokenUuid A UUID string identifying this RAC Connection token. + @return ApiRacConnectionTokensPartialUpdateRequest +*/ +func (a *RacAPIService) RacConnectionTokensPartialUpdate(ctx context.Context, connectionTokenUuid string) ApiRacConnectionTokensPartialUpdateRequest { + return ApiRacConnectionTokensPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + connectionTokenUuid: connectionTokenUuid, + } +} + +// Execute executes the request +// +// @return ConnectionToken +func (a *RacAPIService) RacConnectionTokensPartialUpdateExecute(r ApiRacConnectionTokensPartialUpdateRequest) (*ConnectionToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConnectionToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/{connection_token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connection_token_uuid"+"}", url.PathEscape(parameterValueToString(r.connectionTokenUuid, "connectionTokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedConnectionTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacConnectionTokensRetrieveRequest struct { + ctx context.Context + ApiService *RacAPIService + connectionTokenUuid string +} + +func (r ApiRacConnectionTokensRetrieveRequest) Execute() (*ConnectionToken, *http.Response, error) { + return r.ApiService.RacConnectionTokensRetrieveExecute(r) +} + +/* +RacConnectionTokensRetrieve Method for RacConnectionTokensRetrieve + +ConnectionToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionTokenUuid A UUID string identifying this RAC Connection token. + @return ApiRacConnectionTokensRetrieveRequest +*/ +func (a *RacAPIService) RacConnectionTokensRetrieve(ctx context.Context, connectionTokenUuid string) ApiRacConnectionTokensRetrieveRequest { + return ApiRacConnectionTokensRetrieveRequest{ + ApiService: a, + ctx: ctx, + connectionTokenUuid: connectionTokenUuid, + } +} + +// Execute executes the request +// +// @return ConnectionToken +func (a *RacAPIService) RacConnectionTokensRetrieveExecute(r ApiRacConnectionTokensRetrieveRequest) (*ConnectionToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConnectionToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/{connection_token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connection_token_uuid"+"}", url.PathEscape(parameterValueToString(r.connectionTokenUuid, "connectionTokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacConnectionTokensUpdateRequest struct { + ctx context.Context + ApiService *RacAPIService + connectionTokenUuid string + connectionTokenRequest *ConnectionTokenRequest +} + +func (r ApiRacConnectionTokensUpdateRequest) ConnectionTokenRequest(connectionTokenRequest ConnectionTokenRequest) ApiRacConnectionTokensUpdateRequest { + r.connectionTokenRequest = &connectionTokenRequest + return r +} + +func (r ApiRacConnectionTokensUpdateRequest) Execute() (*ConnectionToken, *http.Response, error) { + return r.ApiService.RacConnectionTokensUpdateExecute(r) +} + +/* +RacConnectionTokensUpdate Method for RacConnectionTokensUpdate + +ConnectionToken Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionTokenUuid A UUID string identifying this RAC Connection token. + @return ApiRacConnectionTokensUpdateRequest +*/ +func (a *RacAPIService) RacConnectionTokensUpdate(ctx context.Context, connectionTokenUuid string) ApiRacConnectionTokensUpdateRequest { + return ApiRacConnectionTokensUpdateRequest{ + ApiService: a, + ctx: ctx, + connectionTokenUuid: connectionTokenUuid, + } +} + +// Execute executes the request +// +// @return ConnectionToken +func (a *RacAPIService) RacConnectionTokensUpdateExecute(r ApiRacConnectionTokensUpdateRequest) (*ConnectionToken, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConnectionToken + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/{connection_token_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"connection_token_uuid"+"}", url.PathEscape(parameterValueToString(r.connectionTokenUuid, "connectionTokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.connectionTokenRequest == nil { + return localVarReturnValue, nil, reportError("connectionTokenRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.connectionTokenRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacConnectionTokensUsedByListRequest struct { + ctx context.Context + ApiService *RacAPIService + connectionTokenUuid string +} + +func (r ApiRacConnectionTokensUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.RacConnectionTokensUsedByListExecute(r) +} + +/* +RacConnectionTokensUsedByList Method for RacConnectionTokensUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param connectionTokenUuid A UUID string identifying this RAC Connection token. + @return ApiRacConnectionTokensUsedByListRequest +*/ +func (a *RacAPIService) RacConnectionTokensUsedByList(ctx context.Context, connectionTokenUuid string) ApiRacConnectionTokensUsedByListRequest { + return ApiRacConnectionTokensUsedByListRequest{ + ApiService: a, + ctx: ctx, + connectionTokenUuid: connectionTokenUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *RacAPIService) RacConnectionTokensUsedByListExecute(r ApiRacConnectionTokensUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacConnectionTokensUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/connection_tokens/{connection_token_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"connection_token_uuid"+"}", url.PathEscape(parameterValueToString(r.connectionTokenUuid, "connectionTokenUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsCreateRequest struct { + ctx context.Context + ApiService *RacAPIService + endpointRequest *EndpointRequest +} + +func (r ApiRacEndpointsCreateRequest) EndpointRequest(endpointRequest EndpointRequest) ApiRacEndpointsCreateRequest { + r.endpointRequest = &endpointRequest + return r +} + +func (r ApiRacEndpointsCreateRequest) Execute() (*Endpoint, *http.Response, error) { + return r.ApiService.RacEndpointsCreateExecute(r) +} + +/* +RacEndpointsCreate Method for RacEndpointsCreate + +Endpoint Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRacEndpointsCreateRequest +*/ +func (a *RacAPIService) RacEndpointsCreate(ctx context.Context) ApiRacEndpointsCreateRequest { + return ApiRacEndpointsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Endpoint +func (a *RacAPIService) RacEndpointsCreateExecute(r ApiRacEndpointsCreateRequest) (*Endpoint, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Endpoint + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.endpointRequest == nil { + return localVarReturnValue, nil, reportError("endpointRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.endpointRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsDestroyRequest struct { + ctx context.Context + ApiService *RacAPIService + pbmUuid string +} + +func (r ApiRacEndpointsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.RacEndpointsDestroyExecute(r) +} + +/* +RacEndpointsDestroy Method for RacEndpointsDestroy + +Endpoint Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this RAC Endpoint. + @return ApiRacEndpointsDestroyRequest +*/ +func (a *RacAPIService) RacEndpointsDestroy(ctx context.Context, pbmUuid string) ApiRacEndpointsDestroyRequest { + return ApiRacEndpointsDestroyRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +func (a *RacAPIService) RacEndpointsDestroyExecute(r ApiRacEndpointsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRacEndpointsListRequest struct { + ctx context.Context + ApiService *RacAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string + superuserFullList *bool +} + +func (r ApiRacEndpointsListRequest) Name(name string) ApiRacEndpointsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiRacEndpointsListRequest) Ordering(ordering string) ApiRacEndpointsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRacEndpointsListRequest) Page(page int32) ApiRacEndpointsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRacEndpointsListRequest) PageSize(pageSize int32) ApiRacEndpointsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiRacEndpointsListRequest) Provider(provider int32) ApiRacEndpointsListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiRacEndpointsListRequest) Search(search string) ApiRacEndpointsListRequest { + r.search = &search + return r +} + +func (r ApiRacEndpointsListRequest) SuperuserFullList(superuserFullList bool) ApiRacEndpointsListRequest { + r.superuserFullList = &superuserFullList + return r +} + +func (r ApiRacEndpointsListRequest) Execute() (*PaginatedEndpointList, *http.Response, error) { + return r.ApiService.RacEndpointsListExecute(r) +} + +/* +RacEndpointsList Method for RacEndpointsList + +List accessible endpoints + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRacEndpointsListRequest +*/ +func (a *RacAPIService) RacEndpointsList(ctx context.Context) ApiRacEndpointsListRequest { + return ApiRacEndpointsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEndpointList +func (a *RacAPIService) RacEndpointsListExecute(r ApiRacEndpointsListRequest) (*PaginatedEndpointList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEndpointList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.superuserFullList != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "superuser_full_list", r.superuserFullList, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsPartialUpdateRequest struct { + ctx context.Context + ApiService *RacAPIService + pbmUuid string + patchedEndpointRequest *PatchedEndpointRequest +} + +func (r ApiRacEndpointsPartialUpdateRequest) PatchedEndpointRequest(patchedEndpointRequest PatchedEndpointRequest) ApiRacEndpointsPartialUpdateRequest { + r.patchedEndpointRequest = &patchedEndpointRequest + return r +} + +func (r ApiRacEndpointsPartialUpdateRequest) Execute() (*Endpoint, *http.Response, error) { + return r.ApiService.RacEndpointsPartialUpdateExecute(r) +} + +/* +RacEndpointsPartialUpdate Method for RacEndpointsPartialUpdate + +Endpoint Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this RAC Endpoint. + @return ApiRacEndpointsPartialUpdateRequest +*/ +func (a *RacAPIService) RacEndpointsPartialUpdate(ctx context.Context, pbmUuid string) ApiRacEndpointsPartialUpdateRequest { + return ApiRacEndpointsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return Endpoint +func (a *RacAPIService) RacEndpointsPartialUpdateExecute(r ApiRacEndpointsPartialUpdateRequest) (*Endpoint, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Endpoint + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEndpointRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsRetrieveRequest struct { + ctx context.Context + ApiService *RacAPIService + pbmUuid string +} + +func (r ApiRacEndpointsRetrieveRequest) Execute() (*Endpoint, *http.Response, error) { + return r.ApiService.RacEndpointsRetrieveExecute(r) +} + +/* +RacEndpointsRetrieve Method for RacEndpointsRetrieve + +Endpoint Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this RAC Endpoint. + @return ApiRacEndpointsRetrieveRequest +*/ +func (a *RacAPIService) RacEndpointsRetrieve(ctx context.Context, pbmUuid string) ApiRacEndpointsRetrieveRequest { + return ApiRacEndpointsRetrieveRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return Endpoint +func (a *RacAPIService) RacEndpointsRetrieveExecute(r ApiRacEndpointsRetrieveRequest) (*Endpoint, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Endpoint + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsUpdateRequest struct { + ctx context.Context + ApiService *RacAPIService + pbmUuid string + endpointRequest *EndpointRequest +} + +func (r ApiRacEndpointsUpdateRequest) EndpointRequest(endpointRequest EndpointRequest) ApiRacEndpointsUpdateRequest { + r.endpointRequest = &endpointRequest + return r +} + +func (r ApiRacEndpointsUpdateRequest) Execute() (*Endpoint, *http.Response, error) { + return r.ApiService.RacEndpointsUpdateExecute(r) +} + +/* +RacEndpointsUpdate Method for RacEndpointsUpdate + +Endpoint Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this RAC Endpoint. + @return ApiRacEndpointsUpdateRequest +*/ +func (a *RacAPIService) RacEndpointsUpdate(ctx context.Context, pbmUuid string) ApiRacEndpointsUpdateRequest { + return ApiRacEndpointsUpdateRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return Endpoint +func (a *RacAPIService) RacEndpointsUpdateExecute(r ApiRacEndpointsUpdateRequest) (*Endpoint, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Endpoint + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/{pbm_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.endpointRequest == nil { + return localVarReturnValue, nil, reportError("endpointRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.endpointRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRacEndpointsUsedByListRequest struct { + ctx context.Context + ApiService *RacAPIService + pbmUuid string +} + +func (r ApiRacEndpointsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.RacEndpointsUsedByListExecute(r) +} + +/* +RacEndpointsUsedByList Method for RacEndpointsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param pbmUuid A UUID string identifying this RAC Endpoint. + @return ApiRacEndpointsUsedByListRequest +*/ +func (a *RacAPIService) RacEndpointsUsedByList(ctx context.Context, pbmUuid string) ApiRacEndpointsUsedByListRequest { + return ApiRacEndpointsUsedByListRequest{ + ApiService: a, + ctx: ctx, + pbmUuid: pbmUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *RacAPIService) RacEndpointsUsedByListExecute(r ApiRacEndpointsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RacAPIService.RacEndpointsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rac/endpoints/{pbm_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"pbm_uuid"+"}", url.PathEscape(parameterValueToString(r.pbmUuid, "pbmUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_rbac.go b/packages/client-go/api_rbac.go new file mode 100644 index 0000000000..ef975fd073 --- /dev/null +++ b/packages/client-go/api_rbac.go @@ -0,0 +1,3126 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// RbacAPIService RbacAPI service +type RbacAPIService service + +type ApiRbacInitialPermissionsCreateRequest struct { + ctx context.Context + ApiService *RbacAPIService + initialPermissionsRequest *InitialPermissionsRequest +} + +func (r ApiRbacInitialPermissionsCreateRequest) InitialPermissionsRequest(initialPermissionsRequest InitialPermissionsRequest) ApiRbacInitialPermissionsCreateRequest { + r.initialPermissionsRequest = &initialPermissionsRequest + return r +} + +func (r ApiRbacInitialPermissionsCreateRequest) Execute() (*InitialPermissions, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsCreateExecute(r) +} + +/* +RbacInitialPermissionsCreate Method for RbacInitialPermissionsCreate + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacInitialPermissionsCreateRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsCreate(ctx context.Context) ApiRbacInitialPermissionsCreateRequest { + return ApiRbacInitialPermissionsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InitialPermissions +func (a *RbacAPIService) RbacInitialPermissionsCreateExecute(r ApiRbacInitialPermissionsCreateRequest) (*InitialPermissions, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InitialPermissions + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.initialPermissionsRequest == nil { + return localVarReturnValue, nil, reportError("initialPermissionsRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initialPermissionsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsDestroyRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 +} + +func (r ApiRbacInitialPermissionsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.RbacInitialPermissionsDestroyExecute(r) +} + +/* +RbacInitialPermissionsDestroy Method for RbacInitialPermissionsDestroy + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Initial Permissions. + @return ApiRbacInitialPermissionsDestroyRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsDestroy(ctx context.Context, id int32) ApiRbacInitialPermissionsDestroyRequest { + return ApiRbacInitialPermissionsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *RbacAPIService) RbacInitialPermissionsDestroyExecute(r ApiRbacInitialPermissionsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsListRequest struct { + ctx context.Context + ApiService *RbacAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiRbacInitialPermissionsListRequest) Name(name string) ApiRbacInitialPermissionsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiRbacInitialPermissionsListRequest) Ordering(ordering string) ApiRbacInitialPermissionsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRbacInitialPermissionsListRequest) Page(page int32) ApiRbacInitialPermissionsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRbacInitialPermissionsListRequest) PageSize(pageSize int32) ApiRbacInitialPermissionsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiRbacInitialPermissionsListRequest) Search(search string) ApiRbacInitialPermissionsListRequest { + r.search = &search + return r +} + +func (r ApiRbacInitialPermissionsListRequest) Execute() (*PaginatedInitialPermissionsList, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsListExecute(r) +} + +/* +RbacInitialPermissionsList Method for RbacInitialPermissionsList + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacInitialPermissionsListRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsList(ctx context.Context) ApiRbacInitialPermissionsListRequest { + return ApiRbacInitialPermissionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInitialPermissionsList +func (a *RbacAPIService) RbacInitialPermissionsListExecute(r ApiRbacInitialPermissionsListRequest) (*PaginatedInitialPermissionsList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInitialPermissionsList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsPartialUpdateRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 + patchedInitialPermissionsRequest *PatchedInitialPermissionsRequest +} + +func (r ApiRbacInitialPermissionsPartialUpdateRequest) PatchedInitialPermissionsRequest(patchedInitialPermissionsRequest PatchedInitialPermissionsRequest) ApiRbacInitialPermissionsPartialUpdateRequest { + r.patchedInitialPermissionsRequest = &patchedInitialPermissionsRequest + return r +} + +func (r ApiRbacInitialPermissionsPartialUpdateRequest) Execute() (*InitialPermissions, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsPartialUpdateExecute(r) +} + +/* +RbacInitialPermissionsPartialUpdate Method for RbacInitialPermissionsPartialUpdate + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Initial Permissions. + @return ApiRbacInitialPermissionsPartialUpdateRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsPartialUpdate(ctx context.Context, id int32) ApiRbacInitialPermissionsPartialUpdateRequest { + return ApiRbacInitialPermissionsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InitialPermissions +func (a *RbacAPIService) RbacInitialPermissionsPartialUpdateExecute(r ApiRbacInitialPermissionsPartialUpdateRequest) (*InitialPermissions, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InitialPermissions + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedInitialPermissionsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsRetrieveRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 +} + +func (r ApiRbacInitialPermissionsRetrieveRequest) Execute() (*InitialPermissions, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsRetrieveExecute(r) +} + +/* +RbacInitialPermissionsRetrieve Method for RbacInitialPermissionsRetrieve + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Initial Permissions. + @return ApiRbacInitialPermissionsRetrieveRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsRetrieve(ctx context.Context, id int32) ApiRbacInitialPermissionsRetrieveRequest { + return ApiRbacInitialPermissionsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InitialPermissions +func (a *RbacAPIService) RbacInitialPermissionsRetrieveExecute(r ApiRbacInitialPermissionsRetrieveRequest) (*InitialPermissions, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InitialPermissions + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsUpdateRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 + initialPermissionsRequest *InitialPermissionsRequest +} + +func (r ApiRbacInitialPermissionsUpdateRequest) InitialPermissionsRequest(initialPermissionsRequest InitialPermissionsRequest) ApiRbacInitialPermissionsUpdateRequest { + r.initialPermissionsRequest = &initialPermissionsRequest + return r +} + +func (r ApiRbacInitialPermissionsUpdateRequest) Execute() (*InitialPermissions, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsUpdateExecute(r) +} + +/* +RbacInitialPermissionsUpdate Method for RbacInitialPermissionsUpdate + +InitialPermissions viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Initial Permissions. + @return ApiRbacInitialPermissionsUpdateRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsUpdate(ctx context.Context, id int32) ApiRbacInitialPermissionsUpdateRequest { + return ApiRbacInitialPermissionsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return InitialPermissions +func (a *RbacAPIService) RbacInitialPermissionsUpdateExecute(r ApiRbacInitialPermissionsUpdateRequest) (*InitialPermissions, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InitialPermissions + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.initialPermissionsRequest == nil { + return localVarReturnValue, nil, reportError("initialPermissionsRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.initialPermissionsRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacInitialPermissionsUsedByListRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 +} + +func (r ApiRbacInitialPermissionsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.RbacInitialPermissionsUsedByListExecute(r) +} + +/* +RbacInitialPermissionsUsedByList Method for RbacInitialPermissionsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Initial Permissions. + @return ApiRbacInitialPermissionsUsedByListRequest +*/ +func (a *RbacAPIService) RbacInitialPermissionsUsedByList(ctx context.Context, id int32) ApiRbacInitialPermissionsUsedByListRequest { + return ApiRbacInitialPermissionsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *RbacAPIService) RbacInitialPermissionsUsedByListExecute(r ApiRbacInitialPermissionsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacInitialPermissionsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/initial_permissions/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacPermissionsAssignedByRolesAssignRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + permissionAssignRequest *PermissionAssignRequest +} + +func (r ApiRbacPermissionsAssignedByRolesAssignRequest) PermissionAssignRequest(permissionAssignRequest PermissionAssignRequest) ApiRbacPermissionsAssignedByRolesAssignRequest { + r.permissionAssignRequest = &permissionAssignRequest + return r +} + +func (r ApiRbacPermissionsAssignedByRolesAssignRequest) Execute() ([]PermissionAssignResult, *http.Response, error) { + return r.ApiService.RbacPermissionsAssignedByRolesAssignExecute(r) +} + +/* +RbacPermissionsAssignedByRolesAssign Method for RbacPermissionsAssignedByRolesAssign + +Assign permission(s) to role. When `object_pk` is set, the permissions +are only assigned to the specific object, otherwise they are assigned globally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacPermissionsAssignedByRolesAssignRequest +*/ +func (a *RbacAPIService) RbacPermissionsAssignedByRolesAssign(ctx context.Context, uuid string) ApiRbacPermissionsAssignedByRolesAssignRequest { + return ApiRbacPermissionsAssignedByRolesAssignRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []PermissionAssignResult +func (a *RbacAPIService) RbacPermissionsAssignedByRolesAssignExecute(r ApiRbacPermissionsAssignedByRolesAssignRequest) ([]PermissionAssignResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []PermissionAssignResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsAssignedByRolesAssign") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/assigned_by_roles/{uuid}/assign/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.permissionAssignRequest == nil { + return localVarReturnValue, nil, reportError("permissionAssignRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.permissionAssignRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacPermissionsAssignedByRolesListRequest struct { + ctx context.Context + ApiService *RbacAPIService + model *string + objectPk *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiRbacPermissionsAssignedByRolesListRequest) Model(model string) ApiRbacPermissionsAssignedByRolesListRequest { + r.model = &model + return r +} + +func (r ApiRbacPermissionsAssignedByRolesListRequest) ObjectPk(objectPk string) ApiRbacPermissionsAssignedByRolesListRequest { + r.objectPk = &objectPk + return r +} + +// Which field to use when ordering the results. +func (r ApiRbacPermissionsAssignedByRolesListRequest) Ordering(ordering string) ApiRbacPermissionsAssignedByRolesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRbacPermissionsAssignedByRolesListRequest) Page(page int32) ApiRbacPermissionsAssignedByRolesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRbacPermissionsAssignedByRolesListRequest) PageSize(pageSize int32) ApiRbacPermissionsAssignedByRolesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiRbacPermissionsAssignedByRolesListRequest) Search(search string) ApiRbacPermissionsAssignedByRolesListRequest { + r.search = &search + return r +} + +func (r ApiRbacPermissionsAssignedByRolesListRequest) Execute() (*PaginatedRoleAssignedObjectPermissionList, *http.Response, error) { + return r.ApiService.RbacPermissionsAssignedByRolesListExecute(r) +} + +/* +RbacPermissionsAssignedByRolesList Method for RbacPermissionsAssignedByRolesList + +Get assigned object permissions for a single object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacPermissionsAssignedByRolesListRequest +*/ +func (a *RbacAPIService) RbacPermissionsAssignedByRolesList(ctx context.Context) ApiRbacPermissionsAssignedByRolesListRequest { + return ApiRbacPermissionsAssignedByRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRoleAssignedObjectPermissionList +func (a *RbacAPIService) RbacPermissionsAssignedByRolesListExecute(r ApiRbacPermissionsAssignedByRolesListRequest) (*PaginatedRoleAssignedObjectPermissionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRoleAssignedObjectPermissionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsAssignedByRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/assigned_by_roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.model == nil { + return localVarReturnValue, nil, reportError("model is required and must be specified") + } + + parameterAddToHeaderOrQuery(localVarQueryParams, "model", r.model, "form", "") + if r.objectPk != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_pk", r.objectPk, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + patchedPermissionAssignRequest *PatchedPermissionAssignRequest +} + +func (r ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest) PatchedPermissionAssignRequest(patchedPermissionAssignRequest PatchedPermissionAssignRequest) ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest { + r.patchedPermissionAssignRequest = &patchedPermissionAssignRequest + return r +} + +func (r ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest) Execute() (*http.Response, error) { + return r.ApiService.RbacPermissionsAssignedByRolesUnassignPartialUpdateExecute(r) +} + +/* +RbacPermissionsAssignedByRolesUnassignPartialUpdate Method for RbacPermissionsAssignedByRolesUnassignPartialUpdate + +Unassign permission(s) to role. When `object_pk` is set, the permissions +are only assigned to the specific object, otherwise they are assigned globally. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest +*/ +func (a *RbacAPIService) RbacPermissionsAssignedByRolesUnassignPartialUpdate(ctx context.Context, uuid string) ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest { + return ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *RbacAPIService) RbacPermissionsAssignedByRolesUnassignPartialUpdateExecute(r ApiRbacPermissionsAssignedByRolesUnassignPartialUpdateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsAssignedByRolesUnassignPartialUpdate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/assigned_by_roles/{uuid}/unassign/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPermissionAssignRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRbacPermissionsListRequest struct { + ctx context.Context + ApiService *RbacAPIService + codename *string + contentTypeAppLabel *string + contentTypeModel *string + ordering *string + page *int32 + pageSize *int32 + role *string + search *string +} + +func (r ApiRbacPermissionsListRequest) Codename(codename string) ApiRbacPermissionsListRequest { + r.codename = &codename + return r +} + +func (r ApiRbacPermissionsListRequest) ContentTypeAppLabel(contentTypeAppLabel string) ApiRbacPermissionsListRequest { + r.contentTypeAppLabel = &contentTypeAppLabel + return r +} + +func (r ApiRbacPermissionsListRequest) ContentTypeModel(contentTypeModel string) ApiRbacPermissionsListRequest { + r.contentTypeModel = &contentTypeModel + return r +} + +// Which field to use when ordering the results. +func (r ApiRbacPermissionsListRequest) Ordering(ordering string) ApiRbacPermissionsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRbacPermissionsListRequest) Page(page int32) ApiRbacPermissionsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRbacPermissionsListRequest) PageSize(pageSize int32) ApiRbacPermissionsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiRbacPermissionsListRequest) Role(role string) ApiRbacPermissionsListRequest { + r.role = &role + return r +} + +// A search term. +func (r ApiRbacPermissionsListRequest) Search(search string) ApiRbacPermissionsListRequest { + r.search = &search + return r +} + +func (r ApiRbacPermissionsListRequest) Execute() (*PaginatedPermissionList, *http.Response, error) { + return r.ApiService.RbacPermissionsListExecute(r) +} + +/* +RbacPermissionsList Method for RbacPermissionsList + +Read-only list of all permissions, filterable by model and app + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacPermissionsListRequest +*/ +func (a *RbacAPIService) RbacPermissionsList(ctx context.Context) ApiRbacPermissionsListRequest { + return ApiRbacPermissionsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPermissionList +func (a *RbacAPIService) RbacPermissionsListExecute(r ApiRbacPermissionsListRequest) (*PaginatedPermissionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPermissionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.codename != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "codename", r.codename, "form", "") + } + if r.contentTypeAppLabel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type__app_label", r.contentTypeAppLabel, "form", "") + } + if r.contentTypeModel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "content_type__model", r.contentTypeModel, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.role != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "role", r.role, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacPermissionsRetrieveRequest struct { + ctx context.Context + ApiService *RbacAPIService + id int32 +} + +func (r ApiRbacPermissionsRetrieveRequest) Execute() (*Permission, *http.Response, error) { + return r.ApiService.RbacPermissionsRetrieveExecute(r) +} + +/* +RbacPermissionsRetrieve Method for RbacPermissionsRetrieve + +Read-only list of all permissions, filterable by model and app + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this permission. + @return ApiRbacPermissionsRetrieveRequest +*/ +func (a *RbacAPIService) RbacPermissionsRetrieve(ctx context.Context, id int32) ApiRbacPermissionsRetrieveRequest { + return ApiRbacPermissionsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Permission +func (a *RbacAPIService) RbacPermissionsRetrieveExecute(r ApiRbacPermissionsRetrieveRequest) (*Permission, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Permission + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacPermissionsRolesListRequest struct { + ctx context.Context + ApiService *RbacAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + uuid *string +} + +// Which field to use when ordering the results. +func (r ApiRbacPermissionsRolesListRequest) Ordering(ordering string) ApiRbacPermissionsRolesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRbacPermissionsRolesListRequest) Page(page int32) ApiRbacPermissionsRolesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRbacPermissionsRolesListRequest) PageSize(pageSize int32) ApiRbacPermissionsRolesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiRbacPermissionsRolesListRequest) Search(search string) ApiRbacPermissionsRolesListRequest { + r.search = &search + return r +} + +func (r ApiRbacPermissionsRolesListRequest) Uuid(uuid string) ApiRbacPermissionsRolesListRequest { + r.uuid = &uuid + return r +} + +func (r ApiRbacPermissionsRolesListRequest) Execute() (*PaginatedExtraRoleObjectPermissionList, *http.Response, error) { + return r.ApiService.RbacPermissionsRolesListExecute(r) +} + +/* +RbacPermissionsRolesList Method for RbacPermissionsRolesList + +Get a role's assigned object permissions + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacPermissionsRolesListRequest +*/ +func (a *RbacAPIService) RbacPermissionsRolesList(ctx context.Context) ApiRbacPermissionsRolesListRequest { + return ApiRbacPermissionsRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedExtraRoleObjectPermissionList +func (a *RbacAPIService) RbacPermissionsRolesListExecute(r ApiRbacPermissionsRolesListRequest) (*PaginatedExtraRoleObjectPermissionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedExtraRoleObjectPermissionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacPermissionsRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/permissions/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.uuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "uuid", r.uuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesAddUserCreateRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + userAccountSerializerForRoleRequest *UserAccountSerializerForRoleRequest +} + +func (r ApiRbacRolesAddUserCreateRequest) UserAccountSerializerForRoleRequest(userAccountSerializerForRoleRequest UserAccountSerializerForRoleRequest) ApiRbacRolesAddUserCreateRequest { + r.userAccountSerializerForRoleRequest = &userAccountSerializerForRoleRequest + return r +} + +func (r ApiRbacRolesAddUserCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.RbacRolesAddUserCreateExecute(r) +} + +/* +RbacRolesAddUserCreate Method for RbacRolesAddUserCreate + +Add user to role + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesAddUserCreateRequest +*/ +func (a *RbacAPIService) RbacRolesAddUserCreate(ctx context.Context, uuid string) ApiRbacRolesAddUserCreateRequest { + return ApiRbacRolesAddUserCreateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *RbacAPIService) RbacRolesAddUserCreateExecute(r ApiRbacRolesAddUserCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesAddUserCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/add_user/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userAccountSerializerForRoleRequest == nil { + return nil, reportError("userAccountSerializerForRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userAccountSerializerForRoleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRbacRolesCreateRequest struct { + ctx context.Context + ApiService *RbacAPIService + roleRequest *RoleRequest +} + +func (r ApiRbacRolesCreateRequest) RoleRequest(roleRequest RoleRequest) ApiRbacRolesCreateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiRbacRolesCreateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.RbacRolesCreateExecute(r) +} + +/* +RbacRolesCreate Method for RbacRolesCreate + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacRolesCreateRequest +*/ +func (a *RbacAPIService) RbacRolesCreate(ctx context.Context) ApiRbacRolesCreateRequest { + return ApiRbacRolesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Role +func (a *RbacAPIService) RbacRolesCreateExecute(r ApiRbacRolesCreateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesDestroyRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string +} + +func (r ApiRbacRolesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.RbacRolesDestroyExecute(r) +} + +/* +RbacRolesDestroy Method for RbacRolesDestroy + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesDestroyRequest +*/ +func (a *RbacAPIService) RbacRolesDestroy(ctx context.Context, uuid string) ApiRbacRolesDestroyRequest { + return ApiRbacRolesDestroyRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *RbacAPIService) RbacRolesDestroyExecute(r ApiRbacRolesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRbacRolesListRequest struct { + ctx context.Context + ApiService *RbacAPIService + groups *string + inherited *bool + managed *[]string + managedIsnull *bool + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + users *int32 +} + +func (r ApiRbacRolesListRequest) Groups(groups string) ApiRbacRolesListRequest { + r.groups = &groups + return r +} + +// Include inherited roles (requires users or groups filter) +func (r ApiRbacRolesListRequest) Inherited(inherited bool) ApiRbacRolesListRequest { + r.inherited = &inherited + return r +} + +func (r ApiRbacRolesListRequest) Managed(managed []string) ApiRbacRolesListRequest { + r.managed = &managed + return r +} + +func (r ApiRbacRolesListRequest) ManagedIsnull(managedIsnull bool) ApiRbacRolesListRequest { + r.managedIsnull = &managedIsnull + return r +} + +func (r ApiRbacRolesListRequest) Name(name string) ApiRbacRolesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiRbacRolesListRequest) Ordering(ordering string) ApiRbacRolesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiRbacRolesListRequest) Page(page int32) ApiRbacRolesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiRbacRolesListRequest) PageSize(pageSize int32) ApiRbacRolesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiRbacRolesListRequest) Search(search string) ApiRbacRolesListRequest { + r.search = &search + return r +} + +func (r ApiRbacRolesListRequest) Users(users int32) ApiRbacRolesListRequest { + r.users = &users + return r +} + +func (r ApiRbacRolesListRequest) Execute() (*PaginatedRoleList, *http.Response, error) { + return r.ApiService.RbacRolesListExecute(r) +} + +/* +RbacRolesList Method for RbacRolesList + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRbacRolesListRequest +*/ +func (a *RbacAPIService) RbacRolesList(ctx context.Context) ApiRbacRolesListRequest { + return ApiRbacRolesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRoleList +func (a *RbacAPIService) RbacRolesListExecute(r ApiRbacRolesListRequest) (*PaginatedRoleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRoleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.groups != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "groups", r.groups, "form", "") + } + if r.inherited != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "inherited", r.inherited, "form", "") + } + if r.managed != nil { + t := *r.managed + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", t, "form", "multi") + } + } + if r.managedIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed__isnull", r.managedIsnull, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.users != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "users", r.users, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesPartialUpdateRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + patchedRoleRequest *PatchedRoleRequest +} + +func (r ApiRbacRolesPartialUpdateRequest) PatchedRoleRequest(patchedRoleRequest PatchedRoleRequest) ApiRbacRolesPartialUpdateRequest { + r.patchedRoleRequest = &patchedRoleRequest + return r +} + +func (r ApiRbacRolesPartialUpdateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.RbacRolesPartialUpdateExecute(r) +} + +/* +RbacRolesPartialUpdate Method for RbacRolesPartialUpdate + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesPartialUpdateRequest +*/ +func (a *RbacAPIService) RbacRolesPartialUpdate(ctx context.Context, uuid string) ApiRbacRolesPartialUpdateRequest { + return ApiRbacRolesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Role +func (a *RbacAPIService) RbacRolesPartialUpdateExecute(r ApiRbacRolesPartialUpdateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRoleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesRemoveUserCreateRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + userAccountSerializerForRoleRequest *UserAccountSerializerForRoleRequest +} + +func (r ApiRbacRolesRemoveUserCreateRequest) UserAccountSerializerForRoleRequest(userAccountSerializerForRoleRequest UserAccountSerializerForRoleRequest) ApiRbacRolesRemoveUserCreateRequest { + r.userAccountSerializerForRoleRequest = &userAccountSerializerForRoleRequest + return r +} + +func (r ApiRbacRolesRemoveUserCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.RbacRolesRemoveUserCreateExecute(r) +} + +/* +RbacRolesRemoveUserCreate Method for RbacRolesRemoveUserCreate + +Remove user from role + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesRemoveUserCreateRequest +*/ +func (a *RbacAPIService) RbacRolesRemoveUserCreate(ctx context.Context, uuid string) ApiRbacRolesRemoveUserCreateRequest { + return ApiRbacRolesRemoveUserCreateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +func (a *RbacAPIService) RbacRolesRemoveUserCreateExecute(r ApiRbacRolesRemoveUserCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesRemoveUserCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/remove_user/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userAccountSerializerForRoleRequest == nil { + return nil, reportError("userAccountSerializerForRoleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userAccountSerializerForRoleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiRbacRolesRetrieveRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string +} + +func (r ApiRbacRolesRetrieveRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.RbacRolesRetrieveExecute(r) +} + +/* +RbacRolesRetrieve Method for RbacRolesRetrieve + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesRetrieveRequest +*/ +func (a *RbacAPIService) RbacRolesRetrieve(ctx context.Context, uuid string) ApiRbacRolesRetrieveRequest { + return ApiRbacRolesRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Role +func (a *RbacAPIService) RbacRolesRetrieveExecute(r ApiRbacRolesRetrieveRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesUpdateRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string + roleRequest *RoleRequest +} + +func (r ApiRbacRolesUpdateRequest) RoleRequest(roleRequest RoleRequest) ApiRbacRolesUpdateRequest { + r.roleRequest = &roleRequest + return r +} + +func (r ApiRbacRolesUpdateRequest) Execute() (*Role, *http.Response, error) { + return r.ApiService.RbacRolesUpdateExecute(r) +} + +/* +RbacRolesUpdate Method for RbacRolesUpdate + +Role viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesUpdateRequest +*/ +func (a *RbacAPIService) RbacRolesUpdate(ctx context.Context, uuid string) ApiRbacRolesUpdateRequest { + return ApiRbacRolesUpdateRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return Role +func (a *RbacAPIService) RbacRolesUpdateExecute(r ApiRbacRolesUpdateRequest) (*Role, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Role + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.roleRequest == nil { + return localVarReturnValue, nil, reportError("roleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.roleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiRbacRolesUsedByListRequest struct { + ctx context.Context + ApiService *RbacAPIService + uuid string +} + +func (r ApiRbacRolesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.RbacRolesUsedByListExecute(r) +} + +/* +RbacRolesUsedByList Method for RbacRolesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this Role. + @return ApiRbacRolesUsedByListRequest +*/ +func (a *RbacAPIService) RbacRolesUsedByList(ctx context.Context, uuid string) ApiRbacRolesUsedByListRequest { + return ApiRbacRolesUsedByListRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *RbacAPIService) RbacRolesUsedByListExecute(r ApiRbacRolesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RbacAPIService.RbacRolesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/rbac/roles/{uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_reports.go b/packages/client-go/api_reports.go new file mode 100644 index 0000000000..4b64670b3e --- /dev/null +++ b/packages/client-go/api_reports.go @@ -0,0 +1,417 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// ReportsAPIService ReportsAPI service +type ReportsAPIService service + +type ApiReportsExportsDestroyRequest struct { + ctx context.Context + ApiService *ReportsAPIService + id string +} + +func (r ApiReportsExportsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.ReportsExportsDestroyExecute(r) +} + +/* +ReportsExportsDestroy Method for ReportsExportsDestroy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Data Export. + @return ApiReportsExportsDestroyRequest +*/ +func (a *ReportsAPIService) ReportsExportsDestroy(ctx context.Context, id string) ApiReportsExportsDestroyRequest { + return ApiReportsExportsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *ReportsAPIService) ReportsExportsDestroyExecute(r ApiReportsExportsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReportsAPIService.ReportsExportsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/reports/exports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiReportsExportsListRequest struct { + ctx context.Context + ApiService *ReportsAPIService + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Which field to use when ordering the results. +func (r ApiReportsExportsListRequest) Ordering(ordering string) ApiReportsExportsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiReportsExportsListRequest) Page(page int32) ApiReportsExportsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiReportsExportsListRequest) PageSize(pageSize int32) ApiReportsExportsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiReportsExportsListRequest) Search(search string) ApiReportsExportsListRequest { + r.search = &search + return r +} + +func (r ApiReportsExportsListRequest) Execute() (*PaginatedDataExportList, *http.Response, error) { + return r.ApiService.ReportsExportsListExecute(r) +} + +/* +ReportsExportsList Method for ReportsExportsList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiReportsExportsListRequest +*/ +func (a *ReportsAPIService) ReportsExportsList(ctx context.Context) ApiReportsExportsListRequest { + return ApiReportsExportsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDataExportList +func (a *ReportsAPIService) ReportsExportsListExecute(r ApiReportsExportsListRequest) (*PaginatedDataExportList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDataExportList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReportsAPIService.ReportsExportsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/reports/exports/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiReportsExportsRetrieveRequest struct { + ctx context.Context + ApiService *ReportsAPIService + id string +} + +func (r ApiReportsExportsRetrieveRequest) Execute() (*DataExport, *http.Response, error) { + return r.ApiService.ReportsExportsRetrieveExecute(r) +} + +/* +ReportsExportsRetrieve Method for ReportsExportsRetrieve + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Data Export. + @return ApiReportsExportsRetrieveRequest +*/ +func (a *ReportsAPIService) ReportsExportsRetrieve(ctx context.Context, id string) ApiReportsExportsRetrieveRequest { + return ApiReportsExportsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DataExport +func (a *ReportsAPIService) ReportsExportsRetrieveExecute(r ApiReportsExportsRetrieveRequest) (*DataExport, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DataExport + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReportsAPIService.ReportsExportsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/reports/exports/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_root.go b/packages/client-go/api_root.go new file mode 100644 index 0000000000..43541c4de9 --- /dev/null +++ b/packages/client-go/api_root.go @@ -0,0 +1,144 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// RootAPIService RootAPI service +type RootAPIService service + +type ApiRootConfigRetrieveRequest struct { + ctx context.Context + ApiService *RootAPIService +} + +func (r ApiRootConfigRetrieveRequest) Execute() (*Config, *http.Response, error) { + return r.ApiService.RootConfigRetrieveExecute(r) +} + +/* +RootConfigRetrieve Method for RootConfigRetrieve + +Retrieve public configuration options + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiRootConfigRetrieveRequest +*/ +func (a *RootAPIService) RootConfigRetrieve(ctx context.Context) ApiRootConfigRetrieveRequest { + return ApiRootConfigRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Config +func (a *RootAPIService) RootConfigRetrieveExecute(r ApiRootConfigRetrieveRequest) (*Config, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Config + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RootAPIService.RootConfigRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/root/config/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_schema.go b/packages/client-go/api_schema.go new file mode 100644 index 0000000000..ce11195cec --- /dev/null +++ b/packages/client-go/api_schema.go @@ -0,0 +1,165 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// SchemaAPIService SchemaAPI service +type SchemaAPIService service + +type ApiSchemaRetrieveRequest struct { + ctx context.Context + ApiService *SchemaAPIService + format *string + lang *string +} + +func (r ApiSchemaRetrieveRequest) Format(format string) ApiSchemaRetrieveRequest { + r.format = &format + return r +} + +func (r ApiSchemaRetrieveRequest) Lang(lang string) ApiSchemaRetrieveRequest { + r.lang = &lang + return r +} + +func (r ApiSchemaRetrieveRequest) Execute() (map[string]interface{}, *http.Response, error) { + return r.ApiService.SchemaRetrieveExecute(r) +} + +/* +SchemaRetrieve Method for SchemaRetrieve + +OpenApi3 schema for this API. Format can be selected via content negotiation. + +- YAML: application/vnd.oai.openapi +- JSON: application/vnd.oai.openapi+json + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSchemaRetrieveRequest +*/ +func (a *SchemaAPIService) SchemaRetrieve(ctx context.Context) ApiSchemaRetrieveRequest { + return ApiSchemaRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *SchemaAPIService) SchemaRetrieveExecute(r ApiSchemaRetrieveRequest) (map[string]interface{}, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SchemaAPIService.SchemaRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/schema/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.format != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "format", r.format, "form", "") + } + if r.lang != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "lang", r.lang, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/vnd.oai.openapi", "application/yaml", "application/vnd.oai.openapi+json", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_sources.go b/packages/client-go/api_sources.go new file mode 100644 index 0000000000..cb733da18d --- /dev/null +++ b/packages/client-go/api_sources.go @@ -0,0 +1,24082 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// SourcesAPIService SourcesAPI service +type SourcesAPIService service + +type ApiSourcesAllDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesAllDestroyExecute(r) +} + +/* +SourcesAllDestroy Method for SourcesAllDestroy + +Prevent deletion of built-in sources + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesAllDestroyRequest +*/ +func (a *SourcesAPIService) SourcesAllDestroy(ctx context.Context, slug string) ApiSourcesAllDestroyRequest { + return ApiSourcesAllDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesAllDestroyExecute(r ApiSourcesAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesAllListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + managed *string + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + search *string + slug *string +} + +func (r ApiSourcesAllListRequest) Managed(managed string) ApiSourcesAllListRequest { + r.managed = &managed + return r +} + +func (r ApiSourcesAllListRequest) Name(name string) ApiSourcesAllListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesAllListRequest) Ordering(ordering string) ApiSourcesAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesAllListRequest) Page(page int32) ApiSourcesAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesAllListRequest) PageSize(pageSize int32) ApiSourcesAllListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesAllListRequest) PbmUuid(pbmUuid string) ApiSourcesAllListRequest { + r.pbmUuid = &pbmUuid + return r +} + +// A search term. +func (r ApiSourcesAllListRequest) Search(search string) ApiSourcesAllListRequest { + r.search = &search + return r +} + +func (r ApiSourcesAllListRequest) Slug(slug string) ApiSourcesAllListRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesAllListRequest) Execute() (*PaginatedSourceList, *http.Response, error) { + return r.ApiService.SourcesAllListExecute(r) +} + +/* +SourcesAllList Method for SourcesAllList + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesAllListRequest +*/ +func (a *SourcesAPIService) SourcesAllList(ctx context.Context) ApiSourcesAllListRequest { + return ApiSourcesAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSourceList +func (a *SourcesAPIService) SourcesAllListExecute(r ApiSourcesAllListRequest) (*PaginatedSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.managed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", r.managed, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesAllRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesAllRetrieveRequest) Execute() (*Source, *http.Response, error) { + return r.ApiService.SourcesAllRetrieveExecute(r) +} + +/* +SourcesAllRetrieve Method for SourcesAllRetrieve + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesAllRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesAllRetrieve(ctx context.Context, slug string) ApiSourcesAllRetrieveRequest { + return ApiSourcesAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return Source +func (a *SourcesAPIService) SourcesAllRetrieveExecute(r ApiSourcesAllRetrieveRequest) (*Source, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Source + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesAllTypesListRequest struct { + ctx context.Context + ApiService *SourcesAPIService +} + +func (r ApiSourcesAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.SourcesAllTypesListExecute(r) +} + +/* +SourcesAllTypesList Method for SourcesAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesAllTypesListRequest +*/ +func (a *SourcesAPIService) SourcesAllTypesList(ctx context.Context) ApiSourcesAllTypesListRequest { + return ApiSourcesAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *SourcesAPIService) SourcesAllTypesListExecute(r ApiSourcesAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesAllUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesAllUsedByListExecute(r) +} + +/* +SourcesAllUsedByList Method for SourcesAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesAllUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesAllUsedByList(ctx context.Context, slug string) ApiSourcesAllUsedByListRequest { + return ApiSourcesAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesAllUsedByListExecute(r ApiSourcesAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesAllUserSettingsListRequest struct { + ctx context.Context + ApiService *SourcesAPIService +} + +func (r ApiSourcesAllUserSettingsListRequest) Execute() ([]UserSetting, *http.Response, error) { + return r.ApiService.SourcesAllUserSettingsListExecute(r) +} + +/* +SourcesAllUserSettingsList Method for SourcesAllUserSettingsList + +Get all sources the user can configure + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesAllUserSettingsListRequest +*/ +func (a *SourcesAPIService) SourcesAllUserSettingsList(ctx context.Context) ApiSourcesAllUserSettingsListRequest { + return ApiSourcesAllUserSettingsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []UserSetting +func (a *SourcesAPIService) SourcesAllUserSettingsListExecute(r ApiSourcesAllUserSettingsListRequest) ([]UserSetting, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UserSetting + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesAllUserSettingsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/all/user_settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllDestroyExecute(r) +} + +/* +SourcesGroupConnectionsAllDestroy Method for SourcesGroupConnectionsAllDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group source connection. + @return ApiSourcesGroupConnectionsAllDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsAllDestroyRequest { + return ApiSourcesGroupConnectionsAllDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsAllDestroyExecute(r ApiSourcesGroupConnectionsAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsAllListRequest) Group(group string) ApiSourcesGroupConnectionsAllListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsAllListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsAllListRequest) Page(page int32) ApiSourcesGroupConnectionsAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsAllListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsAllListRequest) Search(search string) ApiSourcesGroupConnectionsAllListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsAllListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsAllListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsAllListRequest) Execute() (*PaginatedGroupSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllListExecute(r) +} + +/* +SourcesGroupConnectionsAllList Method for SourcesGroupConnectionsAllList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsAllListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllList(ctx context.Context) ApiSourcesGroupConnectionsAllListRequest { + return ApiSourcesGroupConnectionsAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsAllListExecute(r ApiSourcesGroupConnectionsAllListRequest) (*PaginatedGroupSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupSourceConnectionRequest *PatchedGroupSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsAllPartialUpdateRequest) PatchedGroupSourceConnectionRequest(patchedGroupSourceConnectionRequest PatchedGroupSourceConnectionRequest) ApiSourcesGroupConnectionsAllPartialUpdateRequest { + r.patchedGroupSourceConnectionRequest = &patchedGroupSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsAllPartialUpdateRequest) Execute() (*GroupSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsAllPartialUpdate Method for SourcesGroupConnectionsAllPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group source connection. + @return ApiSourcesGroupConnectionsAllPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsAllPartialUpdateRequest { + return ApiSourcesGroupConnectionsAllPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsAllPartialUpdateExecute(r ApiSourcesGroupConnectionsAllPartialUpdateRequest) (*GroupSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsAllRetrieveRequest) Execute() (*GroupSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsAllRetrieve Method for SourcesGroupConnectionsAllRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group source connection. + @return ApiSourcesGroupConnectionsAllRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsAllRetrieveRequest { + return ApiSourcesGroupConnectionsAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsAllRetrieveExecute(r ApiSourcesGroupConnectionsAllRetrieveRequest) (*GroupSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupSourceConnectionRequest *GroupSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsAllUpdateRequest) GroupSourceConnectionRequest(groupSourceConnectionRequest GroupSourceConnectionRequest) ApiSourcesGroupConnectionsAllUpdateRequest { + r.groupSourceConnectionRequest = &groupSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsAllUpdateRequest) Execute() (*GroupSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllUpdateExecute(r) +} + +/* +SourcesGroupConnectionsAllUpdate Method for SourcesGroupConnectionsAllUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group source connection. + @return ApiSourcesGroupConnectionsAllUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsAllUpdateRequest { + return ApiSourcesGroupConnectionsAllUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsAllUpdateExecute(r ApiSourcesGroupConnectionsAllUpdateRequest) (*GroupSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsAllUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsAllUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsAllUsedByList Method for SourcesGroupConnectionsAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this group source connection. + @return ApiSourcesGroupConnectionsAllUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsAllUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsAllUsedByListRequest { + return ApiSourcesGroupConnectionsAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsAllUsedByListExecute(r ApiSourcesGroupConnectionsAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/all/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupKerberosSourceConnectionRequest *GroupKerberosSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsKerberosCreateRequest) GroupKerberosSourceConnectionRequest(groupKerberosSourceConnectionRequest GroupKerberosSourceConnectionRequest) ApiSourcesGroupConnectionsKerberosCreateRequest { + r.groupKerberosSourceConnectionRequest = &groupKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsKerberosCreateRequest) Execute() (*GroupKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosCreateExecute(r) +} + +/* +SourcesGroupConnectionsKerberosCreate Method for SourcesGroupConnectionsKerberosCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsKerberosCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosCreate(ctx context.Context) ApiSourcesGroupConnectionsKerberosCreateRequest { + return ApiSourcesGroupConnectionsKerberosCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupKerberosSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosCreateExecute(r ApiSourcesGroupConnectionsKerberosCreateRequest) (*GroupKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupKerberosSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupKerberosSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsKerberosDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosDestroyExecute(r) +} + +/* +SourcesGroupConnectionsKerberosDestroy Method for SourcesGroupConnectionsKerberosDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Kerberos Source Connection. + @return ApiSourcesGroupConnectionsKerberosDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsKerberosDestroyRequest { + return ApiSourcesGroupConnectionsKerberosDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosDestroyExecute(r ApiSourcesGroupConnectionsKerberosDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsKerberosListRequest) Group(group string) ApiSourcesGroupConnectionsKerberosListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsKerberosListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsKerberosListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsKerberosListRequest) Page(page int32) ApiSourcesGroupConnectionsKerberosListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsKerberosListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsKerberosListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsKerberosListRequest) Search(search string) ApiSourcesGroupConnectionsKerberosListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsKerberosListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsKerberosListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsKerberosListRequest) Execute() (*PaginatedGroupKerberosSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosListExecute(r) +} + +/* +SourcesGroupConnectionsKerberosList Method for SourcesGroupConnectionsKerberosList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsKerberosListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosList(ctx context.Context) ApiSourcesGroupConnectionsKerberosListRequest { + return ApiSourcesGroupConnectionsKerberosListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupKerberosSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosListExecute(r ApiSourcesGroupConnectionsKerberosListRequest) (*PaginatedGroupKerberosSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupKerberosSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupKerberosSourceConnectionRequest *PatchedGroupKerberosSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsKerberosPartialUpdateRequest) PatchedGroupKerberosSourceConnectionRequest(patchedGroupKerberosSourceConnectionRequest PatchedGroupKerberosSourceConnectionRequest) ApiSourcesGroupConnectionsKerberosPartialUpdateRequest { + r.patchedGroupKerberosSourceConnectionRequest = &patchedGroupKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsKerberosPartialUpdateRequest) Execute() (*GroupKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsKerberosPartialUpdate Method for SourcesGroupConnectionsKerberosPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Kerberos Source Connection. + @return ApiSourcesGroupConnectionsKerberosPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsKerberosPartialUpdateRequest { + return ApiSourcesGroupConnectionsKerberosPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupKerberosSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosPartialUpdateExecute(r ApiSourcesGroupConnectionsKerberosPartialUpdateRequest) (*GroupKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsKerberosRetrieveRequest) Execute() (*GroupKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsKerberosRetrieve Method for SourcesGroupConnectionsKerberosRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Kerberos Source Connection. + @return ApiSourcesGroupConnectionsKerberosRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsKerberosRetrieveRequest { + return ApiSourcesGroupConnectionsKerberosRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupKerberosSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosRetrieveExecute(r ApiSourcesGroupConnectionsKerberosRetrieveRequest) (*GroupKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupKerberosSourceConnectionRequest *GroupKerberosSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsKerberosUpdateRequest) GroupKerberosSourceConnectionRequest(groupKerberosSourceConnectionRequest GroupKerberosSourceConnectionRequest) ApiSourcesGroupConnectionsKerberosUpdateRequest { + r.groupKerberosSourceConnectionRequest = &groupKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsKerberosUpdateRequest) Execute() (*GroupKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosUpdateExecute(r) +} + +/* +SourcesGroupConnectionsKerberosUpdate Method for SourcesGroupConnectionsKerberosUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Kerberos Source Connection. + @return ApiSourcesGroupConnectionsKerberosUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsKerberosUpdateRequest { + return ApiSourcesGroupConnectionsKerberosUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupKerberosSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosUpdateExecute(r ApiSourcesGroupConnectionsKerberosUpdateRequest) (*GroupKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupKerberosSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupKerberosSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsKerberosUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsKerberosUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsKerberosUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsKerberosUsedByList Method for SourcesGroupConnectionsKerberosUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Kerberos Source Connection. + @return ApiSourcesGroupConnectionsKerberosUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsKerberosUsedByListRequest { + return ApiSourcesGroupConnectionsKerberosUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsKerberosUsedByListExecute(r ApiSourcesGroupConnectionsKerberosUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsKerberosUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/kerberos/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupLDAPSourceConnectionRequest *GroupLDAPSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsLdapCreateRequest) GroupLDAPSourceConnectionRequest(groupLDAPSourceConnectionRequest GroupLDAPSourceConnectionRequest) ApiSourcesGroupConnectionsLdapCreateRequest { + r.groupLDAPSourceConnectionRequest = &groupLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsLdapCreateRequest) Execute() (*GroupLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapCreateExecute(r) +} + +/* +SourcesGroupConnectionsLdapCreate Method for SourcesGroupConnectionsLdapCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsLdapCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapCreate(ctx context.Context) ApiSourcesGroupConnectionsLdapCreateRequest { + return ApiSourcesGroupConnectionsLdapCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupLDAPSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsLdapCreateExecute(r ApiSourcesGroupConnectionsLdapCreateRequest) (*GroupLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupLDAPSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupLDAPSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsLdapDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapDestroyExecute(r) +} + +/* +SourcesGroupConnectionsLdapDestroy Method for SourcesGroupConnectionsLdapDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group LDAP Source Connection. + @return ApiSourcesGroupConnectionsLdapDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsLdapDestroyRequest { + return ApiSourcesGroupConnectionsLdapDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsLdapDestroyExecute(r ApiSourcesGroupConnectionsLdapDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsLdapListRequest) Group(group string) ApiSourcesGroupConnectionsLdapListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsLdapListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsLdapListRequest) Page(page int32) ApiSourcesGroupConnectionsLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsLdapListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsLdapListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsLdapListRequest) Search(search string) ApiSourcesGroupConnectionsLdapListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsLdapListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsLdapListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsLdapListRequest) Execute() (*PaginatedGroupLDAPSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapListExecute(r) +} + +/* +SourcesGroupConnectionsLdapList Method for SourcesGroupConnectionsLdapList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsLdapListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapList(ctx context.Context) ApiSourcesGroupConnectionsLdapListRequest { + return ApiSourcesGroupConnectionsLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupLDAPSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsLdapListExecute(r ApiSourcesGroupConnectionsLdapListRequest) (*PaginatedGroupLDAPSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupLDAPSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupLDAPSourceConnectionRequest *PatchedGroupLDAPSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsLdapPartialUpdateRequest) PatchedGroupLDAPSourceConnectionRequest(patchedGroupLDAPSourceConnectionRequest PatchedGroupLDAPSourceConnectionRequest) ApiSourcesGroupConnectionsLdapPartialUpdateRequest { + r.patchedGroupLDAPSourceConnectionRequest = &patchedGroupLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsLdapPartialUpdateRequest) Execute() (*GroupLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsLdapPartialUpdate Method for SourcesGroupConnectionsLdapPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group LDAP Source Connection. + @return ApiSourcesGroupConnectionsLdapPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsLdapPartialUpdateRequest { + return ApiSourcesGroupConnectionsLdapPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupLDAPSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsLdapPartialUpdateExecute(r ApiSourcesGroupConnectionsLdapPartialUpdateRequest) (*GroupLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsLdapRetrieveRequest) Execute() (*GroupLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsLdapRetrieve Method for SourcesGroupConnectionsLdapRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group LDAP Source Connection. + @return ApiSourcesGroupConnectionsLdapRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsLdapRetrieveRequest { + return ApiSourcesGroupConnectionsLdapRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupLDAPSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsLdapRetrieveExecute(r ApiSourcesGroupConnectionsLdapRetrieveRequest) (*GroupLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupLDAPSourceConnectionRequest *GroupLDAPSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsLdapUpdateRequest) GroupLDAPSourceConnectionRequest(groupLDAPSourceConnectionRequest GroupLDAPSourceConnectionRequest) ApiSourcesGroupConnectionsLdapUpdateRequest { + r.groupLDAPSourceConnectionRequest = &groupLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsLdapUpdateRequest) Execute() (*GroupLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapUpdateExecute(r) +} + +/* +SourcesGroupConnectionsLdapUpdate Method for SourcesGroupConnectionsLdapUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group LDAP Source Connection. + @return ApiSourcesGroupConnectionsLdapUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsLdapUpdateRequest { + return ApiSourcesGroupConnectionsLdapUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupLDAPSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsLdapUpdateExecute(r ApiSourcesGroupConnectionsLdapUpdateRequest) (*GroupLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupLDAPSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupLDAPSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsLdapUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsLdapUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsLdapUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsLdapUsedByList Method for SourcesGroupConnectionsLdapUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group LDAP Source Connection. + @return ApiSourcesGroupConnectionsLdapUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsLdapUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsLdapUsedByListRequest { + return ApiSourcesGroupConnectionsLdapUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsLdapUsedByListExecute(r ApiSourcesGroupConnectionsLdapUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsLdapUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/ldap/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupOAuthSourceConnectionRequest *GroupOAuthSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsOauthCreateRequest) GroupOAuthSourceConnectionRequest(groupOAuthSourceConnectionRequest GroupOAuthSourceConnectionRequest) ApiSourcesGroupConnectionsOauthCreateRequest { + r.groupOAuthSourceConnectionRequest = &groupOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsOauthCreateRequest) Execute() (*GroupOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthCreateExecute(r) +} + +/* +SourcesGroupConnectionsOauthCreate Method for SourcesGroupConnectionsOauthCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsOauthCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthCreate(ctx context.Context) ApiSourcesGroupConnectionsOauthCreateRequest { + return ApiSourcesGroupConnectionsOauthCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupOAuthSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsOauthCreateExecute(r ApiSourcesGroupConnectionsOauthCreateRequest) (*GroupOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupOAuthSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupOAuthSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsOauthDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthDestroyExecute(r) +} + +/* +SourcesGroupConnectionsOauthDestroy Method for SourcesGroupConnectionsOauthDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group OAuth Source Connection. + @return ApiSourcesGroupConnectionsOauthDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsOauthDestroyRequest { + return ApiSourcesGroupConnectionsOauthDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsOauthDestroyExecute(r ApiSourcesGroupConnectionsOauthDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsOauthListRequest) Group(group string) ApiSourcesGroupConnectionsOauthListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsOauthListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsOauthListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsOauthListRequest) Page(page int32) ApiSourcesGroupConnectionsOauthListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsOauthListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsOauthListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsOauthListRequest) Search(search string) ApiSourcesGroupConnectionsOauthListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsOauthListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsOauthListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsOauthListRequest) Execute() (*PaginatedGroupOAuthSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthListExecute(r) +} + +/* +SourcesGroupConnectionsOauthList Method for SourcesGroupConnectionsOauthList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsOauthListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthList(ctx context.Context) ApiSourcesGroupConnectionsOauthListRequest { + return ApiSourcesGroupConnectionsOauthListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupOAuthSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsOauthListExecute(r ApiSourcesGroupConnectionsOauthListRequest) (*PaginatedGroupOAuthSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupOAuthSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupOAuthSourceConnectionRequest *PatchedGroupOAuthSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsOauthPartialUpdateRequest) PatchedGroupOAuthSourceConnectionRequest(patchedGroupOAuthSourceConnectionRequest PatchedGroupOAuthSourceConnectionRequest) ApiSourcesGroupConnectionsOauthPartialUpdateRequest { + r.patchedGroupOAuthSourceConnectionRequest = &patchedGroupOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsOauthPartialUpdateRequest) Execute() (*GroupOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsOauthPartialUpdate Method for SourcesGroupConnectionsOauthPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group OAuth Source Connection. + @return ApiSourcesGroupConnectionsOauthPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsOauthPartialUpdateRequest { + return ApiSourcesGroupConnectionsOauthPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupOAuthSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsOauthPartialUpdateExecute(r ApiSourcesGroupConnectionsOauthPartialUpdateRequest) (*GroupOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsOauthRetrieveRequest) Execute() (*GroupOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsOauthRetrieve Method for SourcesGroupConnectionsOauthRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group OAuth Source Connection. + @return ApiSourcesGroupConnectionsOauthRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsOauthRetrieveRequest { + return ApiSourcesGroupConnectionsOauthRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupOAuthSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsOauthRetrieveExecute(r ApiSourcesGroupConnectionsOauthRetrieveRequest) (*GroupOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupOAuthSourceConnectionRequest *GroupOAuthSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsOauthUpdateRequest) GroupOAuthSourceConnectionRequest(groupOAuthSourceConnectionRequest GroupOAuthSourceConnectionRequest) ApiSourcesGroupConnectionsOauthUpdateRequest { + r.groupOAuthSourceConnectionRequest = &groupOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsOauthUpdateRequest) Execute() (*GroupOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthUpdateExecute(r) +} + +/* +SourcesGroupConnectionsOauthUpdate Method for SourcesGroupConnectionsOauthUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group OAuth Source Connection. + @return ApiSourcesGroupConnectionsOauthUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsOauthUpdateRequest { + return ApiSourcesGroupConnectionsOauthUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupOAuthSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsOauthUpdateExecute(r ApiSourcesGroupConnectionsOauthUpdateRequest) (*GroupOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupOAuthSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupOAuthSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsOauthUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsOauthUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsOauthUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsOauthUsedByList Method for SourcesGroupConnectionsOauthUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group OAuth Source Connection. + @return ApiSourcesGroupConnectionsOauthUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsOauthUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsOauthUsedByListRequest { + return ApiSourcesGroupConnectionsOauthUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsOauthUsedByListExecute(r ApiSourcesGroupConnectionsOauthUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsOauthUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/oauth/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupPlexSourceConnectionRequest *GroupPlexSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsPlexCreateRequest) GroupPlexSourceConnectionRequest(groupPlexSourceConnectionRequest GroupPlexSourceConnectionRequest) ApiSourcesGroupConnectionsPlexCreateRequest { + r.groupPlexSourceConnectionRequest = &groupPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsPlexCreateRequest) Execute() (*GroupPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexCreateExecute(r) +} + +/* +SourcesGroupConnectionsPlexCreate Method for SourcesGroupConnectionsPlexCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsPlexCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexCreate(ctx context.Context) ApiSourcesGroupConnectionsPlexCreateRequest { + return ApiSourcesGroupConnectionsPlexCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupPlexSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsPlexCreateExecute(r ApiSourcesGroupConnectionsPlexCreateRequest) (*GroupPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupPlexSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupPlexSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsPlexDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexDestroyExecute(r) +} + +/* +SourcesGroupConnectionsPlexDestroy Method for SourcesGroupConnectionsPlexDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Plex Source Connection. + @return ApiSourcesGroupConnectionsPlexDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsPlexDestroyRequest { + return ApiSourcesGroupConnectionsPlexDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsPlexDestroyExecute(r ApiSourcesGroupConnectionsPlexDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsPlexListRequest) Group(group string) ApiSourcesGroupConnectionsPlexListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsPlexListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsPlexListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsPlexListRequest) Page(page int32) ApiSourcesGroupConnectionsPlexListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsPlexListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsPlexListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsPlexListRequest) Search(search string) ApiSourcesGroupConnectionsPlexListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsPlexListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsPlexListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsPlexListRequest) Execute() (*PaginatedGroupPlexSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexListExecute(r) +} + +/* +SourcesGroupConnectionsPlexList Method for SourcesGroupConnectionsPlexList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsPlexListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexList(ctx context.Context) ApiSourcesGroupConnectionsPlexListRequest { + return ApiSourcesGroupConnectionsPlexListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupPlexSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsPlexListExecute(r ApiSourcesGroupConnectionsPlexListRequest) (*PaginatedGroupPlexSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupPlexSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupPlexSourceConnectionRequest *PatchedGroupPlexSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsPlexPartialUpdateRequest) PatchedGroupPlexSourceConnectionRequest(patchedGroupPlexSourceConnectionRequest PatchedGroupPlexSourceConnectionRequest) ApiSourcesGroupConnectionsPlexPartialUpdateRequest { + r.patchedGroupPlexSourceConnectionRequest = &patchedGroupPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsPlexPartialUpdateRequest) Execute() (*GroupPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsPlexPartialUpdate Method for SourcesGroupConnectionsPlexPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Plex Source Connection. + @return ApiSourcesGroupConnectionsPlexPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsPlexPartialUpdateRequest { + return ApiSourcesGroupConnectionsPlexPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupPlexSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsPlexPartialUpdateExecute(r ApiSourcesGroupConnectionsPlexPartialUpdateRequest) (*GroupPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsPlexRetrieveRequest) Execute() (*GroupPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsPlexRetrieve Method for SourcesGroupConnectionsPlexRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Plex Source Connection. + @return ApiSourcesGroupConnectionsPlexRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsPlexRetrieveRequest { + return ApiSourcesGroupConnectionsPlexRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupPlexSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsPlexRetrieveExecute(r ApiSourcesGroupConnectionsPlexRetrieveRequest) (*GroupPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupPlexSourceConnectionRequest *GroupPlexSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsPlexUpdateRequest) GroupPlexSourceConnectionRequest(groupPlexSourceConnectionRequest GroupPlexSourceConnectionRequest) ApiSourcesGroupConnectionsPlexUpdateRequest { + r.groupPlexSourceConnectionRequest = &groupPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsPlexUpdateRequest) Execute() (*GroupPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexUpdateExecute(r) +} + +/* +SourcesGroupConnectionsPlexUpdate Method for SourcesGroupConnectionsPlexUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Plex Source Connection. + @return ApiSourcesGroupConnectionsPlexUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsPlexUpdateRequest { + return ApiSourcesGroupConnectionsPlexUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupPlexSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsPlexUpdateExecute(r ApiSourcesGroupConnectionsPlexUpdateRequest) (*GroupPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupPlexSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupPlexSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsPlexUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsPlexUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsPlexUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsPlexUsedByList Method for SourcesGroupConnectionsPlexUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Plex Source Connection. + @return ApiSourcesGroupConnectionsPlexUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsPlexUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsPlexUsedByListRequest { + return ApiSourcesGroupConnectionsPlexUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsPlexUsedByListExecute(r ApiSourcesGroupConnectionsPlexUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsPlexUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/plex/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupSAMLSourceConnectionRequest *GroupSAMLSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsSamlCreateRequest) GroupSAMLSourceConnectionRequest(groupSAMLSourceConnectionRequest GroupSAMLSourceConnectionRequest) ApiSourcesGroupConnectionsSamlCreateRequest { + r.groupSAMLSourceConnectionRequest = &groupSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsSamlCreateRequest) Execute() (*GroupSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlCreateExecute(r) +} + +/* +SourcesGroupConnectionsSamlCreate Method for SourcesGroupConnectionsSamlCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsSamlCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlCreate(ctx context.Context) ApiSourcesGroupConnectionsSamlCreateRequest { + return ApiSourcesGroupConnectionsSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupSAMLSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsSamlCreateExecute(r ApiSourcesGroupConnectionsSamlCreateRequest) (*GroupSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupSAMLSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupSAMLSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlDestroyExecute(r) +} + +/* +SourcesGroupConnectionsSamlDestroy Method for SourcesGroupConnectionsSamlDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group SAML Source Connection. + @return ApiSourcesGroupConnectionsSamlDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsSamlDestroyRequest { + return ApiSourcesGroupConnectionsSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsSamlDestroyExecute(r ApiSourcesGroupConnectionsSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsSamlListRequest) Group(group string) ApiSourcesGroupConnectionsSamlListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsSamlListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsSamlListRequest) Page(page int32) ApiSourcesGroupConnectionsSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsSamlListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsSamlListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsSamlListRequest) Search(search string) ApiSourcesGroupConnectionsSamlListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsSamlListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsSamlListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsSamlListRequest) Execute() (*PaginatedGroupSAMLSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlListExecute(r) +} + +/* +SourcesGroupConnectionsSamlList Method for SourcesGroupConnectionsSamlList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsSamlListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlList(ctx context.Context) ApiSourcesGroupConnectionsSamlListRequest { + return ApiSourcesGroupConnectionsSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupSAMLSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsSamlListExecute(r ApiSourcesGroupConnectionsSamlListRequest) (*PaginatedGroupSAMLSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupSAMLSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupSAMLSourceConnectionRequest *PatchedGroupSAMLSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsSamlPartialUpdateRequest) PatchedGroupSAMLSourceConnectionRequest(patchedGroupSAMLSourceConnectionRequest PatchedGroupSAMLSourceConnectionRequest) ApiSourcesGroupConnectionsSamlPartialUpdateRequest { + r.patchedGroupSAMLSourceConnectionRequest = &patchedGroupSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsSamlPartialUpdateRequest) Execute() (*GroupSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsSamlPartialUpdate Method for SourcesGroupConnectionsSamlPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group SAML Source Connection. + @return ApiSourcesGroupConnectionsSamlPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsSamlPartialUpdateRequest { + return ApiSourcesGroupConnectionsSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSAMLSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsSamlPartialUpdateExecute(r ApiSourcesGroupConnectionsSamlPartialUpdateRequest) (*GroupSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsSamlRetrieveRequest) Execute() (*GroupSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsSamlRetrieve Method for SourcesGroupConnectionsSamlRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group SAML Source Connection. + @return ApiSourcesGroupConnectionsSamlRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsSamlRetrieveRequest { + return ApiSourcesGroupConnectionsSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSAMLSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsSamlRetrieveExecute(r ApiSourcesGroupConnectionsSamlRetrieveRequest) (*GroupSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupSAMLSourceConnectionRequest *GroupSAMLSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsSamlUpdateRequest) GroupSAMLSourceConnectionRequest(groupSAMLSourceConnectionRequest GroupSAMLSourceConnectionRequest) ApiSourcesGroupConnectionsSamlUpdateRequest { + r.groupSAMLSourceConnectionRequest = &groupSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsSamlUpdateRequest) Execute() (*GroupSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlUpdateExecute(r) +} + +/* +SourcesGroupConnectionsSamlUpdate Method for SourcesGroupConnectionsSamlUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group SAML Source Connection. + @return ApiSourcesGroupConnectionsSamlUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsSamlUpdateRequest { + return ApiSourcesGroupConnectionsSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupSAMLSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsSamlUpdateExecute(r ApiSourcesGroupConnectionsSamlUpdateRequest) (*GroupSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupSAMLSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupSAMLSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsSamlUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsSamlUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsSamlUsedByList Method for SourcesGroupConnectionsSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group SAML Source Connection. + @return ApiSourcesGroupConnectionsSamlUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsSamlUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsSamlUsedByListRequest { + return ApiSourcesGroupConnectionsSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsSamlUsedByListExecute(r ApiSourcesGroupConnectionsSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/saml/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupTelegramSourceConnectionRequest *GroupTelegramSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsTelegramCreateRequest) GroupTelegramSourceConnectionRequest(groupTelegramSourceConnectionRequest GroupTelegramSourceConnectionRequest) ApiSourcesGroupConnectionsTelegramCreateRequest { + r.groupTelegramSourceConnectionRequest = &groupTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsTelegramCreateRequest) Execute() (*GroupTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramCreateExecute(r) +} + +/* +SourcesGroupConnectionsTelegramCreate Method for SourcesGroupConnectionsTelegramCreate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsTelegramCreateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramCreate(ctx context.Context) ApiSourcesGroupConnectionsTelegramCreateRequest { + return ApiSourcesGroupConnectionsTelegramCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GroupTelegramSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramCreateExecute(r ApiSourcesGroupConnectionsTelegramCreateRequest) (*GroupTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupTelegramSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupTelegramSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsTelegramDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramDestroyExecute(r) +} + +/* +SourcesGroupConnectionsTelegramDestroy Method for SourcesGroupConnectionsTelegramDestroy + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Telegram Source Connection. + @return ApiSourcesGroupConnectionsTelegramDestroyRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramDestroy(ctx context.Context, id int32) ApiSourcesGroupConnectionsTelegramDestroyRequest { + return ApiSourcesGroupConnectionsTelegramDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramDestroyExecute(r ApiSourcesGroupConnectionsTelegramDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + group *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesGroupConnectionsTelegramListRequest) Group(group string) ApiSourcesGroupConnectionsTelegramListRequest { + r.group = &group + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesGroupConnectionsTelegramListRequest) Ordering(ordering string) ApiSourcesGroupConnectionsTelegramListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesGroupConnectionsTelegramListRequest) Page(page int32) ApiSourcesGroupConnectionsTelegramListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesGroupConnectionsTelegramListRequest) PageSize(pageSize int32) ApiSourcesGroupConnectionsTelegramListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesGroupConnectionsTelegramListRequest) Search(search string) ApiSourcesGroupConnectionsTelegramListRequest { + r.search = &search + return r +} + +func (r ApiSourcesGroupConnectionsTelegramListRequest) SourceSlug(sourceSlug string) ApiSourcesGroupConnectionsTelegramListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesGroupConnectionsTelegramListRequest) Execute() (*PaginatedGroupTelegramSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramListExecute(r) +} + +/* +SourcesGroupConnectionsTelegramList Method for SourcesGroupConnectionsTelegramList + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesGroupConnectionsTelegramListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramList(ctx context.Context) ApiSourcesGroupConnectionsTelegramListRequest { + return ApiSourcesGroupConnectionsTelegramListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedGroupTelegramSourceConnectionList +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramListExecute(r ApiSourcesGroupConnectionsTelegramListRequest) (*PaginatedGroupTelegramSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedGroupTelegramSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.group != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group", r.group, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedGroupTelegramSourceConnectionRequest *PatchedGroupTelegramSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsTelegramPartialUpdateRequest) PatchedGroupTelegramSourceConnectionRequest(patchedGroupTelegramSourceConnectionRequest PatchedGroupTelegramSourceConnectionRequest) ApiSourcesGroupConnectionsTelegramPartialUpdateRequest { + r.patchedGroupTelegramSourceConnectionRequest = &patchedGroupTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsTelegramPartialUpdateRequest) Execute() (*GroupTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramPartialUpdateExecute(r) +} + +/* +SourcesGroupConnectionsTelegramPartialUpdate Method for SourcesGroupConnectionsTelegramPartialUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Telegram Source Connection. + @return ApiSourcesGroupConnectionsTelegramPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramPartialUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsTelegramPartialUpdateRequest { + return ApiSourcesGroupConnectionsTelegramPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupTelegramSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramPartialUpdateExecute(r ApiSourcesGroupConnectionsTelegramPartialUpdateRequest) (*GroupTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedGroupTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsTelegramRetrieveRequest) Execute() (*GroupTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramRetrieveExecute(r) +} + +/* +SourcesGroupConnectionsTelegramRetrieve Method for SourcesGroupConnectionsTelegramRetrieve + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Telegram Source Connection. + @return ApiSourcesGroupConnectionsTelegramRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramRetrieve(ctx context.Context, id int32) ApiSourcesGroupConnectionsTelegramRetrieveRequest { + return ApiSourcesGroupConnectionsTelegramRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupTelegramSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramRetrieveExecute(r ApiSourcesGroupConnectionsTelegramRetrieveRequest) (*GroupTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + groupTelegramSourceConnectionRequest *GroupTelegramSourceConnectionRequest +} + +func (r ApiSourcesGroupConnectionsTelegramUpdateRequest) GroupTelegramSourceConnectionRequest(groupTelegramSourceConnectionRequest GroupTelegramSourceConnectionRequest) ApiSourcesGroupConnectionsTelegramUpdateRequest { + r.groupTelegramSourceConnectionRequest = &groupTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesGroupConnectionsTelegramUpdateRequest) Execute() (*GroupTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramUpdateExecute(r) +} + +/* +SourcesGroupConnectionsTelegramUpdate Method for SourcesGroupConnectionsTelegramUpdate + +Group-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Telegram Source Connection. + @return ApiSourcesGroupConnectionsTelegramUpdateRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramUpdate(ctx context.Context, id int32) ApiSourcesGroupConnectionsTelegramUpdateRequest { + return ApiSourcesGroupConnectionsTelegramUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return GroupTelegramSourceConnection +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramUpdateExecute(r ApiSourcesGroupConnectionsTelegramUpdateRequest) (*GroupTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GroupTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.groupTelegramSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("groupTelegramSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.groupTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesGroupConnectionsTelegramUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesGroupConnectionsTelegramUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesGroupConnectionsTelegramUsedByListExecute(r) +} + +/* +SourcesGroupConnectionsTelegramUsedByList Method for SourcesGroupConnectionsTelegramUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Group Telegram Source Connection. + @return ApiSourcesGroupConnectionsTelegramUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramUsedByList(ctx context.Context, id int32) ApiSourcesGroupConnectionsTelegramUsedByListRequest { + return ApiSourcesGroupConnectionsTelegramUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesGroupConnectionsTelegramUsedByListExecute(r ApiSourcesGroupConnectionsTelegramUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesGroupConnectionsTelegramUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/group_connections/telegram/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + kerberosSourceRequest *KerberosSourceRequest +} + +func (r ApiSourcesKerberosCreateRequest) KerberosSourceRequest(kerberosSourceRequest KerberosSourceRequest) ApiSourcesKerberosCreateRequest { + r.kerberosSourceRequest = &kerberosSourceRequest + return r +} + +func (r ApiSourcesKerberosCreateRequest) Execute() (*KerberosSource, *http.Response, error) { + return r.ApiService.SourcesKerberosCreateExecute(r) +} + +/* +SourcesKerberosCreate Method for SourcesKerberosCreate + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesKerberosCreateRequest +*/ +func (a *SourcesAPIService) SourcesKerberosCreate(ctx context.Context) ApiSourcesKerberosCreateRequest { + return ApiSourcesKerberosCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KerberosSource +func (a *SourcesAPIService) SourcesKerberosCreateExecute(r ApiSourcesKerberosCreateRequest) (*KerberosSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kerberosSourceRequest == nil { + return localVarReturnValue, nil, reportError("kerberosSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kerberosSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesKerberosDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesKerberosDestroyExecute(r) +} + +/* +SourcesKerberosDestroy Method for SourcesKerberosDestroy + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosDestroyRequest +*/ +func (a *SourcesAPIService) SourcesKerberosDestroy(ctx context.Context, slug string) ApiSourcesKerberosDestroyRequest { + return ApiSourcesKerberosDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesKerberosDestroyExecute(r ApiSourcesKerberosDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesKerberosListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + enabled *bool + kadminType *string + name *string + ordering *string + page *int32 + pageSize *int32 + passwordLoginUpdateInternalPassword *bool + pbmUuid *string + realm *string + search *string + slug *string + spnegoServerName *string + syncPrincipal *string + syncUsers *bool + syncUsersPassword *bool +} + +func (r ApiSourcesKerberosListRequest) Enabled(enabled bool) ApiSourcesKerberosListRequest { + r.enabled = &enabled + return r +} + +// KAdmin server type +func (r ApiSourcesKerberosListRequest) KadminType(kadminType string) ApiSourcesKerberosListRequest { + r.kadminType = &kadminType + return r +} + +func (r ApiSourcesKerberosListRequest) Name(name string) ApiSourcesKerberosListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesKerberosListRequest) Ordering(ordering string) ApiSourcesKerberosListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesKerberosListRequest) Page(page int32) ApiSourcesKerberosListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesKerberosListRequest) PageSize(pageSize int32) ApiSourcesKerberosListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesKerberosListRequest) PasswordLoginUpdateInternalPassword(passwordLoginUpdateInternalPassword bool) ApiSourcesKerberosListRequest { + r.passwordLoginUpdateInternalPassword = &passwordLoginUpdateInternalPassword + return r +} + +func (r ApiSourcesKerberosListRequest) PbmUuid(pbmUuid string) ApiSourcesKerberosListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesKerberosListRequest) Realm(realm string) ApiSourcesKerberosListRequest { + r.realm = &realm + return r +} + +// A search term. +func (r ApiSourcesKerberosListRequest) Search(search string) ApiSourcesKerberosListRequest { + r.search = &search + return r +} + +func (r ApiSourcesKerberosListRequest) Slug(slug string) ApiSourcesKerberosListRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesKerberosListRequest) SpnegoServerName(spnegoServerName string) ApiSourcesKerberosListRequest { + r.spnegoServerName = &spnegoServerName + return r +} + +func (r ApiSourcesKerberosListRequest) SyncPrincipal(syncPrincipal string) ApiSourcesKerberosListRequest { + r.syncPrincipal = &syncPrincipal + return r +} + +func (r ApiSourcesKerberosListRequest) SyncUsers(syncUsers bool) ApiSourcesKerberosListRequest { + r.syncUsers = &syncUsers + return r +} + +func (r ApiSourcesKerberosListRequest) SyncUsersPassword(syncUsersPassword bool) ApiSourcesKerberosListRequest { + r.syncUsersPassword = &syncUsersPassword + return r +} + +func (r ApiSourcesKerberosListRequest) Execute() (*PaginatedKerberosSourceList, *http.Response, error) { + return r.ApiService.SourcesKerberosListExecute(r) +} + +/* +SourcesKerberosList Method for SourcesKerberosList + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesKerberosListRequest +*/ +func (a *SourcesAPIService) SourcesKerberosList(ctx context.Context) ApiSourcesKerberosListRequest { + return ApiSourcesKerberosListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedKerberosSourceList +func (a *SourcesAPIService) SourcesKerberosListExecute(r ApiSourcesKerberosListRequest) (*PaginatedKerberosSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedKerberosSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.kadminType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "kadmin_type", r.kadminType, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.passwordLoginUpdateInternalPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password_login_update_internal_password", r.passwordLoginUpdateInternalPassword, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.realm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "realm", r.realm, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.spnegoServerName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "spnego_server_name", r.spnegoServerName, "form", "") + } + if r.syncPrincipal != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_principal", r.syncPrincipal, "form", "") + } + if r.syncUsers != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_users", r.syncUsers, "form", "") + } + if r.syncUsersPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_users_password", r.syncUsersPassword, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedKerberosSourceRequest *PatchedKerberosSourceRequest +} + +func (r ApiSourcesKerberosPartialUpdateRequest) PatchedKerberosSourceRequest(patchedKerberosSourceRequest PatchedKerberosSourceRequest) ApiSourcesKerberosPartialUpdateRequest { + r.patchedKerberosSourceRequest = &patchedKerberosSourceRequest + return r +} + +func (r ApiSourcesKerberosPartialUpdateRequest) Execute() (*KerberosSource, *http.Response, error) { + return r.ApiService.SourcesKerberosPartialUpdateExecute(r) +} + +/* +SourcesKerberosPartialUpdate Method for SourcesKerberosPartialUpdate + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesKerberosPartialUpdate(ctx context.Context, slug string) ApiSourcesKerberosPartialUpdateRequest { + return ApiSourcesKerberosPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return KerberosSource +func (a *SourcesAPIService) SourcesKerberosPartialUpdateExecute(r ApiSourcesKerberosPartialUpdateRequest) (*KerberosSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedKerberosSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesKerberosRetrieveRequest) Execute() (*KerberosSource, *http.Response, error) { + return r.ApiService.SourcesKerberosRetrieveExecute(r) +} + +/* +SourcesKerberosRetrieve Method for SourcesKerberosRetrieve + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesKerberosRetrieve(ctx context.Context, slug string) ApiSourcesKerberosRetrieveRequest { + return ApiSourcesKerberosRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return KerberosSource +func (a *SourcesAPIService) SourcesKerberosRetrieveExecute(r ApiSourcesKerberosRetrieveRequest) (*KerberosSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosSyncStatusRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesKerberosSyncStatusRetrieveRequest) Execute() (*SyncStatus, *http.Response, error) { + return r.ApiService.SourcesKerberosSyncStatusRetrieveExecute(r) +} + +/* +SourcesKerberosSyncStatusRetrieve Method for SourcesKerberosSyncStatusRetrieve + +Get provider's sync status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosSyncStatusRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesKerberosSyncStatusRetrieve(ctx context.Context, slug string) ApiSourcesKerberosSyncStatusRetrieveRequest { + return ApiSourcesKerberosSyncStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SyncStatus +func (a *SourcesAPIService) SourcesKerberosSyncStatusRetrieveExecute(r ApiSourcesKerberosSyncStatusRetrieveRequest) (*SyncStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosSyncStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/sync/status/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + kerberosSourceRequest *KerberosSourceRequest +} + +func (r ApiSourcesKerberosUpdateRequest) KerberosSourceRequest(kerberosSourceRequest KerberosSourceRequest) ApiSourcesKerberosUpdateRequest { + r.kerberosSourceRequest = &kerberosSourceRequest + return r +} + +func (r ApiSourcesKerberosUpdateRequest) Execute() (*KerberosSource, *http.Response, error) { + return r.ApiService.SourcesKerberosUpdateExecute(r) +} + +/* +SourcesKerberosUpdate Method for SourcesKerberosUpdate + +Kerberos Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosUpdateRequest +*/ +func (a *SourcesAPIService) SourcesKerberosUpdate(ctx context.Context, slug string) ApiSourcesKerberosUpdateRequest { + return ApiSourcesKerberosUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return KerberosSource +func (a *SourcesAPIService) SourcesKerberosUpdateExecute(r ApiSourcesKerberosUpdateRequest) (*KerberosSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KerberosSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.kerberosSourceRequest == nil { + return localVarReturnValue, nil, reportError("kerberosSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.kerberosSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesKerberosUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesKerberosUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesKerberosUsedByListExecute(r) +} + +/* +SourcesKerberosUsedByList Method for SourcesKerberosUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesKerberosUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesKerberosUsedByList(ctx context.Context, slug string) ApiSourcesKerberosUsedByListRequest { + return ApiSourcesKerberosUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesKerberosUsedByListExecute(r ApiSourcesKerberosUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesKerberosUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/kerberos/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + lDAPSourceRequest *LDAPSourceRequest +} + +func (r ApiSourcesLdapCreateRequest) LDAPSourceRequest(lDAPSourceRequest LDAPSourceRequest) ApiSourcesLdapCreateRequest { + r.lDAPSourceRequest = &lDAPSourceRequest + return r +} + +func (r ApiSourcesLdapCreateRequest) Execute() (*LDAPSource, *http.Response, error) { + return r.ApiService.SourcesLdapCreateExecute(r) +} + +/* +SourcesLdapCreate Method for SourcesLdapCreate + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesLdapCreateRequest +*/ +func (a *SourcesAPIService) SourcesLdapCreate(ctx context.Context) ApiSourcesLdapCreateRequest { + return ApiSourcesLdapCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return LDAPSource +func (a *SourcesAPIService) SourcesLdapCreateExecute(r ApiSourcesLdapCreateRequest) (*LDAPSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPSourceRequest == nil { + return localVarReturnValue, nil, reportError("lDAPSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapDebugRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesLdapDebugRetrieveRequest) Execute() (*LDAPDebug, *http.Response, error) { + return r.ApiService.SourcesLdapDebugRetrieveExecute(r) +} + +/* +SourcesLdapDebugRetrieve Method for SourcesLdapDebugRetrieve + +Get raw LDAP data to debug + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapDebugRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesLdapDebugRetrieve(ctx context.Context, slug string) ApiSourcesLdapDebugRetrieveRequest { + return ApiSourcesLdapDebugRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return LDAPDebug +func (a *SourcesAPIService) SourcesLdapDebugRetrieveExecute(r ApiSourcesLdapDebugRetrieveRequest) (*LDAPDebug, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPDebug + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapDebugRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/debug/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesLdapDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesLdapDestroyExecute(r) +} + +/* +SourcesLdapDestroy Method for SourcesLdapDestroy + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapDestroyRequest +*/ +func (a *SourcesAPIService) SourcesLdapDestroy(ctx context.Context, slug string) ApiSourcesLdapDestroyRequest { + return ApiSourcesLdapDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesLdapDestroyExecute(r ApiSourcesLdapDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesLdapListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + additionalGroupDn *string + additionalUserDn *string + baseDn *string + bindCn *string + clientCertificate *string + deleteNotFoundObjects *bool + enabled *bool + groupMembershipField *string + groupObjectFilter *string + groupPropertyMappings *[]string + lookupGroupsFromUser *bool + name *string + objectUniquenessField *string + ordering *string + page *int32 + pageSize *int32 + passwordLoginUpdateInternalPassword *bool + pbmUuid *string + peerCertificate *string + search *string + serverUri *string + slug *string + sni *bool + startTls *bool + syncGroups *bool + syncParentGroup *string + syncUsers *bool + syncUsersPassword *bool + userMembershipAttribute *string + userObjectFilter *string + userPropertyMappings *[]string +} + +func (r ApiSourcesLdapListRequest) AdditionalGroupDn(additionalGroupDn string) ApiSourcesLdapListRequest { + r.additionalGroupDn = &additionalGroupDn + return r +} + +func (r ApiSourcesLdapListRequest) AdditionalUserDn(additionalUserDn string) ApiSourcesLdapListRequest { + r.additionalUserDn = &additionalUserDn + return r +} + +func (r ApiSourcesLdapListRequest) BaseDn(baseDn string) ApiSourcesLdapListRequest { + r.baseDn = &baseDn + return r +} + +func (r ApiSourcesLdapListRequest) BindCn(bindCn string) ApiSourcesLdapListRequest { + r.bindCn = &bindCn + return r +} + +func (r ApiSourcesLdapListRequest) ClientCertificate(clientCertificate string) ApiSourcesLdapListRequest { + r.clientCertificate = &clientCertificate + return r +} + +func (r ApiSourcesLdapListRequest) DeleteNotFoundObjects(deleteNotFoundObjects bool) ApiSourcesLdapListRequest { + r.deleteNotFoundObjects = &deleteNotFoundObjects + return r +} + +func (r ApiSourcesLdapListRequest) Enabled(enabled bool) ApiSourcesLdapListRequest { + r.enabled = &enabled + return r +} + +func (r ApiSourcesLdapListRequest) GroupMembershipField(groupMembershipField string) ApiSourcesLdapListRequest { + r.groupMembershipField = &groupMembershipField + return r +} + +func (r ApiSourcesLdapListRequest) GroupObjectFilter(groupObjectFilter string) ApiSourcesLdapListRequest { + r.groupObjectFilter = &groupObjectFilter + return r +} + +func (r ApiSourcesLdapListRequest) GroupPropertyMappings(groupPropertyMappings []string) ApiSourcesLdapListRequest { + r.groupPropertyMappings = &groupPropertyMappings + return r +} + +func (r ApiSourcesLdapListRequest) LookupGroupsFromUser(lookupGroupsFromUser bool) ApiSourcesLdapListRequest { + r.lookupGroupsFromUser = &lookupGroupsFromUser + return r +} + +func (r ApiSourcesLdapListRequest) Name(name string) ApiSourcesLdapListRequest { + r.name = &name + return r +} + +func (r ApiSourcesLdapListRequest) ObjectUniquenessField(objectUniquenessField string) ApiSourcesLdapListRequest { + r.objectUniquenessField = &objectUniquenessField + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesLdapListRequest) Ordering(ordering string) ApiSourcesLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesLdapListRequest) Page(page int32) ApiSourcesLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesLdapListRequest) PageSize(pageSize int32) ApiSourcesLdapListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesLdapListRequest) PasswordLoginUpdateInternalPassword(passwordLoginUpdateInternalPassword bool) ApiSourcesLdapListRequest { + r.passwordLoginUpdateInternalPassword = &passwordLoginUpdateInternalPassword + return r +} + +func (r ApiSourcesLdapListRequest) PbmUuid(pbmUuid string) ApiSourcesLdapListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesLdapListRequest) PeerCertificate(peerCertificate string) ApiSourcesLdapListRequest { + r.peerCertificate = &peerCertificate + return r +} + +// A search term. +func (r ApiSourcesLdapListRequest) Search(search string) ApiSourcesLdapListRequest { + r.search = &search + return r +} + +func (r ApiSourcesLdapListRequest) ServerUri(serverUri string) ApiSourcesLdapListRequest { + r.serverUri = &serverUri + return r +} + +func (r ApiSourcesLdapListRequest) Slug(slug string) ApiSourcesLdapListRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesLdapListRequest) Sni(sni bool) ApiSourcesLdapListRequest { + r.sni = &sni + return r +} + +func (r ApiSourcesLdapListRequest) StartTls(startTls bool) ApiSourcesLdapListRequest { + r.startTls = &startTls + return r +} + +func (r ApiSourcesLdapListRequest) SyncGroups(syncGroups bool) ApiSourcesLdapListRequest { + r.syncGroups = &syncGroups + return r +} + +func (r ApiSourcesLdapListRequest) SyncParentGroup(syncParentGroup string) ApiSourcesLdapListRequest { + r.syncParentGroup = &syncParentGroup + return r +} + +func (r ApiSourcesLdapListRequest) SyncUsers(syncUsers bool) ApiSourcesLdapListRequest { + r.syncUsers = &syncUsers + return r +} + +func (r ApiSourcesLdapListRequest) SyncUsersPassword(syncUsersPassword bool) ApiSourcesLdapListRequest { + r.syncUsersPassword = &syncUsersPassword + return r +} + +func (r ApiSourcesLdapListRequest) UserMembershipAttribute(userMembershipAttribute string) ApiSourcesLdapListRequest { + r.userMembershipAttribute = &userMembershipAttribute + return r +} + +func (r ApiSourcesLdapListRequest) UserObjectFilter(userObjectFilter string) ApiSourcesLdapListRequest { + r.userObjectFilter = &userObjectFilter + return r +} + +func (r ApiSourcesLdapListRequest) UserPropertyMappings(userPropertyMappings []string) ApiSourcesLdapListRequest { + r.userPropertyMappings = &userPropertyMappings + return r +} + +func (r ApiSourcesLdapListRequest) Execute() (*PaginatedLDAPSourceList, *http.Response, error) { + return r.ApiService.SourcesLdapListExecute(r) +} + +/* +SourcesLdapList Method for SourcesLdapList + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesLdapListRequest +*/ +func (a *SourcesAPIService) SourcesLdapList(ctx context.Context) ApiSourcesLdapListRequest { + return ApiSourcesLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedLDAPSourceList +func (a *SourcesAPIService) SourcesLdapListExecute(r ApiSourcesLdapListRequest) (*PaginatedLDAPSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedLDAPSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.additionalGroupDn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "additional_group_dn", r.additionalGroupDn, "form", "") + } + if r.additionalUserDn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "additional_user_dn", r.additionalUserDn, "form", "") + } + if r.baseDn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "base_dn", r.baseDn, "form", "") + } + if r.bindCn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bind_cn", r.bindCn, "form", "") + } + if r.clientCertificate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_certificate", r.clientCertificate, "form", "") + } + if r.deleteNotFoundObjects != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delete_not_found_objects", r.deleteNotFoundObjects, "form", "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.groupMembershipField != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_membership_field", r.groupMembershipField, "form", "") + } + if r.groupObjectFilter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_object_filter", r.groupObjectFilter, "form", "") + } + if r.groupPropertyMappings != nil { + t := *r.groupPropertyMappings + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_property_mappings", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_property_mappings", t, "form", "multi") + } + } + if r.lookupGroupsFromUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "lookup_groups_from_user", r.lookupGroupsFromUser, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.objectUniquenessField != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "object_uniqueness_field", r.objectUniquenessField, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.passwordLoginUpdateInternalPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password_login_update_internal_password", r.passwordLoginUpdateInternalPassword, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.peerCertificate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "peer_certificate", r.peerCertificate, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.serverUri != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "server_uri", r.serverUri, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.sni != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sni", r.sni, "form", "") + } + if r.startTls != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "start_tls", r.startTls, "form", "") + } + if r.syncGroups != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_groups", r.syncGroups, "form", "") + } + if r.syncParentGroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_parent_group", r.syncParentGroup, "form", "") + } + if r.syncUsers != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_users", r.syncUsers, "form", "") + } + if r.syncUsersPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sync_users_password", r.syncUsersPassword, "form", "") + } + if r.userMembershipAttribute != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_membership_attribute", r.userMembershipAttribute, "form", "") + } + if r.userObjectFilter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_object_filter", r.userObjectFilter, "form", "") + } + if r.userPropertyMappings != nil { + t := *r.userPropertyMappings + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_property_mappings", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_property_mappings", t, "form", "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedLDAPSourceRequest *PatchedLDAPSourceRequest +} + +func (r ApiSourcesLdapPartialUpdateRequest) PatchedLDAPSourceRequest(patchedLDAPSourceRequest PatchedLDAPSourceRequest) ApiSourcesLdapPartialUpdateRequest { + r.patchedLDAPSourceRequest = &patchedLDAPSourceRequest + return r +} + +func (r ApiSourcesLdapPartialUpdateRequest) Execute() (*LDAPSource, *http.Response, error) { + return r.ApiService.SourcesLdapPartialUpdateExecute(r) +} + +/* +SourcesLdapPartialUpdate Method for SourcesLdapPartialUpdate + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesLdapPartialUpdate(ctx context.Context, slug string) ApiSourcesLdapPartialUpdateRequest { + return ApiSourcesLdapPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return LDAPSource +func (a *SourcesAPIService) SourcesLdapPartialUpdateExecute(r ApiSourcesLdapPartialUpdateRequest) (*LDAPSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedLDAPSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesLdapRetrieveRequest) Execute() (*LDAPSource, *http.Response, error) { + return r.ApiService.SourcesLdapRetrieveExecute(r) +} + +/* +SourcesLdapRetrieve Method for SourcesLdapRetrieve + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesLdapRetrieve(ctx context.Context, slug string) ApiSourcesLdapRetrieveRequest { + return ApiSourcesLdapRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return LDAPSource +func (a *SourcesAPIService) SourcesLdapRetrieveExecute(r ApiSourcesLdapRetrieveRequest) (*LDAPSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapSyncStatusRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesLdapSyncStatusRetrieveRequest) Execute() (*SyncStatus, *http.Response, error) { + return r.ApiService.SourcesLdapSyncStatusRetrieveExecute(r) +} + +/* +SourcesLdapSyncStatusRetrieve Method for SourcesLdapSyncStatusRetrieve + +Get provider's sync status + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapSyncStatusRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesLdapSyncStatusRetrieve(ctx context.Context, slug string) ApiSourcesLdapSyncStatusRetrieveRequest { + return ApiSourcesLdapSyncStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SyncStatus +func (a *SourcesAPIService) SourcesLdapSyncStatusRetrieveExecute(r ApiSourcesLdapSyncStatusRetrieveRequest) (*SyncStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SyncStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapSyncStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/sync/status/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + lDAPSourceRequest *LDAPSourceRequest +} + +func (r ApiSourcesLdapUpdateRequest) LDAPSourceRequest(lDAPSourceRequest LDAPSourceRequest) ApiSourcesLdapUpdateRequest { + r.lDAPSourceRequest = &lDAPSourceRequest + return r +} + +func (r ApiSourcesLdapUpdateRequest) Execute() (*LDAPSource, *http.Response, error) { + return r.ApiService.SourcesLdapUpdateExecute(r) +} + +/* +SourcesLdapUpdate Method for SourcesLdapUpdate + +LDAP Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapUpdateRequest +*/ +func (a *SourcesAPIService) SourcesLdapUpdate(ctx context.Context, slug string) ApiSourcesLdapUpdateRequest { + return ApiSourcesLdapUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return LDAPSource +func (a *SourcesAPIService) SourcesLdapUpdateExecute(r ApiSourcesLdapUpdateRequest) (*LDAPSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *LDAPSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.lDAPSourceRequest == nil { + return localVarReturnValue, nil, reportError("lDAPSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.lDAPSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesLdapUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesLdapUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesLdapUsedByListExecute(r) +} + +/* +SourcesLdapUsedByList Method for SourcesLdapUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesLdapUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesLdapUsedByList(ctx context.Context, slug string) ApiSourcesLdapUsedByListRequest { + return ApiSourcesLdapUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesLdapUsedByListExecute(r ApiSourcesLdapUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesLdapUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/ldap/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + oAuthSourceRequest *OAuthSourceRequest +} + +func (r ApiSourcesOauthCreateRequest) OAuthSourceRequest(oAuthSourceRequest OAuthSourceRequest) ApiSourcesOauthCreateRequest { + r.oAuthSourceRequest = &oAuthSourceRequest + return r +} + +func (r ApiSourcesOauthCreateRequest) Execute() (*OAuthSource, *http.Response, error) { + return r.ApiService.SourcesOauthCreateExecute(r) +} + +/* +SourcesOauthCreate Method for SourcesOauthCreate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesOauthCreateRequest +*/ +func (a *SourcesAPIService) SourcesOauthCreate(ctx context.Context) ApiSourcesOauthCreateRequest { + return ApiSourcesOauthCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return OAuthSource +func (a *SourcesAPIService) SourcesOauthCreateExecute(r ApiSourcesOauthCreateRequest) (*OAuthSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuthSourceRequest == nil { + return localVarReturnValue, nil, reportError("oAuthSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuthSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesOauthDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesOauthDestroyExecute(r) +} + +/* +SourcesOauthDestroy Method for SourcesOauthDestroy + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesOauthDestroyRequest +*/ +func (a *SourcesAPIService) SourcesOauthDestroy(ctx context.Context, slug string) ApiSourcesOauthDestroyRequest { + return ApiSourcesOauthDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesOauthDestroyExecute(r ApiSourcesOauthDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesOauthListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + accessTokenUrl *string + additionalScopes *string + authenticationFlow *string + authorizationUrl *string + consumerKey *string + enabled *bool + enrollmentFlow *string + groupMatchingMode *string + hasJwks *bool + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + policyEngineMode *string + profileUrl *string + providerType *string + requestTokenUrl *string + search *string + slug *string + userMatchingMode *string +} + +func (r ApiSourcesOauthListRequest) AccessTokenUrl(accessTokenUrl string) ApiSourcesOauthListRequest { + r.accessTokenUrl = &accessTokenUrl + return r +} + +func (r ApiSourcesOauthListRequest) AdditionalScopes(additionalScopes string) ApiSourcesOauthListRequest { + r.additionalScopes = &additionalScopes + return r +} + +func (r ApiSourcesOauthListRequest) AuthenticationFlow(authenticationFlow string) ApiSourcesOauthListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiSourcesOauthListRequest) AuthorizationUrl(authorizationUrl string) ApiSourcesOauthListRequest { + r.authorizationUrl = &authorizationUrl + return r +} + +func (r ApiSourcesOauthListRequest) ConsumerKey(consumerKey string) ApiSourcesOauthListRequest { + r.consumerKey = &consumerKey + return r +} + +func (r ApiSourcesOauthListRequest) Enabled(enabled bool) ApiSourcesOauthListRequest { + r.enabled = &enabled + return r +} + +func (r ApiSourcesOauthListRequest) EnrollmentFlow(enrollmentFlow string) ApiSourcesOauthListRequest { + r.enrollmentFlow = &enrollmentFlow + return r +} + +// How the source determines if an existing group should be used or a new group created. +func (r ApiSourcesOauthListRequest) GroupMatchingMode(groupMatchingMode string) ApiSourcesOauthListRequest { + r.groupMatchingMode = &groupMatchingMode + return r +} + +// Only return sources with JWKS data +func (r ApiSourcesOauthListRequest) HasJwks(hasJwks bool) ApiSourcesOauthListRequest { + r.hasJwks = &hasJwks + return r +} + +func (r ApiSourcesOauthListRequest) Name(name string) ApiSourcesOauthListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesOauthListRequest) Ordering(ordering string) ApiSourcesOauthListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesOauthListRequest) Page(page int32) ApiSourcesOauthListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesOauthListRequest) PageSize(pageSize int32) ApiSourcesOauthListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesOauthListRequest) PbmUuid(pbmUuid string) ApiSourcesOauthListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesOauthListRequest) PolicyEngineMode(policyEngineMode string) ApiSourcesOauthListRequest { + r.policyEngineMode = &policyEngineMode + return r +} + +func (r ApiSourcesOauthListRequest) ProfileUrl(profileUrl string) ApiSourcesOauthListRequest { + r.profileUrl = &profileUrl + return r +} + +func (r ApiSourcesOauthListRequest) ProviderType(providerType string) ApiSourcesOauthListRequest { + r.providerType = &providerType + return r +} + +func (r ApiSourcesOauthListRequest) RequestTokenUrl(requestTokenUrl string) ApiSourcesOauthListRequest { + r.requestTokenUrl = &requestTokenUrl + return r +} + +// A search term. +func (r ApiSourcesOauthListRequest) Search(search string) ApiSourcesOauthListRequest { + r.search = &search + return r +} + +func (r ApiSourcesOauthListRequest) Slug(slug string) ApiSourcesOauthListRequest { + r.slug = &slug + return r +} + +// How the source determines if an existing user should be authenticated or a new user enrolled. +func (r ApiSourcesOauthListRequest) UserMatchingMode(userMatchingMode string) ApiSourcesOauthListRequest { + r.userMatchingMode = &userMatchingMode + return r +} + +func (r ApiSourcesOauthListRequest) Execute() (*PaginatedOAuthSourceList, *http.Response, error) { + return r.ApiService.SourcesOauthListExecute(r) +} + +/* +SourcesOauthList Method for SourcesOauthList + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesOauthListRequest +*/ +func (a *SourcesAPIService) SourcesOauthList(ctx context.Context) ApiSourcesOauthListRequest { + return ApiSourcesOauthListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedOAuthSourceList +func (a *SourcesAPIService) SourcesOauthListExecute(r ApiSourcesOauthListRequest) (*PaginatedOAuthSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedOAuthSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.accessTokenUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "access_token_url", r.accessTokenUrl, "form", "") + } + if r.additionalScopes != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "additional_scopes", r.additionalScopes, "form", "") + } + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.authorizationUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authorization_url", r.authorizationUrl, "form", "") + } + if r.consumerKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "consumer_key", r.consumerKey, "form", "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.enrollmentFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enrollment_flow", r.enrollmentFlow, "form", "") + } + if r.groupMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_matching_mode", r.groupMatchingMode, "form", "") + } + if r.hasJwks != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "has_jwks", r.hasJwks, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.policyEngineMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_engine_mode", r.policyEngineMode, "form", "") + } + if r.profileUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "profile_url", r.profileUrl, "form", "") + } + if r.providerType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider_type", r.providerType, "form", "") + } + if r.requestTokenUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "request_token_url", r.requestTokenUrl, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.userMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_matching_mode", r.userMatchingMode, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedOAuthSourceRequest *PatchedOAuthSourceRequest +} + +func (r ApiSourcesOauthPartialUpdateRequest) PatchedOAuthSourceRequest(patchedOAuthSourceRequest PatchedOAuthSourceRequest) ApiSourcesOauthPartialUpdateRequest { + r.patchedOAuthSourceRequest = &patchedOAuthSourceRequest + return r +} + +func (r ApiSourcesOauthPartialUpdateRequest) Execute() (*OAuthSource, *http.Response, error) { + return r.ApiService.SourcesOauthPartialUpdateExecute(r) +} + +/* +SourcesOauthPartialUpdate Method for SourcesOauthPartialUpdate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesOauthPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesOauthPartialUpdate(ctx context.Context, slug string) ApiSourcesOauthPartialUpdateRequest { + return ApiSourcesOauthPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return OAuthSource +func (a *SourcesAPIService) SourcesOauthPartialUpdateExecute(r ApiSourcesOauthPartialUpdateRequest) (*OAuthSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedOAuthSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesOauthRetrieveRequest) Execute() (*OAuthSource, *http.Response, error) { + return r.ApiService.SourcesOauthRetrieveExecute(r) +} + +/* +SourcesOauthRetrieve Method for SourcesOauthRetrieve + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesOauthRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesOauthRetrieve(ctx context.Context, slug string) ApiSourcesOauthRetrieveRequest { + return ApiSourcesOauthRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return OAuthSource +func (a *SourcesAPIService) SourcesOauthRetrieveExecute(r ApiSourcesOauthRetrieveRequest) (*OAuthSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthSourceTypesListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + name *string +} + +func (r ApiSourcesOauthSourceTypesListRequest) Name(name string) ApiSourcesOauthSourceTypesListRequest { + r.name = &name + return r +} + +func (r ApiSourcesOauthSourceTypesListRequest) Execute() ([]SourceType, *http.Response, error) { + return r.ApiService.SourcesOauthSourceTypesListExecute(r) +} + +/* +SourcesOauthSourceTypesList Method for SourcesOauthSourceTypesList + +Get all creatable source types. If ?name is set, only returns the type for . +If isn't found, returns the default type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesOauthSourceTypesListRequest +*/ +func (a *SourcesAPIService) SourcesOauthSourceTypesList(ctx context.Context) ApiSourcesOauthSourceTypesListRequest { + return ApiSourcesOauthSourceTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []SourceType +func (a *SourcesAPIService) SourcesOauthSourceTypesListExecute(r ApiSourcesOauthSourceTypesListRequest) ([]SourceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []SourceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthSourceTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/source_types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + oAuthSourceRequest *OAuthSourceRequest +} + +func (r ApiSourcesOauthUpdateRequest) OAuthSourceRequest(oAuthSourceRequest OAuthSourceRequest) ApiSourcesOauthUpdateRequest { + r.oAuthSourceRequest = &oAuthSourceRequest + return r +} + +func (r ApiSourcesOauthUpdateRequest) Execute() (*OAuthSource, *http.Response, error) { + return r.ApiService.SourcesOauthUpdateExecute(r) +} + +/* +SourcesOauthUpdate Method for SourcesOauthUpdate + +Source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesOauthUpdateRequest +*/ +func (a *SourcesAPIService) SourcesOauthUpdate(ctx context.Context, slug string) ApiSourcesOauthUpdateRequest { + return ApiSourcesOauthUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return OAuthSource +func (a *SourcesAPIService) SourcesOauthUpdateExecute(r ApiSourcesOauthUpdateRequest) (*OAuthSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *OAuthSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.oAuthSourceRequest == nil { + return localVarReturnValue, nil, reportError("oAuthSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.oAuthSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesOauthUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesOauthUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesOauthUsedByListExecute(r) +} + +/* +SourcesOauthUsedByList Method for SourcesOauthUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesOauthUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesOauthUsedByList(ctx context.Context, slug string) ApiSourcesOauthUsedByListRequest { + return ApiSourcesOauthUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesOauthUsedByListExecute(r ApiSourcesOauthUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesOauthUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/oauth/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + plexSourceRequest *PlexSourceRequest +} + +func (r ApiSourcesPlexCreateRequest) PlexSourceRequest(plexSourceRequest PlexSourceRequest) ApiSourcesPlexCreateRequest { + r.plexSourceRequest = &plexSourceRequest + return r +} + +func (r ApiSourcesPlexCreateRequest) Execute() (*PlexSource, *http.Response, error) { + return r.ApiService.SourcesPlexCreateExecute(r) +} + +/* +SourcesPlexCreate Method for SourcesPlexCreate + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesPlexCreateRequest +*/ +func (a *SourcesAPIService) SourcesPlexCreate(ctx context.Context) ApiSourcesPlexCreateRequest { + return ApiSourcesPlexCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PlexSource +func (a *SourcesAPIService) SourcesPlexCreateExecute(r ApiSourcesPlexCreateRequest) (*PlexSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexSourceRequest == nil { + return localVarReturnValue, nil, reportError("plexSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesPlexDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesPlexDestroyExecute(r) +} + +/* +SourcesPlexDestroy Method for SourcesPlexDestroy + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesPlexDestroyRequest +*/ +func (a *SourcesAPIService) SourcesPlexDestroy(ctx context.Context, slug string) ApiSourcesPlexDestroyRequest { + return ApiSourcesPlexDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesPlexDestroyExecute(r ApiSourcesPlexDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesPlexListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + allowFriends *bool + authenticationFlow *string + clientId *string + enabled *bool + enrollmentFlow *string + groupMatchingMode *string + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + policyEngineMode *string + search *string + slug *string + userMatchingMode *string +} + +func (r ApiSourcesPlexListRequest) AllowFriends(allowFriends bool) ApiSourcesPlexListRequest { + r.allowFriends = &allowFriends + return r +} + +func (r ApiSourcesPlexListRequest) AuthenticationFlow(authenticationFlow string) ApiSourcesPlexListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiSourcesPlexListRequest) ClientId(clientId string) ApiSourcesPlexListRequest { + r.clientId = &clientId + return r +} + +func (r ApiSourcesPlexListRequest) Enabled(enabled bool) ApiSourcesPlexListRequest { + r.enabled = &enabled + return r +} + +func (r ApiSourcesPlexListRequest) EnrollmentFlow(enrollmentFlow string) ApiSourcesPlexListRequest { + r.enrollmentFlow = &enrollmentFlow + return r +} + +// How the source determines if an existing group should be used or a new group created. +func (r ApiSourcesPlexListRequest) GroupMatchingMode(groupMatchingMode string) ApiSourcesPlexListRequest { + r.groupMatchingMode = &groupMatchingMode + return r +} + +func (r ApiSourcesPlexListRequest) Name(name string) ApiSourcesPlexListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesPlexListRequest) Ordering(ordering string) ApiSourcesPlexListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesPlexListRequest) Page(page int32) ApiSourcesPlexListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesPlexListRequest) PageSize(pageSize int32) ApiSourcesPlexListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesPlexListRequest) PbmUuid(pbmUuid string) ApiSourcesPlexListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesPlexListRequest) PolicyEngineMode(policyEngineMode string) ApiSourcesPlexListRequest { + r.policyEngineMode = &policyEngineMode + return r +} + +// A search term. +func (r ApiSourcesPlexListRequest) Search(search string) ApiSourcesPlexListRequest { + r.search = &search + return r +} + +func (r ApiSourcesPlexListRequest) Slug(slug string) ApiSourcesPlexListRequest { + r.slug = &slug + return r +} + +// How the source determines if an existing user should be authenticated or a new user enrolled. +func (r ApiSourcesPlexListRequest) UserMatchingMode(userMatchingMode string) ApiSourcesPlexListRequest { + r.userMatchingMode = &userMatchingMode + return r +} + +func (r ApiSourcesPlexListRequest) Execute() (*PaginatedPlexSourceList, *http.Response, error) { + return r.ApiService.SourcesPlexListExecute(r) +} + +/* +SourcesPlexList Method for SourcesPlexList + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesPlexListRequest +*/ +func (a *SourcesAPIService) SourcesPlexList(ctx context.Context) ApiSourcesPlexListRequest { + return ApiSourcesPlexListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPlexSourceList +func (a *SourcesAPIService) SourcesPlexListExecute(r ApiSourcesPlexListRequest) (*PaginatedPlexSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPlexSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.allowFriends != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allow_friends", r.allowFriends, "form", "") + } + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.clientId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_id", r.clientId, "form", "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.enrollmentFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enrollment_flow", r.enrollmentFlow, "form", "") + } + if r.groupMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_matching_mode", r.groupMatchingMode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.policyEngineMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_engine_mode", r.policyEngineMode, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.userMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_matching_mode", r.userMatchingMode, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedPlexSourceRequest *PatchedPlexSourceRequest +} + +func (r ApiSourcesPlexPartialUpdateRequest) PatchedPlexSourceRequest(patchedPlexSourceRequest PatchedPlexSourceRequest) ApiSourcesPlexPartialUpdateRequest { + r.patchedPlexSourceRequest = &patchedPlexSourceRequest + return r +} + +func (r ApiSourcesPlexPartialUpdateRequest) Execute() (*PlexSource, *http.Response, error) { + return r.ApiService.SourcesPlexPartialUpdateExecute(r) +} + +/* +SourcesPlexPartialUpdate Method for SourcesPlexPartialUpdate + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesPlexPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesPlexPartialUpdate(ctx context.Context, slug string) ApiSourcesPlexPartialUpdateRequest { + return ApiSourcesPlexPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return PlexSource +func (a *SourcesAPIService) SourcesPlexPartialUpdateExecute(r ApiSourcesPlexPartialUpdateRequest) (*PlexSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPlexSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + plexTokenRedeemRequest *PlexTokenRedeemRequest + slug *string +} + +func (r ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest) PlexTokenRedeemRequest(plexTokenRedeemRequest PlexTokenRedeemRequest) ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest { + r.plexTokenRedeemRequest = &plexTokenRedeemRequest + return r +} + +func (r ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest) Slug(slug string) ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesPlexRedeemTokenAuthenticatedCreateExecute(r) +} + +/* +SourcesPlexRedeemTokenAuthenticatedCreate Method for SourcesPlexRedeemTokenAuthenticatedCreate + +Redeem a plex token for an authenticated user, creating a connection + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest +*/ +func (a *SourcesAPIService) SourcesPlexRedeemTokenAuthenticatedCreate(ctx context.Context) ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest { + return ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesPlexRedeemTokenAuthenticatedCreateExecute(r ApiSourcesPlexRedeemTokenAuthenticatedCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexRedeemTokenAuthenticatedCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/redeem_token_authenticated/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexTokenRedeemRequest == nil { + return nil, reportError("plexTokenRedeemRequest is required and must be specified") + } + + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexTokenRedeemRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesPlexRedeemTokenCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + plexTokenRedeemRequest *PlexTokenRedeemRequest + slug *string +} + +func (r ApiSourcesPlexRedeemTokenCreateRequest) PlexTokenRedeemRequest(plexTokenRedeemRequest PlexTokenRedeemRequest) ApiSourcesPlexRedeemTokenCreateRequest { + r.plexTokenRedeemRequest = &plexTokenRedeemRequest + return r +} + +func (r ApiSourcesPlexRedeemTokenCreateRequest) Slug(slug string) ApiSourcesPlexRedeemTokenCreateRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesPlexRedeemTokenCreateRequest) Execute() (*RedirectChallenge, *http.Response, error) { + return r.ApiService.SourcesPlexRedeemTokenCreateExecute(r) +} + +/* +SourcesPlexRedeemTokenCreate Method for SourcesPlexRedeemTokenCreate + +Redeem a plex token, check it's access to resources against what's allowed +for the source, and redirect to an authentication/enrollment flow. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesPlexRedeemTokenCreateRequest +*/ +func (a *SourcesAPIService) SourcesPlexRedeemTokenCreate(ctx context.Context) ApiSourcesPlexRedeemTokenCreateRequest { + return ApiSourcesPlexRedeemTokenCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RedirectChallenge +func (a *SourcesAPIService) SourcesPlexRedeemTokenCreateExecute(r ApiSourcesPlexRedeemTokenCreateRequest) (*RedirectChallenge, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedirectChallenge + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexRedeemTokenCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/redeem_token/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexTokenRedeemRequest == nil { + return localVarReturnValue, nil, reportError("plexTokenRedeemRequest is required and must be specified") + } + + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexTokenRedeemRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesPlexRetrieveRequest) Execute() (*PlexSource, *http.Response, error) { + return r.ApiService.SourcesPlexRetrieveExecute(r) +} + +/* +SourcesPlexRetrieve Method for SourcesPlexRetrieve + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesPlexRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesPlexRetrieve(ctx context.Context, slug string) ApiSourcesPlexRetrieveRequest { + return ApiSourcesPlexRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return PlexSource +func (a *SourcesAPIService) SourcesPlexRetrieveExecute(r ApiSourcesPlexRetrieveRequest) (*PlexSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + plexSourceRequest *PlexSourceRequest +} + +func (r ApiSourcesPlexUpdateRequest) PlexSourceRequest(plexSourceRequest PlexSourceRequest) ApiSourcesPlexUpdateRequest { + r.plexSourceRequest = &plexSourceRequest + return r +} + +func (r ApiSourcesPlexUpdateRequest) Execute() (*PlexSource, *http.Response, error) { + return r.ApiService.SourcesPlexUpdateExecute(r) +} + +/* +SourcesPlexUpdate Method for SourcesPlexUpdate + +Plex source Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesPlexUpdateRequest +*/ +func (a *SourcesAPIService) SourcesPlexUpdate(ctx context.Context, slug string) ApiSourcesPlexUpdateRequest { + return ApiSourcesPlexUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return PlexSource +func (a *SourcesAPIService) SourcesPlexUpdateExecute(r ApiSourcesPlexUpdateRequest) (*PlexSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PlexSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.plexSourceRequest == nil { + return localVarReturnValue, nil, reportError("plexSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.plexSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesPlexUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesPlexUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesPlexUsedByListExecute(r) +} + +/* +SourcesPlexUsedByList Method for SourcesPlexUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesPlexUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesPlexUsedByList(ctx context.Context, slug string) ApiSourcesPlexUsedByListRequest { + return ApiSourcesPlexUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesPlexUsedByListExecute(r ApiSourcesPlexUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesPlexUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/plex/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + sAMLSourceRequest *SAMLSourceRequest +} + +func (r ApiSourcesSamlCreateRequest) SAMLSourceRequest(sAMLSourceRequest SAMLSourceRequest) ApiSourcesSamlCreateRequest { + r.sAMLSourceRequest = &sAMLSourceRequest + return r +} + +func (r ApiSourcesSamlCreateRequest) Execute() (*SAMLSource, *http.Response, error) { + return r.ApiService.SourcesSamlCreateExecute(r) +} + +/* +SourcesSamlCreate Method for SourcesSamlCreate + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesSamlCreateRequest +*/ +func (a *SourcesAPIService) SourcesSamlCreate(ctx context.Context) ApiSourcesSamlCreateRequest { + return ApiSourcesSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SAMLSource +func (a *SourcesAPIService) SourcesSamlCreateExecute(r ApiSourcesSamlCreateRequest) (*SAMLSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLSourceRequest == nil { + return localVarReturnValue, nil, reportError("sAMLSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesSamlDestroyExecute(r) +} + +/* +SourcesSamlDestroy Method for SourcesSamlDestroy + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlDestroyRequest +*/ +func (a *SourcesAPIService) SourcesSamlDestroy(ctx context.Context, slug string) ApiSourcesSamlDestroyRequest { + return ApiSourcesSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesSamlDestroyExecute(r ApiSourcesSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesSamlListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + allowIdpInitiated *bool + authenticationFlow *string + bindingType *string + digestAlgorithm *string + enabled *bool + enrollmentFlow *string + issuer *string + managed *string + name *string + nameIdPolicy *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + policyEngineMode *string + preAuthenticationFlow *string + search *string + signatureAlgorithm *string + signedAssertion *bool + signedResponse *bool + signingKp *string + sloUrl *string + slug *string + ssoUrl *string + temporaryUserDeleteAfter *string + userMatchingMode *string + verificationKp *string +} + +func (r ApiSourcesSamlListRequest) AllowIdpInitiated(allowIdpInitiated bool) ApiSourcesSamlListRequest { + r.allowIdpInitiated = &allowIdpInitiated + return r +} + +func (r ApiSourcesSamlListRequest) AuthenticationFlow(authenticationFlow string) ApiSourcesSamlListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiSourcesSamlListRequest) BindingType(bindingType string) ApiSourcesSamlListRequest { + r.bindingType = &bindingType + return r +} + +func (r ApiSourcesSamlListRequest) DigestAlgorithm(digestAlgorithm string) ApiSourcesSamlListRequest { + r.digestAlgorithm = &digestAlgorithm + return r +} + +func (r ApiSourcesSamlListRequest) Enabled(enabled bool) ApiSourcesSamlListRequest { + r.enabled = &enabled + return r +} + +func (r ApiSourcesSamlListRequest) EnrollmentFlow(enrollmentFlow string) ApiSourcesSamlListRequest { + r.enrollmentFlow = &enrollmentFlow + return r +} + +func (r ApiSourcesSamlListRequest) Issuer(issuer string) ApiSourcesSamlListRequest { + r.issuer = &issuer + return r +} + +func (r ApiSourcesSamlListRequest) Managed(managed string) ApiSourcesSamlListRequest { + r.managed = &managed + return r +} + +func (r ApiSourcesSamlListRequest) Name(name string) ApiSourcesSamlListRequest { + r.name = &name + return r +} + +// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. +func (r ApiSourcesSamlListRequest) NameIdPolicy(nameIdPolicy string) ApiSourcesSamlListRequest { + r.nameIdPolicy = &nameIdPolicy + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesSamlListRequest) Ordering(ordering string) ApiSourcesSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesSamlListRequest) Page(page int32) ApiSourcesSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesSamlListRequest) PageSize(pageSize int32) ApiSourcesSamlListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesSamlListRequest) PbmUuid(pbmUuid string) ApiSourcesSamlListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesSamlListRequest) PolicyEngineMode(policyEngineMode string) ApiSourcesSamlListRequest { + r.policyEngineMode = &policyEngineMode + return r +} + +func (r ApiSourcesSamlListRequest) PreAuthenticationFlow(preAuthenticationFlow string) ApiSourcesSamlListRequest { + r.preAuthenticationFlow = &preAuthenticationFlow + return r +} + +// A search term. +func (r ApiSourcesSamlListRequest) Search(search string) ApiSourcesSamlListRequest { + r.search = &search + return r +} + +func (r ApiSourcesSamlListRequest) SignatureAlgorithm(signatureAlgorithm string) ApiSourcesSamlListRequest { + r.signatureAlgorithm = &signatureAlgorithm + return r +} + +func (r ApiSourcesSamlListRequest) SignedAssertion(signedAssertion bool) ApiSourcesSamlListRequest { + r.signedAssertion = &signedAssertion + return r +} + +func (r ApiSourcesSamlListRequest) SignedResponse(signedResponse bool) ApiSourcesSamlListRequest { + r.signedResponse = &signedResponse + return r +} + +func (r ApiSourcesSamlListRequest) SigningKp(signingKp string) ApiSourcesSamlListRequest { + r.signingKp = &signingKp + return r +} + +func (r ApiSourcesSamlListRequest) SloUrl(sloUrl string) ApiSourcesSamlListRequest { + r.sloUrl = &sloUrl + return r +} + +func (r ApiSourcesSamlListRequest) Slug(slug string) ApiSourcesSamlListRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesSamlListRequest) SsoUrl(ssoUrl string) ApiSourcesSamlListRequest { + r.ssoUrl = &ssoUrl + return r +} + +func (r ApiSourcesSamlListRequest) TemporaryUserDeleteAfter(temporaryUserDeleteAfter string) ApiSourcesSamlListRequest { + r.temporaryUserDeleteAfter = &temporaryUserDeleteAfter + return r +} + +// How the source determines if an existing user should be authenticated or a new user enrolled. +func (r ApiSourcesSamlListRequest) UserMatchingMode(userMatchingMode string) ApiSourcesSamlListRequest { + r.userMatchingMode = &userMatchingMode + return r +} + +func (r ApiSourcesSamlListRequest) VerificationKp(verificationKp string) ApiSourcesSamlListRequest { + r.verificationKp = &verificationKp + return r +} + +func (r ApiSourcesSamlListRequest) Execute() (*PaginatedSAMLSourceList, *http.Response, error) { + return r.ApiService.SourcesSamlListExecute(r) +} + +/* +SourcesSamlList Method for SourcesSamlList + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesSamlListRequest +*/ +func (a *SourcesAPIService) SourcesSamlList(ctx context.Context) ApiSourcesSamlListRequest { + return ApiSourcesSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSAMLSourceList +func (a *SourcesAPIService) SourcesSamlListExecute(r ApiSourcesSamlListRequest) (*PaginatedSAMLSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSAMLSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.allowIdpInitiated != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allow_idp_initiated", r.allowIdpInitiated, "form", "") + } + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.bindingType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "binding_type", r.bindingType, "form", "") + } + if r.digestAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "digest_algorithm", r.digestAlgorithm, "form", "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.enrollmentFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enrollment_flow", r.enrollmentFlow, "form", "") + } + if r.issuer != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "issuer", r.issuer, "form", "") + } + if r.managed != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "managed", r.managed, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.nameIdPolicy != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name_id_policy", r.nameIdPolicy, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.policyEngineMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_engine_mode", r.policyEngineMode, "form", "") + } + if r.preAuthenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pre_authentication_flow", r.preAuthenticationFlow, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.signatureAlgorithm != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signature_algorithm", r.signatureAlgorithm, "form", "") + } + if r.signedAssertion != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signed_assertion", r.signedAssertion, "form", "") + } + if r.signedResponse != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signed_response", r.signedResponse, "form", "") + } + if r.signingKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "signing_kp", r.signingKp, "form", "") + } + if r.sloUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slo_url", r.sloUrl, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.ssoUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "sso_url", r.ssoUrl, "form", "") + } + if r.temporaryUserDeleteAfter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "temporary_user_delete_after", r.temporaryUserDeleteAfter, "form", "") + } + if r.userMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_matching_mode", r.userMatchingMode, "form", "") + } + if r.verificationKp != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "verification_kp", r.verificationKp, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlMetadataRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesSamlMetadataRetrieveRequest) Execute() (*SAMLMetadata, *http.Response, error) { + return r.ApiService.SourcesSamlMetadataRetrieveExecute(r) +} + +/* +SourcesSamlMetadataRetrieve Method for SourcesSamlMetadataRetrieve + +Return metadata as XML string + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlMetadataRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesSamlMetadataRetrieve(ctx context.Context, slug string) ApiSourcesSamlMetadataRetrieveRequest { + return ApiSourcesSamlMetadataRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SAMLMetadata +func (a *SourcesAPIService) SourcesSamlMetadataRetrieveExecute(r ApiSourcesSamlMetadataRetrieveRequest) (*SAMLMetadata, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLMetadata + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlMetadataRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/metadata/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedSAMLSourceRequest *PatchedSAMLSourceRequest +} + +func (r ApiSourcesSamlPartialUpdateRequest) PatchedSAMLSourceRequest(patchedSAMLSourceRequest PatchedSAMLSourceRequest) ApiSourcesSamlPartialUpdateRequest { + r.patchedSAMLSourceRequest = &patchedSAMLSourceRequest + return r +} + +func (r ApiSourcesSamlPartialUpdateRequest) Execute() (*SAMLSource, *http.Response, error) { + return r.ApiService.SourcesSamlPartialUpdateExecute(r) +} + +/* +SourcesSamlPartialUpdate Method for SourcesSamlPartialUpdate + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesSamlPartialUpdate(ctx context.Context, slug string) ApiSourcesSamlPartialUpdateRequest { + return ApiSourcesSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SAMLSource +func (a *SourcesAPIService) SourcesSamlPartialUpdateExecute(r ApiSourcesSamlPartialUpdateRequest) (*SAMLSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSAMLSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesSamlRetrieveRequest) Execute() (*SAMLSource, *http.Response, error) { + return r.ApiService.SourcesSamlRetrieveExecute(r) +} + +/* +SourcesSamlRetrieve Method for SourcesSamlRetrieve + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesSamlRetrieve(ctx context.Context, slug string) ApiSourcesSamlRetrieveRequest { + return ApiSourcesSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SAMLSource +func (a *SourcesAPIService) SourcesSamlRetrieveExecute(r ApiSourcesSamlRetrieveRequest) (*SAMLSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + sAMLSourceRequest *SAMLSourceRequest +} + +func (r ApiSourcesSamlUpdateRequest) SAMLSourceRequest(sAMLSourceRequest SAMLSourceRequest) ApiSourcesSamlUpdateRequest { + r.sAMLSourceRequest = &sAMLSourceRequest + return r +} + +func (r ApiSourcesSamlUpdateRequest) Execute() (*SAMLSource, *http.Response, error) { + return r.ApiService.SourcesSamlUpdateExecute(r) +} + +/* +SourcesSamlUpdate Method for SourcesSamlUpdate + +SAMLSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlUpdateRequest +*/ +func (a *SourcesAPIService) SourcesSamlUpdate(ctx context.Context, slug string) ApiSourcesSamlUpdateRequest { + return ApiSourcesSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SAMLSource +func (a *SourcesAPIService) SourcesSamlUpdateExecute(r ApiSourcesSamlUpdateRequest) (*SAMLSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SAMLSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sAMLSourceRequest == nil { + return localVarReturnValue, nil, reportError("sAMLSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sAMLSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesSamlUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesSamlUsedByListExecute(r) +} + +/* +SourcesSamlUsedByList Method for SourcesSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesSamlUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesSamlUsedByList(ctx context.Context, slug string) ApiSourcesSamlUsedByListRequest { + return ApiSourcesSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesSamlUsedByListExecute(r ApiSourcesSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/saml/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + sCIMSourceRequest *SCIMSourceRequest +} + +func (r ApiSourcesScimCreateRequest) SCIMSourceRequest(sCIMSourceRequest SCIMSourceRequest) ApiSourcesScimCreateRequest { + r.sCIMSourceRequest = &sCIMSourceRequest + return r +} + +func (r ApiSourcesScimCreateRequest) Execute() (*SCIMSource, *http.Response, error) { + return r.ApiService.SourcesScimCreateExecute(r) +} + +/* +SourcesScimCreate Method for SourcesScimCreate + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimCreateRequest +*/ +func (a *SourcesAPIService) SourcesScimCreate(ctx context.Context) ApiSourcesScimCreateRequest { + return ApiSourcesScimCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMSource +func (a *SourcesAPIService) SourcesScimCreateExecute(r ApiSourcesScimCreateRequest) (*SCIMSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesScimDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesScimDestroyExecute(r) +} + +/* +SourcesScimDestroy Method for SourcesScimDestroy + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesScimDestroyRequest +*/ +func (a *SourcesAPIService) SourcesScimDestroy(ctx context.Context, slug string) ApiSourcesScimDestroyRequest { + return ApiSourcesScimDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesScimDestroyExecute(r ApiSourcesScimDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + sCIMSourceGroupRequest *SCIMSourceGroupRequest +} + +func (r ApiSourcesScimGroupsCreateRequest) SCIMSourceGroupRequest(sCIMSourceGroupRequest SCIMSourceGroupRequest) ApiSourcesScimGroupsCreateRequest { + r.sCIMSourceGroupRequest = &sCIMSourceGroupRequest + return r +} + +func (r ApiSourcesScimGroupsCreateRequest) Execute() (*SCIMSourceGroup, *http.Response, error) { + return r.ApiService.SourcesScimGroupsCreateExecute(r) +} + +/* +SourcesScimGroupsCreate Method for SourcesScimGroupsCreate + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimGroupsCreateRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsCreate(ctx context.Context) ApiSourcesScimGroupsCreateRequest { + return ApiSourcesScimGroupsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMSourceGroup +func (a *SourcesAPIService) SourcesScimGroupsCreateExecute(r ApiSourcesScimGroupsCreateRequest) (*SCIMSourceGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceGroupRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimGroupsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesScimGroupsDestroyExecute(r) +} + +/* +SourcesScimGroupsDestroy Method for SourcesScimGroupsDestroy + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source group. + @return ApiSourcesScimGroupsDestroyRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsDestroy(ctx context.Context, id string) ApiSourcesScimGroupsDestroyRequest { + return ApiSourcesScimGroupsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesScimGroupsDestroyExecute(r ApiSourcesScimGroupsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + groupGroupUuid *string + groupName *string + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string +} + +func (r ApiSourcesScimGroupsListRequest) GroupGroupUuid(groupGroupUuid string) ApiSourcesScimGroupsListRequest { + r.groupGroupUuid = &groupGroupUuid + return r +} + +func (r ApiSourcesScimGroupsListRequest) GroupName(groupName string) ApiSourcesScimGroupsListRequest { + r.groupName = &groupName + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesScimGroupsListRequest) Ordering(ordering string) ApiSourcesScimGroupsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesScimGroupsListRequest) Page(page int32) ApiSourcesScimGroupsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesScimGroupsListRequest) PageSize(pageSize int32) ApiSourcesScimGroupsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesScimGroupsListRequest) Search(search string) ApiSourcesScimGroupsListRequest { + r.search = &search + return r +} + +func (r ApiSourcesScimGroupsListRequest) SourceSlug(sourceSlug string) ApiSourcesScimGroupsListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesScimGroupsListRequest) Execute() (*PaginatedSCIMSourceGroupList, *http.Response, error) { + return r.ApiService.SourcesScimGroupsListExecute(r) +} + +/* +SourcesScimGroupsList Method for SourcesScimGroupsList + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimGroupsListRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsList(ctx context.Context) ApiSourcesScimGroupsListRequest { + return ApiSourcesScimGroupsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMSourceGroupList +func (a *SourcesAPIService) SourcesScimGroupsListExecute(r ApiSourcesScimGroupsListRequest) (*PaginatedSCIMSourceGroupList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMSourceGroupList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.groupGroupUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__group_uuid", r.groupGroupUuid, "form", "") + } + if r.groupName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group__name", r.groupName, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string + patchedSCIMSourceGroupRequest *PatchedSCIMSourceGroupRequest +} + +func (r ApiSourcesScimGroupsPartialUpdateRequest) PatchedSCIMSourceGroupRequest(patchedSCIMSourceGroupRequest PatchedSCIMSourceGroupRequest) ApiSourcesScimGroupsPartialUpdateRequest { + r.patchedSCIMSourceGroupRequest = &patchedSCIMSourceGroupRequest + return r +} + +func (r ApiSourcesScimGroupsPartialUpdateRequest) Execute() (*SCIMSourceGroup, *http.Response, error) { + return r.ApiService.SourcesScimGroupsPartialUpdateExecute(r) +} + +/* +SourcesScimGroupsPartialUpdate Method for SourcesScimGroupsPartialUpdate + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source group. + @return ApiSourcesScimGroupsPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsPartialUpdate(ctx context.Context, id string) ApiSourcesScimGroupsPartialUpdateRequest { + return ApiSourcesScimGroupsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceGroup +func (a *SourcesAPIService) SourcesScimGroupsPartialUpdateExecute(r ApiSourcesScimGroupsPartialUpdateRequest) (*SCIMSourceGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMSourceGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimGroupsRetrieveRequest) Execute() (*SCIMSourceGroup, *http.Response, error) { + return r.ApiService.SourcesScimGroupsRetrieveExecute(r) +} + +/* +SourcesScimGroupsRetrieve Method for SourcesScimGroupsRetrieve + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source group. + @return ApiSourcesScimGroupsRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsRetrieve(ctx context.Context, id string) ApiSourcesScimGroupsRetrieveRequest { + return ApiSourcesScimGroupsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceGroup +func (a *SourcesAPIService) SourcesScimGroupsRetrieveExecute(r ApiSourcesScimGroupsRetrieveRequest) (*SCIMSourceGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string + sCIMSourceGroupRequest *SCIMSourceGroupRequest +} + +func (r ApiSourcesScimGroupsUpdateRequest) SCIMSourceGroupRequest(sCIMSourceGroupRequest SCIMSourceGroupRequest) ApiSourcesScimGroupsUpdateRequest { + r.sCIMSourceGroupRequest = &sCIMSourceGroupRequest + return r +} + +func (r ApiSourcesScimGroupsUpdateRequest) Execute() (*SCIMSourceGroup, *http.Response, error) { + return r.ApiService.SourcesScimGroupsUpdateExecute(r) +} + +/* +SourcesScimGroupsUpdate Method for SourcesScimGroupsUpdate + +SCIMSourceGroup Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source group. + @return ApiSourcesScimGroupsUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsUpdate(ctx context.Context, id string) ApiSourcesScimGroupsUpdateRequest { + return ApiSourcesScimGroupsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceGroup +func (a *SourcesAPIService) SourcesScimGroupsUpdateExecute(r ApiSourcesScimGroupsUpdateRequest) (*SCIMSourceGroup, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceGroupRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceGroupRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceGroupRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimGroupsUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimGroupsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesScimGroupsUsedByListExecute(r) +} + +/* +SourcesScimGroupsUsedByList Method for SourcesScimGroupsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source group. + @return ApiSourcesScimGroupsUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesScimGroupsUsedByList(ctx context.Context, id string) ApiSourcesScimGroupsUsedByListRequest { + return ApiSourcesScimGroupsUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesScimGroupsUsedByListExecute(r ApiSourcesScimGroupsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimGroupsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_groups/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + search *string + slug *string +} + +func (r ApiSourcesScimListRequest) Name(name string) ApiSourcesScimListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesScimListRequest) Ordering(ordering string) ApiSourcesScimListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesScimListRequest) Page(page int32) ApiSourcesScimListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesScimListRequest) PageSize(pageSize int32) ApiSourcesScimListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesScimListRequest) PbmUuid(pbmUuid string) ApiSourcesScimListRequest { + r.pbmUuid = &pbmUuid + return r +} + +// A search term. +func (r ApiSourcesScimListRequest) Search(search string) ApiSourcesScimListRequest { + r.search = &search + return r +} + +func (r ApiSourcesScimListRequest) Slug(slug string) ApiSourcesScimListRequest { + r.slug = &slug + return r +} + +func (r ApiSourcesScimListRequest) Execute() (*PaginatedSCIMSourceList, *http.Response, error) { + return r.ApiService.SourcesScimListExecute(r) +} + +/* +SourcesScimList Method for SourcesScimList + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimListRequest +*/ +func (a *SourcesAPIService) SourcesScimList(ctx context.Context) ApiSourcesScimListRequest { + return ApiSourcesScimListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMSourceList +func (a *SourcesAPIService) SourcesScimListExecute(r ApiSourcesScimListRequest) (*PaginatedSCIMSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedSCIMSourceRequest *PatchedSCIMSourceRequest +} + +func (r ApiSourcesScimPartialUpdateRequest) PatchedSCIMSourceRequest(patchedSCIMSourceRequest PatchedSCIMSourceRequest) ApiSourcesScimPartialUpdateRequest { + r.patchedSCIMSourceRequest = &patchedSCIMSourceRequest + return r +} + +func (r ApiSourcesScimPartialUpdateRequest) Execute() (*SCIMSource, *http.Response, error) { + return r.ApiService.SourcesScimPartialUpdateExecute(r) +} + +/* +SourcesScimPartialUpdate Method for SourcesScimPartialUpdate + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesScimPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimPartialUpdate(ctx context.Context, slug string) ApiSourcesScimPartialUpdateRequest { + return ApiSourcesScimPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SCIMSource +func (a *SourcesAPIService) SourcesScimPartialUpdateExecute(r ApiSourcesScimPartialUpdateRequest) (*SCIMSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesScimRetrieveRequest) Execute() (*SCIMSource, *http.Response, error) { + return r.ApiService.SourcesScimRetrieveExecute(r) +} + +/* +SourcesScimRetrieve Method for SourcesScimRetrieve + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesScimRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesScimRetrieve(ctx context.Context, slug string) ApiSourcesScimRetrieveRequest { + return ApiSourcesScimRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SCIMSource +func (a *SourcesAPIService) SourcesScimRetrieveExecute(r ApiSourcesScimRetrieveRequest) (*SCIMSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + sCIMSourceRequest *SCIMSourceRequest +} + +func (r ApiSourcesScimUpdateRequest) SCIMSourceRequest(sCIMSourceRequest SCIMSourceRequest) ApiSourcesScimUpdateRequest { + r.sCIMSourceRequest = &sCIMSourceRequest + return r +} + +func (r ApiSourcesScimUpdateRequest) Execute() (*SCIMSource, *http.Response, error) { + return r.ApiService.SourcesScimUpdateExecute(r) +} + +/* +SourcesScimUpdate Method for SourcesScimUpdate + +SCIMSource Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesScimUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimUpdate(ctx context.Context, slug string) ApiSourcesScimUpdateRequest { + return ApiSourcesScimUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return SCIMSource +func (a *SourcesAPIService) SourcesScimUpdateExecute(r ApiSourcesScimUpdateRequest) (*SCIMSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesScimUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesScimUsedByListExecute(r) +} + +/* +SourcesScimUsedByList Method for SourcesScimUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesScimUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesScimUsedByList(ctx context.Context, slug string) ApiSourcesScimUsedByListRequest { + return ApiSourcesScimUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesScimUsedByListExecute(r ApiSourcesScimUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + sCIMSourceUserRequest *SCIMSourceUserRequest +} + +func (r ApiSourcesScimUsersCreateRequest) SCIMSourceUserRequest(sCIMSourceUserRequest SCIMSourceUserRequest) ApiSourcesScimUsersCreateRequest { + r.sCIMSourceUserRequest = &sCIMSourceUserRequest + return r +} + +func (r ApiSourcesScimUsersCreateRequest) Execute() (*SCIMSourceUser, *http.Response, error) { + return r.ApiService.SourcesScimUsersCreateExecute(r) +} + +/* +SourcesScimUsersCreate Method for SourcesScimUsersCreate + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimUsersCreateRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersCreate(ctx context.Context) ApiSourcesScimUsersCreateRequest { + return ApiSourcesScimUsersCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SCIMSourceUser +func (a *SourcesAPIService) SourcesScimUsersCreateExecute(r ApiSourcesScimUsersCreateRequest) (*SCIMSourceUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceUserRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimUsersDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesScimUsersDestroyExecute(r) +} + +/* +SourcesScimUsersDestroy Method for SourcesScimUsersDestroy + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source user. + @return ApiSourcesScimUsersDestroyRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersDestroy(ctx context.Context, id string) ApiSourcesScimUsersDestroyRequest { + return ApiSourcesScimUsersDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesScimUsersDestroyExecute(r ApiSourcesScimUsersDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + userId *int32 + userUsername *string +} + +// Which field to use when ordering the results. +func (r ApiSourcesScimUsersListRequest) Ordering(ordering string) ApiSourcesScimUsersListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesScimUsersListRequest) Page(page int32) ApiSourcesScimUsersListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesScimUsersListRequest) PageSize(pageSize int32) ApiSourcesScimUsersListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesScimUsersListRequest) Search(search string) ApiSourcesScimUsersListRequest { + r.search = &search + return r +} + +func (r ApiSourcesScimUsersListRequest) SourceSlug(sourceSlug string) ApiSourcesScimUsersListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesScimUsersListRequest) UserId(userId int32) ApiSourcesScimUsersListRequest { + r.userId = &userId + return r +} + +func (r ApiSourcesScimUsersListRequest) UserUsername(userUsername string) ApiSourcesScimUsersListRequest { + r.userUsername = &userUsername + return r +} + +func (r ApiSourcesScimUsersListRequest) Execute() (*PaginatedSCIMSourceUserList, *http.Response, error) { + return r.ApiService.SourcesScimUsersListExecute(r) +} + +/* +SourcesScimUsersList Method for SourcesScimUsersList + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesScimUsersListRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersList(ctx context.Context) ApiSourcesScimUsersListRequest { + return ApiSourcesScimUsersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSCIMSourceUserList +func (a *SourcesAPIService) SourcesScimUsersListExecute(r ApiSourcesScimUsersListRequest) (*PaginatedSCIMSourceUserList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSCIMSourceUserList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.userId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__id", r.userId, "form", "") + } + if r.userUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user__username", r.userUsername, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string + patchedSCIMSourceUserRequest *PatchedSCIMSourceUserRequest +} + +func (r ApiSourcesScimUsersPartialUpdateRequest) PatchedSCIMSourceUserRequest(patchedSCIMSourceUserRequest PatchedSCIMSourceUserRequest) ApiSourcesScimUsersPartialUpdateRequest { + r.patchedSCIMSourceUserRequest = &patchedSCIMSourceUserRequest + return r +} + +func (r ApiSourcesScimUsersPartialUpdateRequest) Execute() (*SCIMSourceUser, *http.Response, error) { + return r.ApiService.SourcesScimUsersPartialUpdateExecute(r) +} + +/* +SourcesScimUsersPartialUpdate Method for SourcesScimUsersPartialUpdate + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source user. + @return ApiSourcesScimUsersPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersPartialUpdate(ctx context.Context, id string) ApiSourcesScimUsersPartialUpdateRequest { + return ApiSourcesScimUsersPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceUser +func (a *SourcesAPIService) SourcesScimUsersPartialUpdateExecute(r ApiSourcesScimUsersPartialUpdateRequest) (*SCIMSourceUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSCIMSourceUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimUsersRetrieveRequest) Execute() (*SCIMSourceUser, *http.Response, error) { + return r.ApiService.SourcesScimUsersRetrieveExecute(r) +} + +/* +SourcesScimUsersRetrieve Method for SourcesScimUsersRetrieve + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source user. + @return ApiSourcesScimUsersRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersRetrieve(ctx context.Context, id string) ApiSourcesScimUsersRetrieveRequest { + return ApiSourcesScimUsersRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceUser +func (a *SourcesAPIService) SourcesScimUsersRetrieveExecute(r ApiSourcesScimUsersRetrieveRequest) (*SCIMSourceUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string + sCIMSourceUserRequest *SCIMSourceUserRequest +} + +func (r ApiSourcesScimUsersUpdateRequest) SCIMSourceUserRequest(sCIMSourceUserRequest SCIMSourceUserRequest) ApiSourcesScimUsersUpdateRequest { + r.sCIMSourceUserRequest = &sCIMSourceUserRequest + return r +} + +func (r ApiSourcesScimUsersUpdateRequest) Execute() (*SCIMSourceUser, *http.Response, error) { + return r.ApiService.SourcesScimUsersUpdateExecute(r) +} + +/* +SourcesScimUsersUpdate Method for SourcesScimUsersUpdate + +SCIMSourceUser Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source user. + @return ApiSourcesScimUsersUpdateRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersUpdate(ctx context.Context, id string) ApiSourcesScimUsersUpdateRequest { + return ApiSourcesScimUsersUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return SCIMSourceUser +func (a *SourcesAPIService) SourcesScimUsersUpdateExecute(r ApiSourcesScimUsersUpdateRequest) (*SCIMSourceUser, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SCIMSourceUser + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sCIMSourceUserRequest == nil { + return localVarReturnValue, nil, reportError("sCIMSourceUserRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sCIMSourceUserRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesScimUsersUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id string +} + +func (r ApiSourcesScimUsersUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesScimUsersUsedByListExecute(r) +} + +/* +SourcesScimUsersUsedByList Method for SourcesScimUsersUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique value identifying this scim source user. + @return ApiSourcesScimUsersUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesScimUsersUsedByList(ctx context.Context, id string) ApiSourcesScimUsersUsedByListRequest { + return ApiSourcesScimUsersUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesScimUsersUsedByListExecute(r ApiSourcesScimUsersUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesScimUsersUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/scim_users/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramConnectUserCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + telegramAuthRequest *TelegramAuthRequest +} + +func (r ApiSourcesTelegramConnectUserCreateRequest) TelegramAuthRequest(telegramAuthRequest TelegramAuthRequest) ApiSourcesTelegramConnectUserCreateRequest { + r.telegramAuthRequest = &telegramAuthRequest + return r +} + +func (r ApiSourcesTelegramConnectUserCreateRequest) Execute() (*UserTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesTelegramConnectUserCreateExecute(r) +} + +/* +SourcesTelegramConnectUserCreate Method for SourcesTelegramConnectUserCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramConnectUserCreateRequest +*/ +func (a *SourcesAPIService) SourcesTelegramConnectUserCreate(ctx context.Context, slug string) ApiSourcesTelegramConnectUserCreateRequest { + return ApiSourcesTelegramConnectUserCreateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return UserTelegramSourceConnection +func (a *SourcesAPIService) SourcesTelegramConnectUserCreateExecute(r ApiSourcesTelegramConnectUserCreateRequest) (*UserTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramConnectUserCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/connect_user/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.telegramAuthRequest == nil { + return localVarReturnValue, nil, reportError("telegramAuthRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.telegramAuthRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + telegramSourceRequest *TelegramSourceRequest +} + +func (r ApiSourcesTelegramCreateRequest) TelegramSourceRequest(telegramSourceRequest TelegramSourceRequest) ApiSourcesTelegramCreateRequest { + r.telegramSourceRequest = &telegramSourceRequest + return r +} + +func (r ApiSourcesTelegramCreateRequest) Execute() (*TelegramSource, *http.Response, error) { + return r.ApiService.SourcesTelegramCreateExecute(r) +} + +/* +SourcesTelegramCreate Method for SourcesTelegramCreate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesTelegramCreateRequest +*/ +func (a *SourcesAPIService) SourcesTelegramCreate(ctx context.Context) ApiSourcesTelegramCreateRequest { + return ApiSourcesTelegramCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return TelegramSource +func (a *SourcesAPIService) SourcesTelegramCreateExecute(r ApiSourcesTelegramCreateRequest) (*TelegramSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.telegramSourceRequest == nil { + return localVarReturnValue, nil, reportError("telegramSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.telegramSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesTelegramDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesTelegramDestroyExecute(r) +} + +/* +SourcesTelegramDestroy Method for SourcesTelegramDestroy + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramDestroyRequest +*/ +func (a *SourcesAPIService) SourcesTelegramDestroy(ctx context.Context, slug string) ApiSourcesTelegramDestroyRequest { + return ApiSourcesTelegramDestroyRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesTelegramDestroyExecute(r ApiSourcesTelegramDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesTelegramListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + authenticationFlow *string + botUsername *string + enabled *bool + enrollmentFlow *string + groupMatchingMode *string + name *string + ordering *string + page *int32 + pageSize *int32 + pbmUuid *string + policyEngineMode *string + requestMessageAccess *bool + search *string + slug *string + userMatchingMode *string +} + +func (r ApiSourcesTelegramListRequest) AuthenticationFlow(authenticationFlow string) ApiSourcesTelegramListRequest { + r.authenticationFlow = &authenticationFlow + return r +} + +func (r ApiSourcesTelegramListRequest) BotUsername(botUsername string) ApiSourcesTelegramListRequest { + r.botUsername = &botUsername + return r +} + +func (r ApiSourcesTelegramListRequest) Enabled(enabled bool) ApiSourcesTelegramListRequest { + r.enabled = &enabled + return r +} + +func (r ApiSourcesTelegramListRequest) EnrollmentFlow(enrollmentFlow string) ApiSourcesTelegramListRequest { + r.enrollmentFlow = &enrollmentFlow + return r +} + +// How the source determines if an existing group should be used or a new group created. +func (r ApiSourcesTelegramListRequest) GroupMatchingMode(groupMatchingMode string) ApiSourcesTelegramListRequest { + r.groupMatchingMode = &groupMatchingMode + return r +} + +func (r ApiSourcesTelegramListRequest) Name(name string) ApiSourcesTelegramListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiSourcesTelegramListRequest) Ordering(ordering string) ApiSourcesTelegramListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesTelegramListRequest) Page(page int32) ApiSourcesTelegramListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesTelegramListRequest) PageSize(pageSize int32) ApiSourcesTelegramListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSourcesTelegramListRequest) PbmUuid(pbmUuid string) ApiSourcesTelegramListRequest { + r.pbmUuid = &pbmUuid + return r +} + +func (r ApiSourcesTelegramListRequest) PolicyEngineMode(policyEngineMode string) ApiSourcesTelegramListRequest { + r.policyEngineMode = &policyEngineMode + return r +} + +func (r ApiSourcesTelegramListRequest) RequestMessageAccess(requestMessageAccess bool) ApiSourcesTelegramListRequest { + r.requestMessageAccess = &requestMessageAccess + return r +} + +// A search term. +func (r ApiSourcesTelegramListRequest) Search(search string) ApiSourcesTelegramListRequest { + r.search = &search + return r +} + +func (r ApiSourcesTelegramListRequest) Slug(slug string) ApiSourcesTelegramListRequest { + r.slug = &slug + return r +} + +// How the source determines if an existing user should be authenticated or a new user enrolled. +func (r ApiSourcesTelegramListRequest) UserMatchingMode(userMatchingMode string) ApiSourcesTelegramListRequest { + r.userMatchingMode = &userMatchingMode + return r +} + +func (r ApiSourcesTelegramListRequest) Execute() (*PaginatedTelegramSourceList, *http.Response, error) { + return r.ApiService.SourcesTelegramListExecute(r) +} + +/* +SourcesTelegramList Method for SourcesTelegramList + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesTelegramListRequest +*/ +func (a *SourcesAPIService) SourcesTelegramList(ctx context.Context) ApiSourcesTelegramListRequest { + return ApiSourcesTelegramListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTelegramSourceList +func (a *SourcesAPIService) SourcesTelegramListExecute(r ApiSourcesTelegramListRequest) (*PaginatedTelegramSourceList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTelegramSourceList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authenticationFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authentication_flow", r.authenticationFlow, "form", "") + } + if r.botUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "bot_username", r.botUsername, "form", "") + } + if r.enabled != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enabled", r.enabled, "form", "") + } + if r.enrollmentFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enrollment_flow", r.enrollmentFlow, "form", "") + } + if r.groupMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "group_matching_mode", r.groupMatchingMode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.pbmUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "pbm_uuid", r.pbmUuid, "form", "") + } + if r.policyEngineMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "policy_engine_mode", r.policyEngineMode, "form", "") + } + if r.requestMessageAccess != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "request_message_access", r.requestMessageAccess, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.slug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "slug", r.slug, "form", "") + } + if r.userMatchingMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_matching_mode", r.userMatchingMode, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + patchedTelegramSourceRequest *PatchedTelegramSourceRequest +} + +func (r ApiSourcesTelegramPartialUpdateRequest) PatchedTelegramSourceRequest(patchedTelegramSourceRequest PatchedTelegramSourceRequest) ApiSourcesTelegramPartialUpdateRequest { + r.patchedTelegramSourceRequest = &patchedTelegramSourceRequest + return r +} + +func (r ApiSourcesTelegramPartialUpdateRequest) Execute() (*TelegramSource, *http.Response, error) { + return r.ApiService.SourcesTelegramPartialUpdateExecute(r) +} + +/* +SourcesTelegramPartialUpdate Method for SourcesTelegramPartialUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesTelegramPartialUpdate(ctx context.Context, slug string) ApiSourcesTelegramPartialUpdateRequest { + return ApiSourcesTelegramPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return TelegramSource +func (a *SourcesAPIService) SourcesTelegramPartialUpdateExecute(r ApiSourcesTelegramPartialUpdateRequest) (*TelegramSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTelegramSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesTelegramRetrieveRequest) Execute() (*TelegramSource, *http.Response, error) { + return r.ApiService.SourcesTelegramRetrieveExecute(r) +} + +/* +SourcesTelegramRetrieve Method for SourcesTelegramRetrieve + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesTelegramRetrieve(ctx context.Context, slug string) ApiSourcesTelegramRetrieveRequest { + return ApiSourcesTelegramRetrieveRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return TelegramSource +func (a *SourcesAPIService) SourcesTelegramRetrieveExecute(r ApiSourcesTelegramRetrieveRequest) (*TelegramSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string + telegramSourceRequest *TelegramSourceRequest +} + +func (r ApiSourcesTelegramUpdateRequest) TelegramSourceRequest(telegramSourceRequest TelegramSourceRequest) ApiSourcesTelegramUpdateRequest { + r.telegramSourceRequest = &telegramSourceRequest + return r +} + +func (r ApiSourcesTelegramUpdateRequest) Execute() (*TelegramSource, *http.Response, error) { + return r.ApiService.SourcesTelegramUpdateExecute(r) +} + +/* +SourcesTelegramUpdate Method for SourcesTelegramUpdate + +Mixin to add a used_by endpoint to return a list of all objects using this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramUpdateRequest +*/ +func (a *SourcesAPIService) SourcesTelegramUpdate(ctx context.Context, slug string) ApiSourcesTelegramUpdateRequest { + return ApiSourcesTelegramUpdateRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return TelegramSource +func (a *SourcesAPIService) SourcesTelegramUpdateExecute(r ApiSourcesTelegramUpdateRequest) (*TelegramSource, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TelegramSource + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.telegramSourceRequest == nil { + return localVarReturnValue, nil, reportError("telegramSourceRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.telegramSourceRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesTelegramUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + slug string +} + +func (r ApiSourcesTelegramUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesTelegramUsedByListExecute(r) +} + +/* +SourcesTelegramUsedByList Method for SourcesTelegramUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param slug + @return ApiSourcesTelegramUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesTelegramUsedByList(ctx context.Context, slug string) ApiSourcesTelegramUsedByListRequest { + return ApiSourcesTelegramUsedByListRequest{ + ApiService: a, + ctx: ctx, + slug: slug, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesTelegramUsedByListExecute(r ApiSourcesTelegramUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesTelegramUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/telegram/{slug}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"slug"+"}", url.PathEscape(parameterValueToString(r.slug, "slug")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllDestroyExecute(r) +} + +/* +SourcesUserConnectionsAllDestroy Method for SourcesUserConnectionsAllDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user source connection. + @return ApiSourcesUserConnectionsAllDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsAllDestroyRequest { + return ApiSourcesUserConnectionsAllDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsAllDestroyExecute(r ApiSourcesUserConnectionsAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsAllListRequest) Ordering(ordering string) ApiSourcesUserConnectionsAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsAllListRequest) Page(page int32) ApiSourcesUserConnectionsAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsAllListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsAllListRequest) Search(search string) ApiSourcesUserConnectionsAllListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsAllListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsAllListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsAllListRequest) User(user int32) ApiSourcesUserConnectionsAllListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsAllListRequest) Execute() (*PaginatedUserSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllListExecute(r) +} + +/* +SourcesUserConnectionsAllList Method for SourcesUserConnectionsAllList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsAllListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllList(ctx context.Context) ApiSourcesUserConnectionsAllListRequest { + return ApiSourcesUserConnectionsAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsAllListExecute(r ApiSourcesUserConnectionsAllListRequest) (*PaginatedUserSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserSourceConnectionRequest *PatchedUserSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsAllPartialUpdateRequest) PatchedUserSourceConnectionRequest(patchedUserSourceConnectionRequest PatchedUserSourceConnectionRequest) ApiSourcesUserConnectionsAllPartialUpdateRequest { + r.patchedUserSourceConnectionRequest = &patchedUserSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsAllPartialUpdateRequest) Execute() (*UserSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsAllPartialUpdate Method for SourcesUserConnectionsAllPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user source connection. + @return ApiSourcesUserConnectionsAllPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsAllPartialUpdateRequest { + return ApiSourcesUserConnectionsAllPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsAllPartialUpdateExecute(r ApiSourcesUserConnectionsAllPartialUpdateRequest) (*UserSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsAllRetrieveRequest) Execute() (*UserSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllRetrieveExecute(r) +} + +/* +SourcesUserConnectionsAllRetrieve Method for SourcesUserConnectionsAllRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user source connection. + @return ApiSourcesUserConnectionsAllRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsAllRetrieveRequest { + return ApiSourcesUserConnectionsAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsAllRetrieveExecute(r ApiSourcesUserConnectionsAllRetrieveRequest) (*UserSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userSourceConnectionRequest *UserSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsAllUpdateRequest) UserSourceConnectionRequest(userSourceConnectionRequest UserSourceConnectionRequest) ApiSourcesUserConnectionsAllUpdateRequest { + r.userSourceConnectionRequest = &userSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsAllUpdateRequest) Execute() (*UserSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllUpdateExecute(r) +} + +/* +SourcesUserConnectionsAllUpdate Method for SourcesUserConnectionsAllUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user source connection. + @return ApiSourcesUserConnectionsAllUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsAllUpdateRequest { + return ApiSourcesUserConnectionsAllUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsAllUpdateExecute(r ApiSourcesUserConnectionsAllUpdateRequest) (*UserSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsAllUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsAllUsedByListExecute(r) +} + +/* +SourcesUserConnectionsAllUsedByList Method for SourcesUserConnectionsAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this user source connection. + @return ApiSourcesUserConnectionsAllUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsAllUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsAllUsedByListRequest { + return ApiSourcesUserConnectionsAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsAllUsedByListExecute(r ApiSourcesUserConnectionsAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/all/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userKerberosSourceConnectionRequest *UserKerberosSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsKerberosCreateRequest) UserKerberosSourceConnectionRequest(userKerberosSourceConnectionRequest UserKerberosSourceConnectionRequest) ApiSourcesUserConnectionsKerberosCreateRequest { + r.userKerberosSourceConnectionRequest = &userKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsKerberosCreateRequest) Execute() (*UserKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosCreateExecute(r) +} + +/* +SourcesUserConnectionsKerberosCreate Method for SourcesUserConnectionsKerberosCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsKerberosCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosCreate(ctx context.Context) ApiSourcesUserConnectionsKerberosCreateRequest { + return ApiSourcesUserConnectionsKerberosCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserKerberosSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsKerberosCreateExecute(r ApiSourcesUserConnectionsKerberosCreateRequest) (*UserKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userKerberosSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userKerberosSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsKerberosDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosDestroyExecute(r) +} + +/* +SourcesUserConnectionsKerberosDestroy Method for SourcesUserConnectionsKerberosDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Kerberos Source Connection. + @return ApiSourcesUserConnectionsKerberosDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsKerberosDestroyRequest { + return ApiSourcesUserConnectionsKerberosDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsKerberosDestroyExecute(r ApiSourcesUserConnectionsKerberosDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsKerberosListRequest) Ordering(ordering string) ApiSourcesUserConnectionsKerberosListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsKerberosListRequest) Page(page int32) ApiSourcesUserConnectionsKerberosListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsKerberosListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsKerberosListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsKerberosListRequest) Search(search string) ApiSourcesUserConnectionsKerberosListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsKerberosListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsKerberosListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsKerberosListRequest) User(user int32) ApiSourcesUserConnectionsKerberosListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsKerberosListRequest) Execute() (*PaginatedUserKerberosSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosListExecute(r) +} + +/* +SourcesUserConnectionsKerberosList Method for SourcesUserConnectionsKerberosList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsKerberosListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosList(ctx context.Context) ApiSourcesUserConnectionsKerberosListRequest { + return ApiSourcesUserConnectionsKerberosListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserKerberosSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsKerberosListExecute(r ApiSourcesUserConnectionsKerberosListRequest) (*PaginatedUserKerberosSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserKerberosSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserKerberosSourceConnectionRequest *PatchedUserKerberosSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsKerberosPartialUpdateRequest) PatchedUserKerberosSourceConnectionRequest(patchedUserKerberosSourceConnectionRequest PatchedUserKerberosSourceConnectionRequest) ApiSourcesUserConnectionsKerberosPartialUpdateRequest { + r.patchedUserKerberosSourceConnectionRequest = &patchedUserKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsKerberosPartialUpdateRequest) Execute() (*UserKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsKerberosPartialUpdate Method for SourcesUserConnectionsKerberosPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Kerberos Source Connection. + @return ApiSourcesUserConnectionsKerberosPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsKerberosPartialUpdateRequest { + return ApiSourcesUserConnectionsKerberosPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserKerberosSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsKerberosPartialUpdateExecute(r ApiSourcesUserConnectionsKerberosPartialUpdateRequest) (*UserKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsKerberosRetrieveRequest) Execute() (*UserKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosRetrieveExecute(r) +} + +/* +SourcesUserConnectionsKerberosRetrieve Method for SourcesUserConnectionsKerberosRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Kerberos Source Connection. + @return ApiSourcesUserConnectionsKerberosRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsKerberosRetrieveRequest { + return ApiSourcesUserConnectionsKerberosRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserKerberosSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsKerberosRetrieveExecute(r ApiSourcesUserConnectionsKerberosRetrieveRequest) (*UserKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userKerberosSourceConnectionRequest *UserKerberosSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsKerberosUpdateRequest) UserKerberosSourceConnectionRequest(userKerberosSourceConnectionRequest UserKerberosSourceConnectionRequest) ApiSourcesUserConnectionsKerberosUpdateRequest { + r.userKerberosSourceConnectionRequest = &userKerberosSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsKerberosUpdateRequest) Execute() (*UserKerberosSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosUpdateExecute(r) +} + +/* +SourcesUserConnectionsKerberosUpdate Method for SourcesUserConnectionsKerberosUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Kerberos Source Connection. + @return ApiSourcesUserConnectionsKerberosUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsKerberosUpdateRequest { + return ApiSourcesUserConnectionsKerberosUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserKerberosSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsKerberosUpdateExecute(r ApiSourcesUserConnectionsKerberosUpdateRequest) (*UserKerberosSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserKerberosSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userKerberosSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userKerberosSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userKerberosSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsKerberosUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsKerberosUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsKerberosUsedByListExecute(r) +} + +/* +SourcesUserConnectionsKerberosUsedByList Method for SourcesUserConnectionsKerberosUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Kerberos Source Connection. + @return ApiSourcesUserConnectionsKerberosUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsKerberosUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsKerberosUsedByListRequest { + return ApiSourcesUserConnectionsKerberosUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsKerberosUsedByListExecute(r ApiSourcesUserConnectionsKerberosUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsKerberosUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/kerberos/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userLDAPSourceConnectionRequest *UserLDAPSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsLdapCreateRequest) UserLDAPSourceConnectionRequest(userLDAPSourceConnectionRequest UserLDAPSourceConnectionRequest) ApiSourcesUserConnectionsLdapCreateRequest { + r.userLDAPSourceConnectionRequest = &userLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsLdapCreateRequest) Execute() (*UserLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapCreateExecute(r) +} + +/* +SourcesUserConnectionsLdapCreate Method for SourcesUserConnectionsLdapCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsLdapCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapCreate(ctx context.Context) ApiSourcesUserConnectionsLdapCreateRequest { + return ApiSourcesUserConnectionsLdapCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserLDAPSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsLdapCreateExecute(r ApiSourcesUserConnectionsLdapCreateRequest) (*UserLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLDAPSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userLDAPSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsLdapDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapDestroyExecute(r) +} + +/* +SourcesUserConnectionsLdapDestroy Method for SourcesUserConnectionsLdapDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User LDAP Source Connection. + @return ApiSourcesUserConnectionsLdapDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsLdapDestroyRequest { + return ApiSourcesUserConnectionsLdapDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsLdapDestroyExecute(r ApiSourcesUserConnectionsLdapDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsLdapListRequest) Ordering(ordering string) ApiSourcesUserConnectionsLdapListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsLdapListRequest) Page(page int32) ApiSourcesUserConnectionsLdapListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsLdapListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsLdapListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsLdapListRequest) Search(search string) ApiSourcesUserConnectionsLdapListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsLdapListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsLdapListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsLdapListRequest) User(user int32) ApiSourcesUserConnectionsLdapListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsLdapListRequest) Execute() (*PaginatedUserLDAPSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapListExecute(r) +} + +/* +SourcesUserConnectionsLdapList Method for SourcesUserConnectionsLdapList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsLdapListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapList(ctx context.Context) ApiSourcesUserConnectionsLdapListRequest { + return ApiSourcesUserConnectionsLdapListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserLDAPSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsLdapListExecute(r ApiSourcesUserConnectionsLdapListRequest) (*PaginatedUserLDAPSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserLDAPSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserLDAPSourceConnectionRequest *PatchedUserLDAPSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsLdapPartialUpdateRequest) PatchedUserLDAPSourceConnectionRequest(patchedUserLDAPSourceConnectionRequest PatchedUserLDAPSourceConnectionRequest) ApiSourcesUserConnectionsLdapPartialUpdateRequest { + r.patchedUserLDAPSourceConnectionRequest = &patchedUserLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsLdapPartialUpdateRequest) Execute() (*UserLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsLdapPartialUpdate Method for SourcesUserConnectionsLdapPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User LDAP Source Connection. + @return ApiSourcesUserConnectionsLdapPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsLdapPartialUpdateRequest { + return ApiSourcesUserConnectionsLdapPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserLDAPSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsLdapPartialUpdateExecute(r ApiSourcesUserConnectionsLdapPartialUpdateRequest) (*UserLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsLdapRetrieveRequest) Execute() (*UserLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapRetrieveExecute(r) +} + +/* +SourcesUserConnectionsLdapRetrieve Method for SourcesUserConnectionsLdapRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User LDAP Source Connection. + @return ApiSourcesUserConnectionsLdapRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsLdapRetrieveRequest { + return ApiSourcesUserConnectionsLdapRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserLDAPSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsLdapRetrieveExecute(r ApiSourcesUserConnectionsLdapRetrieveRequest) (*UserLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userLDAPSourceConnectionRequest *UserLDAPSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsLdapUpdateRequest) UserLDAPSourceConnectionRequest(userLDAPSourceConnectionRequest UserLDAPSourceConnectionRequest) ApiSourcesUserConnectionsLdapUpdateRequest { + r.userLDAPSourceConnectionRequest = &userLDAPSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsLdapUpdateRequest) Execute() (*UserLDAPSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapUpdateExecute(r) +} + +/* +SourcesUserConnectionsLdapUpdate Method for SourcesUserConnectionsLdapUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User LDAP Source Connection. + @return ApiSourcesUserConnectionsLdapUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsLdapUpdateRequest { + return ApiSourcesUserConnectionsLdapUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserLDAPSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsLdapUpdateExecute(r ApiSourcesUserConnectionsLdapUpdateRequest) (*UserLDAPSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLDAPSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLDAPSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userLDAPSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLDAPSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsLdapUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsLdapUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsLdapUsedByListExecute(r) +} + +/* +SourcesUserConnectionsLdapUsedByList Method for SourcesUserConnectionsLdapUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User LDAP Source Connection. + @return ApiSourcesUserConnectionsLdapUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsLdapUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsLdapUsedByListRequest { + return ApiSourcesUserConnectionsLdapUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsLdapUsedByListExecute(r ApiSourcesUserConnectionsLdapUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsLdapUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/ldap/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userOAuthSourceConnectionRequest *UserOAuthSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsOauthCreateRequest) UserOAuthSourceConnectionRequest(userOAuthSourceConnectionRequest UserOAuthSourceConnectionRequest) ApiSourcesUserConnectionsOauthCreateRequest { + r.userOAuthSourceConnectionRequest = &userOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsOauthCreateRequest) Execute() (*UserOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthCreateExecute(r) +} + +/* +SourcesUserConnectionsOauthCreate Method for SourcesUserConnectionsOauthCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsOauthCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthCreate(ctx context.Context) ApiSourcesUserConnectionsOauthCreateRequest { + return ApiSourcesUserConnectionsOauthCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserOAuthSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsOauthCreateExecute(r ApiSourcesUserConnectionsOauthCreateRequest) (*UserOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userOAuthSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userOAuthSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsOauthDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthDestroyExecute(r) +} + +/* +SourcesUserConnectionsOauthDestroy Method for SourcesUserConnectionsOauthDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User OAuth Source Connection. + @return ApiSourcesUserConnectionsOauthDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsOauthDestroyRequest { + return ApiSourcesUserConnectionsOauthDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsOauthDestroyExecute(r ApiSourcesUserConnectionsOauthDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsOauthListRequest) Ordering(ordering string) ApiSourcesUserConnectionsOauthListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsOauthListRequest) Page(page int32) ApiSourcesUserConnectionsOauthListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsOauthListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsOauthListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsOauthListRequest) Search(search string) ApiSourcesUserConnectionsOauthListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsOauthListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsOauthListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsOauthListRequest) User(user int32) ApiSourcesUserConnectionsOauthListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsOauthListRequest) Execute() (*PaginatedUserOAuthSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthListExecute(r) +} + +/* +SourcesUserConnectionsOauthList Method for SourcesUserConnectionsOauthList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsOauthListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthList(ctx context.Context) ApiSourcesUserConnectionsOauthListRequest { + return ApiSourcesUserConnectionsOauthListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserOAuthSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsOauthListExecute(r ApiSourcesUserConnectionsOauthListRequest) (*PaginatedUserOAuthSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserOAuthSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserOAuthSourceConnectionRequest *PatchedUserOAuthSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsOauthPartialUpdateRequest) PatchedUserOAuthSourceConnectionRequest(patchedUserOAuthSourceConnectionRequest PatchedUserOAuthSourceConnectionRequest) ApiSourcesUserConnectionsOauthPartialUpdateRequest { + r.patchedUserOAuthSourceConnectionRequest = &patchedUserOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsOauthPartialUpdateRequest) Execute() (*UserOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsOauthPartialUpdate Method for SourcesUserConnectionsOauthPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User OAuth Source Connection. + @return ApiSourcesUserConnectionsOauthPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsOauthPartialUpdateRequest { + return ApiSourcesUserConnectionsOauthPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserOAuthSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsOauthPartialUpdateExecute(r ApiSourcesUserConnectionsOauthPartialUpdateRequest) (*UserOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsOauthRetrieveRequest) Execute() (*UserOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthRetrieveExecute(r) +} + +/* +SourcesUserConnectionsOauthRetrieve Method for SourcesUserConnectionsOauthRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User OAuth Source Connection. + @return ApiSourcesUserConnectionsOauthRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsOauthRetrieveRequest { + return ApiSourcesUserConnectionsOauthRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserOAuthSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsOauthRetrieveExecute(r ApiSourcesUserConnectionsOauthRetrieveRequest) (*UserOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userOAuthSourceConnectionRequest *UserOAuthSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsOauthUpdateRequest) UserOAuthSourceConnectionRequest(userOAuthSourceConnectionRequest UserOAuthSourceConnectionRequest) ApiSourcesUserConnectionsOauthUpdateRequest { + r.userOAuthSourceConnectionRequest = &userOAuthSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsOauthUpdateRequest) Execute() (*UserOAuthSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthUpdateExecute(r) +} + +/* +SourcesUserConnectionsOauthUpdate Method for SourcesUserConnectionsOauthUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User OAuth Source Connection. + @return ApiSourcesUserConnectionsOauthUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsOauthUpdateRequest { + return ApiSourcesUserConnectionsOauthUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserOAuthSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsOauthUpdateExecute(r ApiSourcesUserConnectionsOauthUpdateRequest) (*UserOAuthSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserOAuthSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userOAuthSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userOAuthSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userOAuthSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsOauthUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsOauthUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsOauthUsedByListExecute(r) +} + +/* +SourcesUserConnectionsOauthUsedByList Method for SourcesUserConnectionsOauthUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User OAuth Source Connection. + @return ApiSourcesUserConnectionsOauthUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsOauthUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsOauthUsedByListRequest { + return ApiSourcesUserConnectionsOauthUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsOauthUsedByListExecute(r ApiSourcesUserConnectionsOauthUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsOauthUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/oauth/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userPlexSourceConnectionRequest *UserPlexSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsPlexCreateRequest) UserPlexSourceConnectionRequest(userPlexSourceConnectionRequest UserPlexSourceConnectionRequest) ApiSourcesUserConnectionsPlexCreateRequest { + r.userPlexSourceConnectionRequest = &userPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsPlexCreateRequest) Execute() (*UserPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexCreateExecute(r) +} + +/* +SourcesUserConnectionsPlexCreate Method for SourcesUserConnectionsPlexCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsPlexCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexCreate(ctx context.Context) ApiSourcesUserConnectionsPlexCreateRequest { + return ApiSourcesUserConnectionsPlexCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserPlexSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsPlexCreateExecute(r ApiSourcesUserConnectionsPlexCreateRequest) (*UserPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userPlexSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userPlexSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsPlexDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexDestroyExecute(r) +} + +/* +SourcesUserConnectionsPlexDestroy Method for SourcesUserConnectionsPlexDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Plex Source Connection. + @return ApiSourcesUserConnectionsPlexDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsPlexDestroyRequest { + return ApiSourcesUserConnectionsPlexDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsPlexDestroyExecute(r ApiSourcesUserConnectionsPlexDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsPlexListRequest) Ordering(ordering string) ApiSourcesUserConnectionsPlexListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsPlexListRequest) Page(page int32) ApiSourcesUserConnectionsPlexListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsPlexListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsPlexListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsPlexListRequest) Search(search string) ApiSourcesUserConnectionsPlexListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsPlexListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsPlexListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsPlexListRequest) User(user int32) ApiSourcesUserConnectionsPlexListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsPlexListRequest) Execute() (*PaginatedUserPlexSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexListExecute(r) +} + +/* +SourcesUserConnectionsPlexList Method for SourcesUserConnectionsPlexList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsPlexListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexList(ctx context.Context) ApiSourcesUserConnectionsPlexListRequest { + return ApiSourcesUserConnectionsPlexListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserPlexSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsPlexListExecute(r ApiSourcesUserConnectionsPlexListRequest) (*PaginatedUserPlexSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserPlexSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserPlexSourceConnectionRequest *PatchedUserPlexSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsPlexPartialUpdateRequest) PatchedUserPlexSourceConnectionRequest(patchedUserPlexSourceConnectionRequest PatchedUserPlexSourceConnectionRequest) ApiSourcesUserConnectionsPlexPartialUpdateRequest { + r.patchedUserPlexSourceConnectionRequest = &patchedUserPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsPlexPartialUpdateRequest) Execute() (*UserPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsPlexPartialUpdate Method for SourcesUserConnectionsPlexPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Plex Source Connection. + @return ApiSourcesUserConnectionsPlexPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsPlexPartialUpdateRequest { + return ApiSourcesUserConnectionsPlexPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserPlexSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsPlexPartialUpdateExecute(r ApiSourcesUserConnectionsPlexPartialUpdateRequest) (*UserPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsPlexRetrieveRequest) Execute() (*UserPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexRetrieveExecute(r) +} + +/* +SourcesUserConnectionsPlexRetrieve Method for SourcesUserConnectionsPlexRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Plex Source Connection. + @return ApiSourcesUserConnectionsPlexRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsPlexRetrieveRequest { + return ApiSourcesUserConnectionsPlexRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserPlexSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsPlexRetrieveExecute(r ApiSourcesUserConnectionsPlexRetrieveRequest) (*UserPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userPlexSourceConnectionRequest *UserPlexSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsPlexUpdateRequest) UserPlexSourceConnectionRequest(userPlexSourceConnectionRequest UserPlexSourceConnectionRequest) ApiSourcesUserConnectionsPlexUpdateRequest { + r.userPlexSourceConnectionRequest = &userPlexSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsPlexUpdateRequest) Execute() (*UserPlexSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexUpdateExecute(r) +} + +/* +SourcesUserConnectionsPlexUpdate Method for SourcesUserConnectionsPlexUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Plex Source Connection. + @return ApiSourcesUserConnectionsPlexUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsPlexUpdateRequest { + return ApiSourcesUserConnectionsPlexUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserPlexSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsPlexUpdateExecute(r ApiSourcesUserConnectionsPlexUpdateRequest) (*UserPlexSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserPlexSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userPlexSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userPlexSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userPlexSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsPlexUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsPlexUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsPlexUsedByListExecute(r) +} + +/* +SourcesUserConnectionsPlexUsedByList Method for SourcesUserConnectionsPlexUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Plex Source Connection. + @return ApiSourcesUserConnectionsPlexUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsPlexUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsPlexUsedByListRequest { + return ApiSourcesUserConnectionsPlexUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsPlexUsedByListExecute(r ApiSourcesUserConnectionsPlexUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsPlexUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/plex/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userSAMLSourceConnectionRequest *UserSAMLSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsSamlCreateRequest) UserSAMLSourceConnectionRequest(userSAMLSourceConnectionRequest UserSAMLSourceConnectionRequest) ApiSourcesUserConnectionsSamlCreateRequest { + r.userSAMLSourceConnectionRequest = &userSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsSamlCreateRequest) Execute() (*UserSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlCreateExecute(r) +} + +/* +SourcesUserConnectionsSamlCreate Method for SourcesUserConnectionsSamlCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsSamlCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlCreate(ctx context.Context) ApiSourcesUserConnectionsSamlCreateRequest { + return ApiSourcesUserConnectionsSamlCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserSAMLSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsSamlCreateExecute(r ApiSourcesUserConnectionsSamlCreateRequest) (*UserSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userSAMLSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userSAMLSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsSamlDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlDestroyExecute(r) +} + +/* +SourcesUserConnectionsSamlDestroy Method for SourcesUserConnectionsSamlDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User SAML Source Connection. + @return ApiSourcesUserConnectionsSamlDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsSamlDestroyRequest { + return ApiSourcesUserConnectionsSamlDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsSamlDestroyExecute(r ApiSourcesUserConnectionsSamlDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsSamlListRequest) Ordering(ordering string) ApiSourcesUserConnectionsSamlListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsSamlListRequest) Page(page int32) ApiSourcesUserConnectionsSamlListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsSamlListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsSamlListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsSamlListRequest) Search(search string) ApiSourcesUserConnectionsSamlListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsSamlListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsSamlListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsSamlListRequest) User(user int32) ApiSourcesUserConnectionsSamlListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsSamlListRequest) Execute() (*PaginatedUserSAMLSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlListExecute(r) +} + +/* +SourcesUserConnectionsSamlList Method for SourcesUserConnectionsSamlList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsSamlListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlList(ctx context.Context) ApiSourcesUserConnectionsSamlListRequest { + return ApiSourcesUserConnectionsSamlListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserSAMLSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsSamlListExecute(r ApiSourcesUserConnectionsSamlListRequest) (*PaginatedUserSAMLSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserSAMLSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserSAMLSourceConnectionRequest *PatchedUserSAMLSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsSamlPartialUpdateRequest) PatchedUserSAMLSourceConnectionRequest(patchedUserSAMLSourceConnectionRequest PatchedUserSAMLSourceConnectionRequest) ApiSourcesUserConnectionsSamlPartialUpdateRequest { + r.patchedUserSAMLSourceConnectionRequest = &patchedUserSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsSamlPartialUpdateRequest) Execute() (*UserSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsSamlPartialUpdate Method for SourcesUserConnectionsSamlPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User SAML Source Connection. + @return ApiSourcesUserConnectionsSamlPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsSamlPartialUpdateRequest { + return ApiSourcesUserConnectionsSamlPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSAMLSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsSamlPartialUpdateExecute(r ApiSourcesUserConnectionsSamlPartialUpdateRequest) (*UserSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsSamlRetrieveRequest) Execute() (*UserSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlRetrieveExecute(r) +} + +/* +SourcesUserConnectionsSamlRetrieve Method for SourcesUserConnectionsSamlRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User SAML Source Connection. + @return ApiSourcesUserConnectionsSamlRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsSamlRetrieveRequest { + return ApiSourcesUserConnectionsSamlRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSAMLSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsSamlRetrieveExecute(r ApiSourcesUserConnectionsSamlRetrieveRequest) (*UserSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userSAMLSourceConnectionRequest *UserSAMLSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsSamlUpdateRequest) UserSAMLSourceConnectionRequest(userSAMLSourceConnectionRequest UserSAMLSourceConnectionRequest) ApiSourcesUserConnectionsSamlUpdateRequest { + r.userSAMLSourceConnectionRequest = &userSAMLSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsSamlUpdateRequest) Execute() (*UserSAMLSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlUpdateExecute(r) +} + +/* +SourcesUserConnectionsSamlUpdate Method for SourcesUserConnectionsSamlUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User SAML Source Connection. + @return ApiSourcesUserConnectionsSamlUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsSamlUpdateRequest { + return ApiSourcesUserConnectionsSamlUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserSAMLSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsSamlUpdateExecute(r ApiSourcesUserConnectionsSamlUpdateRequest) (*UserSAMLSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserSAMLSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userSAMLSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userSAMLSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userSAMLSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsSamlUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsSamlUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsSamlUsedByListExecute(r) +} + +/* +SourcesUserConnectionsSamlUsedByList Method for SourcesUserConnectionsSamlUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User SAML Source Connection. + @return ApiSourcesUserConnectionsSamlUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsSamlUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsSamlUsedByListRequest { + return ApiSourcesUserConnectionsSamlUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsSamlUsedByListExecute(r ApiSourcesUserConnectionsSamlUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsSamlUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/saml/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramCreateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + userTelegramSourceConnectionRequest *UserTelegramSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsTelegramCreateRequest) UserTelegramSourceConnectionRequest(userTelegramSourceConnectionRequest UserTelegramSourceConnectionRequest) ApiSourcesUserConnectionsTelegramCreateRequest { + r.userTelegramSourceConnectionRequest = &userTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsTelegramCreateRequest) Execute() (*UserTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramCreateExecute(r) +} + +/* +SourcesUserConnectionsTelegramCreate Method for SourcesUserConnectionsTelegramCreate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsTelegramCreateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramCreate(ctx context.Context) ApiSourcesUserConnectionsTelegramCreateRequest { + return ApiSourcesUserConnectionsTelegramCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserTelegramSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsTelegramCreateExecute(r ApiSourcesUserConnectionsTelegramCreateRequest) (*UserTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userTelegramSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userTelegramSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramDestroyRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsTelegramDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramDestroyExecute(r) +} + +/* +SourcesUserConnectionsTelegramDestroy Method for SourcesUserConnectionsTelegramDestroy + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Telegram Source Connection. + @return ApiSourcesUserConnectionsTelegramDestroyRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramDestroy(ctx context.Context, id int32) ApiSourcesUserConnectionsTelegramDestroyRequest { + return ApiSourcesUserConnectionsTelegramDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *SourcesAPIService) SourcesUserConnectionsTelegramDestroyExecute(r ApiSourcesUserConnectionsTelegramDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + ordering *string + page *int32 + pageSize *int32 + search *string + sourceSlug *string + user *int32 +} + +// Which field to use when ordering the results. +func (r ApiSourcesUserConnectionsTelegramListRequest) Ordering(ordering string) ApiSourcesUserConnectionsTelegramListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSourcesUserConnectionsTelegramListRequest) Page(page int32) ApiSourcesUserConnectionsTelegramListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSourcesUserConnectionsTelegramListRequest) PageSize(pageSize int32) ApiSourcesUserConnectionsTelegramListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiSourcesUserConnectionsTelegramListRequest) Search(search string) ApiSourcesUserConnectionsTelegramListRequest { + r.search = &search + return r +} + +func (r ApiSourcesUserConnectionsTelegramListRequest) SourceSlug(sourceSlug string) ApiSourcesUserConnectionsTelegramListRequest { + r.sourceSlug = &sourceSlug + return r +} + +func (r ApiSourcesUserConnectionsTelegramListRequest) User(user int32) ApiSourcesUserConnectionsTelegramListRequest { + r.user = &user + return r +} + +func (r ApiSourcesUserConnectionsTelegramListRequest) Execute() (*PaginatedUserTelegramSourceConnectionList, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramListExecute(r) +} + +/* +SourcesUserConnectionsTelegramList Method for SourcesUserConnectionsTelegramList + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSourcesUserConnectionsTelegramListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramList(ctx context.Context) ApiSourcesUserConnectionsTelegramListRequest { + return ApiSourcesUserConnectionsTelegramListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserTelegramSourceConnectionList +func (a *SourcesAPIService) SourcesUserConnectionsTelegramListExecute(r ApiSourcesUserConnectionsTelegramListRequest) (*PaginatedUserTelegramSourceConnectionList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserTelegramSourceConnectionList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sourceSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source__slug", r.sourceSlug, "form", "") + } + if r.user != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user", r.user, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramPartialUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + patchedUserTelegramSourceConnectionRequest *PatchedUserTelegramSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsTelegramPartialUpdateRequest) PatchedUserTelegramSourceConnectionRequest(patchedUserTelegramSourceConnectionRequest PatchedUserTelegramSourceConnectionRequest) ApiSourcesUserConnectionsTelegramPartialUpdateRequest { + r.patchedUserTelegramSourceConnectionRequest = &patchedUserTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsTelegramPartialUpdateRequest) Execute() (*UserTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramPartialUpdateExecute(r) +} + +/* +SourcesUserConnectionsTelegramPartialUpdate Method for SourcesUserConnectionsTelegramPartialUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Telegram Source Connection. + @return ApiSourcesUserConnectionsTelegramPartialUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramPartialUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsTelegramPartialUpdateRequest { + return ApiSourcesUserConnectionsTelegramPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserTelegramSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsTelegramPartialUpdateExecute(r ApiSourcesUserConnectionsTelegramPartialUpdateRequest) (*UserTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramRetrieveRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsTelegramRetrieveRequest) Execute() (*UserTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramRetrieveExecute(r) +} + +/* +SourcesUserConnectionsTelegramRetrieve Method for SourcesUserConnectionsTelegramRetrieve + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Telegram Source Connection. + @return ApiSourcesUserConnectionsTelegramRetrieveRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramRetrieve(ctx context.Context, id int32) ApiSourcesUserConnectionsTelegramRetrieveRequest { + return ApiSourcesUserConnectionsTelegramRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserTelegramSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsTelegramRetrieveExecute(r ApiSourcesUserConnectionsTelegramRetrieveRequest) (*UserTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramUpdateRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 + userTelegramSourceConnectionRequest *UserTelegramSourceConnectionRequest +} + +func (r ApiSourcesUserConnectionsTelegramUpdateRequest) UserTelegramSourceConnectionRequest(userTelegramSourceConnectionRequest UserTelegramSourceConnectionRequest) ApiSourcesUserConnectionsTelegramUpdateRequest { + r.userTelegramSourceConnectionRequest = &userTelegramSourceConnectionRequest + return r +} + +func (r ApiSourcesUserConnectionsTelegramUpdateRequest) Execute() (*UserTelegramSourceConnection, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramUpdateExecute(r) +} + +/* +SourcesUserConnectionsTelegramUpdate Method for SourcesUserConnectionsTelegramUpdate + +User-source connection Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Telegram Source Connection. + @return ApiSourcesUserConnectionsTelegramUpdateRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramUpdate(ctx context.Context, id int32) ApiSourcesUserConnectionsTelegramUpdateRequest { + return ApiSourcesUserConnectionsTelegramUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return UserTelegramSourceConnection +func (a *SourcesAPIService) SourcesUserConnectionsTelegramUpdateExecute(r ApiSourcesUserConnectionsTelegramUpdateRequest) (*UserTelegramSourceConnection, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserTelegramSourceConnection + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userTelegramSourceConnectionRequest == nil { + return localVarReturnValue, nil, reportError("userTelegramSourceConnectionRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userTelegramSourceConnectionRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSourcesUserConnectionsTelegramUsedByListRequest struct { + ctx context.Context + ApiService *SourcesAPIService + id int32 +} + +func (r ApiSourcesUserConnectionsTelegramUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.SourcesUserConnectionsTelegramUsedByListExecute(r) +} + +/* +SourcesUserConnectionsTelegramUsedByList Method for SourcesUserConnectionsTelegramUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this User Telegram Source Connection. + @return ApiSourcesUserConnectionsTelegramUsedByListRequest +*/ +func (a *SourcesAPIService) SourcesUserConnectionsTelegramUsedByList(ctx context.Context, id int32) ApiSourcesUserConnectionsTelegramUsedByListRequest { + return ApiSourcesUserConnectionsTelegramUsedByListRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *SourcesAPIService) SourcesUserConnectionsTelegramUsedByListExecute(r ApiSourcesUserConnectionsTelegramUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SourcesAPIService.SourcesUserConnectionsTelegramUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/sources/user_connections/telegram/{id}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_ssf.go b/packages/client-go/api_ssf.go new file mode 100644 index 0000000000..4b09fcac98 --- /dev/null +++ b/packages/client-go/api_ssf.go @@ -0,0 +1,337 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// SsfAPIService SsfAPI service +type SsfAPIService service + +type ApiSsfStreamsListRequest struct { + ctx context.Context + ApiService *SsfAPIService + deliveryMethod *string + endpointUrl *string + ordering *string + page *int32 + pageSize *int32 + provider *int32 + search *string +} + +func (r ApiSsfStreamsListRequest) DeliveryMethod(deliveryMethod string) ApiSsfStreamsListRequest { + r.deliveryMethod = &deliveryMethod + return r +} + +func (r ApiSsfStreamsListRequest) EndpointUrl(endpointUrl string) ApiSsfStreamsListRequest { + r.endpointUrl = &endpointUrl + return r +} + +// Which field to use when ordering the results. +func (r ApiSsfStreamsListRequest) Ordering(ordering string) ApiSsfStreamsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiSsfStreamsListRequest) Page(page int32) ApiSsfStreamsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiSsfStreamsListRequest) PageSize(pageSize int32) ApiSsfStreamsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiSsfStreamsListRequest) Provider(provider int32) ApiSsfStreamsListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiSsfStreamsListRequest) Search(search string) ApiSsfStreamsListRequest { + r.search = &search + return r +} + +func (r ApiSsfStreamsListRequest) Execute() (*PaginatedSSFStreamList, *http.Response, error) { + return r.ApiService.SsfStreamsListExecute(r) +} + +/* +SsfStreamsList Method for SsfStreamsList + +SSFStream Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSsfStreamsListRequest +*/ +func (a *SsfAPIService) SsfStreamsList(ctx context.Context) ApiSsfStreamsListRequest { + return ApiSsfStreamsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSSFStreamList +func (a *SsfAPIService) SsfStreamsListExecute(r ApiSsfStreamsListRequest) (*PaginatedSSFStreamList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSSFStreamList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SsfAPIService.SsfStreamsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssf/streams/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.deliveryMethod != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "delivery_method", r.deliveryMethod, "form", "") + } + if r.endpointUrl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "endpoint_url", r.endpointUrl, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiSsfStreamsRetrieveRequest struct { + ctx context.Context + ApiService *SsfAPIService + uuid string +} + +func (r ApiSsfStreamsRetrieveRequest) Execute() (*SSFStream, *http.Response, error) { + return r.ApiService.SsfStreamsRetrieveExecute(r) +} + +/* +SsfStreamsRetrieve Method for SsfStreamsRetrieve + +SSFStream Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param uuid A UUID string identifying this SSF Stream. + @return ApiSsfStreamsRetrieveRequest +*/ +func (a *SsfAPIService) SsfStreamsRetrieve(ctx context.Context, uuid string) ApiSsfStreamsRetrieveRequest { + return ApiSsfStreamsRetrieveRequest{ + ApiService: a, + ctx: ctx, + uuid: uuid, + } +} + +// Execute executes the request +// +// @return SSFStream +func (a *SsfAPIService) SsfStreamsRetrieveExecute(r ApiSsfStreamsRetrieveRequest) (*SSFStream, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SSFStream + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SsfAPIService.SsfStreamsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/ssf/streams/{uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"uuid"+"}", url.PathEscape(parameterValueToString(r.uuid, "uuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_stages.go b/packages/client-go/api_stages.go new file mode 100644 index 0000000000..d8a26c14f9 --- /dev/null +++ b/packages/client-go/api_stages.go @@ -0,0 +1,28138 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" + "time" +) + +// StagesAPIService StagesAPI service +type StagesAPIService service + +type ApiStagesAllDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAllDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAllDestroyExecute(r) +} + +/* +StagesAllDestroy Method for StagesAllDestroy + +Stage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this stage. + @return ApiStagesAllDestroyRequest +*/ +func (a *StagesAPIService) StagesAllDestroy(ctx context.Context, stageUuid string) ApiStagesAllDestroyRequest { + return ApiStagesAllDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAllDestroyExecute(r ApiStagesAllDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAllListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesAllListRequest) Name(name string) ApiStagesAllListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAllListRequest) Ordering(ordering string) ApiStagesAllListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAllListRequest) Page(page int32) ApiStagesAllListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAllListRequest) PageSize(pageSize int32) ApiStagesAllListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAllListRequest) Search(search string) ApiStagesAllListRequest { + r.search = &search + return r +} + +func (r ApiStagesAllListRequest) Execute() (*PaginatedStageList, *http.Response, error) { + return r.ApiService.StagesAllListExecute(r) +} + +/* +StagesAllList Method for StagesAllList + +Stage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAllListRequest +*/ +func (a *StagesAPIService) StagesAllList(ctx context.Context) ApiStagesAllListRequest { + return ApiStagesAllListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedStageList +func (a *StagesAPIService) StagesAllListExecute(r ApiStagesAllListRequest) (*PaginatedStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAllRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAllRetrieveRequest) Execute() (*Stage, *http.Response, error) { + return r.ApiService.StagesAllRetrieveExecute(r) +} + +/* +StagesAllRetrieve Method for StagesAllRetrieve + +Stage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this stage. + @return ApiStagesAllRetrieveRequest +*/ +func (a *StagesAPIService) StagesAllRetrieve(ctx context.Context, stageUuid string) ApiStagesAllRetrieveRequest { + return ApiStagesAllRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return Stage +func (a *StagesAPIService) StagesAllRetrieveExecute(r ApiStagesAllRetrieveRequest) (*Stage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Stage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAllTypesListRequest struct { + ctx context.Context + ApiService *StagesAPIService +} + +func (r ApiStagesAllTypesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.StagesAllTypesListExecute(r) +} + +/* +StagesAllTypesList Method for StagesAllTypesList + +Get all creatable types + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAllTypesListRequest +*/ +func (a *StagesAPIService) StagesAllTypesList(ctx context.Context) ApiStagesAllTypesListRequest { + return ApiStagesAllTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *StagesAPIService) StagesAllTypesListExecute(r ApiStagesAllTypesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAllUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAllUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAllUsedByListExecute(r) +} + +/* +StagesAllUsedByList Method for StagesAllUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this stage. + @return ApiStagesAllUsedByListRequest +*/ +func (a *StagesAPIService) StagesAllUsedByList(ctx context.Context, stageUuid string) ApiStagesAllUsedByListRequest { + return ApiStagesAllUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAllUsedByListExecute(r ApiStagesAllUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAllUserSettingsListRequest struct { + ctx context.Context + ApiService *StagesAPIService +} + +func (r ApiStagesAllUserSettingsListRequest) Execute() ([]UserSetting, *http.Response, error) { + return r.ApiService.StagesAllUserSettingsListExecute(r) +} + +/* +StagesAllUserSettingsList Method for StagesAllUserSettingsList + +Get all stages the user can configure + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAllUserSettingsListRequest +*/ +func (a *StagesAPIService) StagesAllUserSettingsList(ctx context.Context) ApiStagesAllUserSettingsListRequest { + return ApiStagesAllUserSettingsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []UserSetting +func (a *StagesAPIService) StagesAllUserSettingsListExecute(r ApiStagesAllUserSettingsListRequest) ([]UserSetting, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UserSetting + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAllUserSettingsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/all/user_settings/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorDuoStageRequest *AuthenticatorDuoStageRequest +} + +func (r ApiStagesAuthenticatorDuoCreateRequest) AuthenticatorDuoStageRequest(authenticatorDuoStageRequest AuthenticatorDuoStageRequest) ApiStagesAuthenticatorDuoCreateRequest { + r.authenticatorDuoStageRequest = &authenticatorDuoStageRequest + return r +} + +func (r ApiStagesAuthenticatorDuoCreateRequest) Execute() (*AuthenticatorDuoStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoCreateExecute(r) +} + +/* +StagesAuthenticatorDuoCreate Method for StagesAuthenticatorDuoCreate + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorDuoCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoCreate(ctx context.Context) ApiStagesAuthenticatorDuoCreateRequest { + return ApiStagesAuthenticatorDuoCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorDuoStage +func (a *StagesAPIService) StagesAuthenticatorDuoCreateExecute(r ApiStagesAuthenticatorDuoCreateRequest) (*AuthenticatorDuoStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorDuoStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorDuoStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorDuoStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorDuoStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorDuoDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoDestroyExecute(r) +} + +/* +StagesAuthenticatorDuoDestroy Method for StagesAuthenticatorDuoDestroy + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoDestroyRequest { + return ApiStagesAuthenticatorDuoDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorDuoDestroyExecute(r ApiStagesAuthenticatorDuoDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest) Execute() (*DuoDeviceEnrollmentStatus, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoEnrollmentStatusCreateExecute(r) +} + +/* +StagesAuthenticatorDuoEnrollmentStatusCreate Method for StagesAuthenticatorDuoEnrollmentStatusCreate + +Check enrollment status of user details in current session + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoEnrollmentStatusCreate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest { + return ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DuoDeviceEnrollmentStatus +func (a *StagesAPIService) StagesAuthenticatorDuoEnrollmentStatusCreateExecute(r ApiStagesAuthenticatorDuoEnrollmentStatusCreateRequest) (*DuoDeviceEnrollmentStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DuoDeviceEnrollmentStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoEnrollmentStatusCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/enrollment_status/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorDuoStageManualDeviceImportRequest *AuthenticatorDuoStageManualDeviceImportRequest +} + +func (r ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest) AuthenticatorDuoStageManualDeviceImportRequest(authenticatorDuoStageManualDeviceImportRequest AuthenticatorDuoStageManualDeviceImportRequest) ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest { + r.authenticatorDuoStageManualDeviceImportRequest = &authenticatorDuoStageManualDeviceImportRequest + return r +} + +func (r ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoImportDeviceManualCreateExecute(r) +} + +/* +StagesAuthenticatorDuoImportDeviceManualCreate Method for StagesAuthenticatorDuoImportDeviceManualCreate + +Import duo devices into authentik + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoImportDeviceManualCreate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest { + return ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorDuoImportDeviceManualCreateExecute(r ApiStagesAuthenticatorDuoImportDeviceManualCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoImportDeviceManualCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/import_device_manual/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorDuoStageManualDeviceImportRequest == nil { + return nil, reportError("authenticatorDuoStageManualDeviceImportRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorDuoStageManualDeviceImportRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest) Execute() (*AuthenticatorDuoStageDeviceImportResponse, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoImportDevicesAutomaticCreateExecute(r) +} + +/* +StagesAuthenticatorDuoImportDevicesAutomaticCreate Method for StagesAuthenticatorDuoImportDevicesAutomaticCreate + +Import duo devices into authentik + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoImportDevicesAutomaticCreate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest { + return ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorDuoStageDeviceImportResponse +func (a *StagesAPIService) StagesAuthenticatorDuoImportDevicesAutomaticCreateExecute(r ApiStagesAuthenticatorDuoImportDevicesAutomaticCreateRequest) (*AuthenticatorDuoStageDeviceImportResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorDuoStageDeviceImportResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoImportDevicesAutomaticCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/import_devices_automatic/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoListRequest struct { + ctx context.Context + ApiService *StagesAPIService + apiHostname *string + clientId *string + configureFlow *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesAuthenticatorDuoListRequest) ApiHostname(apiHostname string) ApiStagesAuthenticatorDuoListRequest { + r.apiHostname = &apiHostname + return r +} + +func (r ApiStagesAuthenticatorDuoListRequest) ClientId(clientId string) ApiStagesAuthenticatorDuoListRequest { + r.clientId = &clientId + return r +} + +func (r ApiStagesAuthenticatorDuoListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorDuoListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorDuoListRequest) Name(name string) ApiStagesAuthenticatorDuoListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorDuoListRequest) Ordering(ordering string) ApiStagesAuthenticatorDuoListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorDuoListRequest) Page(page int32) ApiStagesAuthenticatorDuoListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorDuoListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorDuoListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorDuoListRequest) Search(search string) ApiStagesAuthenticatorDuoListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorDuoListRequest) Execute() (*PaginatedAuthenticatorDuoStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoListExecute(r) +} + +/* +StagesAuthenticatorDuoList Method for StagesAuthenticatorDuoList + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorDuoListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoList(ctx context.Context) ApiStagesAuthenticatorDuoListRequest { + return ApiStagesAuthenticatorDuoListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorDuoStageList +func (a *StagesAPIService) StagesAuthenticatorDuoListExecute(r ApiStagesAuthenticatorDuoListRequest) (*PaginatedAuthenticatorDuoStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorDuoStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.apiHostname != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "api_hostname", r.apiHostname, "form", "") + } + if r.clientId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "client_id", r.clientId, "form", "") + } + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorDuoStageRequest *PatchedAuthenticatorDuoStageRequest +} + +func (r ApiStagesAuthenticatorDuoPartialUpdateRequest) PatchedAuthenticatorDuoStageRequest(patchedAuthenticatorDuoStageRequest PatchedAuthenticatorDuoStageRequest) ApiStagesAuthenticatorDuoPartialUpdateRequest { + r.patchedAuthenticatorDuoStageRequest = &patchedAuthenticatorDuoStageRequest + return r +} + +func (r ApiStagesAuthenticatorDuoPartialUpdateRequest) Execute() (*AuthenticatorDuoStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorDuoPartialUpdate Method for StagesAuthenticatorDuoPartialUpdate + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoPartialUpdateRequest { + return ApiStagesAuthenticatorDuoPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorDuoStage +func (a *StagesAPIService) StagesAuthenticatorDuoPartialUpdateExecute(r ApiStagesAuthenticatorDuoPartialUpdateRequest) (*AuthenticatorDuoStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorDuoStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorDuoStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorDuoRetrieveRequest) Execute() (*AuthenticatorDuoStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoRetrieveExecute(r) +} + +/* +StagesAuthenticatorDuoRetrieve Method for StagesAuthenticatorDuoRetrieve + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoRetrieveRequest { + return ApiStagesAuthenticatorDuoRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorDuoStage +func (a *StagesAPIService) StagesAuthenticatorDuoRetrieveExecute(r ApiStagesAuthenticatorDuoRetrieveRequest) (*AuthenticatorDuoStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorDuoStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorDuoStageRequest *AuthenticatorDuoStageRequest +} + +func (r ApiStagesAuthenticatorDuoUpdateRequest) AuthenticatorDuoStageRequest(authenticatorDuoStageRequest AuthenticatorDuoStageRequest) ApiStagesAuthenticatorDuoUpdateRequest { + r.authenticatorDuoStageRequest = &authenticatorDuoStageRequest + return r +} + +func (r ApiStagesAuthenticatorDuoUpdateRequest) Execute() (*AuthenticatorDuoStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoUpdateExecute(r) +} + +/* +StagesAuthenticatorDuoUpdate Method for StagesAuthenticatorDuoUpdate + +AuthenticatorDuoStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoUpdateRequest { + return ApiStagesAuthenticatorDuoUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorDuoStage +func (a *StagesAPIService) StagesAuthenticatorDuoUpdateExecute(r ApiStagesAuthenticatorDuoUpdateRequest) (*AuthenticatorDuoStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorDuoStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorDuoStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorDuoStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorDuoStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorDuoUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorDuoUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorDuoUsedByListExecute(r) +} + +/* +StagesAuthenticatorDuoUsedByList Method for StagesAuthenticatorDuoUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Duo Authenticator Setup Stage. + @return ApiStagesAuthenticatorDuoUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorDuoUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorDuoUsedByListRequest { + return ApiStagesAuthenticatorDuoUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorDuoUsedByListExecute(r ApiStagesAuthenticatorDuoUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorDuoUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/duo/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorEmailStageRequest *AuthenticatorEmailStageRequest +} + +func (r ApiStagesAuthenticatorEmailCreateRequest) AuthenticatorEmailStageRequest(authenticatorEmailStageRequest AuthenticatorEmailStageRequest) ApiStagesAuthenticatorEmailCreateRequest { + r.authenticatorEmailStageRequest = &authenticatorEmailStageRequest + return r +} + +func (r ApiStagesAuthenticatorEmailCreateRequest) Execute() (*AuthenticatorEmailStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailCreateExecute(r) +} + +/* +StagesAuthenticatorEmailCreate Method for StagesAuthenticatorEmailCreate + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorEmailCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailCreate(ctx context.Context) ApiStagesAuthenticatorEmailCreateRequest { + return ApiStagesAuthenticatorEmailCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorEmailStage +func (a *StagesAPIService) StagesAuthenticatorEmailCreateExecute(r ApiStagesAuthenticatorEmailCreateRequest) (*AuthenticatorEmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorEmailStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorEmailStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorEmailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEmailDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailDestroyExecute(r) +} + +/* +StagesAuthenticatorEmailDestroy Method for StagesAuthenticatorEmailDestroy + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Authenticator Setup Stage. + @return ApiStagesAuthenticatorEmailDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEmailDestroyRequest { + return ApiStagesAuthenticatorEmailDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorEmailDestroyExecute(r ApiStagesAuthenticatorEmailDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailListRequest struct { + ctx context.Context + ApiService *StagesAPIService + configureFlow *string + friendlyName *string + fromAddress *string + host *string + name *string + ordering *string + page *int32 + pageSize *int32 + password *string + port *int32 + search *string + stageUuid *string + subject *string + template *string + timeout *int32 + tokenExpiry *string + useGlobalSettings *bool + useSsl *bool + useTls *bool + username *string +} + +func (r ApiStagesAuthenticatorEmailListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorEmailListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) FriendlyName(friendlyName string) ApiStagesAuthenticatorEmailListRequest { + r.friendlyName = &friendlyName + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) FromAddress(fromAddress string) ApiStagesAuthenticatorEmailListRequest { + r.fromAddress = &fromAddress + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Host(host string) ApiStagesAuthenticatorEmailListRequest { + r.host = &host + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Name(name string) ApiStagesAuthenticatorEmailListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorEmailListRequest) Ordering(ordering string) ApiStagesAuthenticatorEmailListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorEmailListRequest) Page(page int32) ApiStagesAuthenticatorEmailListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorEmailListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorEmailListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Password(password string) ApiStagesAuthenticatorEmailListRequest { + r.password = &password + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Port(port int32) ApiStagesAuthenticatorEmailListRequest { + r.port = &port + return r +} + +// A search term. +func (r ApiStagesAuthenticatorEmailListRequest) Search(search string) ApiStagesAuthenticatorEmailListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) StageUuid(stageUuid string) ApiStagesAuthenticatorEmailListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Subject(subject string) ApiStagesAuthenticatorEmailListRequest { + r.subject = &subject + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Template(template string) ApiStagesAuthenticatorEmailListRequest { + r.template = &template + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Timeout(timeout int32) ApiStagesAuthenticatorEmailListRequest { + r.timeout = &timeout + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) TokenExpiry(tokenExpiry string) ApiStagesAuthenticatorEmailListRequest { + r.tokenExpiry = &tokenExpiry + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) UseGlobalSettings(useGlobalSettings bool) ApiStagesAuthenticatorEmailListRequest { + r.useGlobalSettings = &useGlobalSettings + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) UseSsl(useSsl bool) ApiStagesAuthenticatorEmailListRequest { + r.useSsl = &useSsl + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) UseTls(useTls bool) ApiStagesAuthenticatorEmailListRequest { + r.useTls = &useTls + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Username(username string) ApiStagesAuthenticatorEmailListRequest { + r.username = &username + return r +} + +func (r ApiStagesAuthenticatorEmailListRequest) Execute() (*PaginatedAuthenticatorEmailStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailListExecute(r) +} + +/* +StagesAuthenticatorEmailList Method for StagesAuthenticatorEmailList + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorEmailListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailList(ctx context.Context) ApiStagesAuthenticatorEmailListRequest { + return ApiStagesAuthenticatorEmailListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorEmailStageList +func (a *StagesAPIService) StagesAuthenticatorEmailListExecute(r ApiStagesAuthenticatorEmailListRequest) (*PaginatedAuthenticatorEmailStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorEmailStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.friendlyName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "friendly_name", r.friendlyName, "form", "") + } + if r.fromAddress != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from_address", r.fromAddress, "form", "") + } + if r.host != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "host", r.host, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.password != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password", r.password, "form", "") + } + if r.port != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.subject != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "subject", r.subject, "form", "") + } + if r.template != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "template", r.template, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.tokenExpiry != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "token_expiry", r.tokenExpiry, "form", "") + } + if r.useGlobalSettings != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_global_settings", r.useGlobalSettings, "form", "") + } + if r.useSsl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_ssl", r.useSsl, "form", "") + } + if r.useTls != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_tls", r.useTls, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorEmailStageRequest *PatchedAuthenticatorEmailStageRequest +} + +func (r ApiStagesAuthenticatorEmailPartialUpdateRequest) PatchedAuthenticatorEmailStageRequest(patchedAuthenticatorEmailStageRequest PatchedAuthenticatorEmailStageRequest) ApiStagesAuthenticatorEmailPartialUpdateRequest { + r.patchedAuthenticatorEmailStageRequest = &patchedAuthenticatorEmailStageRequest + return r +} + +func (r ApiStagesAuthenticatorEmailPartialUpdateRequest) Execute() (*AuthenticatorEmailStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorEmailPartialUpdate Method for StagesAuthenticatorEmailPartialUpdate + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Authenticator Setup Stage. + @return ApiStagesAuthenticatorEmailPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEmailPartialUpdateRequest { + return ApiStagesAuthenticatorEmailPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEmailStage +func (a *StagesAPIService) StagesAuthenticatorEmailPartialUpdateExecute(r ApiStagesAuthenticatorEmailPartialUpdateRequest) (*AuthenticatorEmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorEmailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEmailRetrieveRequest) Execute() (*AuthenticatorEmailStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailRetrieveExecute(r) +} + +/* +StagesAuthenticatorEmailRetrieve Method for StagesAuthenticatorEmailRetrieve + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Authenticator Setup Stage. + @return ApiStagesAuthenticatorEmailRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEmailRetrieveRequest { + return ApiStagesAuthenticatorEmailRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEmailStage +func (a *StagesAPIService) StagesAuthenticatorEmailRetrieveExecute(r ApiStagesAuthenticatorEmailRetrieveRequest) (*AuthenticatorEmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorEmailStageRequest *AuthenticatorEmailStageRequest +} + +func (r ApiStagesAuthenticatorEmailUpdateRequest) AuthenticatorEmailStageRequest(authenticatorEmailStageRequest AuthenticatorEmailStageRequest) ApiStagesAuthenticatorEmailUpdateRequest { + r.authenticatorEmailStageRequest = &authenticatorEmailStageRequest + return r +} + +func (r ApiStagesAuthenticatorEmailUpdateRequest) Execute() (*AuthenticatorEmailStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailUpdateExecute(r) +} + +/* +StagesAuthenticatorEmailUpdate Method for StagesAuthenticatorEmailUpdate + +AuthenticatorEmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Authenticator Setup Stage. + @return ApiStagesAuthenticatorEmailUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEmailUpdateRequest { + return ApiStagesAuthenticatorEmailUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEmailStage +func (a *StagesAPIService) StagesAuthenticatorEmailUpdateExecute(r ApiStagesAuthenticatorEmailUpdateRequest) (*AuthenticatorEmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorEmailStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorEmailStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorEmailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEmailUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEmailUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEmailUsedByListExecute(r) +} + +/* +StagesAuthenticatorEmailUsedByList Method for StagesAuthenticatorEmailUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Authenticator Setup Stage. + @return ApiStagesAuthenticatorEmailUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEmailUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEmailUsedByListRequest { + return ApiStagesAuthenticatorEmailUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorEmailUsedByListExecute(r ApiStagesAuthenticatorEmailUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEmailUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/email/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorEndpointGDTCStageRequest *AuthenticatorEndpointGDTCStageRequest +} + +func (r ApiStagesAuthenticatorEndpointGdtcCreateRequest) AuthenticatorEndpointGDTCStageRequest(authenticatorEndpointGDTCStageRequest AuthenticatorEndpointGDTCStageRequest) ApiStagesAuthenticatorEndpointGdtcCreateRequest { + r.authenticatorEndpointGDTCStageRequest = &authenticatorEndpointGDTCStageRequest + return r +} + +func (r ApiStagesAuthenticatorEndpointGdtcCreateRequest) Execute() (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcCreateExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcCreate Method for StagesAuthenticatorEndpointGdtcCreate + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorEndpointGdtcCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcCreate(ctx context.Context) ApiStagesAuthenticatorEndpointGdtcCreateRequest { + return ApiStagesAuthenticatorEndpointGdtcCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorEndpointGDTCStage +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcCreateExecute(r ApiStagesAuthenticatorEndpointGdtcCreateRequest) (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEndpointGDTCStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorEndpointGDTCStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorEndpointGDTCStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorEndpointGDTCStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEndpointGdtcDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcDestroyExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcDestroy Method for StagesAuthenticatorEndpointGdtcDestroy + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Authenticator Google Device Trust Connector Stage. + @return ApiStagesAuthenticatorEndpointGdtcDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEndpointGdtcDestroyRequest { + return ApiStagesAuthenticatorEndpointGdtcDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcDestroyExecute(r ApiStagesAuthenticatorEndpointGdtcDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcListRequest struct { + ctx context.Context + ApiService *StagesAPIService + configureFlow *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) Name(name string) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) Ordering(ordering string) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) Page(page int32) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) Search(search string) ApiStagesAuthenticatorEndpointGdtcListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorEndpointGdtcListRequest) Execute() (*PaginatedAuthenticatorEndpointGDTCStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcListExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcList Method for StagesAuthenticatorEndpointGdtcList + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorEndpointGdtcListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcList(ctx context.Context) ApiStagesAuthenticatorEndpointGdtcListRequest { + return ApiStagesAuthenticatorEndpointGdtcListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorEndpointGDTCStageList +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcListExecute(r ApiStagesAuthenticatorEndpointGdtcListRequest) (*PaginatedAuthenticatorEndpointGDTCStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorEndpointGDTCStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorEndpointGDTCStageRequest *PatchedAuthenticatorEndpointGDTCStageRequest +} + +func (r ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest) PatchedAuthenticatorEndpointGDTCStageRequest(patchedAuthenticatorEndpointGDTCStageRequest PatchedAuthenticatorEndpointGDTCStageRequest) ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest { + r.patchedAuthenticatorEndpointGDTCStageRequest = &patchedAuthenticatorEndpointGDTCStageRequest + return r +} + +func (r ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest) Execute() (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcPartialUpdate Method for StagesAuthenticatorEndpointGdtcPartialUpdate + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Authenticator Google Device Trust Connector Stage. + @return ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest { + return ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEndpointGDTCStage +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcPartialUpdateExecute(r ApiStagesAuthenticatorEndpointGdtcPartialUpdateRequest) (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEndpointGDTCStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorEndpointGDTCStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEndpointGdtcRetrieveRequest) Execute() (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcRetrieveExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcRetrieve Method for StagesAuthenticatorEndpointGdtcRetrieve + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Authenticator Google Device Trust Connector Stage. + @return ApiStagesAuthenticatorEndpointGdtcRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEndpointGdtcRetrieveRequest { + return ApiStagesAuthenticatorEndpointGdtcRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEndpointGDTCStage +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcRetrieveExecute(r ApiStagesAuthenticatorEndpointGdtcRetrieveRequest) (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEndpointGDTCStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorEndpointGDTCStageRequest *AuthenticatorEndpointGDTCStageRequest +} + +func (r ApiStagesAuthenticatorEndpointGdtcUpdateRequest) AuthenticatorEndpointGDTCStageRequest(authenticatorEndpointGDTCStageRequest AuthenticatorEndpointGDTCStageRequest) ApiStagesAuthenticatorEndpointGdtcUpdateRequest { + r.authenticatorEndpointGDTCStageRequest = &authenticatorEndpointGDTCStageRequest + return r +} + +func (r ApiStagesAuthenticatorEndpointGdtcUpdateRequest) Execute() (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcUpdateExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcUpdate Method for StagesAuthenticatorEndpointGdtcUpdate + +AuthenticatorEndpointGDTCStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Authenticator Google Device Trust Connector Stage. + @return ApiStagesAuthenticatorEndpointGdtcUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEndpointGdtcUpdateRequest { + return ApiStagesAuthenticatorEndpointGdtcUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorEndpointGDTCStage +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcUpdateExecute(r ApiStagesAuthenticatorEndpointGdtcUpdateRequest) (*AuthenticatorEndpointGDTCStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorEndpointGDTCStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorEndpointGDTCStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorEndpointGDTCStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorEndpointGDTCStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorEndpointGdtcUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorEndpointGdtcUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorEndpointGdtcUsedByListExecute(r) +} + +/* +StagesAuthenticatorEndpointGdtcUsedByList Method for StagesAuthenticatorEndpointGdtcUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Authenticator Google Device Trust Connector Stage. + @return ApiStagesAuthenticatorEndpointGdtcUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorEndpointGdtcUsedByListRequest { + return ApiStagesAuthenticatorEndpointGdtcUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorEndpointGdtcUsedByListExecute(r ApiStagesAuthenticatorEndpointGdtcUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorEndpointGdtcUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/endpoint_gdtc/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorSMSStageRequest *AuthenticatorSMSStageRequest +} + +func (r ApiStagesAuthenticatorSmsCreateRequest) AuthenticatorSMSStageRequest(authenticatorSMSStageRequest AuthenticatorSMSStageRequest) ApiStagesAuthenticatorSmsCreateRequest { + r.authenticatorSMSStageRequest = &authenticatorSMSStageRequest + return r +} + +func (r ApiStagesAuthenticatorSmsCreateRequest) Execute() (*AuthenticatorSMSStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsCreateExecute(r) +} + +/* +StagesAuthenticatorSmsCreate Method for StagesAuthenticatorSmsCreate + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorSmsCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsCreate(ctx context.Context) ApiStagesAuthenticatorSmsCreateRequest { + return ApiStagesAuthenticatorSmsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorSMSStage +func (a *StagesAPIService) StagesAuthenticatorSmsCreateExecute(r ApiStagesAuthenticatorSmsCreateRequest) (*AuthenticatorSMSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorSMSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorSMSStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorSMSStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorSMSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorSmsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsDestroyExecute(r) +} + +/* +StagesAuthenticatorSmsDestroy Method for StagesAuthenticatorSmsDestroy + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this SMS Authenticator Setup Stage. + @return ApiStagesAuthenticatorSmsDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorSmsDestroyRequest { + return ApiStagesAuthenticatorSmsDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorSmsDestroyExecute(r ApiStagesAuthenticatorSmsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsListRequest struct { + ctx context.Context + ApiService *StagesAPIService + accountSid *string + auth *string + authPassword *string + authType *string + configureFlow *string + friendlyName *string + fromNumber *string + mapping *string + name *string + ordering *string + page *int32 + pageSize *int32 + provider *string + search *string + stageUuid *string + verifyOnly *bool +} + +func (r ApiStagesAuthenticatorSmsListRequest) AccountSid(accountSid string) ApiStagesAuthenticatorSmsListRequest { + r.accountSid = &accountSid + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) Auth(auth string) ApiStagesAuthenticatorSmsListRequest { + r.auth = &auth + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) AuthPassword(authPassword string) ApiStagesAuthenticatorSmsListRequest { + r.authPassword = &authPassword + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) AuthType(authType string) ApiStagesAuthenticatorSmsListRequest { + r.authType = &authType + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorSmsListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) FriendlyName(friendlyName string) ApiStagesAuthenticatorSmsListRequest { + r.friendlyName = &friendlyName + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) FromNumber(fromNumber string) ApiStagesAuthenticatorSmsListRequest { + r.fromNumber = &fromNumber + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) Mapping(mapping string) ApiStagesAuthenticatorSmsListRequest { + r.mapping = &mapping + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) Name(name string) ApiStagesAuthenticatorSmsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorSmsListRequest) Ordering(ordering string) ApiStagesAuthenticatorSmsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorSmsListRequest) Page(page int32) ApiStagesAuthenticatorSmsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorSmsListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorSmsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) Provider(provider string) ApiStagesAuthenticatorSmsListRequest { + r.provider = &provider + return r +} + +// A search term. +func (r ApiStagesAuthenticatorSmsListRequest) Search(search string) ApiStagesAuthenticatorSmsListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) StageUuid(stageUuid string) ApiStagesAuthenticatorSmsListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) VerifyOnly(verifyOnly bool) ApiStagesAuthenticatorSmsListRequest { + r.verifyOnly = &verifyOnly + return r +} + +func (r ApiStagesAuthenticatorSmsListRequest) Execute() (*PaginatedAuthenticatorSMSStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsListExecute(r) +} + +/* +StagesAuthenticatorSmsList Method for StagesAuthenticatorSmsList + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorSmsListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsList(ctx context.Context) ApiStagesAuthenticatorSmsListRequest { + return ApiStagesAuthenticatorSmsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorSMSStageList +func (a *StagesAPIService) StagesAuthenticatorSmsListExecute(r ApiStagesAuthenticatorSmsListRequest) (*PaginatedAuthenticatorSMSStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorSMSStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.accountSid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "account_sid", r.accountSid, "form", "") + } + if r.auth != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth", r.auth, "form", "") + } + if r.authPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_password", r.authPassword, "form", "") + } + if r.authType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "auth_type", r.authType, "form", "") + } + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.friendlyName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "friendly_name", r.friendlyName, "form", "") + } + if r.fromNumber != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from_number", r.fromNumber, "form", "") + } + if r.mapping != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mapping", r.mapping, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.provider != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "provider", r.provider, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.verifyOnly != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "verify_only", r.verifyOnly, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorSMSStageRequest *PatchedAuthenticatorSMSStageRequest +} + +func (r ApiStagesAuthenticatorSmsPartialUpdateRequest) PatchedAuthenticatorSMSStageRequest(patchedAuthenticatorSMSStageRequest PatchedAuthenticatorSMSStageRequest) ApiStagesAuthenticatorSmsPartialUpdateRequest { + r.patchedAuthenticatorSMSStageRequest = &patchedAuthenticatorSMSStageRequest + return r +} + +func (r ApiStagesAuthenticatorSmsPartialUpdateRequest) Execute() (*AuthenticatorSMSStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorSmsPartialUpdate Method for StagesAuthenticatorSmsPartialUpdate + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this SMS Authenticator Setup Stage. + @return ApiStagesAuthenticatorSmsPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorSmsPartialUpdateRequest { + return ApiStagesAuthenticatorSmsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorSMSStage +func (a *StagesAPIService) StagesAuthenticatorSmsPartialUpdateExecute(r ApiStagesAuthenticatorSmsPartialUpdateRequest) (*AuthenticatorSMSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorSMSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorSMSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorSmsRetrieveRequest) Execute() (*AuthenticatorSMSStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsRetrieveExecute(r) +} + +/* +StagesAuthenticatorSmsRetrieve Method for StagesAuthenticatorSmsRetrieve + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this SMS Authenticator Setup Stage. + @return ApiStagesAuthenticatorSmsRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorSmsRetrieveRequest { + return ApiStagesAuthenticatorSmsRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorSMSStage +func (a *StagesAPIService) StagesAuthenticatorSmsRetrieveExecute(r ApiStagesAuthenticatorSmsRetrieveRequest) (*AuthenticatorSMSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorSMSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorSMSStageRequest *AuthenticatorSMSStageRequest +} + +func (r ApiStagesAuthenticatorSmsUpdateRequest) AuthenticatorSMSStageRequest(authenticatorSMSStageRequest AuthenticatorSMSStageRequest) ApiStagesAuthenticatorSmsUpdateRequest { + r.authenticatorSMSStageRequest = &authenticatorSMSStageRequest + return r +} + +func (r ApiStagesAuthenticatorSmsUpdateRequest) Execute() (*AuthenticatorSMSStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsUpdateExecute(r) +} + +/* +StagesAuthenticatorSmsUpdate Method for StagesAuthenticatorSmsUpdate + +AuthenticatorSMSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this SMS Authenticator Setup Stage. + @return ApiStagesAuthenticatorSmsUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorSmsUpdateRequest { + return ApiStagesAuthenticatorSmsUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorSMSStage +func (a *StagesAPIService) StagesAuthenticatorSmsUpdateExecute(r ApiStagesAuthenticatorSmsUpdateRequest) (*AuthenticatorSMSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorSMSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorSMSStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorSMSStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorSMSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorSmsUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorSmsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorSmsUsedByListExecute(r) +} + +/* +StagesAuthenticatorSmsUsedByList Method for StagesAuthenticatorSmsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this SMS Authenticator Setup Stage. + @return ApiStagesAuthenticatorSmsUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorSmsUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorSmsUsedByListRequest { + return ApiStagesAuthenticatorSmsUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorSmsUsedByListExecute(r ApiStagesAuthenticatorSmsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorSmsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/sms/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorStaticStageRequest *AuthenticatorStaticStageRequest +} + +func (r ApiStagesAuthenticatorStaticCreateRequest) AuthenticatorStaticStageRequest(authenticatorStaticStageRequest AuthenticatorStaticStageRequest) ApiStagesAuthenticatorStaticCreateRequest { + r.authenticatorStaticStageRequest = &authenticatorStaticStageRequest + return r +} + +func (r ApiStagesAuthenticatorStaticCreateRequest) Execute() (*AuthenticatorStaticStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticCreateExecute(r) +} + +/* +StagesAuthenticatorStaticCreate Method for StagesAuthenticatorStaticCreate + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorStaticCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticCreate(ctx context.Context) ApiStagesAuthenticatorStaticCreateRequest { + return ApiStagesAuthenticatorStaticCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorStaticStage +func (a *StagesAPIService) StagesAuthenticatorStaticCreateExecute(r ApiStagesAuthenticatorStaticCreateRequest) (*AuthenticatorStaticStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorStaticStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorStaticStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorStaticStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorStaticStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorStaticDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticDestroyExecute(r) +} + +/* +StagesAuthenticatorStaticDestroy Method for StagesAuthenticatorStaticDestroy + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Static Authenticator Setup Stage. + @return ApiStagesAuthenticatorStaticDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorStaticDestroyRequest { + return ApiStagesAuthenticatorStaticDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorStaticDestroyExecute(r ApiStagesAuthenticatorStaticDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticListRequest struct { + ctx context.Context + ApiService *StagesAPIService + configureFlow *string + friendlyName *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string + tokenCount *int32 + tokenLength *int32 +} + +func (r ApiStagesAuthenticatorStaticListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorStaticListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) FriendlyName(friendlyName string) ApiStagesAuthenticatorStaticListRequest { + r.friendlyName = &friendlyName + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) Name(name string) ApiStagesAuthenticatorStaticListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorStaticListRequest) Ordering(ordering string) ApiStagesAuthenticatorStaticListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorStaticListRequest) Page(page int32) ApiStagesAuthenticatorStaticListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorStaticListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorStaticListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorStaticListRequest) Search(search string) ApiStagesAuthenticatorStaticListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) StageUuid(stageUuid string) ApiStagesAuthenticatorStaticListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) TokenCount(tokenCount int32) ApiStagesAuthenticatorStaticListRequest { + r.tokenCount = &tokenCount + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) TokenLength(tokenLength int32) ApiStagesAuthenticatorStaticListRequest { + r.tokenLength = &tokenLength + return r +} + +func (r ApiStagesAuthenticatorStaticListRequest) Execute() (*PaginatedAuthenticatorStaticStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticListExecute(r) +} + +/* +StagesAuthenticatorStaticList Method for StagesAuthenticatorStaticList + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorStaticListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticList(ctx context.Context) ApiStagesAuthenticatorStaticListRequest { + return ApiStagesAuthenticatorStaticListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorStaticStageList +func (a *StagesAPIService) StagesAuthenticatorStaticListExecute(r ApiStagesAuthenticatorStaticListRequest) (*PaginatedAuthenticatorStaticStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorStaticStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.friendlyName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "friendly_name", r.friendlyName, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.tokenCount != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "token_count", r.tokenCount, "form", "") + } + if r.tokenLength != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "token_length", r.tokenLength, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorStaticStageRequest *PatchedAuthenticatorStaticStageRequest +} + +func (r ApiStagesAuthenticatorStaticPartialUpdateRequest) PatchedAuthenticatorStaticStageRequest(patchedAuthenticatorStaticStageRequest PatchedAuthenticatorStaticStageRequest) ApiStagesAuthenticatorStaticPartialUpdateRequest { + r.patchedAuthenticatorStaticStageRequest = &patchedAuthenticatorStaticStageRequest + return r +} + +func (r ApiStagesAuthenticatorStaticPartialUpdateRequest) Execute() (*AuthenticatorStaticStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorStaticPartialUpdate Method for StagesAuthenticatorStaticPartialUpdate + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Static Authenticator Setup Stage. + @return ApiStagesAuthenticatorStaticPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorStaticPartialUpdateRequest { + return ApiStagesAuthenticatorStaticPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorStaticStage +func (a *StagesAPIService) StagesAuthenticatorStaticPartialUpdateExecute(r ApiStagesAuthenticatorStaticPartialUpdateRequest) (*AuthenticatorStaticStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorStaticStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorStaticStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorStaticRetrieveRequest) Execute() (*AuthenticatorStaticStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticRetrieveExecute(r) +} + +/* +StagesAuthenticatorStaticRetrieve Method for StagesAuthenticatorStaticRetrieve + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Static Authenticator Setup Stage. + @return ApiStagesAuthenticatorStaticRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorStaticRetrieveRequest { + return ApiStagesAuthenticatorStaticRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorStaticStage +func (a *StagesAPIService) StagesAuthenticatorStaticRetrieveExecute(r ApiStagesAuthenticatorStaticRetrieveRequest) (*AuthenticatorStaticStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorStaticStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorStaticStageRequest *AuthenticatorStaticStageRequest +} + +func (r ApiStagesAuthenticatorStaticUpdateRequest) AuthenticatorStaticStageRequest(authenticatorStaticStageRequest AuthenticatorStaticStageRequest) ApiStagesAuthenticatorStaticUpdateRequest { + r.authenticatorStaticStageRequest = &authenticatorStaticStageRequest + return r +} + +func (r ApiStagesAuthenticatorStaticUpdateRequest) Execute() (*AuthenticatorStaticStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticUpdateExecute(r) +} + +/* +StagesAuthenticatorStaticUpdate Method for StagesAuthenticatorStaticUpdate + +AuthenticatorStaticStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Static Authenticator Setup Stage. + @return ApiStagesAuthenticatorStaticUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorStaticUpdateRequest { + return ApiStagesAuthenticatorStaticUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorStaticStage +func (a *StagesAPIService) StagesAuthenticatorStaticUpdateExecute(r ApiStagesAuthenticatorStaticUpdateRequest) (*AuthenticatorStaticStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorStaticStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorStaticStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorStaticStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorStaticStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorStaticUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorStaticUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorStaticUsedByListExecute(r) +} + +/* +StagesAuthenticatorStaticUsedByList Method for StagesAuthenticatorStaticUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Static Authenticator Setup Stage. + @return ApiStagesAuthenticatorStaticUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorStaticUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorStaticUsedByListRequest { + return ApiStagesAuthenticatorStaticUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorStaticUsedByListExecute(r ApiStagesAuthenticatorStaticUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorStaticUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/static/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorTOTPStageRequest *AuthenticatorTOTPStageRequest +} + +func (r ApiStagesAuthenticatorTotpCreateRequest) AuthenticatorTOTPStageRequest(authenticatorTOTPStageRequest AuthenticatorTOTPStageRequest) ApiStagesAuthenticatorTotpCreateRequest { + r.authenticatorTOTPStageRequest = &authenticatorTOTPStageRequest + return r +} + +func (r ApiStagesAuthenticatorTotpCreateRequest) Execute() (*AuthenticatorTOTPStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpCreateExecute(r) +} + +/* +StagesAuthenticatorTotpCreate Method for StagesAuthenticatorTotpCreate + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorTotpCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpCreate(ctx context.Context) ApiStagesAuthenticatorTotpCreateRequest { + return ApiStagesAuthenticatorTotpCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorTOTPStage +func (a *StagesAPIService) StagesAuthenticatorTotpCreateExecute(r ApiStagesAuthenticatorTotpCreateRequest) (*AuthenticatorTOTPStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorTOTPStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorTOTPStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorTOTPStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorTOTPStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorTotpDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpDestroyExecute(r) +} + +/* +StagesAuthenticatorTotpDestroy Method for StagesAuthenticatorTotpDestroy + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this TOTP Authenticator Setup Stage. + @return ApiStagesAuthenticatorTotpDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorTotpDestroyRequest { + return ApiStagesAuthenticatorTotpDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorTotpDestroyExecute(r ApiStagesAuthenticatorTotpDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpListRequest struct { + ctx context.Context + ApiService *StagesAPIService + configureFlow *string + digits *string + friendlyName *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesAuthenticatorTotpListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorTotpListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorTotpListRequest) Digits(digits string) ApiStagesAuthenticatorTotpListRequest { + r.digits = &digits + return r +} + +func (r ApiStagesAuthenticatorTotpListRequest) FriendlyName(friendlyName string) ApiStagesAuthenticatorTotpListRequest { + r.friendlyName = &friendlyName + return r +} + +func (r ApiStagesAuthenticatorTotpListRequest) Name(name string) ApiStagesAuthenticatorTotpListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorTotpListRequest) Ordering(ordering string) ApiStagesAuthenticatorTotpListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorTotpListRequest) Page(page int32) ApiStagesAuthenticatorTotpListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorTotpListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorTotpListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorTotpListRequest) Search(search string) ApiStagesAuthenticatorTotpListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorTotpListRequest) StageUuid(stageUuid string) ApiStagesAuthenticatorTotpListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesAuthenticatorTotpListRequest) Execute() (*PaginatedAuthenticatorTOTPStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpListExecute(r) +} + +/* +StagesAuthenticatorTotpList Method for StagesAuthenticatorTotpList + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorTotpListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpList(ctx context.Context) ApiStagesAuthenticatorTotpListRequest { + return ApiStagesAuthenticatorTotpListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorTOTPStageList +func (a *StagesAPIService) StagesAuthenticatorTotpListExecute(r ApiStagesAuthenticatorTotpListRequest) (*PaginatedAuthenticatorTOTPStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorTOTPStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.digits != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "digits", r.digits, "form", "") + } + if r.friendlyName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "friendly_name", r.friendlyName, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorTOTPStageRequest *PatchedAuthenticatorTOTPStageRequest +} + +func (r ApiStagesAuthenticatorTotpPartialUpdateRequest) PatchedAuthenticatorTOTPStageRequest(patchedAuthenticatorTOTPStageRequest PatchedAuthenticatorTOTPStageRequest) ApiStagesAuthenticatorTotpPartialUpdateRequest { + r.patchedAuthenticatorTOTPStageRequest = &patchedAuthenticatorTOTPStageRequest + return r +} + +func (r ApiStagesAuthenticatorTotpPartialUpdateRequest) Execute() (*AuthenticatorTOTPStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorTotpPartialUpdate Method for StagesAuthenticatorTotpPartialUpdate + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this TOTP Authenticator Setup Stage. + @return ApiStagesAuthenticatorTotpPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorTotpPartialUpdateRequest { + return ApiStagesAuthenticatorTotpPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorTOTPStage +func (a *StagesAPIService) StagesAuthenticatorTotpPartialUpdateExecute(r ApiStagesAuthenticatorTotpPartialUpdateRequest) (*AuthenticatorTOTPStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorTOTPStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorTOTPStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorTotpRetrieveRequest) Execute() (*AuthenticatorTOTPStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpRetrieveExecute(r) +} + +/* +StagesAuthenticatorTotpRetrieve Method for StagesAuthenticatorTotpRetrieve + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this TOTP Authenticator Setup Stage. + @return ApiStagesAuthenticatorTotpRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorTotpRetrieveRequest { + return ApiStagesAuthenticatorTotpRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorTOTPStage +func (a *StagesAPIService) StagesAuthenticatorTotpRetrieveExecute(r ApiStagesAuthenticatorTotpRetrieveRequest) (*AuthenticatorTOTPStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorTOTPStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorTOTPStageRequest *AuthenticatorTOTPStageRequest +} + +func (r ApiStagesAuthenticatorTotpUpdateRequest) AuthenticatorTOTPStageRequest(authenticatorTOTPStageRequest AuthenticatorTOTPStageRequest) ApiStagesAuthenticatorTotpUpdateRequest { + r.authenticatorTOTPStageRequest = &authenticatorTOTPStageRequest + return r +} + +func (r ApiStagesAuthenticatorTotpUpdateRequest) Execute() (*AuthenticatorTOTPStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpUpdateExecute(r) +} + +/* +StagesAuthenticatorTotpUpdate Method for StagesAuthenticatorTotpUpdate + +AuthenticatorTOTPStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this TOTP Authenticator Setup Stage. + @return ApiStagesAuthenticatorTotpUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorTotpUpdateRequest { + return ApiStagesAuthenticatorTotpUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorTOTPStage +func (a *StagesAPIService) StagesAuthenticatorTotpUpdateExecute(r ApiStagesAuthenticatorTotpUpdateRequest) (*AuthenticatorTOTPStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorTOTPStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorTOTPStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorTOTPStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorTOTPStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorTotpUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorTotpUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorTotpUsedByListExecute(r) +} + +/* +StagesAuthenticatorTotpUsedByList Method for StagesAuthenticatorTotpUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this TOTP Authenticator Setup Stage. + @return ApiStagesAuthenticatorTotpUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorTotpUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorTotpUsedByListRequest { + return ApiStagesAuthenticatorTotpUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorTotpUsedByListExecute(r ApiStagesAuthenticatorTotpUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorTotpUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/totp/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorValidateStageRequest *AuthenticatorValidateStageRequest +} + +func (r ApiStagesAuthenticatorValidateCreateRequest) AuthenticatorValidateStageRequest(authenticatorValidateStageRequest AuthenticatorValidateStageRequest) ApiStagesAuthenticatorValidateCreateRequest { + r.authenticatorValidateStageRequest = &authenticatorValidateStageRequest + return r +} + +func (r ApiStagesAuthenticatorValidateCreateRequest) Execute() (*AuthenticatorValidateStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateCreateExecute(r) +} + +/* +StagesAuthenticatorValidateCreate Method for StagesAuthenticatorValidateCreate + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorValidateCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateCreate(ctx context.Context) ApiStagesAuthenticatorValidateCreateRequest { + return ApiStagesAuthenticatorValidateCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorValidateStage +func (a *StagesAPIService) StagesAuthenticatorValidateCreateExecute(r ApiStagesAuthenticatorValidateCreateRequest) (*AuthenticatorValidateStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorValidateStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorValidateStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorValidateStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorValidateStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorValidateDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateDestroyExecute(r) +} + +/* +StagesAuthenticatorValidateDestroy Method for StagesAuthenticatorValidateDestroy + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Authenticator Validation Stage. + @return ApiStagesAuthenticatorValidateDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorValidateDestroyRequest { + return ApiStagesAuthenticatorValidateDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorValidateDestroyExecute(r ApiStagesAuthenticatorValidateDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateListRequest struct { + ctx context.Context + ApiService *StagesAPIService + configurationStages *[]string + name *string + notConfiguredAction *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesAuthenticatorValidateListRequest) ConfigurationStages(configurationStages []string) ApiStagesAuthenticatorValidateListRequest { + r.configurationStages = &configurationStages + return r +} + +func (r ApiStagesAuthenticatorValidateListRequest) Name(name string) ApiStagesAuthenticatorValidateListRequest { + r.name = &name + return r +} + +func (r ApiStagesAuthenticatorValidateListRequest) NotConfiguredAction(notConfiguredAction string) ApiStagesAuthenticatorValidateListRequest { + r.notConfiguredAction = ¬ConfiguredAction + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorValidateListRequest) Ordering(ordering string) ApiStagesAuthenticatorValidateListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorValidateListRequest) Page(page int32) ApiStagesAuthenticatorValidateListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorValidateListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorValidateListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorValidateListRequest) Search(search string) ApiStagesAuthenticatorValidateListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorValidateListRequest) Execute() (*PaginatedAuthenticatorValidateStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateListExecute(r) +} + +/* +StagesAuthenticatorValidateList Method for StagesAuthenticatorValidateList + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorValidateListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateList(ctx context.Context) ApiStagesAuthenticatorValidateListRequest { + return ApiStagesAuthenticatorValidateListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorValidateStageList +func (a *StagesAPIService) StagesAuthenticatorValidateListExecute(r ApiStagesAuthenticatorValidateListRequest) (*PaginatedAuthenticatorValidateStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorValidateStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.configurationStages != nil { + t := *r.configurationStages + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "configuration_stages", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "configuration_stages", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.notConfiguredAction != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "not_configured_action", r.notConfiguredAction, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidatePartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorValidateStageRequest *PatchedAuthenticatorValidateStageRequest +} + +func (r ApiStagesAuthenticatorValidatePartialUpdateRequest) PatchedAuthenticatorValidateStageRequest(patchedAuthenticatorValidateStageRequest PatchedAuthenticatorValidateStageRequest) ApiStagesAuthenticatorValidatePartialUpdateRequest { + r.patchedAuthenticatorValidateStageRequest = &patchedAuthenticatorValidateStageRequest + return r +} + +func (r ApiStagesAuthenticatorValidatePartialUpdateRequest) Execute() (*AuthenticatorValidateStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidatePartialUpdateExecute(r) +} + +/* +StagesAuthenticatorValidatePartialUpdate Method for StagesAuthenticatorValidatePartialUpdate + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Authenticator Validation Stage. + @return ApiStagesAuthenticatorValidatePartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidatePartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorValidatePartialUpdateRequest { + return ApiStagesAuthenticatorValidatePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorValidateStage +func (a *StagesAPIService) StagesAuthenticatorValidatePartialUpdateExecute(r ApiStagesAuthenticatorValidatePartialUpdateRequest) (*AuthenticatorValidateStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorValidateStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidatePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorValidateStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorValidateRetrieveRequest) Execute() (*AuthenticatorValidateStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateRetrieveExecute(r) +} + +/* +StagesAuthenticatorValidateRetrieve Method for StagesAuthenticatorValidateRetrieve + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Authenticator Validation Stage. + @return ApiStagesAuthenticatorValidateRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorValidateRetrieveRequest { + return ApiStagesAuthenticatorValidateRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorValidateStage +func (a *StagesAPIService) StagesAuthenticatorValidateRetrieveExecute(r ApiStagesAuthenticatorValidateRetrieveRequest) (*AuthenticatorValidateStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorValidateStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorValidateStageRequest *AuthenticatorValidateStageRequest +} + +func (r ApiStagesAuthenticatorValidateUpdateRequest) AuthenticatorValidateStageRequest(authenticatorValidateStageRequest AuthenticatorValidateStageRequest) ApiStagesAuthenticatorValidateUpdateRequest { + r.authenticatorValidateStageRequest = &authenticatorValidateStageRequest + return r +} + +func (r ApiStagesAuthenticatorValidateUpdateRequest) Execute() (*AuthenticatorValidateStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateUpdateExecute(r) +} + +/* +StagesAuthenticatorValidateUpdate Method for StagesAuthenticatorValidateUpdate + +AuthenticatorValidateStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Authenticator Validation Stage. + @return ApiStagesAuthenticatorValidateUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorValidateUpdateRequest { + return ApiStagesAuthenticatorValidateUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorValidateStage +func (a *StagesAPIService) StagesAuthenticatorValidateUpdateExecute(r ApiStagesAuthenticatorValidateUpdateRequest) (*AuthenticatorValidateStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorValidateStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorValidateStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorValidateStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorValidateStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorValidateUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorValidateUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorValidateUsedByListExecute(r) +} + +/* +StagesAuthenticatorValidateUsedByList Method for StagesAuthenticatorValidateUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Authenticator Validation Stage. + @return ApiStagesAuthenticatorValidateUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorValidateUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorValidateUsedByListRequest { + return ApiStagesAuthenticatorValidateUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorValidateUsedByListExecute(r ApiStagesAuthenticatorValidateUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorValidateUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/validate/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorWebAuthnStageRequest *AuthenticatorWebAuthnStageRequest +} + +func (r ApiStagesAuthenticatorWebauthnCreateRequest) AuthenticatorWebAuthnStageRequest(authenticatorWebAuthnStageRequest AuthenticatorWebAuthnStageRequest) ApiStagesAuthenticatorWebauthnCreateRequest { + r.authenticatorWebAuthnStageRequest = &authenticatorWebAuthnStageRequest + return r +} + +func (r ApiStagesAuthenticatorWebauthnCreateRequest) Execute() (*AuthenticatorWebAuthnStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnCreateExecute(r) +} + +/* +StagesAuthenticatorWebauthnCreate Method for StagesAuthenticatorWebauthnCreate + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorWebauthnCreateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnCreate(ctx context.Context) ApiStagesAuthenticatorWebauthnCreateRequest { + return ApiStagesAuthenticatorWebauthnCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AuthenticatorWebAuthnStage +func (a *StagesAPIService) StagesAuthenticatorWebauthnCreateExecute(r ApiStagesAuthenticatorWebauthnCreateRequest) (*AuthenticatorWebAuthnStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorWebAuthnStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorWebAuthnStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorWebAuthnStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorWebAuthnStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorWebauthnDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnDestroyExecute(r) +} + +/* +StagesAuthenticatorWebauthnDestroy Method for StagesAuthenticatorWebauthnDestroy + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this WebAuthn Authenticator Setup Stage. + @return ApiStagesAuthenticatorWebauthnDestroyRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnDestroy(ctx context.Context, stageUuid string) ApiStagesAuthenticatorWebauthnDestroyRequest { + return ApiStagesAuthenticatorWebauthnDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesAuthenticatorWebauthnDestroyExecute(r ApiStagesAuthenticatorWebauthnDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnDeviceTypesListRequest struct { + ctx context.Context + ApiService *StagesAPIService + aaguid *string + description *string + icon *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Aaguid(aaguid string) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.aaguid = &aaguid + return r +} + +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Description(description string) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.description = &description + return r +} + +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Icon(icon string) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.icon = &icon + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Ordering(ordering string) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Page(page int32) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Search(search string) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) Execute() (*PaginatedWebAuthnDeviceTypeList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnDeviceTypesListExecute(r) +} + +/* +StagesAuthenticatorWebauthnDeviceTypesList Method for StagesAuthenticatorWebauthnDeviceTypesList + +WebAuthnDeviceType Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorWebauthnDeviceTypesListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnDeviceTypesList(ctx context.Context) ApiStagesAuthenticatorWebauthnDeviceTypesListRequest { + return ApiStagesAuthenticatorWebauthnDeviceTypesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedWebAuthnDeviceTypeList +func (a *StagesAPIService) StagesAuthenticatorWebauthnDeviceTypesListExecute(r ApiStagesAuthenticatorWebauthnDeviceTypesListRequest) (*PaginatedWebAuthnDeviceTypeList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedWebAuthnDeviceTypeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnDeviceTypesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn_device_types/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.aaguid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "aaguid", r.aaguid, "form", "") + } + if r.description != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "description", r.description, "form", "") + } + if r.icon != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "icon", r.icon, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + aaguid string +} + +func (r ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest) Execute() (*WebAuthnDeviceType, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnDeviceTypesRetrieveExecute(r) +} + +/* +StagesAuthenticatorWebauthnDeviceTypesRetrieve Method for StagesAuthenticatorWebauthnDeviceTypesRetrieve + +WebAuthnDeviceType Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param aaguid A UUID string identifying this WebAuthn Device type. + @return ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnDeviceTypesRetrieve(ctx context.Context, aaguid string) ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest { + return ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest{ + ApiService: a, + ctx: ctx, + aaguid: aaguid, + } +} + +// Execute executes the request +// +// @return WebAuthnDeviceType +func (a *StagesAPIService) StagesAuthenticatorWebauthnDeviceTypesRetrieveExecute(r ApiStagesAuthenticatorWebauthnDeviceTypesRetrieveRequest) (*WebAuthnDeviceType, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *WebAuthnDeviceType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnDeviceTypesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn_device_types/{aaguid}/" + localVarPath = strings.Replace(localVarPath, "{"+"aaguid"+"}", url.PathEscape(parameterValueToString(r.aaguid, "aaguid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnListRequest struct { + ctx context.Context + ApiService *StagesAPIService + authenticatorAttachment *string + configureFlow *string + deviceTypeRestrictions *[]string + maxAttempts *int32 + name *string + ordering *string + page *int32 + pageSize *int32 + residentKeyRequirement *string + search *string + userVerification *string +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) AuthenticatorAttachment(authenticatorAttachment string) ApiStagesAuthenticatorWebauthnListRequest { + r.authenticatorAttachment = &authenticatorAttachment + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) ConfigureFlow(configureFlow string) ApiStagesAuthenticatorWebauthnListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) DeviceTypeRestrictions(deviceTypeRestrictions []string) ApiStagesAuthenticatorWebauthnListRequest { + r.deviceTypeRestrictions = &deviceTypeRestrictions + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) MaxAttempts(maxAttempts int32) ApiStagesAuthenticatorWebauthnListRequest { + r.maxAttempts = &maxAttempts + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) Name(name string) ApiStagesAuthenticatorWebauthnListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesAuthenticatorWebauthnListRequest) Ordering(ordering string) ApiStagesAuthenticatorWebauthnListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesAuthenticatorWebauthnListRequest) Page(page int32) ApiStagesAuthenticatorWebauthnListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesAuthenticatorWebauthnListRequest) PageSize(pageSize int32) ApiStagesAuthenticatorWebauthnListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) ResidentKeyRequirement(residentKeyRequirement string) ApiStagesAuthenticatorWebauthnListRequest { + r.residentKeyRequirement = &residentKeyRequirement + return r +} + +// A search term. +func (r ApiStagesAuthenticatorWebauthnListRequest) Search(search string) ApiStagesAuthenticatorWebauthnListRequest { + r.search = &search + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) UserVerification(userVerification string) ApiStagesAuthenticatorWebauthnListRequest { + r.userVerification = &userVerification + return r +} + +func (r ApiStagesAuthenticatorWebauthnListRequest) Execute() (*PaginatedAuthenticatorWebAuthnStageList, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnListExecute(r) +} + +/* +StagesAuthenticatorWebauthnList Method for StagesAuthenticatorWebauthnList + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesAuthenticatorWebauthnListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnList(ctx context.Context) ApiStagesAuthenticatorWebauthnListRequest { + return ApiStagesAuthenticatorWebauthnListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedAuthenticatorWebAuthnStageList +func (a *StagesAPIService) StagesAuthenticatorWebauthnListExecute(r ApiStagesAuthenticatorWebauthnListRequest) (*PaginatedAuthenticatorWebAuthnStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedAuthenticatorWebAuthnStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.authenticatorAttachment != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "authenticator_attachment", r.authenticatorAttachment, "form", "") + } + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.deviceTypeRestrictions != nil { + t := *r.deviceTypeRestrictions + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_restrictions", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "device_type_restrictions", t, "form", "multi") + } + } + if r.maxAttempts != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "max_attempts", r.maxAttempts, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.residentKeyRequirement != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "resident_key_requirement", r.residentKeyRequirement, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.userVerification != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_verification", r.userVerification, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedAuthenticatorWebAuthnStageRequest *PatchedAuthenticatorWebAuthnStageRequest +} + +func (r ApiStagesAuthenticatorWebauthnPartialUpdateRequest) PatchedAuthenticatorWebAuthnStageRequest(patchedAuthenticatorWebAuthnStageRequest PatchedAuthenticatorWebAuthnStageRequest) ApiStagesAuthenticatorWebauthnPartialUpdateRequest { + r.patchedAuthenticatorWebAuthnStageRequest = &patchedAuthenticatorWebAuthnStageRequest + return r +} + +func (r ApiStagesAuthenticatorWebauthnPartialUpdateRequest) Execute() (*AuthenticatorWebAuthnStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnPartialUpdateExecute(r) +} + +/* +StagesAuthenticatorWebauthnPartialUpdate Method for StagesAuthenticatorWebauthnPartialUpdate + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this WebAuthn Authenticator Setup Stage. + @return ApiStagesAuthenticatorWebauthnPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnPartialUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorWebauthnPartialUpdateRequest { + return ApiStagesAuthenticatorWebauthnPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorWebAuthnStage +func (a *StagesAPIService) StagesAuthenticatorWebauthnPartialUpdateExecute(r ApiStagesAuthenticatorWebauthnPartialUpdateRequest) (*AuthenticatorWebAuthnStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorWebAuthnStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedAuthenticatorWebAuthnStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorWebauthnRetrieveRequest) Execute() (*AuthenticatorWebAuthnStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnRetrieveExecute(r) +} + +/* +StagesAuthenticatorWebauthnRetrieve Method for StagesAuthenticatorWebauthnRetrieve + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this WebAuthn Authenticator Setup Stage. + @return ApiStagesAuthenticatorWebauthnRetrieveRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnRetrieve(ctx context.Context, stageUuid string) ApiStagesAuthenticatorWebauthnRetrieveRequest { + return ApiStagesAuthenticatorWebauthnRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorWebAuthnStage +func (a *StagesAPIService) StagesAuthenticatorWebauthnRetrieveExecute(r ApiStagesAuthenticatorWebauthnRetrieveRequest) (*AuthenticatorWebAuthnStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorWebAuthnStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + authenticatorWebAuthnStageRequest *AuthenticatorWebAuthnStageRequest +} + +func (r ApiStagesAuthenticatorWebauthnUpdateRequest) AuthenticatorWebAuthnStageRequest(authenticatorWebAuthnStageRequest AuthenticatorWebAuthnStageRequest) ApiStagesAuthenticatorWebauthnUpdateRequest { + r.authenticatorWebAuthnStageRequest = &authenticatorWebAuthnStageRequest + return r +} + +func (r ApiStagesAuthenticatorWebauthnUpdateRequest) Execute() (*AuthenticatorWebAuthnStage, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnUpdateExecute(r) +} + +/* +StagesAuthenticatorWebauthnUpdate Method for StagesAuthenticatorWebauthnUpdate + +AuthenticatorWebAuthnStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this WebAuthn Authenticator Setup Stage. + @return ApiStagesAuthenticatorWebauthnUpdateRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnUpdate(ctx context.Context, stageUuid string) ApiStagesAuthenticatorWebauthnUpdateRequest { + return ApiStagesAuthenticatorWebauthnUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return AuthenticatorWebAuthnStage +func (a *StagesAPIService) StagesAuthenticatorWebauthnUpdateExecute(r ApiStagesAuthenticatorWebauthnUpdateRequest) (*AuthenticatorWebAuthnStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticatorWebAuthnStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.authenticatorWebAuthnStageRequest == nil { + return localVarReturnValue, nil, reportError("authenticatorWebAuthnStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.authenticatorWebAuthnStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesAuthenticatorWebauthnUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesAuthenticatorWebauthnUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesAuthenticatorWebauthnUsedByListExecute(r) +} + +/* +StagesAuthenticatorWebauthnUsedByList Method for StagesAuthenticatorWebauthnUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this WebAuthn Authenticator Setup Stage. + @return ApiStagesAuthenticatorWebauthnUsedByListRequest +*/ +func (a *StagesAPIService) StagesAuthenticatorWebauthnUsedByList(ctx context.Context, stageUuid string) ApiStagesAuthenticatorWebauthnUsedByListRequest { + return ApiStagesAuthenticatorWebauthnUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesAuthenticatorWebauthnUsedByListExecute(r ApiStagesAuthenticatorWebauthnUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesAuthenticatorWebauthnUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/authenticator/webauthn/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + captchaStageRequest *CaptchaStageRequest +} + +func (r ApiStagesCaptchaCreateRequest) CaptchaStageRequest(captchaStageRequest CaptchaStageRequest) ApiStagesCaptchaCreateRequest { + r.captchaStageRequest = &captchaStageRequest + return r +} + +func (r ApiStagesCaptchaCreateRequest) Execute() (*CaptchaStage, *http.Response, error) { + return r.ApiService.StagesCaptchaCreateExecute(r) +} + +/* +StagesCaptchaCreate Method for StagesCaptchaCreate + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesCaptchaCreateRequest +*/ +func (a *StagesAPIService) StagesCaptchaCreate(ctx context.Context) ApiStagesCaptchaCreateRequest { + return ApiStagesCaptchaCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CaptchaStage +func (a *StagesAPIService) StagesCaptchaCreateExecute(r ApiStagesCaptchaCreateRequest) (*CaptchaStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CaptchaStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.captchaStageRequest == nil { + return localVarReturnValue, nil, reportError("captchaStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.captchaStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesCaptchaDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesCaptchaDestroyExecute(r) +} + +/* +StagesCaptchaDestroy Method for StagesCaptchaDestroy + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Captcha Stage. + @return ApiStagesCaptchaDestroyRequest +*/ +func (a *StagesAPIService) StagesCaptchaDestroy(ctx context.Context, stageUuid string) ApiStagesCaptchaDestroyRequest { + return ApiStagesCaptchaDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesCaptchaDestroyExecute(r ApiStagesCaptchaDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesCaptchaListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + publicKey *string + search *string +} + +func (r ApiStagesCaptchaListRequest) Name(name string) ApiStagesCaptchaListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesCaptchaListRequest) Ordering(ordering string) ApiStagesCaptchaListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesCaptchaListRequest) Page(page int32) ApiStagesCaptchaListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesCaptchaListRequest) PageSize(pageSize int32) ApiStagesCaptchaListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesCaptchaListRequest) PublicKey(publicKey string) ApiStagesCaptchaListRequest { + r.publicKey = &publicKey + return r +} + +// A search term. +func (r ApiStagesCaptchaListRequest) Search(search string) ApiStagesCaptchaListRequest { + r.search = &search + return r +} + +func (r ApiStagesCaptchaListRequest) Execute() (*PaginatedCaptchaStageList, *http.Response, error) { + return r.ApiService.StagesCaptchaListExecute(r) +} + +/* +StagesCaptchaList Method for StagesCaptchaList + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesCaptchaListRequest +*/ +func (a *StagesAPIService) StagesCaptchaList(ctx context.Context) ApiStagesCaptchaListRequest { + return ApiStagesCaptchaListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedCaptchaStageList +func (a *StagesAPIService) StagesCaptchaListExecute(r ApiStagesCaptchaListRequest) (*PaginatedCaptchaStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedCaptchaStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.publicKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "public_key", r.publicKey, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedCaptchaStageRequest *PatchedCaptchaStageRequest +} + +func (r ApiStagesCaptchaPartialUpdateRequest) PatchedCaptchaStageRequest(patchedCaptchaStageRequest PatchedCaptchaStageRequest) ApiStagesCaptchaPartialUpdateRequest { + r.patchedCaptchaStageRequest = &patchedCaptchaStageRequest + return r +} + +func (r ApiStagesCaptchaPartialUpdateRequest) Execute() (*CaptchaStage, *http.Response, error) { + return r.ApiService.StagesCaptchaPartialUpdateExecute(r) +} + +/* +StagesCaptchaPartialUpdate Method for StagesCaptchaPartialUpdate + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Captcha Stage. + @return ApiStagesCaptchaPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesCaptchaPartialUpdate(ctx context.Context, stageUuid string) ApiStagesCaptchaPartialUpdateRequest { + return ApiStagesCaptchaPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return CaptchaStage +func (a *StagesAPIService) StagesCaptchaPartialUpdateExecute(r ApiStagesCaptchaPartialUpdateRequest) (*CaptchaStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CaptchaStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedCaptchaStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesCaptchaRetrieveRequest) Execute() (*CaptchaStage, *http.Response, error) { + return r.ApiService.StagesCaptchaRetrieveExecute(r) +} + +/* +StagesCaptchaRetrieve Method for StagesCaptchaRetrieve + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Captcha Stage. + @return ApiStagesCaptchaRetrieveRequest +*/ +func (a *StagesAPIService) StagesCaptchaRetrieve(ctx context.Context, stageUuid string) ApiStagesCaptchaRetrieveRequest { + return ApiStagesCaptchaRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return CaptchaStage +func (a *StagesAPIService) StagesCaptchaRetrieveExecute(r ApiStagesCaptchaRetrieveRequest) (*CaptchaStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CaptchaStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + captchaStageRequest *CaptchaStageRequest +} + +func (r ApiStagesCaptchaUpdateRequest) CaptchaStageRequest(captchaStageRequest CaptchaStageRequest) ApiStagesCaptchaUpdateRequest { + r.captchaStageRequest = &captchaStageRequest + return r +} + +func (r ApiStagesCaptchaUpdateRequest) Execute() (*CaptchaStage, *http.Response, error) { + return r.ApiService.StagesCaptchaUpdateExecute(r) +} + +/* +StagesCaptchaUpdate Method for StagesCaptchaUpdate + +CaptchaStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Captcha Stage. + @return ApiStagesCaptchaUpdateRequest +*/ +func (a *StagesAPIService) StagesCaptchaUpdate(ctx context.Context, stageUuid string) ApiStagesCaptchaUpdateRequest { + return ApiStagesCaptchaUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return CaptchaStage +func (a *StagesAPIService) StagesCaptchaUpdateExecute(r ApiStagesCaptchaUpdateRequest) (*CaptchaStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CaptchaStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.captchaStageRequest == nil { + return localVarReturnValue, nil, reportError("captchaStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.captchaStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesCaptchaUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesCaptchaUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesCaptchaUsedByListExecute(r) +} + +/* +StagesCaptchaUsedByList Method for StagesCaptchaUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Captcha Stage. + @return ApiStagesCaptchaUsedByListRequest +*/ +func (a *StagesAPIService) StagesCaptchaUsedByList(ctx context.Context, stageUuid string) ApiStagesCaptchaUsedByListRequest { + return ApiStagesCaptchaUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesCaptchaUsedByListExecute(r ApiStagesCaptchaUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesCaptchaUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/captcha/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + consentStageRequest *ConsentStageRequest +} + +func (r ApiStagesConsentCreateRequest) ConsentStageRequest(consentStageRequest ConsentStageRequest) ApiStagesConsentCreateRequest { + r.consentStageRequest = &consentStageRequest + return r +} + +func (r ApiStagesConsentCreateRequest) Execute() (*ConsentStage, *http.Response, error) { + return r.ApiService.StagesConsentCreateExecute(r) +} + +/* +StagesConsentCreate Method for StagesConsentCreate + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesConsentCreateRequest +*/ +func (a *StagesAPIService) StagesConsentCreate(ctx context.Context) ApiStagesConsentCreateRequest { + return ApiStagesConsentCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return ConsentStage +func (a *StagesAPIService) StagesConsentCreateExecute(r ApiStagesConsentCreateRequest) (*ConsentStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsentStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consentStageRequest == nil { + return localVarReturnValue, nil, reportError("consentStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consentStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesConsentDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesConsentDestroyExecute(r) +} + +/* +StagesConsentDestroy Method for StagesConsentDestroy + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Consent Stage. + @return ApiStagesConsentDestroyRequest +*/ +func (a *StagesAPIService) StagesConsentDestroy(ctx context.Context, stageUuid string) ApiStagesConsentDestroyRequest { + return ApiStagesConsentDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesConsentDestroyExecute(r ApiStagesConsentDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesConsentListRequest struct { + ctx context.Context + ApiService *StagesAPIService + consentExpireIn *string + mode *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesConsentListRequest) ConsentExpireIn(consentExpireIn string) ApiStagesConsentListRequest { + r.consentExpireIn = &consentExpireIn + return r +} + +func (r ApiStagesConsentListRequest) Mode(mode string) ApiStagesConsentListRequest { + r.mode = &mode + return r +} + +func (r ApiStagesConsentListRequest) Name(name string) ApiStagesConsentListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesConsentListRequest) Ordering(ordering string) ApiStagesConsentListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesConsentListRequest) Page(page int32) ApiStagesConsentListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesConsentListRequest) PageSize(pageSize int32) ApiStagesConsentListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesConsentListRequest) Search(search string) ApiStagesConsentListRequest { + r.search = &search + return r +} + +func (r ApiStagesConsentListRequest) StageUuid(stageUuid string) ApiStagesConsentListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesConsentListRequest) Execute() (*PaginatedConsentStageList, *http.Response, error) { + return r.ApiService.StagesConsentListExecute(r) +} + +/* +StagesConsentList Method for StagesConsentList + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesConsentListRequest +*/ +func (a *StagesAPIService) StagesConsentList(ctx context.Context) ApiStagesConsentListRequest { + return ApiStagesConsentListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedConsentStageList +func (a *StagesAPIService) StagesConsentListExecute(r ApiStagesConsentListRequest) (*PaginatedConsentStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedConsentStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.consentExpireIn != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "consent_expire_in", r.consentExpireIn, "form", "") + } + if r.mode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", r.mode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedConsentStageRequest *PatchedConsentStageRequest +} + +func (r ApiStagesConsentPartialUpdateRequest) PatchedConsentStageRequest(patchedConsentStageRequest PatchedConsentStageRequest) ApiStagesConsentPartialUpdateRequest { + r.patchedConsentStageRequest = &patchedConsentStageRequest + return r +} + +func (r ApiStagesConsentPartialUpdateRequest) Execute() (*ConsentStage, *http.Response, error) { + return r.ApiService.StagesConsentPartialUpdateExecute(r) +} + +/* +StagesConsentPartialUpdate Method for StagesConsentPartialUpdate + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Consent Stage. + @return ApiStagesConsentPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesConsentPartialUpdate(ctx context.Context, stageUuid string) ApiStagesConsentPartialUpdateRequest { + return ApiStagesConsentPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return ConsentStage +func (a *StagesAPIService) StagesConsentPartialUpdateExecute(r ApiStagesConsentPartialUpdateRequest) (*ConsentStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsentStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedConsentStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesConsentRetrieveRequest) Execute() (*ConsentStage, *http.Response, error) { + return r.ApiService.StagesConsentRetrieveExecute(r) +} + +/* +StagesConsentRetrieve Method for StagesConsentRetrieve + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Consent Stage. + @return ApiStagesConsentRetrieveRequest +*/ +func (a *StagesAPIService) StagesConsentRetrieve(ctx context.Context, stageUuid string) ApiStagesConsentRetrieveRequest { + return ApiStagesConsentRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return ConsentStage +func (a *StagesAPIService) StagesConsentRetrieveExecute(r ApiStagesConsentRetrieveRequest) (*ConsentStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsentStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + consentStageRequest *ConsentStageRequest +} + +func (r ApiStagesConsentUpdateRequest) ConsentStageRequest(consentStageRequest ConsentStageRequest) ApiStagesConsentUpdateRequest { + r.consentStageRequest = &consentStageRequest + return r +} + +func (r ApiStagesConsentUpdateRequest) Execute() (*ConsentStage, *http.Response, error) { + return r.ApiService.StagesConsentUpdateExecute(r) +} + +/* +StagesConsentUpdate Method for StagesConsentUpdate + +ConsentStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Consent Stage. + @return ApiStagesConsentUpdateRequest +*/ +func (a *StagesAPIService) StagesConsentUpdate(ctx context.Context, stageUuid string) ApiStagesConsentUpdateRequest { + return ApiStagesConsentUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return ConsentStage +func (a *StagesAPIService) StagesConsentUpdateExecute(r ApiStagesConsentUpdateRequest) (*ConsentStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ConsentStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.consentStageRequest == nil { + return localVarReturnValue, nil, reportError("consentStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.consentStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesConsentUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesConsentUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesConsentUsedByListExecute(r) +} + +/* +StagesConsentUsedByList Method for StagesConsentUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Consent Stage. + @return ApiStagesConsentUsedByListRequest +*/ +func (a *StagesAPIService) StagesConsentUsedByList(ctx context.Context, stageUuid string) ApiStagesConsentUsedByListRequest { + return ApiStagesConsentUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesConsentUsedByListExecute(r ApiStagesConsentUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesConsentUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/consent/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + denyStageRequest *DenyStageRequest +} + +func (r ApiStagesDenyCreateRequest) DenyStageRequest(denyStageRequest DenyStageRequest) ApiStagesDenyCreateRequest { + r.denyStageRequest = &denyStageRequest + return r +} + +func (r ApiStagesDenyCreateRequest) Execute() (*DenyStage, *http.Response, error) { + return r.ApiService.StagesDenyCreateExecute(r) +} + +/* +StagesDenyCreate Method for StagesDenyCreate + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesDenyCreateRequest +*/ +func (a *StagesAPIService) StagesDenyCreate(ctx context.Context) ApiStagesDenyCreateRequest { + return ApiStagesDenyCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DenyStage +func (a *StagesAPIService) StagesDenyCreateExecute(r ApiStagesDenyCreateRequest) (*DenyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DenyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.denyStageRequest == nil { + return localVarReturnValue, nil, reportError("denyStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.denyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDenyDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesDenyDestroyExecute(r) +} + +/* +StagesDenyDestroy Method for StagesDenyDestroy + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Deny Stage. + @return ApiStagesDenyDestroyRequest +*/ +func (a *StagesAPIService) StagesDenyDestroy(ctx context.Context, stageUuid string) ApiStagesDenyDestroyRequest { + return ApiStagesDenyDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesDenyDestroyExecute(r ApiStagesDenyDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesDenyListRequest struct { + ctx context.Context + ApiService *StagesAPIService + denyMessage *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesDenyListRequest) DenyMessage(denyMessage string) ApiStagesDenyListRequest { + r.denyMessage = &denyMessage + return r +} + +func (r ApiStagesDenyListRequest) Name(name string) ApiStagesDenyListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesDenyListRequest) Ordering(ordering string) ApiStagesDenyListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesDenyListRequest) Page(page int32) ApiStagesDenyListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesDenyListRequest) PageSize(pageSize int32) ApiStagesDenyListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesDenyListRequest) Search(search string) ApiStagesDenyListRequest { + r.search = &search + return r +} + +func (r ApiStagesDenyListRequest) StageUuid(stageUuid string) ApiStagesDenyListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesDenyListRequest) Execute() (*PaginatedDenyStageList, *http.Response, error) { + return r.ApiService.StagesDenyListExecute(r) +} + +/* +StagesDenyList Method for StagesDenyList + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesDenyListRequest +*/ +func (a *StagesAPIService) StagesDenyList(ctx context.Context) ApiStagesDenyListRequest { + return ApiStagesDenyListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDenyStageList +func (a *StagesAPIService) StagesDenyListExecute(r ApiStagesDenyListRequest) (*PaginatedDenyStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDenyStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.denyMessage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "deny_message", r.denyMessage, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedDenyStageRequest *PatchedDenyStageRequest +} + +func (r ApiStagesDenyPartialUpdateRequest) PatchedDenyStageRequest(patchedDenyStageRequest PatchedDenyStageRequest) ApiStagesDenyPartialUpdateRequest { + r.patchedDenyStageRequest = &patchedDenyStageRequest + return r +} + +func (r ApiStagesDenyPartialUpdateRequest) Execute() (*DenyStage, *http.Response, error) { + return r.ApiService.StagesDenyPartialUpdateExecute(r) +} + +/* +StagesDenyPartialUpdate Method for StagesDenyPartialUpdate + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Deny Stage. + @return ApiStagesDenyPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesDenyPartialUpdate(ctx context.Context, stageUuid string) ApiStagesDenyPartialUpdateRequest { + return ApiStagesDenyPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DenyStage +func (a *StagesAPIService) StagesDenyPartialUpdateExecute(r ApiStagesDenyPartialUpdateRequest) (*DenyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DenyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDenyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDenyRetrieveRequest) Execute() (*DenyStage, *http.Response, error) { + return r.ApiService.StagesDenyRetrieveExecute(r) +} + +/* +StagesDenyRetrieve Method for StagesDenyRetrieve + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Deny Stage. + @return ApiStagesDenyRetrieveRequest +*/ +func (a *StagesAPIService) StagesDenyRetrieve(ctx context.Context, stageUuid string) ApiStagesDenyRetrieveRequest { + return ApiStagesDenyRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DenyStage +func (a *StagesAPIService) StagesDenyRetrieveExecute(r ApiStagesDenyRetrieveRequest) (*DenyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DenyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + denyStageRequest *DenyStageRequest +} + +func (r ApiStagesDenyUpdateRequest) DenyStageRequest(denyStageRequest DenyStageRequest) ApiStagesDenyUpdateRequest { + r.denyStageRequest = &denyStageRequest + return r +} + +func (r ApiStagesDenyUpdateRequest) Execute() (*DenyStage, *http.Response, error) { + return r.ApiService.StagesDenyUpdateExecute(r) +} + +/* +StagesDenyUpdate Method for StagesDenyUpdate + +DenyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Deny Stage. + @return ApiStagesDenyUpdateRequest +*/ +func (a *StagesAPIService) StagesDenyUpdate(ctx context.Context, stageUuid string) ApiStagesDenyUpdateRequest { + return ApiStagesDenyUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DenyStage +func (a *StagesAPIService) StagesDenyUpdateExecute(r ApiStagesDenyUpdateRequest) (*DenyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DenyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.denyStageRequest == nil { + return localVarReturnValue, nil, reportError("denyStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.denyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDenyUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDenyUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesDenyUsedByListExecute(r) +} + +/* +StagesDenyUsedByList Method for StagesDenyUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Deny Stage. + @return ApiStagesDenyUsedByListRequest +*/ +func (a *StagesAPIService) StagesDenyUsedByList(ctx context.Context, stageUuid string) ApiStagesDenyUsedByListRequest { + return ApiStagesDenyUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesDenyUsedByListExecute(r ApiStagesDenyUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDenyUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/deny/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + dummyStageRequest *DummyStageRequest +} + +func (r ApiStagesDummyCreateRequest) DummyStageRequest(dummyStageRequest DummyStageRequest) ApiStagesDummyCreateRequest { + r.dummyStageRequest = &dummyStageRequest + return r +} + +func (r ApiStagesDummyCreateRequest) Execute() (*DummyStage, *http.Response, error) { + return r.ApiService.StagesDummyCreateExecute(r) +} + +/* +StagesDummyCreate Method for StagesDummyCreate + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesDummyCreateRequest +*/ +func (a *StagesAPIService) StagesDummyCreate(ctx context.Context) ApiStagesDummyCreateRequest { + return ApiStagesDummyCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DummyStage +func (a *StagesAPIService) StagesDummyCreateExecute(r ApiStagesDummyCreateRequest) (*DummyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dummyStageRequest == nil { + return localVarReturnValue, nil, reportError("dummyStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dummyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDummyDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesDummyDestroyExecute(r) +} + +/* +StagesDummyDestroy Method for StagesDummyDestroy + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Dummy Stage. + @return ApiStagesDummyDestroyRequest +*/ +func (a *StagesAPIService) StagesDummyDestroy(ctx context.Context, stageUuid string) ApiStagesDummyDestroyRequest { + return ApiStagesDummyDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesDummyDestroyExecute(r ApiStagesDummyDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesDummyListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string + throwError *bool +} + +func (r ApiStagesDummyListRequest) Name(name string) ApiStagesDummyListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesDummyListRequest) Ordering(ordering string) ApiStagesDummyListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesDummyListRequest) Page(page int32) ApiStagesDummyListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesDummyListRequest) PageSize(pageSize int32) ApiStagesDummyListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesDummyListRequest) Search(search string) ApiStagesDummyListRequest { + r.search = &search + return r +} + +func (r ApiStagesDummyListRequest) StageUuid(stageUuid string) ApiStagesDummyListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesDummyListRequest) ThrowError(throwError bool) ApiStagesDummyListRequest { + r.throwError = &throwError + return r +} + +func (r ApiStagesDummyListRequest) Execute() (*PaginatedDummyStageList, *http.Response, error) { + return r.ApiService.StagesDummyListExecute(r) +} + +/* +StagesDummyList Method for StagesDummyList + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesDummyListRequest +*/ +func (a *StagesAPIService) StagesDummyList(ctx context.Context) ApiStagesDummyListRequest { + return ApiStagesDummyListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDummyStageList +func (a *StagesAPIService) StagesDummyListExecute(r ApiStagesDummyListRequest) (*PaginatedDummyStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDummyStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.throwError != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "throw_error", r.throwError, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedDummyStageRequest *PatchedDummyStageRequest +} + +func (r ApiStagesDummyPartialUpdateRequest) PatchedDummyStageRequest(patchedDummyStageRequest PatchedDummyStageRequest) ApiStagesDummyPartialUpdateRequest { + r.patchedDummyStageRequest = &patchedDummyStageRequest + return r +} + +func (r ApiStagesDummyPartialUpdateRequest) Execute() (*DummyStage, *http.Response, error) { + return r.ApiService.StagesDummyPartialUpdateExecute(r) +} + +/* +StagesDummyPartialUpdate Method for StagesDummyPartialUpdate + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Dummy Stage. + @return ApiStagesDummyPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesDummyPartialUpdate(ctx context.Context, stageUuid string) ApiStagesDummyPartialUpdateRequest { + return ApiStagesDummyPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DummyStage +func (a *StagesAPIService) StagesDummyPartialUpdateExecute(r ApiStagesDummyPartialUpdateRequest) (*DummyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDummyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDummyRetrieveRequest) Execute() (*DummyStage, *http.Response, error) { + return r.ApiService.StagesDummyRetrieveExecute(r) +} + +/* +StagesDummyRetrieve Method for StagesDummyRetrieve + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Dummy Stage. + @return ApiStagesDummyRetrieveRequest +*/ +func (a *StagesAPIService) StagesDummyRetrieve(ctx context.Context, stageUuid string) ApiStagesDummyRetrieveRequest { + return ApiStagesDummyRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DummyStage +func (a *StagesAPIService) StagesDummyRetrieveExecute(r ApiStagesDummyRetrieveRequest) (*DummyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + dummyStageRequest *DummyStageRequest +} + +func (r ApiStagesDummyUpdateRequest) DummyStageRequest(dummyStageRequest DummyStageRequest) ApiStagesDummyUpdateRequest { + r.dummyStageRequest = &dummyStageRequest + return r +} + +func (r ApiStagesDummyUpdateRequest) Execute() (*DummyStage, *http.Response, error) { + return r.ApiService.StagesDummyUpdateExecute(r) +} + +/* +StagesDummyUpdate Method for StagesDummyUpdate + +DummyStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Dummy Stage. + @return ApiStagesDummyUpdateRequest +*/ +func (a *StagesAPIService) StagesDummyUpdate(ctx context.Context, stageUuid string) ApiStagesDummyUpdateRequest { + return ApiStagesDummyUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return DummyStage +func (a *StagesAPIService) StagesDummyUpdateExecute(r ApiStagesDummyUpdateRequest) (*DummyStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DummyStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.dummyStageRequest == nil { + return localVarReturnValue, nil, reportError("dummyStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.dummyStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesDummyUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesDummyUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesDummyUsedByListExecute(r) +} + +/* +StagesDummyUsedByList Method for StagesDummyUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Dummy Stage. + @return ApiStagesDummyUsedByListRequest +*/ +func (a *StagesAPIService) StagesDummyUsedByList(ctx context.Context, stageUuid string) ApiStagesDummyUsedByListRequest { + return ApiStagesDummyUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesDummyUsedByListExecute(r ApiStagesDummyUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesDummyUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/dummy/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + emailStageRequest *EmailStageRequest +} + +func (r ApiStagesEmailCreateRequest) EmailStageRequest(emailStageRequest EmailStageRequest) ApiStagesEmailCreateRequest { + r.emailStageRequest = &emailStageRequest + return r +} + +func (r ApiStagesEmailCreateRequest) Execute() (*EmailStage, *http.Response, error) { + return r.ApiService.StagesEmailCreateExecute(r) +} + +/* +StagesEmailCreate Method for StagesEmailCreate + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesEmailCreateRequest +*/ +func (a *StagesAPIService) StagesEmailCreate(ctx context.Context) ApiStagesEmailCreateRequest { + return ApiStagesEmailCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EmailStage +func (a *StagesAPIService) StagesEmailCreateExecute(r ApiStagesEmailCreateRequest) (*EmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.emailStageRequest == nil { + return localVarReturnValue, nil, reportError("emailStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.emailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEmailDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesEmailDestroyExecute(r) +} + +/* +StagesEmailDestroy Method for StagesEmailDestroy + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Stage. + @return ApiStagesEmailDestroyRequest +*/ +func (a *StagesAPIService) StagesEmailDestroy(ctx context.Context, stageUuid string) ApiStagesEmailDestroyRequest { + return ApiStagesEmailDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesEmailDestroyExecute(r ApiStagesEmailDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesEmailListRequest struct { + ctx context.Context + ApiService *StagesAPIService + activateUserOnSuccess *bool + fromAddress *string + host *string + name *string + ordering *string + page *int32 + pageSize *int32 + port *int32 + search *string + subject *string + template *string + timeout *int32 + tokenExpiry *string + useGlobalSettings *bool + useSsl *bool + useTls *bool + username *string +} + +func (r ApiStagesEmailListRequest) ActivateUserOnSuccess(activateUserOnSuccess bool) ApiStagesEmailListRequest { + r.activateUserOnSuccess = &activateUserOnSuccess + return r +} + +func (r ApiStagesEmailListRequest) FromAddress(fromAddress string) ApiStagesEmailListRequest { + r.fromAddress = &fromAddress + return r +} + +func (r ApiStagesEmailListRequest) Host(host string) ApiStagesEmailListRequest { + r.host = &host + return r +} + +func (r ApiStagesEmailListRequest) Name(name string) ApiStagesEmailListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesEmailListRequest) Ordering(ordering string) ApiStagesEmailListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesEmailListRequest) Page(page int32) ApiStagesEmailListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesEmailListRequest) PageSize(pageSize int32) ApiStagesEmailListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesEmailListRequest) Port(port int32) ApiStagesEmailListRequest { + r.port = &port + return r +} + +// A search term. +func (r ApiStagesEmailListRequest) Search(search string) ApiStagesEmailListRequest { + r.search = &search + return r +} + +func (r ApiStagesEmailListRequest) Subject(subject string) ApiStagesEmailListRequest { + r.subject = &subject + return r +} + +func (r ApiStagesEmailListRequest) Template(template string) ApiStagesEmailListRequest { + r.template = &template + return r +} + +func (r ApiStagesEmailListRequest) Timeout(timeout int32) ApiStagesEmailListRequest { + r.timeout = &timeout + return r +} + +func (r ApiStagesEmailListRequest) TokenExpiry(tokenExpiry string) ApiStagesEmailListRequest { + r.tokenExpiry = &tokenExpiry + return r +} + +func (r ApiStagesEmailListRequest) UseGlobalSettings(useGlobalSettings bool) ApiStagesEmailListRequest { + r.useGlobalSettings = &useGlobalSettings + return r +} + +func (r ApiStagesEmailListRequest) UseSsl(useSsl bool) ApiStagesEmailListRequest { + r.useSsl = &useSsl + return r +} + +func (r ApiStagesEmailListRequest) UseTls(useTls bool) ApiStagesEmailListRequest { + r.useTls = &useTls + return r +} + +func (r ApiStagesEmailListRequest) Username(username string) ApiStagesEmailListRequest { + r.username = &username + return r +} + +func (r ApiStagesEmailListRequest) Execute() (*PaginatedEmailStageList, *http.Response, error) { + return r.ApiService.StagesEmailListExecute(r) +} + +/* +StagesEmailList Method for StagesEmailList + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesEmailListRequest +*/ +func (a *StagesAPIService) StagesEmailList(ctx context.Context) ApiStagesEmailListRequest { + return ApiStagesEmailListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEmailStageList +func (a *StagesAPIService) StagesEmailListExecute(r ApiStagesEmailListRequest) (*PaginatedEmailStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEmailStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.activateUserOnSuccess != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "activate_user_on_success", r.activateUserOnSuccess, "form", "") + } + if r.fromAddress != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from_address", r.fromAddress, "form", "") + } + if r.host != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "host", r.host, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.port != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.subject != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "subject", r.subject, "form", "") + } + if r.template != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "template", r.template, "form", "") + } + if r.timeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "timeout", r.timeout, "form", "") + } + if r.tokenExpiry != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "token_expiry", r.tokenExpiry, "form", "") + } + if r.useGlobalSettings != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_global_settings", r.useGlobalSettings, "form", "") + } + if r.useSsl != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_ssl", r.useSsl, "form", "") + } + if r.useTls != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "use_tls", r.useTls, "form", "") + } + if r.username != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "username", r.username, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedEmailStageRequest *PatchedEmailStageRequest +} + +func (r ApiStagesEmailPartialUpdateRequest) PatchedEmailStageRequest(patchedEmailStageRequest PatchedEmailStageRequest) ApiStagesEmailPartialUpdateRequest { + r.patchedEmailStageRequest = &patchedEmailStageRequest + return r +} + +func (r ApiStagesEmailPartialUpdateRequest) Execute() (*EmailStage, *http.Response, error) { + return r.ApiService.StagesEmailPartialUpdateExecute(r) +} + +/* +StagesEmailPartialUpdate Method for StagesEmailPartialUpdate + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Stage. + @return ApiStagesEmailPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesEmailPartialUpdate(ctx context.Context, stageUuid string) ApiStagesEmailPartialUpdateRequest { + return ApiStagesEmailPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EmailStage +func (a *StagesAPIService) StagesEmailPartialUpdateExecute(r ApiStagesEmailPartialUpdateRequest) (*EmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEmailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEmailRetrieveRequest) Execute() (*EmailStage, *http.Response, error) { + return r.ApiService.StagesEmailRetrieveExecute(r) +} + +/* +StagesEmailRetrieve Method for StagesEmailRetrieve + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Stage. + @return ApiStagesEmailRetrieveRequest +*/ +func (a *StagesAPIService) StagesEmailRetrieve(ctx context.Context, stageUuid string) ApiStagesEmailRetrieveRequest { + return ApiStagesEmailRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EmailStage +func (a *StagesAPIService) StagesEmailRetrieveExecute(r ApiStagesEmailRetrieveRequest) (*EmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailTemplatesListRequest struct { + ctx context.Context + ApiService *StagesAPIService +} + +func (r ApiStagesEmailTemplatesListRequest) Execute() ([]TypeCreate, *http.Response, error) { + return r.ApiService.StagesEmailTemplatesListExecute(r) +} + +/* +StagesEmailTemplatesList Method for StagesEmailTemplatesList + +Get all available templates, including custom templates + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesEmailTemplatesListRequest +*/ +func (a *StagesAPIService) StagesEmailTemplatesList(ctx context.Context) ApiStagesEmailTemplatesListRequest { + return ApiStagesEmailTemplatesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []TypeCreate +func (a *StagesAPIService) StagesEmailTemplatesListExecute(r ApiStagesEmailTemplatesListRequest) ([]TypeCreate, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []TypeCreate + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailTemplatesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/templates/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + emailStageRequest *EmailStageRequest +} + +func (r ApiStagesEmailUpdateRequest) EmailStageRequest(emailStageRequest EmailStageRequest) ApiStagesEmailUpdateRequest { + r.emailStageRequest = &emailStageRequest + return r +} + +func (r ApiStagesEmailUpdateRequest) Execute() (*EmailStage, *http.Response, error) { + return r.ApiService.StagesEmailUpdateExecute(r) +} + +/* +StagesEmailUpdate Method for StagesEmailUpdate + +EmailStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Stage. + @return ApiStagesEmailUpdateRequest +*/ +func (a *StagesAPIService) StagesEmailUpdate(ctx context.Context, stageUuid string) ApiStagesEmailUpdateRequest { + return ApiStagesEmailUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EmailStage +func (a *StagesAPIService) StagesEmailUpdateExecute(r ApiStagesEmailUpdateRequest) (*EmailStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EmailStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.emailStageRequest == nil { + return localVarReturnValue, nil, reportError("emailStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.emailStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEmailUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEmailUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesEmailUsedByListExecute(r) +} + +/* +StagesEmailUsedByList Method for StagesEmailUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Email Stage. + @return ApiStagesEmailUsedByListRequest +*/ +func (a *StagesAPIService) StagesEmailUsedByList(ctx context.Context, stageUuid string) ApiStagesEmailUsedByListRequest { + return ApiStagesEmailUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesEmailUsedByListExecute(r ApiStagesEmailUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEmailUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/email/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + endpointStageRequest *EndpointStageRequest +} + +func (r ApiStagesEndpointsCreateRequest) EndpointStageRequest(endpointStageRequest EndpointStageRequest) ApiStagesEndpointsCreateRequest { + r.endpointStageRequest = &endpointStageRequest + return r +} + +func (r ApiStagesEndpointsCreateRequest) Execute() (*EndpointStage, *http.Response, error) { + return r.ApiService.StagesEndpointsCreateExecute(r) +} + +/* +StagesEndpointsCreate Method for StagesEndpointsCreate + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesEndpointsCreateRequest +*/ +func (a *StagesAPIService) StagesEndpointsCreate(ctx context.Context) ApiStagesEndpointsCreateRequest { + return ApiStagesEndpointsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return EndpointStage +func (a *StagesAPIService) StagesEndpointsCreateExecute(r ApiStagesEndpointsCreateRequest) (*EndpointStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.endpointStageRequest == nil { + return localVarReturnValue, nil, reportError("endpointStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.endpointStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEndpointsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesEndpointsDestroyExecute(r) +} + +/* +StagesEndpointsDestroy Method for StagesEndpointsDestroy + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Stage. + @return ApiStagesEndpointsDestroyRequest +*/ +func (a *StagesAPIService) StagesEndpointsDestroy(ctx context.Context, stageUuid string) ApiStagesEndpointsDestroyRequest { + return ApiStagesEndpointsDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesEndpointsDestroyExecute(r ApiStagesEndpointsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesEndpointsListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesEndpointsListRequest) Name(name string) ApiStagesEndpointsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesEndpointsListRequest) Ordering(ordering string) ApiStagesEndpointsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesEndpointsListRequest) Page(page int32) ApiStagesEndpointsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesEndpointsListRequest) PageSize(pageSize int32) ApiStagesEndpointsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesEndpointsListRequest) Search(search string) ApiStagesEndpointsListRequest { + r.search = &search + return r +} + +func (r ApiStagesEndpointsListRequest) Execute() (*PaginatedEndpointStageList, *http.Response, error) { + return r.ApiService.StagesEndpointsListExecute(r) +} + +/* +StagesEndpointsList Method for StagesEndpointsList + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesEndpointsListRequest +*/ +func (a *StagesAPIService) StagesEndpointsList(ctx context.Context) ApiStagesEndpointsListRequest { + return ApiStagesEndpointsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedEndpointStageList +func (a *StagesAPIService) StagesEndpointsListExecute(r ApiStagesEndpointsListRequest) (*PaginatedEndpointStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedEndpointStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedEndpointStageRequest *PatchedEndpointStageRequest +} + +func (r ApiStagesEndpointsPartialUpdateRequest) PatchedEndpointStageRequest(patchedEndpointStageRequest PatchedEndpointStageRequest) ApiStagesEndpointsPartialUpdateRequest { + r.patchedEndpointStageRequest = &patchedEndpointStageRequest + return r +} + +func (r ApiStagesEndpointsPartialUpdateRequest) Execute() (*EndpointStage, *http.Response, error) { + return r.ApiService.StagesEndpointsPartialUpdateExecute(r) +} + +/* +StagesEndpointsPartialUpdate Method for StagesEndpointsPartialUpdate + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Stage. + @return ApiStagesEndpointsPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesEndpointsPartialUpdate(ctx context.Context, stageUuid string) ApiStagesEndpointsPartialUpdateRequest { + return ApiStagesEndpointsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EndpointStage +func (a *StagesAPIService) StagesEndpointsPartialUpdateExecute(r ApiStagesEndpointsPartialUpdateRequest) (*EndpointStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedEndpointStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEndpointsRetrieveRequest) Execute() (*EndpointStage, *http.Response, error) { + return r.ApiService.StagesEndpointsRetrieveExecute(r) +} + +/* +StagesEndpointsRetrieve Method for StagesEndpointsRetrieve + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Stage. + @return ApiStagesEndpointsRetrieveRequest +*/ +func (a *StagesAPIService) StagesEndpointsRetrieve(ctx context.Context, stageUuid string) ApiStagesEndpointsRetrieveRequest { + return ApiStagesEndpointsRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EndpointStage +func (a *StagesAPIService) StagesEndpointsRetrieveExecute(r ApiStagesEndpointsRetrieveRequest) (*EndpointStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + endpointStageRequest *EndpointStageRequest +} + +func (r ApiStagesEndpointsUpdateRequest) EndpointStageRequest(endpointStageRequest EndpointStageRequest) ApiStagesEndpointsUpdateRequest { + r.endpointStageRequest = &endpointStageRequest + return r +} + +func (r ApiStagesEndpointsUpdateRequest) Execute() (*EndpointStage, *http.Response, error) { + return r.ApiService.StagesEndpointsUpdateExecute(r) +} + +/* +StagesEndpointsUpdate Method for StagesEndpointsUpdate + +EndpointStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Stage. + @return ApiStagesEndpointsUpdateRequest +*/ +func (a *StagesAPIService) StagesEndpointsUpdate(ctx context.Context, stageUuid string) ApiStagesEndpointsUpdateRequest { + return ApiStagesEndpointsUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return EndpointStage +func (a *StagesAPIService) StagesEndpointsUpdateExecute(r ApiStagesEndpointsUpdateRequest) (*EndpointStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *EndpointStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.endpointStageRequest == nil { + return localVarReturnValue, nil, reportError("endpointStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.endpointStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesEndpointsUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesEndpointsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesEndpointsUsedByListExecute(r) +} + +/* +StagesEndpointsUsedByList Method for StagesEndpointsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Endpoint Stage. + @return ApiStagesEndpointsUsedByListRequest +*/ +func (a *StagesAPIService) StagesEndpointsUsedByList(ctx context.Context, stageUuid string) ApiStagesEndpointsUsedByListRequest { + return ApiStagesEndpointsUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesEndpointsUsedByListExecute(r ApiStagesEndpointsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesEndpointsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/endpoints/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + identificationStageRequest *IdentificationStageRequest +} + +func (r ApiStagesIdentificationCreateRequest) IdentificationStageRequest(identificationStageRequest IdentificationStageRequest) ApiStagesIdentificationCreateRequest { + r.identificationStageRequest = &identificationStageRequest + return r +} + +func (r ApiStagesIdentificationCreateRequest) Execute() (*IdentificationStage, *http.Response, error) { + return r.ApiService.StagesIdentificationCreateExecute(r) +} + +/* +StagesIdentificationCreate Method for StagesIdentificationCreate + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesIdentificationCreateRequest +*/ +func (a *StagesAPIService) StagesIdentificationCreate(ctx context.Context) ApiStagesIdentificationCreateRequest { + return ApiStagesIdentificationCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return IdentificationStage +func (a *StagesAPIService) StagesIdentificationCreateExecute(r ApiStagesIdentificationCreateRequest) (*IdentificationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IdentificationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.identificationStageRequest == nil { + return localVarReturnValue, nil, reportError("identificationStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.identificationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesIdentificationDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesIdentificationDestroyExecute(r) +} + +/* +StagesIdentificationDestroy Method for StagesIdentificationDestroy + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Identification Stage. + @return ApiStagesIdentificationDestroyRequest +*/ +func (a *StagesAPIService) StagesIdentificationDestroy(ctx context.Context, stageUuid string) ApiStagesIdentificationDestroyRequest { + return ApiStagesIdentificationDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesIdentificationDestroyExecute(r ApiStagesIdentificationDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesIdentificationListRequest struct { + ctx context.Context + ApiService *StagesAPIService + captchaStage *string + caseInsensitiveMatching *bool + enrollmentFlow *string + name *string + ordering *string + page *int32 + pageSize *int32 + passwordStage *string + passwordlessFlow *string + recoveryFlow *string + search *string + showMatchedUser *bool + showSourceLabels *bool + webauthnStage *string +} + +func (r ApiStagesIdentificationListRequest) CaptchaStage(captchaStage string) ApiStagesIdentificationListRequest { + r.captchaStage = &captchaStage + return r +} + +func (r ApiStagesIdentificationListRequest) CaseInsensitiveMatching(caseInsensitiveMatching bool) ApiStagesIdentificationListRequest { + r.caseInsensitiveMatching = &caseInsensitiveMatching + return r +} + +func (r ApiStagesIdentificationListRequest) EnrollmentFlow(enrollmentFlow string) ApiStagesIdentificationListRequest { + r.enrollmentFlow = &enrollmentFlow + return r +} + +func (r ApiStagesIdentificationListRequest) Name(name string) ApiStagesIdentificationListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesIdentificationListRequest) Ordering(ordering string) ApiStagesIdentificationListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesIdentificationListRequest) Page(page int32) ApiStagesIdentificationListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesIdentificationListRequest) PageSize(pageSize int32) ApiStagesIdentificationListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesIdentificationListRequest) PasswordStage(passwordStage string) ApiStagesIdentificationListRequest { + r.passwordStage = &passwordStage + return r +} + +func (r ApiStagesIdentificationListRequest) PasswordlessFlow(passwordlessFlow string) ApiStagesIdentificationListRequest { + r.passwordlessFlow = &passwordlessFlow + return r +} + +func (r ApiStagesIdentificationListRequest) RecoveryFlow(recoveryFlow string) ApiStagesIdentificationListRequest { + r.recoveryFlow = &recoveryFlow + return r +} + +// A search term. +func (r ApiStagesIdentificationListRequest) Search(search string) ApiStagesIdentificationListRequest { + r.search = &search + return r +} + +func (r ApiStagesIdentificationListRequest) ShowMatchedUser(showMatchedUser bool) ApiStagesIdentificationListRequest { + r.showMatchedUser = &showMatchedUser + return r +} + +func (r ApiStagesIdentificationListRequest) ShowSourceLabels(showSourceLabels bool) ApiStagesIdentificationListRequest { + r.showSourceLabels = &showSourceLabels + return r +} + +func (r ApiStagesIdentificationListRequest) WebauthnStage(webauthnStage string) ApiStagesIdentificationListRequest { + r.webauthnStage = &webauthnStage + return r +} + +func (r ApiStagesIdentificationListRequest) Execute() (*PaginatedIdentificationStageList, *http.Response, error) { + return r.ApiService.StagesIdentificationListExecute(r) +} + +/* +StagesIdentificationList Method for StagesIdentificationList + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesIdentificationListRequest +*/ +func (a *StagesAPIService) StagesIdentificationList(ctx context.Context) ApiStagesIdentificationListRequest { + return ApiStagesIdentificationListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedIdentificationStageList +func (a *StagesAPIService) StagesIdentificationListExecute(r ApiStagesIdentificationListRequest) (*PaginatedIdentificationStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedIdentificationStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.captchaStage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "captcha_stage", r.captchaStage, "form", "") + } + if r.caseInsensitiveMatching != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "case_insensitive_matching", r.caseInsensitiveMatching, "form", "") + } + if r.enrollmentFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "enrollment_flow", r.enrollmentFlow, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.passwordStage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "password_stage", r.passwordStage, "form", "") + } + if r.passwordlessFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "passwordless_flow", r.passwordlessFlow, "form", "") + } + if r.recoveryFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "recovery_flow", r.recoveryFlow, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.showMatchedUser != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "show_matched_user", r.showMatchedUser, "form", "") + } + if r.showSourceLabels != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "show_source_labels", r.showSourceLabels, "form", "") + } + if r.webauthnStage != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "webauthn_stage", r.webauthnStage, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedIdentificationStageRequest *PatchedIdentificationStageRequest +} + +func (r ApiStagesIdentificationPartialUpdateRequest) PatchedIdentificationStageRequest(patchedIdentificationStageRequest PatchedIdentificationStageRequest) ApiStagesIdentificationPartialUpdateRequest { + r.patchedIdentificationStageRequest = &patchedIdentificationStageRequest + return r +} + +func (r ApiStagesIdentificationPartialUpdateRequest) Execute() (*IdentificationStage, *http.Response, error) { + return r.ApiService.StagesIdentificationPartialUpdateExecute(r) +} + +/* +StagesIdentificationPartialUpdate Method for StagesIdentificationPartialUpdate + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Identification Stage. + @return ApiStagesIdentificationPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesIdentificationPartialUpdate(ctx context.Context, stageUuid string) ApiStagesIdentificationPartialUpdateRequest { + return ApiStagesIdentificationPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return IdentificationStage +func (a *StagesAPIService) StagesIdentificationPartialUpdateExecute(r ApiStagesIdentificationPartialUpdateRequest) (*IdentificationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IdentificationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedIdentificationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesIdentificationRetrieveRequest) Execute() (*IdentificationStage, *http.Response, error) { + return r.ApiService.StagesIdentificationRetrieveExecute(r) +} + +/* +StagesIdentificationRetrieve Method for StagesIdentificationRetrieve + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Identification Stage. + @return ApiStagesIdentificationRetrieveRequest +*/ +func (a *StagesAPIService) StagesIdentificationRetrieve(ctx context.Context, stageUuid string) ApiStagesIdentificationRetrieveRequest { + return ApiStagesIdentificationRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return IdentificationStage +func (a *StagesAPIService) StagesIdentificationRetrieveExecute(r ApiStagesIdentificationRetrieveRequest) (*IdentificationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IdentificationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + identificationStageRequest *IdentificationStageRequest +} + +func (r ApiStagesIdentificationUpdateRequest) IdentificationStageRequest(identificationStageRequest IdentificationStageRequest) ApiStagesIdentificationUpdateRequest { + r.identificationStageRequest = &identificationStageRequest + return r +} + +func (r ApiStagesIdentificationUpdateRequest) Execute() (*IdentificationStage, *http.Response, error) { + return r.ApiService.StagesIdentificationUpdateExecute(r) +} + +/* +StagesIdentificationUpdate Method for StagesIdentificationUpdate + +IdentificationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Identification Stage. + @return ApiStagesIdentificationUpdateRequest +*/ +func (a *StagesAPIService) StagesIdentificationUpdate(ctx context.Context, stageUuid string) ApiStagesIdentificationUpdateRequest { + return ApiStagesIdentificationUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return IdentificationStage +func (a *StagesAPIService) StagesIdentificationUpdateExecute(r ApiStagesIdentificationUpdateRequest) (*IdentificationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *IdentificationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.identificationStageRequest == nil { + return localVarReturnValue, nil, reportError("identificationStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.identificationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesIdentificationUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesIdentificationUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesIdentificationUsedByListExecute(r) +} + +/* +StagesIdentificationUsedByList Method for StagesIdentificationUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Identification Stage. + @return ApiStagesIdentificationUsedByListRequest +*/ +func (a *StagesAPIService) StagesIdentificationUsedByList(ctx context.Context, stageUuid string) ApiStagesIdentificationUsedByListRequest { + return ApiStagesIdentificationUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesIdentificationUsedByListExecute(r ApiStagesIdentificationUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesIdentificationUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/identification/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + invitationRequest *InvitationRequest +} + +func (r ApiStagesInvitationInvitationsCreateRequest) InvitationRequest(invitationRequest InvitationRequest) ApiStagesInvitationInvitationsCreateRequest { + r.invitationRequest = &invitationRequest + return r +} + +func (r ApiStagesInvitationInvitationsCreateRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsCreateExecute(r) +} + +/* +StagesInvitationInvitationsCreate Method for StagesInvitationInvitationsCreate + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesInvitationInvitationsCreateRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsCreate(ctx context.Context) ApiStagesInvitationInvitationsCreateRequest { + return ApiStagesInvitationInvitationsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *StagesAPIService) StagesInvitationInvitationsCreateExecute(r ApiStagesInvitationInvitationsCreateRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationRequest == nil { + return localVarReturnValue, nil, reportError("invitationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string +} + +func (r ApiStagesInvitationInvitationsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesInvitationInvitationsDestroyExecute(r) +} + +/* +StagesInvitationInvitationsDestroy Method for StagesInvitationInvitationsDestroy + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsDestroyRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsDestroy(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsDestroyRequest { + return ApiStagesInvitationInvitationsDestroyRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesInvitationInvitationsDestroyExecute(r ApiStagesInvitationInvitationsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsListRequest struct { + ctx context.Context + ApiService *StagesAPIService + createdByUsername *string + expires *time.Time + flowSlug *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesInvitationInvitationsListRequest) CreatedByUsername(createdByUsername string) ApiStagesInvitationInvitationsListRequest { + r.createdByUsername = &createdByUsername + return r +} + +func (r ApiStagesInvitationInvitationsListRequest) Expires(expires time.Time) ApiStagesInvitationInvitationsListRequest { + r.expires = &expires + return r +} + +func (r ApiStagesInvitationInvitationsListRequest) FlowSlug(flowSlug string) ApiStagesInvitationInvitationsListRequest { + r.flowSlug = &flowSlug + return r +} + +func (r ApiStagesInvitationInvitationsListRequest) Name(name string) ApiStagesInvitationInvitationsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesInvitationInvitationsListRequest) Ordering(ordering string) ApiStagesInvitationInvitationsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesInvitationInvitationsListRequest) Page(page int32) ApiStagesInvitationInvitationsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesInvitationInvitationsListRequest) PageSize(pageSize int32) ApiStagesInvitationInvitationsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesInvitationInvitationsListRequest) Search(search string) ApiStagesInvitationInvitationsListRequest { + r.search = &search + return r +} + +func (r ApiStagesInvitationInvitationsListRequest) Execute() (*PaginatedInvitationList, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsListExecute(r) +} + +/* +StagesInvitationInvitationsList Method for StagesInvitationInvitationsList + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesInvitationInvitationsListRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsList(ctx context.Context) ApiStagesInvitationInvitationsListRequest { + return ApiStagesInvitationInvitationsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInvitationList +func (a *StagesAPIService) StagesInvitationInvitationsListExecute(r ApiStagesInvitationInvitationsListRequest) (*PaginatedInvitationList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInvitationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.createdByUsername != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "created_by__username", r.createdByUsername, "form", "") + } + if r.expires != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "expires", r.expires, "form", "") + } + if r.flowSlug != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "flow__slug", r.flowSlug, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string + patchedInvitationRequest *PatchedInvitationRequest +} + +func (r ApiStagesInvitationInvitationsPartialUpdateRequest) PatchedInvitationRequest(patchedInvitationRequest PatchedInvitationRequest) ApiStagesInvitationInvitationsPartialUpdateRequest { + r.patchedInvitationRequest = &patchedInvitationRequest + return r +} + +func (r ApiStagesInvitationInvitationsPartialUpdateRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsPartialUpdateExecute(r) +} + +/* +StagesInvitationInvitationsPartialUpdate Method for StagesInvitationInvitationsPartialUpdate + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsPartialUpdate(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsPartialUpdateRequest { + return ApiStagesInvitationInvitationsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *StagesAPIService) StagesInvitationInvitationsPartialUpdateExecute(r ApiStagesInvitationInvitationsPartialUpdateRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedInvitationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string +} + +func (r ApiStagesInvitationInvitationsRetrieveRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsRetrieveExecute(r) +} + +/* +StagesInvitationInvitationsRetrieve Method for StagesInvitationInvitationsRetrieve + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsRetrieveRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsRetrieve(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsRetrieveRequest { + return ApiStagesInvitationInvitationsRetrieveRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *StagesAPIService) StagesInvitationInvitationsRetrieveExecute(r ApiStagesInvitationInvitationsRetrieveRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsSendEmailCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string + invitationSendEmailRequest *InvitationSendEmailRequest +} + +func (r ApiStagesInvitationInvitationsSendEmailCreateRequest) InvitationSendEmailRequest(invitationSendEmailRequest InvitationSendEmailRequest) ApiStagesInvitationInvitationsSendEmailCreateRequest { + r.invitationSendEmailRequest = &invitationSendEmailRequest + return r +} + +func (r ApiStagesInvitationInvitationsSendEmailCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesInvitationInvitationsSendEmailCreateExecute(r) +} + +/* +StagesInvitationInvitationsSendEmailCreate Method for StagesInvitationInvitationsSendEmailCreate + +Send invitation link via email to one or more addresses + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsSendEmailCreateRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsSendEmailCreate(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsSendEmailCreateRequest { + return ApiStagesInvitationInvitationsSendEmailCreateRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesInvitationInvitationsSendEmailCreateExecute(r ApiStagesInvitationInvitationsSendEmailCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsSendEmailCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/send_email/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationSendEmailRequest == nil { + return nil, reportError("invitationSendEmailRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationSendEmailRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string + invitationRequest *InvitationRequest +} + +func (r ApiStagesInvitationInvitationsUpdateRequest) InvitationRequest(invitationRequest InvitationRequest) ApiStagesInvitationInvitationsUpdateRequest { + r.invitationRequest = &invitationRequest + return r +} + +func (r ApiStagesInvitationInvitationsUpdateRequest) Execute() (*Invitation, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsUpdateExecute(r) +} + +/* +StagesInvitationInvitationsUpdate Method for StagesInvitationInvitationsUpdate + +Invitation Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsUpdateRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsUpdate(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsUpdateRequest { + return ApiStagesInvitationInvitationsUpdateRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +// +// @return Invitation +func (a *StagesAPIService) StagesInvitationInvitationsUpdateExecute(r ApiStagesInvitationInvitationsUpdateRequest) (*Invitation, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Invitation + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationRequest == nil { + return localVarReturnValue, nil, reportError("invitationRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationInvitationsUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + inviteUuid string +} + +func (r ApiStagesInvitationInvitationsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesInvitationInvitationsUsedByListExecute(r) +} + +/* +StagesInvitationInvitationsUsedByList Method for StagesInvitationInvitationsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param inviteUuid A UUID string identifying this Invitation. + @return ApiStagesInvitationInvitationsUsedByListRequest +*/ +func (a *StagesAPIService) StagesInvitationInvitationsUsedByList(ctx context.Context, inviteUuid string) ApiStagesInvitationInvitationsUsedByListRequest { + return ApiStagesInvitationInvitationsUsedByListRequest{ + ApiService: a, + ctx: ctx, + inviteUuid: inviteUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesInvitationInvitationsUsedByListExecute(r ApiStagesInvitationInvitationsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationInvitationsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/invitations/{invite_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"invite_uuid"+"}", url.PathEscape(parameterValueToString(r.inviteUuid, "inviteUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + invitationStageRequest *InvitationStageRequest +} + +func (r ApiStagesInvitationStagesCreateRequest) InvitationStageRequest(invitationStageRequest InvitationStageRequest) ApiStagesInvitationStagesCreateRequest { + r.invitationStageRequest = &invitationStageRequest + return r +} + +func (r ApiStagesInvitationStagesCreateRequest) Execute() (*InvitationStage, *http.Response, error) { + return r.ApiService.StagesInvitationStagesCreateExecute(r) +} + +/* +StagesInvitationStagesCreate Method for StagesInvitationStagesCreate + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesInvitationStagesCreateRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesCreate(ctx context.Context) ApiStagesInvitationStagesCreateRequest { + return ApiStagesInvitationStagesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return InvitationStage +func (a *StagesAPIService) StagesInvitationStagesCreateExecute(r ApiStagesInvitationStagesCreateRequest) (*InvitationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationStageRequest == nil { + return localVarReturnValue, nil, reportError("invitationStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesInvitationStagesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesInvitationStagesDestroyExecute(r) +} + +/* +StagesInvitationStagesDestroy Method for StagesInvitationStagesDestroy + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Invitation Stage. + @return ApiStagesInvitationStagesDestroyRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesDestroy(ctx context.Context, stageUuid string) ApiStagesInvitationStagesDestroyRequest { + return ApiStagesInvitationStagesDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesInvitationStagesDestroyExecute(r ApiStagesInvitationStagesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesListRequest struct { + ctx context.Context + ApiService *StagesAPIService + continueFlowWithoutInvitation *bool + name *string + noFlows *bool + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesInvitationStagesListRequest) ContinueFlowWithoutInvitation(continueFlowWithoutInvitation bool) ApiStagesInvitationStagesListRequest { + r.continueFlowWithoutInvitation = &continueFlowWithoutInvitation + return r +} + +func (r ApiStagesInvitationStagesListRequest) Name(name string) ApiStagesInvitationStagesListRequest { + r.name = &name + return r +} + +func (r ApiStagesInvitationStagesListRequest) NoFlows(noFlows bool) ApiStagesInvitationStagesListRequest { + r.noFlows = &noFlows + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesInvitationStagesListRequest) Ordering(ordering string) ApiStagesInvitationStagesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesInvitationStagesListRequest) Page(page int32) ApiStagesInvitationStagesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesInvitationStagesListRequest) PageSize(pageSize int32) ApiStagesInvitationStagesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesInvitationStagesListRequest) Search(search string) ApiStagesInvitationStagesListRequest { + r.search = &search + return r +} + +func (r ApiStagesInvitationStagesListRequest) StageUuid(stageUuid string) ApiStagesInvitationStagesListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesInvitationStagesListRequest) Execute() (*PaginatedInvitationStageList, *http.Response, error) { + return r.ApiService.StagesInvitationStagesListExecute(r) +} + +/* +StagesInvitationStagesList Method for StagesInvitationStagesList + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesInvitationStagesListRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesList(ctx context.Context) ApiStagesInvitationStagesListRequest { + return ApiStagesInvitationStagesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedInvitationStageList +func (a *StagesAPIService) StagesInvitationStagesListExecute(r ApiStagesInvitationStagesListRequest) (*PaginatedInvitationStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedInvitationStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.continueFlowWithoutInvitation != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "continue_flow_without_invitation", r.continueFlowWithoutInvitation, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.noFlows != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "no_flows", r.noFlows, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedInvitationStageRequest *PatchedInvitationStageRequest +} + +func (r ApiStagesInvitationStagesPartialUpdateRequest) PatchedInvitationStageRequest(patchedInvitationStageRequest PatchedInvitationStageRequest) ApiStagesInvitationStagesPartialUpdateRequest { + r.patchedInvitationStageRequest = &patchedInvitationStageRequest + return r +} + +func (r ApiStagesInvitationStagesPartialUpdateRequest) Execute() (*InvitationStage, *http.Response, error) { + return r.ApiService.StagesInvitationStagesPartialUpdateExecute(r) +} + +/* +StagesInvitationStagesPartialUpdate Method for StagesInvitationStagesPartialUpdate + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Invitation Stage. + @return ApiStagesInvitationStagesPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesPartialUpdate(ctx context.Context, stageUuid string) ApiStagesInvitationStagesPartialUpdateRequest { + return ApiStagesInvitationStagesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return InvitationStage +func (a *StagesAPIService) StagesInvitationStagesPartialUpdateExecute(r ApiStagesInvitationStagesPartialUpdateRequest) (*InvitationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedInvitationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesInvitationStagesRetrieveRequest) Execute() (*InvitationStage, *http.Response, error) { + return r.ApiService.StagesInvitationStagesRetrieveExecute(r) +} + +/* +StagesInvitationStagesRetrieve Method for StagesInvitationStagesRetrieve + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Invitation Stage. + @return ApiStagesInvitationStagesRetrieveRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesRetrieve(ctx context.Context, stageUuid string) ApiStagesInvitationStagesRetrieveRequest { + return ApiStagesInvitationStagesRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return InvitationStage +func (a *StagesAPIService) StagesInvitationStagesRetrieveExecute(r ApiStagesInvitationStagesRetrieveRequest) (*InvitationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + invitationStageRequest *InvitationStageRequest +} + +func (r ApiStagesInvitationStagesUpdateRequest) InvitationStageRequest(invitationStageRequest InvitationStageRequest) ApiStagesInvitationStagesUpdateRequest { + r.invitationStageRequest = &invitationStageRequest + return r +} + +func (r ApiStagesInvitationStagesUpdateRequest) Execute() (*InvitationStage, *http.Response, error) { + return r.ApiService.StagesInvitationStagesUpdateExecute(r) +} + +/* +StagesInvitationStagesUpdate Method for StagesInvitationStagesUpdate + +InvitationStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Invitation Stage. + @return ApiStagesInvitationStagesUpdateRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesUpdate(ctx context.Context, stageUuid string) ApiStagesInvitationStagesUpdateRequest { + return ApiStagesInvitationStagesUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return InvitationStage +func (a *StagesAPIService) StagesInvitationStagesUpdateExecute(r ApiStagesInvitationStagesUpdateRequest) (*InvitationStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *InvitationStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.invitationStageRequest == nil { + return localVarReturnValue, nil, reportError("invitationStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.invitationStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesInvitationStagesUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesInvitationStagesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesInvitationStagesUsedByListExecute(r) +} + +/* +StagesInvitationStagesUsedByList Method for StagesInvitationStagesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Invitation Stage. + @return ApiStagesInvitationStagesUsedByListRequest +*/ +func (a *StagesAPIService) StagesInvitationStagesUsedByList(ctx context.Context, stageUuid string) ApiStagesInvitationStagesUsedByListRequest { + return ApiStagesInvitationStagesUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesInvitationStagesUsedByListExecute(r ApiStagesInvitationStagesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesInvitationStagesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/invitation/stages/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + mutualTLSStageRequest *MutualTLSStageRequest +} + +func (r ApiStagesMtlsCreateRequest) MutualTLSStageRequest(mutualTLSStageRequest MutualTLSStageRequest) ApiStagesMtlsCreateRequest { + r.mutualTLSStageRequest = &mutualTLSStageRequest + return r +} + +func (r ApiStagesMtlsCreateRequest) Execute() (*MutualTLSStage, *http.Response, error) { + return r.ApiService.StagesMtlsCreateExecute(r) +} + +/* +StagesMtlsCreate Method for StagesMtlsCreate + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesMtlsCreateRequest +*/ +func (a *StagesAPIService) StagesMtlsCreate(ctx context.Context) ApiStagesMtlsCreateRequest { + return ApiStagesMtlsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return MutualTLSStage +func (a *StagesAPIService) StagesMtlsCreateExecute(r ApiStagesMtlsCreateRequest) (*MutualTLSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MutualTLSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mutualTLSStageRequest == nil { + return localVarReturnValue, nil, reportError("mutualTLSStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.mutualTLSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesMtlsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesMtlsDestroyExecute(r) +} + +/* +StagesMtlsDestroy Method for StagesMtlsDestroy + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Mutual TLS Stage. + @return ApiStagesMtlsDestroyRequest +*/ +func (a *StagesAPIService) StagesMtlsDestroy(ctx context.Context, stageUuid string) ApiStagesMtlsDestroyRequest { + return ApiStagesMtlsDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesMtlsDestroyExecute(r ApiStagesMtlsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesMtlsListRequest struct { + ctx context.Context + ApiService *StagesAPIService + certAttribute *string + certificateAuthorities *[]string + mode *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string + userAttribute *string +} + +func (r ApiStagesMtlsListRequest) CertAttribute(certAttribute string) ApiStagesMtlsListRequest { + r.certAttribute = &certAttribute + return r +} + +func (r ApiStagesMtlsListRequest) CertificateAuthorities(certificateAuthorities []string) ApiStagesMtlsListRequest { + r.certificateAuthorities = &certificateAuthorities + return r +} + +func (r ApiStagesMtlsListRequest) Mode(mode string) ApiStagesMtlsListRequest { + r.mode = &mode + return r +} + +func (r ApiStagesMtlsListRequest) Name(name string) ApiStagesMtlsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesMtlsListRequest) Ordering(ordering string) ApiStagesMtlsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesMtlsListRequest) Page(page int32) ApiStagesMtlsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesMtlsListRequest) PageSize(pageSize int32) ApiStagesMtlsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesMtlsListRequest) Search(search string) ApiStagesMtlsListRequest { + r.search = &search + return r +} + +func (r ApiStagesMtlsListRequest) StageUuid(stageUuid string) ApiStagesMtlsListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesMtlsListRequest) UserAttribute(userAttribute string) ApiStagesMtlsListRequest { + r.userAttribute = &userAttribute + return r +} + +func (r ApiStagesMtlsListRequest) Execute() (*PaginatedMutualTLSStageList, *http.Response, error) { + return r.ApiService.StagesMtlsListExecute(r) +} + +/* +StagesMtlsList Method for StagesMtlsList + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesMtlsListRequest +*/ +func (a *StagesAPIService) StagesMtlsList(ctx context.Context) ApiStagesMtlsListRequest { + return ApiStagesMtlsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedMutualTLSStageList +func (a *StagesAPIService) StagesMtlsListExecute(r ApiStagesMtlsListRequest) (*PaginatedMutualTLSStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedMutualTLSStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.certAttribute != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "cert_attribute", r.certAttribute, "form", "") + } + if r.certificateAuthorities != nil { + t := *r.certificateAuthorities + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate_authorities", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "certificate_authorities", t, "form", "multi") + } + } + if r.mode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "mode", r.mode, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.userAttribute != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_attribute", r.userAttribute, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedMutualTLSStageRequest *PatchedMutualTLSStageRequest +} + +func (r ApiStagesMtlsPartialUpdateRequest) PatchedMutualTLSStageRequest(patchedMutualTLSStageRequest PatchedMutualTLSStageRequest) ApiStagesMtlsPartialUpdateRequest { + r.patchedMutualTLSStageRequest = &patchedMutualTLSStageRequest + return r +} + +func (r ApiStagesMtlsPartialUpdateRequest) Execute() (*MutualTLSStage, *http.Response, error) { + return r.ApiService.StagesMtlsPartialUpdateExecute(r) +} + +/* +StagesMtlsPartialUpdate Method for StagesMtlsPartialUpdate + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Mutual TLS Stage. + @return ApiStagesMtlsPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesMtlsPartialUpdate(ctx context.Context, stageUuid string) ApiStagesMtlsPartialUpdateRequest { + return ApiStagesMtlsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return MutualTLSStage +func (a *StagesAPIService) StagesMtlsPartialUpdateExecute(r ApiStagesMtlsPartialUpdateRequest) (*MutualTLSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MutualTLSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedMutualTLSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesMtlsRetrieveRequest) Execute() (*MutualTLSStage, *http.Response, error) { + return r.ApiService.StagesMtlsRetrieveExecute(r) +} + +/* +StagesMtlsRetrieve Method for StagesMtlsRetrieve + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Mutual TLS Stage. + @return ApiStagesMtlsRetrieveRequest +*/ +func (a *StagesAPIService) StagesMtlsRetrieve(ctx context.Context, stageUuid string) ApiStagesMtlsRetrieveRequest { + return ApiStagesMtlsRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return MutualTLSStage +func (a *StagesAPIService) StagesMtlsRetrieveExecute(r ApiStagesMtlsRetrieveRequest) (*MutualTLSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MutualTLSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + mutualTLSStageRequest *MutualTLSStageRequest +} + +func (r ApiStagesMtlsUpdateRequest) MutualTLSStageRequest(mutualTLSStageRequest MutualTLSStageRequest) ApiStagesMtlsUpdateRequest { + r.mutualTLSStageRequest = &mutualTLSStageRequest + return r +} + +func (r ApiStagesMtlsUpdateRequest) Execute() (*MutualTLSStage, *http.Response, error) { + return r.ApiService.StagesMtlsUpdateExecute(r) +} + +/* +StagesMtlsUpdate Method for StagesMtlsUpdate + +MutualTLSStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Mutual TLS Stage. + @return ApiStagesMtlsUpdateRequest +*/ +func (a *StagesAPIService) StagesMtlsUpdate(ctx context.Context, stageUuid string) ApiStagesMtlsUpdateRequest { + return ApiStagesMtlsUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return MutualTLSStage +func (a *StagesAPIService) StagesMtlsUpdateExecute(r ApiStagesMtlsUpdateRequest) (*MutualTLSStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MutualTLSStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.mutualTLSStageRequest == nil { + return localVarReturnValue, nil, reportError("mutualTLSStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.mutualTLSStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesMtlsUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesMtlsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesMtlsUsedByListExecute(r) +} + +/* +StagesMtlsUsedByList Method for StagesMtlsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Mutual TLS Stage. + @return ApiStagesMtlsUsedByListRequest +*/ +func (a *StagesAPIService) StagesMtlsUsedByList(ctx context.Context, stageUuid string) ApiStagesMtlsUsedByListRequest { + return ApiStagesMtlsUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesMtlsUsedByListExecute(r ApiStagesMtlsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesMtlsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/mtls/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + passwordStageRequest *PasswordStageRequest +} + +func (r ApiStagesPasswordCreateRequest) PasswordStageRequest(passwordStageRequest PasswordStageRequest) ApiStagesPasswordCreateRequest { + r.passwordStageRequest = &passwordStageRequest + return r +} + +func (r ApiStagesPasswordCreateRequest) Execute() (*PasswordStage, *http.Response, error) { + return r.ApiService.StagesPasswordCreateExecute(r) +} + +/* +StagesPasswordCreate Method for StagesPasswordCreate + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPasswordCreateRequest +*/ +func (a *StagesAPIService) StagesPasswordCreate(ctx context.Context) ApiStagesPasswordCreateRequest { + return ApiStagesPasswordCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PasswordStage +func (a *StagesAPIService) StagesPasswordCreateExecute(r ApiStagesPasswordCreateRequest) (*PasswordStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordStageRequest == nil { + return localVarReturnValue, nil, reportError("passwordStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPasswordDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesPasswordDestroyExecute(r) +} + +/* +StagesPasswordDestroy Method for StagesPasswordDestroy + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Password Stage. + @return ApiStagesPasswordDestroyRequest +*/ +func (a *StagesAPIService) StagesPasswordDestroy(ctx context.Context, stageUuid string) ApiStagesPasswordDestroyRequest { + return ApiStagesPasswordDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesPasswordDestroyExecute(r ApiStagesPasswordDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesPasswordListRequest struct { + ctx context.Context + ApiService *StagesAPIService + allowShowPassword *bool + configureFlow *string + failedAttemptsBeforeCancel *int32 + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesPasswordListRequest) AllowShowPassword(allowShowPassword bool) ApiStagesPasswordListRequest { + r.allowShowPassword = &allowShowPassword + return r +} + +func (r ApiStagesPasswordListRequest) ConfigureFlow(configureFlow string) ApiStagesPasswordListRequest { + r.configureFlow = &configureFlow + return r +} + +func (r ApiStagesPasswordListRequest) FailedAttemptsBeforeCancel(failedAttemptsBeforeCancel int32) ApiStagesPasswordListRequest { + r.failedAttemptsBeforeCancel = &failedAttemptsBeforeCancel + return r +} + +func (r ApiStagesPasswordListRequest) Name(name string) ApiStagesPasswordListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesPasswordListRequest) Ordering(ordering string) ApiStagesPasswordListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesPasswordListRequest) Page(page int32) ApiStagesPasswordListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesPasswordListRequest) PageSize(pageSize int32) ApiStagesPasswordListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesPasswordListRequest) Search(search string) ApiStagesPasswordListRequest { + r.search = &search + return r +} + +func (r ApiStagesPasswordListRequest) Execute() (*PaginatedPasswordStageList, *http.Response, error) { + return r.ApiService.StagesPasswordListExecute(r) +} + +/* +StagesPasswordList Method for StagesPasswordList + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPasswordListRequest +*/ +func (a *StagesAPIService) StagesPasswordList(ctx context.Context) ApiStagesPasswordListRequest { + return ApiStagesPasswordListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPasswordStageList +func (a *StagesAPIService) StagesPasswordListExecute(r ApiStagesPasswordListRequest) (*PaginatedPasswordStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPasswordStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.allowShowPassword != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "allow_show_password", r.allowShowPassword, "form", "") + } + if r.configureFlow != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "configure_flow", r.configureFlow, "form", "") + } + if r.failedAttemptsBeforeCancel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "failed_attempts_before_cancel", r.failedAttemptsBeforeCancel, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedPasswordStageRequest *PatchedPasswordStageRequest +} + +func (r ApiStagesPasswordPartialUpdateRequest) PatchedPasswordStageRequest(patchedPasswordStageRequest PatchedPasswordStageRequest) ApiStagesPasswordPartialUpdateRequest { + r.patchedPasswordStageRequest = &patchedPasswordStageRequest + return r +} + +func (r ApiStagesPasswordPartialUpdateRequest) Execute() (*PasswordStage, *http.Response, error) { + return r.ApiService.StagesPasswordPartialUpdateExecute(r) +} + +/* +StagesPasswordPartialUpdate Method for StagesPasswordPartialUpdate + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Password Stage. + @return ApiStagesPasswordPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesPasswordPartialUpdate(ctx context.Context, stageUuid string) ApiStagesPasswordPartialUpdateRequest { + return ApiStagesPasswordPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PasswordStage +func (a *StagesAPIService) StagesPasswordPartialUpdateExecute(r ApiStagesPasswordPartialUpdateRequest) (*PasswordStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPasswordStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPasswordRetrieveRequest) Execute() (*PasswordStage, *http.Response, error) { + return r.ApiService.StagesPasswordRetrieveExecute(r) +} + +/* +StagesPasswordRetrieve Method for StagesPasswordRetrieve + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Password Stage. + @return ApiStagesPasswordRetrieveRequest +*/ +func (a *StagesAPIService) StagesPasswordRetrieve(ctx context.Context, stageUuid string) ApiStagesPasswordRetrieveRequest { + return ApiStagesPasswordRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PasswordStage +func (a *StagesAPIService) StagesPasswordRetrieveExecute(r ApiStagesPasswordRetrieveRequest) (*PasswordStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + passwordStageRequest *PasswordStageRequest +} + +func (r ApiStagesPasswordUpdateRequest) PasswordStageRequest(passwordStageRequest PasswordStageRequest) ApiStagesPasswordUpdateRequest { + r.passwordStageRequest = &passwordStageRequest + return r +} + +func (r ApiStagesPasswordUpdateRequest) Execute() (*PasswordStage, *http.Response, error) { + return r.ApiService.StagesPasswordUpdateExecute(r) +} + +/* +StagesPasswordUpdate Method for StagesPasswordUpdate + +PasswordStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Password Stage. + @return ApiStagesPasswordUpdateRequest +*/ +func (a *StagesAPIService) StagesPasswordUpdate(ctx context.Context, stageUuid string) ApiStagesPasswordUpdateRequest { + return ApiStagesPasswordUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PasswordStage +func (a *StagesAPIService) StagesPasswordUpdateExecute(r ApiStagesPasswordUpdateRequest) (*PasswordStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PasswordStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.passwordStageRequest == nil { + return localVarReturnValue, nil, reportError("passwordStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.passwordStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPasswordUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPasswordUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesPasswordUsedByListExecute(r) +} + +/* +StagesPasswordUsedByList Method for StagesPasswordUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Password Stage. + @return ApiStagesPasswordUsedByListRequest +*/ +func (a *StagesAPIService) StagesPasswordUsedByList(ctx context.Context, stageUuid string) ApiStagesPasswordUsedByListRequest { + return ApiStagesPasswordUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesPasswordUsedByListExecute(r ApiStagesPasswordUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPasswordUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/password/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptRequest *PromptRequest +} + +func (r ApiStagesPromptPromptsCreateRequest) PromptRequest(promptRequest PromptRequest) ApiStagesPromptPromptsCreateRequest { + r.promptRequest = &promptRequest + return r +} + +func (r ApiStagesPromptPromptsCreateRequest) Execute() (*Prompt, *http.Response, error) { + return r.ApiService.StagesPromptPromptsCreateExecute(r) +} + +/* +StagesPromptPromptsCreate Method for StagesPromptPromptsCreate + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPromptPromptsCreateRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsCreate(ctx context.Context) ApiStagesPromptPromptsCreateRequest { + return ApiStagesPromptPromptsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Prompt +func (a *StagesAPIService) StagesPromptPromptsCreateExecute(r ApiStagesPromptPromptsCreateRequest) (*Prompt, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prompt + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.promptRequest == nil { + return localVarReturnValue, nil, reportError("promptRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.promptRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptUuid string +} + +func (r ApiStagesPromptPromptsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesPromptPromptsDestroyExecute(r) +} + +/* +StagesPromptPromptsDestroy Method for StagesPromptPromptsDestroy + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param promptUuid A UUID string identifying this Prompt. + @return ApiStagesPromptPromptsDestroyRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsDestroy(ctx context.Context, promptUuid string) ApiStagesPromptPromptsDestroyRequest { + return ApiStagesPromptPromptsDestroyRequest{ + ApiService: a, + ctx: ctx, + promptUuid: promptUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesPromptPromptsDestroyExecute(r ApiStagesPromptPromptsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/{prompt_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"prompt_uuid"+"}", url.PathEscape(parameterValueToString(r.promptUuid, "promptUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsListRequest struct { + ctx context.Context + ApiService *StagesAPIService + fieldKey *string + label *string + name *string + ordering *string + page *int32 + pageSize *int32 + placeholder *string + search *string + type_ *string +} + +func (r ApiStagesPromptPromptsListRequest) FieldKey(fieldKey string) ApiStagesPromptPromptsListRequest { + r.fieldKey = &fieldKey + return r +} + +func (r ApiStagesPromptPromptsListRequest) Label(label string) ApiStagesPromptPromptsListRequest { + r.label = &label + return r +} + +func (r ApiStagesPromptPromptsListRequest) Name(name string) ApiStagesPromptPromptsListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesPromptPromptsListRequest) Ordering(ordering string) ApiStagesPromptPromptsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesPromptPromptsListRequest) Page(page int32) ApiStagesPromptPromptsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesPromptPromptsListRequest) PageSize(pageSize int32) ApiStagesPromptPromptsListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesPromptPromptsListRequest) Placeholder(placeholder string) ApiStagesPromptPromptsListRequest { + r.placeholder = &placeholder + return r +} + +// A search term. +func (r ApiStagesPromptPromptsListRequest) Search(search string) ApiStagesPromptPromptsListRequest { + r.search = &search + return r +} + +func (r ApiStagesPromptPromptsListRequest) Type_(type_ string) ApiStagesPromptPromptsListRequest { + r.type_ = &type_ + return r +} + +func (r ApiStagesPromptPromptsListRequest) Execute() (*PaginatedPromptList, *http.Response, error) { + return r.ApiService.StagesPromptPromptsListExecute(r) +} + +/* +StagesPromptPromptsList Method for StagesPromptPromptsList + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPromptPromptsListRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsList(ctx context.Context) ApiStagesPromptPromptsListRequest { + return ApiStagesPromptPromptsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPromptList +func (a *StagesAPIService) StagesPromptPromptsListExecute(r ApiStagesPromptPromptsListRequest) (*PaginatedPromptList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPromptList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fieldKey != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "field_key", r.fieldKey, "form", "") + } + if r.label != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label", r.label, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.placeholder != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "placeholder", r.placeholder, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptUuid string + patchedPromptRequest *PatchedPromptRequest +} + +func (r ApiStagesPromptPromptsPartialUpdateRequest) PatchedPromptRequest(patchedPromptRequest PatchedPromptRequest) ApiStagesPromptPromptsPartialUpdateRequest { + r.patchedPromptRequest = &patchedPromptRequest + return r +} + +func (r ApiStagesPromptPromptsPartialUpdateRequest) Execute() (*Prompt, *http.Response, error) { + return r.ApiService.StagesPromptPromptsPartialUpdateExecute(r) +} + +/* +StagesPromptPromptsPartialUpdate Method for StagesPromptPromptsPartialUpdate + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param promptUuid A UUID string identifying this Prompt. + @return ApiStagesPromptPromptsPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsPartialUpdate(ctx context.Context, promptUuid string) ApiStagesPromptPromptsPartialUpdateRequest { + return ApiStagesPromptPromptsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + promptUuid: promptUuid, + } +} + +// Execute executes the request +// +// @return Prompt +func (a *StagesAPIService) StagesPromptPromptsPartialUpdateExecute(r ApiStagesPromptPromptsPartialUpdateRequest) (*Prompt, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prompt + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/{prompt_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"prompt_uuid"+"}", url.PathEscape(parameterValueToString(r.promptUuid, "promptUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPromptRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsPreviewCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptRequest *PromptRequest +} + +func (r ApiStagesPromptPromptsPreviewCreateRequest) PromptRequest(promptRequest PromptRequest) ApiStagesPromptPromptsPreviewCreateRequest { + r.promptRequest = &promptRequest + return r +} + +func (r ApiStagesPromptPromptsPreviewCreateRequest) Execute() (*PromptChallenge, *http.Response, error) { + return r.ApiService.StagesPromptPromptsPreviewCreateExecute(r) +} + +/* +StagesPromptPromptsPreviewCreate Method for StagesPromptPromptsPreviewCreate + +Preview a prompt as a challenge, just like a flow would receive + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPromptPromptsPreviewCreateRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsPreviewCreate(ctx context.Context) ApiStagesPromptPromptsPreviewCreateRequest { + return ApiStagesPromptPromptsPreviewCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PromptChallenge +func (a *StagesAPIService) StagesPromptPromptsPreviewCreateExecute(r ApiStagesPromptPromptsPreviewCreateRequest) (*PromptChallenge, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PromptChallenge + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsPreviewCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/preview/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.promptRequest == nil { + return localVarReturnValue, nil, reportError("promptRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.promptRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptUuid string +} + +func (r ApiStagesPromptPromptsRetrieveRequest) Execute() (*Prompt, *http.Response, error) { + return r.ApiService.StagesPromptPromptsRetrieveExecute(r) +} + +/* +StagesPromptPromptsRetrieve Method for StagesPromptPromptsRetrieve + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param promptUuid A UUID string identifying this Prompt. + @return ApiStagesPromptPromptsRetrieveRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsRetrieve(ctx context.Context, promptUuid string) ApiStagesPromptPromptsRetrieveRequest { + return ApiStagesPromptPromptsRetrieveRequest{ + ApiService: a, + ctx: ctx, + promptUuid: promptUuid, + } +} + +// Execute executes the request +// +// @return Prompt +func (a *StagesAPIService) StagesPromptPromptsRetrieveExecute(r ApiStagesPromptPromptsRetrieveRequest) (*Prompt, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prompt + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/{prompt_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"prompt_uuid"+"}", url.PathEscape(parameterValueToString(r.promptUuid, "promptUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptUuid string + promptRequest *PromptRequest +} + +func (r ApiStagesPromptPromptsUpdateRequest) PromptRequest(promptRequest PromptRequest) ApiStagesPromptPromptsUpdateRequest { + r.promptRequest = &promptRequest + return r +} + +func (r ApiStagesPromptPromptsUpdateRequest) Execute() (*Prompt, *http.Response, error) { + return r.ApiService.StagesPromptPromptsUpdateExecute(r) +} + +/* +StagesPromptPromptsUpdate Method for StagesPromptPromptsUpdate + +Prompt Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param promptUuid A UUID string identifying this Prompt. + @return ApiStagesPromptPromptsUpdateRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsUpdate(ctx context.Context, promptUuid string) ApiStagesPromptPromptsUpdateRequest { + return ApiStagesPromptPromptsUpdateRequest{ + ApiService: a, + ctx: ctx, + promptUuid: promptUuid, + } +} + +// Execute executes the request +// +// @return Prompt +func (a *StagesAPIService) StagesPromptPromptsUpdateExecute(r ApiStagesPromptPromptsUpdateRequest) (*Prompt, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Prompt + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/{prompt_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"prompt_uuid"+"}", url.PathEscape(parameterValueToString(r.promptUuid, "promptUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.promptRequest == nil { + return localVarReturnValue, nil, reportError("promptRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.promptRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptPromptsUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptUuid string +} + +func (r ApiStagesPromptPromptsUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesPromptPromptsUsedByListExecute(r) +} + +/* +StagesPromptPromptsUsedByList Method for StagesPromptPromptsUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param promptUuid A UUID string identifying this Prompt. + @return ApiStagesPromptPromptsUsedByListRequest +*/ +func (a *StagesAPIService) StagesPromptPromptsUsedByList(ctx context.Context, promptUuid string) ApiStagesPromptPromptsUsedByListRequest { + return ApiStagesPromptPromptsUsedByListRequest{ + ApiService: a, + ctx: ctx, + promptUuid: promptUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesPromptPromptsUsedByListExecute(r ApiStagesPromptPromptsUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptPromptsUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/prompts/{prompt_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"prompt_uuid"+"}", url.PathEscape(parameterValueToString(r.promptUuid, "promptUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + promptStageRequest *PromptStageRequest +} + +func (r ApiStagesPromptStagesCreateRequest) PromptStageRequest(promptStageRequest PromptStageRequest) ApiStagesPromptStagesCreateRequest { + r.promptStageRequest = &promptStageRequest + return r +} + +func (r ApiStagesPromptStagesCreateRequest) Execute() (*PromptStage, *http.Response, error) { + return r.ApiService.StagesPromptStagesCreateExecute(r) +} + +/* +StagesPromptStagesCreate Method for StagesPromptStagesCreate + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPromptStagesCreateRequest +*/ +func (a *StagesAPIService) StagesPromptStagesCreate(ctx context.Context) ApiStagesPromptStagesCreateRequest { + return ApiStagesPromptStagesCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PromptStage +func (a *StagesAPIService) StagesPromptStagesCreateExecute(r ApiStagesPromptStagesCreateRequest) (*PromptStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PromptStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.promptStageRequest == nil { + return localVarReturnValue, nil, reportError("promptStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.promptStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPromptStagesDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesPromptStagesDestroyExecute(r) +} + +/* +StagesPromptStagesDestroy Method for StagesPromptStagesDestroy + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Prompt Stage. + @return ApiStagesPromptStagesDestroyRequest +*/ +func (a *StagesAPIService) StagesPromptStagesDestroy(ctx context.Context, stageUuid string) ApiStagesPromptStagesDestroyRequest { + return ApiStagesPromptStagesDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesPromptStagesDestroyExecute(r ApiStagesPromptStagesDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesListRequest struct { + ctx context.Context + ApiService *StagesAPIService + fields *[]string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string + validationPolicies *[]string +} + +func (r ApiStagesPromptStagesListRequest) Fields(fields []string) ApiStagesPromptStagesListRequest { + r.fields = &fields + return r +} + +func (r ApiStagesPromptStagesListRequest) Name(name string) ApiStagesPromptStagesListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesPromptStagesListRequest) Ordering(ordering string) ApiStagesPromptStagesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesPromptStagesListRequest) Page(page int32) ApiStagesPromptStagesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesPromptStagesListRequest) PageSize(pageSize int32) ApiStagesPromptStagesListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesPromptStagesListRequest) Search(search string) ApiStagesPromptStagesListRequest { + r.search = &search + return r +} + +func (r ApiStagesPromptStagesListRequest) StageUuid(stageUuid string) ApiStagesPromptStagesListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesPromptStagesListRequest) ValidationPolicies(validationPolicies []string) ApiStagesPromptStagesListRequest { + r.validationPolicies = &validationPolicies + return r +} + +func (r ApiStagesPromptStagesListRequest) Execute() (*PaginatedPromptStageList, *http.Response, error) { + return r.ApiService.StagesPromptStagesListExecute(r) +} + +/* +StagesPromptStagesList Method for StagesPromptStagesList + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesPromptStagesListRequest +*/ +func (a *StagesAPIService) StagesPromptStagesList(ctx context.Context) ApiStagesPromptStagesListRequest { + return ApiStagesPromptStagesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedPromptStageList +func (a *StagesAPIService) StagesPromptStagesListExecute(r ApiStagesPromptStagesListRequest) (*PaginatedPromptStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedPromptStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.fields != nil { + t := *r.fields + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "fields", t, "form", "multi") + } + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.validationPolicies != nil { + t := *r.validationPolicies + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "validation_policies", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "validation_policies", t, "form", "multi") + } + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedPromptStageRequest *PatchedPromptStageRequest +} + +func (r ApiStagesPromptStagesPartialUpdateRequest) PatchedPromptStageRequest(patchedPromptStageRequest PatchedPromptStageRequest) ApiStagesPromptStagesPartialUpdateRequest { + r.patchedPromptStageRequest = &patchedPromptStageRequest + return r +} + +func (r ApiStagesPromptStagesPartialUpdateRequest) Execute() (*PromptStage, *http.Response, error) { + return r.ApiService.StagesPromptStagesPartialUpdateExecute(r) +} + +/* +StagesPromptStagesPartialUpdate Method for StagesPromptStagesPartialUpdate + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Prompt Stage. + @return ApiStagesPromptStagesPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesPromptStagesPartialUpdate(ctx context.Context, stageUuid string) ApiStagesPromptStagesPartialUpdateRequest { + return ApiStagesPromptStagesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PromptStage +func (a *StagesAPIService) StagesPromptStagesPartialUpdateExecute(r ApiStagesPromptStagesPartialUpdateRequest) (*PromptStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PromptStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedPromptStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPromptStagesRetrieveRequest) Execute() (*PromptStage, *http.Response, error) { + return r.ApiService.StagesPromptStagesRetrieveExecute(r) +} + +/* +StagesPromptStagesRetrieve Method for StagesPromptStagesRetrieve + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Prompt Stage. + @return ApiStagesPromptStagesRetrieveRequest +*/ +func (a *StagesAPIService) StagesPromptStagesRetrieve(ctx context.Context, stageUuid string) ApiStagesPromptStagesRetrieveRequest { + return ApiStagesPromptStagesRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PromptStage +func (a *StagesAPIService) StagesPromptStagesRetrieveExecute(r ApiStagesPromptStagesRetrieveRequest) (*PromptStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PromptStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + promptStageRequest *PromptStageRequest +} + +func (r ApiStagesPromptStagesUpdateRequest) PromptStageRequest(promptStageRequest PromptStageRequest) ApiStagesPromptStagesUpdateRequest { + r.promptStageRequest = &promptStageRequest + return r +} + +func (r ApiStagesPromptStagesUpdateRequest) Execute() (*PromptStage, *http.Response, error) { + return r.ApiService.StagesPromptStagesUpdateExecute(r) +} + +/* +StagesPromptStagesUpdate Method for StagesPromptStagesUpdate + +PromptStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Prompt Stage. + @return ApiStagesPromptStagesUpdateRequest +*/ +func (a *StagesAPIService) StagesPromptStagesUpdate(ctx context.Context, stageUuid string) ApiStagesPromptStagesUpdateRequest { + return ApiStagesPromptStagesUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return PromptStage +func (a *StagesAPIService) StagesPromptStagesUpdateExecute(r ApiStagesPromptStagesUpdateRequest) (*PromptStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PromptStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.promptStageRequest == nil { + return localVarReturnValue, nil, reportError("promptStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.promptStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesPromptStagesUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesPromptStagesUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesPromptStagesUsedByListExecute(r) +} + +/* +StagesPromptStagesUsedByList Method for StagesPromptStagesUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Prompt Stage. + @return ApiStagesPromptStagesUsedByListRequest +*/ +func (a *StagesAPIService) StagesPromptStagesUsedByList(ctx context.Context, stageUuid string) ApiStagesPromptStagesUsedByListRequest { + return ApiStagesPromptStagesUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesPromptStagesUsedByListExecute(r ApiStagesPromptStagesUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesPromptStagesUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/prompt/stages/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + redirectStageRequest *RedirectStageRequest +} + +func (r ApiStagesRedirectCreateRequest) RedirectStageRequest(redirectStageRequest RedirectStageRequest) ApiStagesRedirectCreateRequest { + r.redirectStageRequest = &redirectStageRequest + return r +} + +func (r ApiStagesRedirectCreateRequest) Execute() (*RedirectStage, *http.Response, error) { + return r.ApiService.StagesRedirectCreateExecute(r) +} + +/* +StagesRedirectCreate Method for StagesRedirectCreate + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesRedirectCreateRequest +*/ +func (a *StagesAPIService) StagesRedirectCreate(ctx context.Context) ApiStagesRedirectCreateRequest { + return ApiStagesRedirectCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return RedirectStage +func (a *StagesAPIService) StagesRedirectCreateExecute(r ApiStagesRedirectCreateRequest) (*RedirectStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedirectStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.redirectStageRequest == nil { + return localVarReturnValue, nil, reportError("redirectStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.redirectStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesRedirectDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesRedirectDestroyExecute(r) +} + +/* +StagesRedirectDestroy Method for StagesRedirectDestroy + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Redirect Stage. + @return ApiStagesRedirectDestroyRequest +*/ +func (a *StagesAPIService) StagesRedirectDestroy(ctx context.Context, stageUuid string) ApiStagesRedirectDestroyRequest { + return ApiStagesRedirectDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesRedirectDestroyExecute(r ApiStagesRedirectDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesRedirectListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string +} + +func (r ApiStagesRedirectListRequest) Name(name string) ApiStagesRedirectListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesRedirectListRequest) Ordering(ordering string) ApiStagesRedirectListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesRedirectListRequest) Page(page int32) ApiStagesRedirectListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesRedirectListRequest) PageSize(pageSize int32) ApiStagesRedirectListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesRedirectListRequest) Search(search string) ApiStagesRedirectListRequest { + r.search = &search + return r +} + +func (r ApiStagesRedirectListRequest) Execute() (*PaginatedRedirectStageList, *http.Response, error) { + return r.ApiService.StagesRedirectListExecute(r) +} + +/* +StagesRedirectList Method for StagesRedirectList + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesRedirectListRequest +*/ +func (a *StagesAPIService) StagesRedirectList(ctx context.Context) ApiStagesRedirectListRequest { + return ApiStagesRedirectListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedRedirectStageList +func (a *StagesAPIService) StagesRedirectListExecute(r ApiStagesRedirectListRequest) (*PaginatedRedirectStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedRedirectStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedRedirectStageRequest *PatchedRedirectStageRequest +} + +func (r ApiStagesRedirectPartialUpdateRequest) PatchedRedirectStageRequest(patchedRedirectStageRequest PatchedRedirectStageRequest) ApiStagesRedirectPartialUpdateRequest { + r.patchedRedirectStageRequest = &patchedRedirectStageRequest + return r +} + +func (r ApiStagesRedirectPartialUpdateRequest) Execute() (*RedirectStage, *http.Response, error) { + return r.ApiService.StagesRedirectPartialUpdateExecute(r) +} + +/* +StagesRedirectPartialUpdate Method for StagesRedirectPartialUpdate + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Redirect Stage. + @return ApiStagesRedirectPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesRedirectPartialUpdate(ctx context.Context, stageUuid string) ApiStagesRedirectPartialUpdateRequest { + return ApiStagesRedirectPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return RedirectStage +func (a *StagesAPIService) StagesRedirectPartialUpdateExecute(r ApiStagesRedirectPartialUpdateRequest) (*RedirectStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedirectStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedRedirectStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesRedirectRetrieveRequest) Execute() (*RedirectStage, *http.Response, error) { + return r.ApiService.StagesRedirectRetrieveExecute(r) +} + +/* +StagesRedirectRetrieve Method for StagesRedirectRetrieve + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Redirect Stage. + @return ApiStagesRedirectRetrieveRequest +*/ +func (a *StagesAPIService) StagesRedirectRetrieve(ctx context.Context, stageUuid string) ApiStagesRedirectRetrieveRequest { + return ApiStagesRedirectRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return RedirectStage +func (a *StagesAPIService) StagesRedirectRetrieveExecute(r ApiStagesRedirectRetrieveRequest) (*RedirectStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedirectStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + redirectStageRequest *RedirectStageRequest +} + +func (r ApiStagesRedirectUpdateRequest) RedirectStageRequest(redirectStageRequest RedirectStageRequest) ApiStagesRedirectUpdateRequest { + r.redirectStageRequest = &redirectStageRequest + return r +} + +func (r ApiStagesRedirectUpdateRequest) Execute() (*RedirectStage, *http.Response, error) { + return r.ApiService.StagesRedirectUpdateExecute(r) +} + +/* +StagesRedirectUpdate Method for StagesRedirectUpdate + +RedirectStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Redirect Stage. + @return ApiStagesRedirectUpdateRequest +*/ +func (a *StagesAPIService) StagesRedirectUpdate(ctx context.Context, stageUuid string) ApiStagesRedirectUpdateRequest { + return ApiStagesRedirectUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return RedirectStage +func (a *StagesAPIService) StagesRedirectUpdateExecute(r ApiStagesRedirectUpdateRequest) (*RedirectStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RedirectStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.redirectStageRequest == nil { + return localVarReturnValue, nil, reportError("redirectStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.redirectStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesRedirectUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesRedirectUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesRedirectUsedByListExecute(r) +} + +/* +StagesRedirectUsedByList Method for StagesRedirectUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Redirect Stage. + @return ApiStagesRedirectUsedByListRequest +*/ +func (a *StagesAPIService) StagesRedirectUsedByList(ctx context.Context, stageUuid string) ApiStagesRedirectUsedByListRequest { + return ApiStagesRedirectUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesRedirectUsedByListExecute(r ApiStagesRedirectUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesRedirectUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/redirect/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourceCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + sourceStageRequest *SourceStageRequest +} + +func (r ApiStagesSourceCreateRequest) SourceStageRequest(sourceStageRequest SourceStageRequest) ApiStagesSourceCreateRequest { + r.sourceStageRequest = &sourceStageRequest + return r +} + +func (r ApiStagesSourceCreateRequest) Execute() (*SourceStage, *http.Response, error) { + return r.ApiService.StagesSourceCreateExecute(r) +} + +/* +StagesSourceCreate Method for StagesSourceCreate + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesSourceCreateRequest +*/ +func (a *StagesAPIService) StagesSourceCreate(ctx context.Context) ApiStagesSourceCreateRequest { + return ApiStagesSourceCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return SourceStage +func (a *StagesAPIService) StagesSourceCreateExecute(r ApiStagesSourceCreateRequest) (*SourceStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SourceStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sourceStageRequest == nil { + return localVarReturnValue, nil, reportError("sourceStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sourceStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourceDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesSourceDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesSourceDestroyExecute(r) +} + +/* +StagesSourceDestroy Method for StagesSourceDestroy + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Source Stage. + @return ApiStagesSourceDestroyRequest +*/ +func (a *StagesAPIService) StagesSourceDestroy(ctx context.Context, stageUuid string) ApiStagesSourceDestroyRequest { + return ApiStagesSourceDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesSourceDestroyExecute(r ApiStagesSourceDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesSourceListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + resumeTimeout *string + search *string + source *string + stageUuid *string +} + +func (r ApiStagesSourceListRequest) Name(name string) ApiStagesSourceListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesSourceListRequest) Ordering(ordering string) ApiStagesSourceListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesSourceListRequest) Page(page int32) ApiStagesSourceListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesSourceListRequest) PageSize(pageSize int32) ApiStagesSourceListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesSourceListRequest) ResumeTimeout(resumeTimeout string) ApiStagesSourceListRequest { + r.resumeTimeout = &resumeTimeout + return r +} + +// A search term. +func (r ApiStagesSourceListRequest) Search(search string) ApiStagesSourceListRequest { + r.search = &search + return r +} + +func (r ApiStagesSourceListRequest) Source(source string) ApiStagesSourceListRequest { + r.source = &source + return r +} + +func (r ApiStagesSourceListRequest) StageUuid(stageUuid string) ApiStagesSourceListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesSourceListRequest) Execute() (*PaginatedSourceStageList, *http.Response, error) { + return r.ApiService.StagesSourceListExecute(r) +} + +/* +StagesSourceList Method for StagesSourceList + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesSourceListRequest +*/ +func (a *StagesAPIService) StagesSourceList(ctx context.Context) ApiStagesSourceListRequest { + return ApiStagesSourceListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedSourceStageList +func (a *StagesAPIService) StagesSourceListExecute(r ApiStagesSourceListRequest) (*PaginatedSourceStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedSourceStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.resumeTimeout != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "resume_timeout", r.resumeTimeout, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.source != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "source", r.source, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourcePartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedSourceStageRequest *PatchedSourceStageRequest +} + +func (r ApiStagesSourcePartialUpdateRequest) PatchedSourceStageRequest(patchedSourceStageRequest PatchedSourceStageRequest) ApiStagesSourcePartialUpdateRequest { + r.patchedSourceStageRequest = &patchedSourceStageRequest + return r +} + +func (r ApiStagesSourcePartialUpdateRequest) Execute() (*SourceStage, *http.Response, error) { + return r.ApiService.StagesSourcePartialUpdateExecute(r) +} + +/* +StagesSourcePartialUpdate Method for StagesSourcePartialUpdate + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Source Stage. + @return ApiStagesSourcePartialUpdateRequest +*/ +func (a *StagesAPIService) StagesSourcePartialUpdate(ctx context.Context, stageUuid string) ApiStagesSourcePartialUpdateRequest { + return ApiStagesSourcePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return SourceStage +func (a *StagesAPIService) StagesSourcePartialUpdateExecute(r ApiStagesSourcePartialUpdateRequest) (*SourceStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SourceStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourcePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedSourceStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourceRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesSourceRetrieveRequest) Execute() (*SourceStage, *http.Response, error) { + return r.ApiService.StagesSourceRetrieveExecute(r) +} + +/* +StagesSourceRetrieve Method for StagesSourceRetrieve + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Source Stage. + @return ApiStagesSourceRetrieveRequest +*/ +func (a *StagesAPIService) StagesSourceRetrieve(ctx context.Context, stageUuid string) ApiStagesSourceRetrieveRequest { + return ApiStagesSourceRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return SourceStage +func (a *StagesAPIService) StagesSourceRetrieveExecute(r ApiStagesSourceRetrieveRequest) (*SourceStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SourceStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourceUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + sourceStageRequest *SourceStageRequest +} + +func (r ApiStagesSourceUpdateRequest) SourceStageRequest(sourceStageRequest SourceStageRequest) ApiStagesSourceUpdateRequest { + r.sourceStageRequest = &sourceStageRequest + return r +} + +func (r ApiStagesSourceUpdateRequest) Execute() (*SourceStage, *http.Response, error) { + return r.ApiService.StagesSourceUpdateExecute(r) +} + +/* +StagesSourceUpdate Method for StagesSourceUpdate + +SourceStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Source Stage. + @return ApiStagesSourceUpdateRequest +*/ +func (a *StagesAPIService) StagesSourceUpdate(ctx context.Context, stageUuid string) ApiStagesSourceUpdateRequest { + return ApiStagesSourceUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return SourceStage +func (a *StagesAPIService) StagesSourceUpdateExecute(r ApiStagesSourceUpdateRequest) (*SourceStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SourceStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.sourceStageRequest == nil { + return localVarReturnValue, nil, reportError("sourceStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.sourceStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesSourceUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesSourceUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesSourceUsedByListExecute(r) +} + +/* +StagesSourceUsedByList Method for StagesSourceUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this Source Stage. + @return ApiStagesSourceUsedByListRequest +*/ +func (a *StagesAPIService) StagesSourceUsedByList(ctx context.Context, stageUuid string) ApiStagesSourceUsedByListRequest { + return ApiStagesSourceUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesSourceUsedByListExecute(r ApiStagesSourceUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesSourceUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/source/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + userDeleteStageRequest *UserDeleteStageRequest +} + +func (r ApiStagesUserDeleteCreateRequest) UserDeleteStageRequest(userDeleteStageRequest UserDeleteStageRequest) ApiStagesUserDeleteCreateRequest { + r.userDeleteStageRequest = &userDeleteStageRequest + return r +} + +func (r ApiStagesUserDeleteCreateRequest) Execute() (*UserDeleteStage, *http.Response, error) { + return r.ApiService.StagesUserDeleteCreateExecute(r) +} + +/* +StagesUserDeleteCreate Method for StagesUserDeleteCreate + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserDeleteCreateRequest +*/ +func (a *StagesAPIService) StagesUserDeleteCreate(ctx context.Context) ApiStagesUserDeleteCreateRequest { + return ApiStagesUserDeleteCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserDeleteStage +func (a *StagesAPIService) StagesUserDeleteCreateExecute(r ApiStagesUserDeleteCreateRequest) (*UserDeleteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserDeleteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userDeleteStageRequest == nil { + return localVarReturnValue, nil, reportError("userDeleteStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userDeleteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserDeleteDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesUserDeleteDestroyExecute(r) +} + +/* +StagesUserDeleteDestroy Method for StagesUserDeleteDestroy + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Delete Stage. + @return ApiStagesUserDeleteDestroyRequest +*/ +func (a *StagesAPIService) StagesUserDeleteDestroy(ctx context.Context, stageUuid string) ApiStagesUserDeleteDestroyRequest { + return ApiStagesUserDeleteDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesUserDeleteDestroyExecute(r ApiStagesUserDeleteDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesUserDeleteListRequest) Name(name string) ApiStagesUserDeleteListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesUserDeleteListRequest) Ordering(ordering string) ApiStagesUserDeleteListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesUserDeleteListRequest) Page(page int32) ApiStagesUserDeleteListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesUserDeleteListRequest) PageSize(pageSize int32) ApiStagesUserDeleteListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesUserDeleteListRequest) Search(search string) ApiStagesUserDeleteListRequest { + r.search = &search + return r +} + +func (r ApiStagesUserDeleteListRequest) StageUuid(stageUuid string) ApiStagesUserDeleteListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesUserDeleteListRequest) Execute() (*PaginatedUserDeleteStageList, *http.Response, error) { + return r.ApiService.StagesUserDeleteListExecute(r) +} + +/* +StagesUserDeleteList Method for StagesUserDeleteList + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserDeleteListRequest +*/ +func (a *StagesAPIService) StagesUserDeleteList(ctx context.Context) ApiStagesUserDeleteListRequest { + return ApiStagesUserDeleteListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserDeleteStageList +func (a *StagesAPIService) StagesUserDeleteListExecute(r ApiStagesUserDeleteListRequest) (*PaginatedUserDeleteStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserDeleteStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeletePartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedUserDeleteStageRequest *PatchedUserDeleteStageRequest +} + +func (r ApiStagesUserDeletePartialUpdateRequest) PatchedUserDeleteStageRequest(patchedUserDeleteStageRequest PatchedUserDeleteStageRequest) ApiStagesUserDeletePartialUpdateRequest { + r.patchedUserDeleteStageRequest = &patchedUserDeleteStageRequest + return r +} + +func (r ApiStagesUserDeletePartialUpdateRequest) Execute() (*UserDeleteStage, *http.Response, error) { + return r.ApiService.StagesUserDeletePartialUpdateExecute(r) +} + +/* +StagesUserDeletePartialUpdate Method for StagesUserDeletePartialUpdate + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Delete Stage. + @return ApiStagesUserDeletePartialUpdateRequest +*/ +func (a *StagesAPIService) StagesUserDeletePartialUpdate(ctx context.Context, stageUuid string) ApiStagesUserDeletePartialUpdateRequest { + return ApiStagesUserDeletePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserDeleteStage +func (a *StagesAPIService) StagesUserDeletePartialUpdateExecute(r ApiStagesUserDeletePartialUpdateRequest) (*UserDeleteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserDeleteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeletePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserDeleteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserDeleteRetrieveRequest) Execute() (*UserDeleteStage, *http.Response, error) { + return r.ApiService.StagesUserDeleteRetrieveExecute(r) +} + +/* +StagesUserDeleteRetrieve Method for StagesUserDeleteRetrieve + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Delete Stage. + @return ApiStagesUserDeleteRetrieveRequest +*/ +func (a *StagesAPIService) StagesUserDeleteRetrieve(ctx context.Context, stageUuid string) ApiStagesUserDeleteRetrieveRequest { + return ApiStagesUserDeleteRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserDeleteStage +func (a *StagesAPIService) StagesUserDeleteRetrieveExecute(r ApiStagesUserDeleteRetrieveRequest) (*UserDeleteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserDeleteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + userDeleteStageRequest *UserDeleteStageRequest +} + +func (r ApiStagesUserDeleteUpdateRequest) UserDeleteStageRequest(userDeleteStageRequest UserDeleteStageRequest) ApiStagesUserDeleteUpdateRequest { + r.userDeleteStageRequest = &userDeleteStageRequest + return r +} + +func (r ApiStagesUserDeleteUpdateRequest) Execute() (*UserDeleteStage, *http.Response, error) { + return r.ApiService.StagesUserDeleteUpdateExecute(r) +} + +/* +StagesUserDeleteUpdate Method for StagesUserDeleteUpdate + +UserDeleteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Delete Stage. + @return ApiStagesUserDeleteUpdateRequest +*/ +func (a *StagesAPIService) StagesUserDeleteUpdate(ctx context.Context, stageUuid string) ApiStagesUserDeleteUpdateRequest { + return ApiStagesUserDeleteUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserDeleteStage +func (a *StagesAPIService) StagesUserDeleteUpdateExecute(r ApiStagesUserDeleteUpdateRequest) (*UserDeleteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserDeleteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userDeleteStageRequest == nil { + return localVarReturnValue, nil, reportError("userDeleteStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userDeleteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserDeleteUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserDeleteUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesUserDeleteUsedByListExecute(r) +} + +/* +StagesUserDeleteUsedByList Method for StagesUserDeleteUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Delete Stage. + @return ApiStagesUserDeleteUsedByListRequest +*/ +func (a *StagesAPIService) StagesUserDeleteUsedByList(ctx context.Context, stageUuid string) ApiStagesUserDeleteUsedByListRequest { + return ApiStagesUserDeleteUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesUserDeleteUsedByListExecute(r ApiStagesUserDeleteUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserDeleteUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_delete/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + userLoginStageRequest *UserLoginStageRequest +} + +func (r ApiStagesUserLoginCreateRequest) UserLoginStageRequest(userLoginStageRequest UserLoginStageRequest) ApiStagesUserLoginCreateRequest { + r.userLoginStageRequest = &userLoginStageRequest + return r +} + +func (r ApiStagesUserLoginCreateRequest) Execute() (*UserLoginStage, *http.Response, error) { + return r.ApiService.StagesUserLoginCreateExecute(r) +} + +/* +StagesUserLoginCreate Method for StagesUserLoginCreate + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserLoginCreateRequest +*/ +func (a *StagesAPIService) StagesUserLoginCreate(ctx context.Context) ApiStagesUserLoginCreateRequest { + return ApiStagesUserLoginCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserLoginStage +func (a *StagesAPIService) StagesUserLoginCreateExecute(r ApiStagesUserLoginCreateRequest) (*UserLoginStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLoginStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLoginStageRequest == nil { + return localVarReturnValue, nil, reportError("userLoginStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLoginStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLoginDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesUserLoginDestroyExecute(r) +} + +/* +StagesUserLoginDestroy Method for StagesUserLoginDestroy + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Login Stage. + @return ApiStagesUserLoginDestroyRequest +*/ +func (a *StagesAPIService) StagesUserLoginDestroy(ctx context.Context, stageUuid string) ApiStagesUserLoginDestroyRequest { + return ApiStagesUserLoginDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesUserLoginDestroyExecute(r ApiStagesUserLoginDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesUserLoginListRequest struct { + ctx context.Context + ApiService *StagesAPIService + geoipBinding *string + name *string + networkBinding *string + ordering *string + page *int32 + pageSize *int32 + rememberDevice *string + rememberMeOffset *string + search *string + sessionDuration *string + stageUuid *string + terminateOtherSessions *bool +} + +// Bind sessions created by this stage to the configured GeoIP location +func (r ApiStagesUserLoginListRequest) GeoipBinding(geoipBinding string) ApiStagesUserLoginListRequest { + r.geoipBinding = &geoipBinding + return r +} + +func (r ApiStagesUserLoginListRequest) Name(name string) ApiStagesUserLoginListRequest { + r.name = &name + return r +} + +// Bind sessions created by this stage to the configured network +func (r ApiStagesUserLoginListRequest) NetworkBinding(networkBinding string) ApiStagesUserLoginListRequest { + r.networkBinding = &networkBinding + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesUserLoginListRequest) Ordering(ordering string) ApiStagesUserLoginListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesUserLoginListRequest) Page(page int32) ApiStagesUserLoginListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesUserLoginListRequest) PageSize(pageSize int32) ApiStagesUserLoginListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiStagesUserLoginListRequest) RememberDevice(rememberDevice string) ApiStagesUserLoginListRequest { + r.rememberDevice = &rememberDevice + return r +} + +func (r ApiStagesUserLoginListRequest) RememberMeOffset(rememberMeOffset string) ApiStagesUserLoginListRequest { + r.rememberMeOffset = &rememberMeOffset + return r +} + +// A search term. +func (r ApiStagesUserLoginListRequest) Search(search string) ApiStagesUserLoginListRequest { + r.search = &search + return r +} + +func (r ApiStagesUserLoginListRequest) SessionDuration(sessionDuration string) ApiStagesUserLoginListRequest { + r.sessionDuration = &sessionDuration + return r +} + +func (r ApiStagesUserLoginListRequest) StageUuid(stageUuid string) ApiStagesUserLoginListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesUserLoginListRequest) TerminateOtherSessions(terminateOtherSessions bool) ApiStagesUserLoginListRequest { + r.terminateOtherSessions = &terminateOtherSessions + return r +} + +func (r ApiStagesUserLoginListRequest) Execute() (*PaginatedUserLoginStageList, *http.Response, error) { + return r.ApiService.StagesUserLoginListExecute(r) +} + +/* +StagesUserLoginList Method for StagesUserLoginList + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserLoginListRequest +*/ +func (a *StagesAPIService) StagesUserLoginList(ctx context.Context) ApiStagesUserLoginListRequest { + return ApiStagesUserLoginListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserLoginStageList +func (a *StagesAPIService) StagesUserLoginListExecute(r ApiStagesUserLoginListRequest) (*PaginatedUserLoginStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserLoginStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.geoipBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "geoip_binding", r.geoipBinding, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.networkBinding != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "network_binding", r.networkBinding, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.rememberDevice != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "remember_device", r.rememberDevice, "form", "") + } + if r.rememberMeOffset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "remember_me_offset", r.rememberMeOffset, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.sessionDuration != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "session_duration", r.sessionDuration, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.terminateOtherSessions != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "terminate_other_sessions", r.terminateOtherSessions, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedUserLoginStageRequest *PatchedUserLoginStageRequest +} + +func (r ApiStagesUserLoginPartialUpdateRequest) PatchedUserLoginStageRequest(patchedUserLoginStageRequest PatchedUserLoginStageRequest) ApiStagesUserLoginPartialUpdateRequest { + r.patchedUserLoginStageRequest = &patchedUserLoginStageRequest + return r +} + +func (r ApiStagesUserLoginPartialUpdateRequest) Execute() (*UserLoginStage, *http.Response, error) { + return r.ApiService.StagesUserLoginPartialUpdateExecute(r) +} + +/* +StagesUserLoginPartialUpdate Method for StagesUserLoginPartialUpdate + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Login Stage. + @return ApiStagesUserLoginPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesUserLoginPartialUpdate(ctx context.Context, stageUuid string) ApiStagesUserLoginPartialUpdateRequest { + return ApiStagesUserLoginPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLoginStage +func (a *StagesAPIService) StagesUserLoginPartialUpdateExecute(r ApiStagesUserLoginPartialUpdateRequest) (*UserLoginStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLoginStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserLoginStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLoginRetrieveRequest) Execute() (*UserLoginStage, *http.Response, error) { + return r.ApiService.StagesUserLoginRetrieveExecute(r) +} + +/* +StagesUserLoginRetrieve Method for StagesUserLoginRetrieve + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Login Stage. + @return ApiStagesUserLoginRetrieveRequest +*/ +func (a *StagesAPIService) StagesUserLoginRetrieve(ctx context.Context, stageUuid string) ApiStagesUserLoginRetrieveRequest { + return ApiStagesUserLoginRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLoginStage +func (a *StagesAPIService) StagesUserLoginRetrieveExecute(r ApiStagesUserLoginRetrieveRequest) (*UserLoginStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLoginStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + userLoginStageRequest *UserLoginStageRequest +} + +func (r ApiStagesUserLoginUpdateRequest) UserLoginStageRequest(userLoginStageRequest UserLoginStageRequest) ApiStagesUserLoginUpdateRequest { + r.userLoginStageRequest = &userLoginStageRequest + return r +} + +func (r ApiStagesUserLoginUpdateRequest) Execute() (*UserLoginStage, *http.Response, error) { + return r.ApiService.StagesUserLoginUpdateExecute(r) +} + +/* +StagesUserLoginUpdate Method for StagesUserLoginUpdate + +UserLoginStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Login Stage. + @return ApiStagesUserLoginUpdateRequest +*/ +func (a *StagesAPIService) StagesUserLoginUpdate(ctx context.Context, stageUuid string) ApiStagesUserLoginUpdateRequest { + return ApiStagesUserLoginUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLoginStage +func (a *StagesAPIService) StagesUserLoginUpdateExecute(r ApiStagesUserLoginUpdateRequest) (*UserLoginStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLoginStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLoginStageRequest == nil { + return localVarReturnValue, nil, reportError("userLoginStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLoginStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLoginUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLoginUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesUserLoginUsedByListExecute(r) +} + +/* +StagesUserLoginUsedByList Method for StagesUserLoginUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Login Stage. + @return ApiStagesUserLoginUsedByListRequest +*/ +func (a *StagesAPIService) StagesUserLoginUsedByList(ctx context.Context, stageUuid string) ApiStagesUserLoginUsedByListRequest { + return ApiStagesUserLoginUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesUserLoginUsedByListExecute(r ApiStagesUserLoginUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLoginUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_login/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + userLogoutStageRequest *UserLogoutStageRequest +} + +func (r ApiStagesUserLogoutCreateRequest) UserLogoutStageRequest(userLogoutStageRequest UserLogoutStageRequest) ApiStagesUserLogoutCreateRequest { + r.userLogoutStageRequest = &userLogoutStageRequest + return r +} + +func (r ApiStagesUserLogoutCreateRequest) Execute() (*UserLogoutStage, *http.Response, error) { + return r.ApiService.StagesUserLogoutCreateExecute(r) +} + +/* +StagesUserLogoutCreate Method for StagesUserLogoutCreate + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserLogoutCreateRequest +*/ +func (a *StagesAPIService) StagesUserLogoutCreate(ctx context.Context) ApiStagesUserLogoutCreateRequest { + return ApiStagesUserLogoutCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserLogoutStage +func (a *StagesAPIService) StagesUserLogoutCreateExecute(r ApiStagesUserLogoutCreateRequest) (*UserLogoutStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLogoutStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLogoutStageRequest == nil { + return localVarReturnValue, nil, reportError("userLogoutStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLogoutStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLogoutDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesUserLogoutDestroyExecute(r) +} + +/* +StagesUserLogoutDestroy Method for StagesUserLogoutDestroy + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Logout Stage. + @return ApiStagesUserLogoutDestroyRequest +*/ +func (a *StagesAPIService) StagesUserLogoutDestroy(ctx context.Context, stageUuid string) ApiStagesUserLogoutDestroyRequest { + return ApiStagesUserLogoutDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesUserLogoutDestroyExecute(r ApiStagesUserLogoutDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutListRequest struct { + ctx context.Context + ApiService *StagesAPIService + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string +} + +func (r ApiStagesUserLogoutListRequest) Name(name string) ApiStagesUserLogoutListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesUserLogoutListRequest) Ordering(ordering string) ApiStagesUserLogoutListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesUserLogoutListRequest) Page(page int32) ApiStagesUserLogoutListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesUserLogoutListRequest) PageSize(pageSize int32) ApiStagesUserLogoutListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesUserLogoutListRequest) Search(search string) ApiStagesUserLogoutListRequest { + r.search = &search + return r +} + +func (r ApiStagesUserLogoutListRequest) StageUuid(stageUuid string) ApiStagesUserLogoutListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesUserLogoutListRequest) Execute() (*PaginatedUserLogoutStageList, *http.Response, error) { + return r.ApiService.StagesUserLogoutListExecute(r) +} + +/* +StagesUserLogoutList Method for StagesUserLogoutList + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserLogoutListRequest +*/ +func (a *StagesAPIService) StagesUserLogoutList(ctx context.Context) ApiStagesUserLogoutListRequest { + return ApiStagesUserLogoutListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserLogoutStageList +func (a *StagesAPIService) StagesUserLogoutListExecute(r ApiStagesUserLogoutListRequest) (*PaginatedUserLogoutStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserLogoutStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutPartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedUserLogoutStageRequest *PatchedUserLogoutStageRequest +} + +func (r ApiStagesUserLogoutPartialUpdateRequest) PatchedUserLogoutStageRequest(patchedUserLogoutStageRequest PatchedUserLogoutStageRequest) ApiStagesUserLogoutPartialUpdateRequest { + r.patchedUserLogoutStageRequest = &patchedUserLogoutStageRequest + return r +} + +func (r ApiStagesUserLogoutPartialUpdateRequest) Execute() (*UserLogoutStage, *http.Response, error) { + return r.ApiService.StagesUserLogoutPartialUpdateExecute(r) +} + +/* +StagesUserLogoutPartialUpdate Method for StagesUserLogoutPartialUpdate + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Logout Stage. + @return ApiStagesUserLogoutPartialUpdateRequest +*/ +func (a *StagesAPIService) StagesUserLogoutPartialUpdate(ctx context.Context, stageUuid string) ApiStagesUserLogoutPartialUpdateRequest { + return ApiStagesUserLogoutPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLogoutStage +func (a *StagesAPIService) StagesUserLogoutPartialUpdateExecute(r ApiStagesUserLogoutPartialUpdateRequest) (*UserLogoutStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLogoutStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserLogoutStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLogoutRetrieveRequest) Execute() (*UserLogoutStage, *http.Response, error) { + return r.ApiService.StagesUserLogoutRetrieveExecute(r) +} + +/* +StagesUserLogoutRetrieve Method for StagesUserLogoutRetrieve + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Logout Stage. + @return ApiStagesUserLogoutRetrieveRequest +*/ +func (a *StagesAPIService) StagesUserLogoutRetrieve(ctx context.Context, stageUuid string) ApiStagesUserLogoutRetrieveRequest { + return ApiStagesUserLogoutRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLogoutStage +func (a *StagesAPIService) StagesUserLogoutRetrieveExecute(r ApiStagesUserLogoutRetrieveRequest) (*UserLogoutStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLogoutStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + userLogoutStageRequest *UserLogoutStageRequest +} + +func (r ApiStagesUserLogoutUpdateRequest) UserLogoutStageRequest(userLogoutStageRequest UserLogoutStageRequest) ApiStagesUserLogoutUpdateRequest { + r.userLogoutStageRequest = &userLogoutStageRequest + return r +} + +func (r ApiStagesUserLogoutUpdateRequest) Execute() (*UserLogoutStage, *http.Response, error) { + return r.ApiService.StagesUserLogoutUpdateExecute(r) +} + +/* +StagesUserLogoutUpdate Method for StagesUserLogoutUpdate + +UserLogoutStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Logout Stage. + @return ApiStagesUserLogoutUpdateRequest +*/ +func (a *StagesAPIService) StagesUserLogoutUpdate(ctx context.Context, stageUuid string) ApiStagesUserLogoutUpdateRequest { + return ApiStagesUserLogoutUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserLogoutStage +func (a *StagesAPIService) StagesUserLogoutUpdateExecute(r ApiStagesUserLogoutUpdateRequest) (*UserLogoutStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserLogoutStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userLogoutStageRequest == nil { + return localVarReturnValue, nil, reportError("userLogoutStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userLogoutStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserLogoutUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserLogoutUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesUserLogoutUsedByListExecute(r) +} + +/* +StagesUserLogoutUsedByList Method for StagesUserLogoutUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Logout Stage. + @return ApiStagesUserLogoutUsedByListRequest +*/ +func (a *StagesAPIService) StagesUserLogoutUsedByList(ctx context.Context, stageUuid string) ApiStagesUserLogoutUsedByListRequest { + return ApiStagesUserLogoutUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesUserLogoutUsedByListExecute(r ApiStagesUserLogoutUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserLogoutUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_logout/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWriteCreateRequest struct { + ctx context.Context + ApiService *StagesAPIService + userWriteStageRequest *UserWriteStageRequest +} + +func (r ApiStagesUserWriteCreateRequest) UserWriteStageRequest(userWriteStageRequest UserWriteStageRequest) ApiStagesUserWriteCreateRequest { + r.userWriteStageRequest = &userWriteStageRequest + return r +} + +func (r ApiStagesUserWriteCreateRequest) Execute() (*UserWriteStage, *http.Response, error) { + return r.ApiService.StagesUserWriteCreateExecute(r) +} + +/* +StagesUserWriteCreate Method for StagesUserWriteCreate + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserWriteCreateRequest +*/ +func (a *StagesAPIService) StagesUserWriteCreate(ctx context.Context) ApiStagesUserWriteCreateRequest { + return ApiStagesUserWriteCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return UserWriteStage +func (a *StagesAPIService) StagesUserWriteCreateExecute(r ApiStagesUserWriteCreateRequest) (*UserWriteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserWriteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userWriteStageRequest == nil { + return localVarReturnValue, nil, reportError("userWriteStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userWriteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWriteDestroyRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserWriteDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.StagesUserWriteDestroyExecute(r) +} + +/* +StagesUserWriteDestroy Method for StagesUserWriteDestroy + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Write Stage. + @return ApiStagesUserWriteDestroyRequest +*/ +func (a *StagesAPIService) StagesUserWriteDestroy(ctx context.Context, stageUuid string) ApiStagesUserWriteDestroyRequest { + return ApiStagesUserWriteDestroyRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +func (a *StagesAPIService) StagesUserWriteDestroyExecute(r ApiStagesUserWriteDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiStagesUserWriteListRequest struct { + ctx context.Context + ApiService *StagesAPIService + createUsersAsInactive *bool + createUsersGroup *string + name *string + ordering *string + page *int32 + pageSize *int32 + search *string + stageUuid *string + userCreationMode *string + userPathTemplate *string + userType *string +} + +func (r ApiStagesUserWriteListRequest) CreateUsersAsInactive(createUsersAsInactive bool) ApiStagesUserWriteListRequest { + r.createUsersAsInactive = &createUsersAsInactive + return r +} + +func (r ApiStagesUserWriteListRequest) CreateUsersGroup(createUsersGroup string) ApiStagesUserWriteListRequest { + r.createUsersGroup = &createUsersGroup + return r +} + +func (r ApiStagesUserWriteListRequest) Name(name string) ApiStagesUserWriteListRequest { + r.name = &name + return r +} + +// Which field to use when ordering the results. +func (r ApiStagesUserWriteListRequest) Ordering(ordering string) ApiStagesUserWriteListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiStagesUserWriteListRequest) Page(page int32) ApiStagesUserWriteListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiStagesUserWriteListRequest) PageSize(pageSize int32) ApiStagesUserWriteListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiStagesUserWriteListRequest) Search(search string) ApiStagesUserWriteListRequest { + r.search = &search + return r +} + +func (r ApiStagesUserWriteListRequest) StageUuid(stageUuid string) ApiStagesUserWriteListRequest { + r.stageUuid = &stageUuid + return r +} + +func (r ApiStagesUserWriteListRequest) UserCreationMode(userCreationMode string) ApiStagesUserWriteListRequest { + r.userCreationMode = &userCreationMode + return r +} + +func (r ApiStagesUserWriteListRequest) UserPathTemplate(userPathTemplate string) ApiStagesUserWriteListRequest { + r.userPathTemplate = &userPathTemplate + return r +} + +func (r ApiStagesUserWriteListRequest) UserType(userType string) ApiStagesUserWriteListRequest { + r.userType = &userType + return r +} + +func (r ApiStagesUserWriteListRequest) Execute() (*PaginatedUserWriteStageList, *http.Response, error) { + return r.ApiService.StagesUserWriteListExecute(r) +} + +/* +StagesUserWriteList Method for StagesUserWriteList + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiStagesUserWriteListRequest +*/ +func (a *StagesAPIService) StagesUserWriteList(ctx context.Context) ApiStagesUserWriteListRequest { + return ApiStagesUserWriteListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedUserWriteStageList +func (a *StagesAPIService) StagesUserWriteListExecute(r ApiStagesUserWriteListRequest) (*PaginatedUserWriteStageList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedUserWriteStageList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.createUsersAsInactive != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "create_users_as_inactive", r.createUsersAsInactive, "form", "") + } + if r.createUsersGroup != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "create_users_group", r.createUsersGroup, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.stageUuid != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "stage_uuid", r.stageUuid, "form", "") + } + if r.userCreationMode != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_creation_mode", r.userCreationMode, "form", "") + } + if r.userPathTemplate != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_path_template", r.userPathTemplate, "form", "") + } + if r.userType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "user_type", r.userType, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWritePartialUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + patchedUserWriteStageRequest *PatchedUserWriteStageRequest +} + +func (r ApiStagesUserWritePartialUpdateRequest) PatchedUserWriteStageRequest(patchedUserWriteStageRequest PatchedUserWriteStageRequest) ApiStagesUserWritePartialUpdateRequest { + r.patchedUserWriteStageRequest = &patchedUserWriteStageRequest + return r +} + +func (r ApiStagesUserWritePartialUpdateRequest) Execute() (*UserWriteStage, *http.Response, error) { + return r.ApiService.StagesUserWritePartialUpdateExecute(r) +} + +/* +StagesUserWritePartialUpdate Method for StagesUserWritePartialUpdate + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Write Stage. + @return ApiStagesUserWritePartialUpdateRequest +*/ +func (a *StagesAPIService) StagesUserWritePartialUpdate(ctx context.Context, stageUuid string) ApiStagesUserWritePartialUpdateRequest { + return ApiStagesUserWritePartialUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserWriteStage +func (a *StagesAPIService) StagesUserWritePartialUpdateExecute(r ApiStagesUserWritePartialUpdateRequest) (*UserWriteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserWriteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWritePartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedUserWriteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWriteRetrieveRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserWriteRetrieveRequest) Execute() (*UserWriteStage, *http.Response, error) { + return r.ApiService.StagesUserWriteRetrieveExecute(r) +} + +/* +StagesUserWriteRetrieve Method for StagesUserWriteRetrieve + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Write Stage. + @return ApiStagesUserWriteRetrieveRequest +*/ +func (a *StagesAPIService) StagesUserWriteRetrieve(ctx context.Context, stageUuid string) ApiStagesUserWriteRetrieveRequest { + return ApiStagesUserWriteRetrieveRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserWriteStage +func (a *StagesAPIService) StagesUserWriteRetrieveExecute(r ApiStagesUserWriteRetrieveRequest) (*UserWriteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserWriteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWriteUpdateRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string + userWriteStageRequest *UserWriteStageRequest +} + +func (r ApiStagesUserWriteUpdateRequest) UserWriteStageRequest(userWriteStageRequest UserWriteStageRequest) ApiStagesUserWriteUpdateRequest { + r.userWriteStageRequest = &userWriteStageRequest + return r +} + +func (r ApiStagesUserWriteUpdateRequest) Execute() (*UserWriteStage, *http.Response, error) { + return r.ApiService.StagesUserWriteUpdateExecute(r) +} + +/* +StagesUserWriteUpdate Method for StagesUserWriteUpdate + +UserWriteStage Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Write Stage. + @return ApiStagesUserWriteUpdateRequest +*/ +func (a *StagesAPIService) StagesUserWriteUpdate(ctx context.Context, stageUuid string) ApiStagesUserWriteUpdateRequest { + return ApiStagesUserWriteUpdateRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return UserWriteStage +func (a *StagesAPIService) StagesUserWriteUpdateExecute(r ApiStagesUserWriteUpdateRequest) (*UserWriteStage, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *UserWriteStage + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/{stage_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.userWriteStageRequest == nil { + return localVarReturnValue, nil, reportError("userWriteStageRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.userWriteStageRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiStagesUserWriteUsedByListRequest struct { + ctx context.Context + ApiService *StagesAPIService + stageUuid string +} + +func (r ApiStagesUserWriteUsedByListRequest) Execute() ([]UsedBy, *http.Response, error) { + return r.ApiService.StagesUserWriteUsedByListExecute(r) +} + +/* +StagesUserWriteUsedByList Method for StagesUserWriteUsedByList + +Get a list of all objects that use this object + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param stageUuid A UUID string identifying this User Write Stage. + @return ApiStagesUserWriteUsedByListRequest +*/ +func (a *StagesAPIService) StagesUserWriteUsedByList(ctx context.Context, stageUuid string) ApiStagesUserWriteUsedByListRequest { + return ApiStagesUserWriteUsedByListRequest{ + ApiService: a, + ctx: ctx, + stageUuid: stageUuid, + } +} + +// Execute executes the request +// +// @return []UsedBy +func (a *StagesAPIService) StagesUserWriteUsedByListExecute(r ApiStagesUserWriteUsedByListRequest) ([]UsedBy, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []UsedBy + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "StagesAPIService.StagesUserWriteUsedByList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/stages/user_write/{stage_uuid}/used_by/" + localVarPath = strings.Replace(localVarPath, "{"+"stage_uuid"+"}", url.PathEscape(parameterValueToString(r.stageUuid, "stageUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_tasks.go b/packages/client-go/api_tasks.go new file mode 100644 index 0000000000..a132f83123 --- /dev/null +++ b/packages/client-go/api_tasks.go @@ -0,0 +1,1446 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "reflect" + "strings" +) + +// TasksAPIService TasksAPI service +type TasksAPIService service + +type ApiTasksSchedulesListRequest struct { + ctx context.Context + ApiService *TasksAPIService + actorName *string + ordering *string + page *int32 + pageSize *int32 + paused *bool + relObjContentTypeAppLabel *string + relObjContentTypeModel *string + relObjId *string + relObjIdIsnull *bool + search *string +} + +func (r ApiTasksSchedulesListRequest) ActorName(actorName string) ApiTasksSchedulesListRequest { + r.actorName = &actorName + return r +} + +// Which field to use when ordering the results. +func (r ApiTasksSchedulesListRequest) Ordering(ordering string) ApiTasksSchedulesListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiTasksSchedulesListRequest) Page(page int32) ApiTasksSchedulesListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiTasksSchedulesListRequest) PageSize(pageSize int32) ApiTasksSchedulesListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiTasksSchedulesListRequest) Paused(paused bool) ApiTasksSchedulesListRequest { + r.paused = &paused + return r +} + +func (r ApiTasksSchedulesListRequest) RelObjContentTypeAppLabel(relObjContentTypeAppLabel string) ApiTasksSchedulesListRequest { + r.relObjContentTypeAppLabel = &relObjContentTypeAppLabel + return r +} + +func (r ApiTasksSchedulesListRequest) RelObjContentTypeModel(relObjContentTypeModel string) ApiTasksSchedulesListRequest { + r.relObjContentTypeModel = &relObjContentTypeModel + return r +} + +func (r ApiTasksSchedulesListRequest) RelObjId(relObjId string) ApiTasksSchedulesListRequest { + r.relObjId = &relObjId + return r +} + +func (r ApiTasksSchedulesListRequest) RelObjIdIsnull(relObjIdIsnull bool) ApiTasksSchedulesListRequest { + r.relObjIdIsnull = &relObjIdIsnull + return r +} + +// A search term. +func (r ApiTasksSchedulesListRequest) Search(search string) ApiTasksSchedulesListRequest { + r.search = &search + return r +} + +func (r ApiTasksSchedulesListRequest) Execute() (*PaginatedScheduleList, *http.Response, error) { + return r.ApiService.TasksSchedulesListExecute(r) +} + +/* +TasksSchedulesList Method for TasksSchedulesList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTasksSchedulesListRequest +*/ +func (a *TasksAPIService) TasksSchedulesList(ctx context.Context) ApiTasksSchedulesListRequest { + return ApiTasksSchedulesListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedScheduleList +func (a *TasksAPIService) TasksSchedulesListExecute(r ApiTasksSchedulesListRequest) (*PaginatedScheduleList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedScheduleList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksSchedulesList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/schedules/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.actorName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "actor_name", r.actorName, "form", "") + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.paused != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "paused", r.paused, "form", "") + } + if r.relObjContentTypeAppLabel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_content_type__app_label", r.relObjContentTypeAppLabel, "form", "") + } + if r.relObjContentTypeModel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_content_type__model", r.relObjContentTypeModel, "form", "") + } + if r.relObjId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_id", r.relObjId, "form", "") + } + if r.relObjIdIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_id__isnull", r.relObjIdIsnull, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksSchedulesPartialUpdateRequest struct { + ctx context.Context + ApiService *TasksAPIService + id string + patchedScheduleRequest *PatchedScheduleRequest +} + +func (r ApiTasksSchedulesPartialUpdateRequest) PatchedScheduleRequest(patchedScheduleRequest PatchedScheduleRequest) ApiTasksSchedulesPartialUpdateRequest { + r.patchedScheduleRequest = &patchedScheduleRequest + return r +} + +func (r ApiTasksSchedulesPartialUpdateRequest) Execute() (*Schedule, *http.Response, error) { + return r.ApiService.TasksSchedulesPartialUpdateExecute(r) +} + +/* +TasksSchedulesPartialUpdate Method for TasksSchedulesPartialUpdate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Schedule. + @return ApiTasksSchedulesPartialUpdateRequest +*/ +func (a *TasksAPIService) TasksSchedulesPartialUpdate(ctx context.Context, id string) ApiTasksSchedulesPartialUpdateRequest { + return ApiTasksSchedulesPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Schedule +func (a *TasksAPIService) TasksSchedulesPartialUpdateExecute(r ApiTasksSchedulesPartialUpdateRequest) (*Schedule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Schedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksSchedulesPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/schedules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedScheduleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksSchedulesRetrieveRequest struct { + ctx context.Context + ApiService *TasksAPIService + id string +} + +func (r ApiTasksSchedulesRetrieveRequest) Execute() (*Schedule, *http.Response, error) { + return r.ApiService.TasksSchedulesRetrieveExecute(r) +} + +/* +TasksSchedulesRetrieve Method for TasksSchedulesRetrieve + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Schedule. + @return ApiTasksSchedulesRetrieveRequest +*/ +func (a *TasksAPIService) TasksSchedulesRetrieve(ctx context.Context, id string) ApiTasksSchedulesRetrieveRequest { + return ApiTasksSchedulesRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Schedule +func (a *TasksAPIService) TasksSchedulesRetrieveExecute(r ApiTasksSchedulesRetrieveRequest) (*Schedule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Schedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksSchedulesRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/schedules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksSchedulesSendCreateRequest struct { + ctx context.Context + ApiService *TasksAPIService + id string +} + +func (r ApiTasksSchedulesSendCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.TasksSchedulesSendCreateExecute(r) +} + +/* +TasksSchedulesSendCreate Method for TasksSchedulesSendCreate + +Trigger this schedule now + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Schedule. + @return ApiTasksSchedulesSendCreateRequest +*/ +func (a *TasksAPIService) TasksSchedulesSendCreate(ctx context.Context, id string) ApiTasksSchedulesSendCreateRequest { + return ApiTasksSchedulesSendCreateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TasksAPIService) TasksSchedulesSendCreateExecute(r ApiTasksSchedulesSendCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksSchedulesSendCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/schedules/{id}/send/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTasksSchedulesUpdateRequest struct { + ctx context.Context + ApiService *TasksAPIService + id string + scheduleRequest *ScheduleRequest +} + +func (r ApiTasksSchedulesUpdateRequest) ScheduleRequest(scheduleRequest ScheduleRequest) ApiTasksSchedulesUpdateRequest { + r.scheduleRequest = &scheduleRequest + return r +} + +func (r ApiTasksSchedulesUpdateRequest) Execute() (*Schedule, *http.Response, error) { + return r.ApiService.TasksSchedulesUpdateExecute(r) +} + +/* +TasksSchedulesUpdate Method for TasksSchedulesUpdate + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A UUID string identifying this Schedule. + @return ApiTasksSchedulesUpdateRequest +*/ +func (a *TasksAPIService) TasksSchedulesUpdate(ctx context.Context, id string) ApiTasksSchedulesUpdateRequest { + return ApiTasksSchedulesUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Schedule +func (a *TasksAPIService) TasksSchedulesUpdateExecute(r ApiTasksSchedulesUpdateRequest) (*Schedule, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Schedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksSchedulesUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/schedules/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.scheduleRequest == nil { + return localVarReturnValue, nil, reportError("scheduleRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.scheduleRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksTasksListRequest struct { + ctx context.Context + ApiService *TasksAPIService + actorName *string + aggregatedStatus *[]string + ordering *string + page *int32 + pageSize *int32 + queueName *string + relObjContentTypeAppLabel *string + relObjContentTypeModel *string + relObjId *string + relObjIdIsnull *bool + search *string + state *string +} + +func (r ApiTasksTasksListRequest) ActorName(actorName string) ApiTasksTasksListRequest { + r.actorName = &actorName + return r +} + +func (r ApiTasksTasksListRequest) AggregatedStatus(aggregatedStatus []string) ApiTasksTasksListRequest { + r.aggregatedStatus = &aggregatedStatus + return r +} + +// Which field to use when ordering the results. +func (r ApiTasksTasksListRequest) Ordering(ordering string) ApiTasksTasksListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiTasksTasksListRequest) Page(page int32) ApiTasksTasksListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiTasksTasksListRequest) PageSize(pageSize int32) ApiTasksTasksListRequest { + r.pageSize = &pageSize + return r +} + +func (r ApiTasksTasksListRequest) QueueName(queueName string) ApiTasksTasksListRequest { + r.queueName = &queueName + return r +} + +func (r ApiTasksTasksListRequest) RelObjContentTypeAppLabel(relObjContentTypeAppLabel string) ApiTasksTasksListRequest { + r.relObjContentTypeAppLabel = &relObjContentTypeAppLabel + return r +} + +func (r ApiTasksTasksListRequest) RelObjContentTypeModel(relObjContentTypeModel string) ApiTasksTasksListRequest { + r.relObjContentTypeModel = &relObjContentTypeModel + return r +} + +func (r ApiTasksTasksListRequest) RelObjId(relObjId string) ApiTasksTasksListRequest { + r.relObjId = &relObjId + return r +} + +func (r ApiTasksTasksListRequest) RelObjIdIsnull(relObjIdIsnull bool) ApiTasksTasksListRequest { + r.relObjIdIsnull = &relObjIdIsnull + return r +} + +// A search term. +func (r ApiTasksTasksListRequest) Search(search string) ApiTasksTasksListRequest { + r.search = &search + return r +} + +// Task status +func (r ApiTasksTasksListRequest) State(state string) ApiTasksTasksListRequest { + r.state = &state + return r +} + +func (r ApiTasksTasksListRequest) Execute() (*PaginatedTaskList, *http.Response, error) { + return r.ApiService.TasksTasksListExecute(r) +} + +/* +TasksTasksList Method for TasksTasksList + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTasksTasksListRequest +*/ +func (a *TasksAPIService) TasksTasksList(ctx context.Context) ApiTasksTasksListRequest { + return ApiTasksTasksListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTaskList +func (a *TasksAPIService) TasksTasksListExecute(r ApiTasksTasksListRequest) (*PaginatedTaskList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTaskList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksTasksList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/tasks/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.actorName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "actor_name", r.actorName, "form", "") + } + if r.aggregatedStatus != nil { + t := *r.aggregatedStatus + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + parameterAddToHeaderOrQuery(localVarQueryParams, "aggregated_status", s.Index(i).Interface(), "form", "multi") + } + } else { + parameterAddToHeaderOrQuery(localVarQueryParams, "aggregated_status", t, "form", "multi") + } + } + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.queueName != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "queue_name", r.queueName, "form", "") + } + if r.relObjContentTypeAppLabel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_content_type__app_label", r.relObjContentTypeAppLabel, "form", "") + } + if r.relObjContentTypeModel != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_content_type__model", r.relObjContentTypeModel, "form", "") + } + if r.relObjId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_id", r.relObjId, "form", "") + } + if r.relObjIdIsnull != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "rel_obj_id__isnull", r.relObjIdIsnull, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksTasksRetrieveRequest struct { + ctx context.Context + ApiService *TasksAPIService + messageId string +} + +func (r ApiTasksTasksRetrieveRequest) Execute() (*Task, *http.Response, error) { + return r.ApiService.TasksTasksRetrieveExecute(r) +} + +/* +TasksTasksRetrieve Method for TasksTasksRetrieve + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param messageId A UUID string identifying this Task. + @return ApiTasksTasksRetrieveRequest +*/ +func (a *TasksAPIService) TasksTasksRetrieve(ctx context.Context, messageId string) ApiTasksTasksRetrieveRequest { + return ApiTasksTasksRetrieveRequest{ + ApiService: a, + ctx: ctx, + messageId: messageId, + } +} + +// Execute executes the request +// +// @return Task +func (a *TasksAPIService) TasksTasksRetrieveExecute(r ApiTasksTasksRetrieveRequest) (*Task, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Task + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksTasksRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/tasks/{message_id}/" + localVarPath = strings.Replace(localVarPath, "{"+"message_id"+"}", url.PathEscape(parameterValueToString(r.messageId, "messageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksTasksRetryCreateRequest struct { + ctx context.Context + ApiService *TasksAPIService + messageId string +} + +func (r ApiTasksTasksRetryCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.TasksTasksRetryCreateExecute(r) +} + +/* +TasksTasksRetryCreate Method for TasksTasksRetryCreate + +Retry task + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param messageId A UUID string identifying this Task. + @return ApiTasksTasksRetryCreateRequest +*/ +func (a *TasksAPIService) TasksTasksRetryCreate(ctx context.Context, messageId string) ApiTasksTasksRetryCreateRequest { + return ApiTasksTasksRetryCreateRequest{ + ApiService: a, + ctx: ctx, + messageId: messageId, + } +} + +// Execute executes the request +func (a *TasksAPIService) TasksTasksRetryCreateExecute(r ApiTasksTasksRetryCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksTasksRetryCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/tasks/{message_id}/retry/" + localVarPath = strings.Replace(localVarPath, "{"+"message_id"+"}", url.PathEscape(parameterValueToString(r.messageId, "messageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTasksTasksStatusRetrieveRequest struct { + ctx context.Context + ApiService *TasksAPIService +} + +func (r ApiTasksTasksStatusRetrieveRequest) Execute() (*GlobalTaskStatus, *http.Response, error) { + return r.ApiService.TasksTasksStatusRetrieveExecute(r) +} + +/* +TasksTasksStatusRetrieve Method for TasksTasksStatusRetrieve + +Global status summary for all tasks + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTasksTasksStatusRetrieveRequest +*/ +func (a *TasksAPIService) TasksTasksStatusRetrieve(ctx context.Context) ApiTasksTasksStatusRetrieveRequest { + return ApiTasksTasksStatusRetrieveRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return GlobalTaskStatus +func (a *TasksAPIService) TasksTasksStatusRetrieveExecute(r ApiTasksTasksStatusRetrieveRequest) (*GlobalTaskStatus, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GlobalTaskStatus + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksTasksStatusRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/tasks/status/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTasksWorkersListRequest struct { + ctx context.Context + ApiService *TasksAPIService +} + +func (r ApiTasksWorkersListRequest) Execute() ([]Worker, *http.Response, error) { + return r.ApiService.TasksWorkersListExecute(r) +} + +/* +TasksWorkersList Method for TasksWorkersList + +Get currently connected worker count. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTasksWorkersListRequest +*/ +func (a *TasksAPIService) TasksWorkersList(ctx context.Context) ApiTasksWorkersListRequest { + return ApiTasksWorkersListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []Worker +func (a *TasksAPIService) TasksWorkersListExecute(r ApiTasksWorkersListRequest) ([]Worker, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []Worker + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TasksAPIService.TasksWorkersList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tasks/workers/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/api_tenants.go b/packages/client-go/api_tenants.go new file mode 100644 index 0000000000..1eda4b55af --- /dev/null +++ b/packages/client-go/api_tenants.go @@ -0,0 +1,1862 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// TenantsAPIService TenantsAPI service +type TenantsAPIService service + +type ApiTenantsDomainsCreateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + domainRequest *DomainRequest +} + +func (r ApiTenantsDomainsCreateRequest) DomainRequest(domainRequest DomainRequest) ApiTenantsDomainsCreateRequest { + r.domainRequest = &domainRequest + return r +} + +func (r ApiTenantsDomainsCreateRequest) Execute() (*Domain, *http.Response, error) { + return r.ApiService.TenantsDomainsCreateExecute(r) +} + +/* +TenantsDomainsCreate Method for TenantsDomainsCreate + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenantsDomainsCreateRequest +*/ +func (a *TenantsAPIService) TenantsDomainsCreate(ctx context.Context) ApiTenantsDomainsCreateRequest { + return ApiTenantsDomainsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Domain +func (a *TenantsAPIService) TenantsDomainsCreateExecute(r ApiTenantsDomainsCreateRequest) (*Domain, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Domain + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.domainRequest == nil { + return localVarReturnValue, nil, reportError("domainRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.domainRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsDomainsDestroyRequest struct { + ctx context.Context + ApiService *TenantsAPIService + id int32 +} + +func (r ApiTenantsDomainsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenantsDomainsDestroyExecute(r) +} + +/* +TenantsDomainsDestroy Method for TenantsDomainsDestroy + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Domain. + @return ApiTenantsDomainsDestroyRequest +*/ +func (a *TenantsAPIService) TenantsDomainsDestroy(ctx context.Context, id int32) ApiTenantsDomainsDestroyRequest { + return ApiTenantsDomainsDestroyRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +func (a *TenantsAPIService) TenantsDomainsDestroyExecute(r ApiTenantsDomainsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenantsDomainsListRequest struct { + ctx context.Context + ApiService *TenantsAPIService + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Which field to use when ordering the results. +func (r ApiTenantsDomainsListRequest) Ordering(ordering string) ApiTenantsDomainsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiTenantsDomainsListRequest) Page(page int32) ApiTenantsDomainsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiTenantsDomainsListRequest) PageSize(pageSize int32) ApiTenantsDomainsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiTenantsDomainsListRequest) Search(search string) ApiTenantsDomainsListRequest { + r.search = &search + return r +} + +func (r ApiTenantsDomainsListRequest) Execute() (*PaginatedDomainList, *http.Response, error) { + return r.ApiService.TenantsDomainsListExecute(r) +} + +/* +TenantsDomainsList Method for TenantsDomainsList + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenantsDomainsListRequest +*/ +func (a *TenantsAPIService) TenantsDomainsList(ctx context.Context) ApiTenantsDomainsListRequest { + return ApiTenantsDomainsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedDomainList +func (a *TenantsAPIService) TenantsDomainsListExecute(r ApiTenantsDomainsListRequest) (*PaginatedDomainList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedDomainList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsDomainsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + id int32 + patchedDomainRequest *PatchedDomainRequest +} + +func (r ApiTenantsDomainsPartialUpdateRequest) PatchedDomainRequest(patchedDomainRequest PatchedDomainRequest) ApiTenantsDomainsPartialUpdateRequest { + r.patchedDomainRequest = &patchedDomainRequest + return r +} + +func (r ApiTenantsDomainsPartialUpdateRequest) Execute() (*Domain, *http.Response, error) { + return r.ApiService.TenantsDomainsPartialUpdateExecute(r) +} + +/* +TenantsDomainsPartialUpdate Method for TenantsDomainsPartialUpdate + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Domain. + @return ApiTenantsDomainsPartialUpdateRequest +*/ +func (a *TenantsAPIService) TenantsDomainsPartialUpdate(ctx context.Context, id int32) ApiTenantsDomainsPartialUpdateRequest { + return ApiTenantsDomainsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Domain +func (a *TenantsAPIService) TenantsDomainsPartialUpdateExecute(r ApiTenantsDomainsPartialUpdateRequest) (*Domain, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Domain + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedDomainRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsDomainsRetrieveRequest struct { + ctx context.Context + ApiService *TenantsAPIService + id int32 +} + +func (r ApiTenantsDomainsRetrieveRequest) Execute() (*Domain, *http.Response, error) { + return r.ApiService.TenantsDomainsRetrieveExecute(r) +} + +/* +TenantsDomainsRetrieve Method for TenantsDomainsRetrieve + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Domain. + @return ApiTenantsDomainsRetrieveRequest +*/ +func (a *TenantsAPIService) TenantsDomainsRetrieve(ctx context.Context, id int32) ApiTenantsDomainsRetrieveRequest { + return ApiTenantsDomainsRetrieveRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Domain +func (a *TenantsAPIService) TenantsDomainsRetrieveExecute(r ApiTenantsDomainsRetrieveRequest) (*Domain, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Domain + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsDomainsUpdateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + id int32 + domainRequest *DomainRequest +} + +func (r ApiTenantsDomainsUpdateRequest) DomainRequest(domainRequest DomainRequest) ApiTenantsDomainsUpdateRequest { + r.domainRequest = &domainRequest + return r +} + +func (r ApiTenantsDomainsUpdateRequest) Execute() (*Domain, *http.Response, error) { + return r.ApiService.TenantsDomainsUpdateExecute(r) +} + +/* +TenantsDomainsUpdate Method for TenantsDomainsUpdate + +Domain ViewSet + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id A unique integer value identifying this Domain. + @return ApiTenantsDomainsUpdateRequest +*/ +func (a *TenantsAPIService) TenantsDomainsUpdate(ctx context.Context, id int32) ApiTenantsDomainsUpdateRequest { + return ApiTenantsDomainsUpdateRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return Domain +func (a *TenantsAPIService) TenantsDomainsUpdateExecute(r ApiTenantsDomainsUpdateRequest) (*Domain, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Domain + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsDomainsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/domains/{id}/" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.domainRequest == nil { + return localVarReturnValue, nil, reportError("domainRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.domainRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsCreateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantRequest *TenantRequest +} + +func (r ApiTenantsTenantsCreateRequest) TenantRequest(tenantRequest TenantRequest) ApiTenantsTenantsCreateRequest { + r.tenantRequest = &tenantRequest + return r +} + +func (r ApiTenantsTenantsCreateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenantsTenantsCreateExecute(r) +} + +/* +TenantsTenantsCreate Method for TenantsTenantsCreate + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenantsTenantsCreateRequest +*/ +func (a *TenantsAPIService) TenantsTenantsCreate(ctx context.Context) ApiTenantsTenantsCreateRequest { + return ApiTenantsTenantsCreateRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenantsAPIService) TenantsTenantsCreateExecute(r ApiTenantsTenantsCreateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRequest == nil { + return localVarReturnValue, nil, reportError("tenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsCreateAdminGroupCreateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string + tenantAdminGroupRequestRequest *TenantAdminGroupRequestRequest +} + +func (r ApiTenantsTenantsCreateAdminGroupCreateRequest) TenantAdminGroupRequestRequest(tenantAdminGroupRequestRequest TenantAdminGroupRequestRequest) ApiTenantsTenantsCreateAdminGroupCreateRequest { + r.tenantAdminGroupRequestRequest = &tenantAdminGroupRequestRequest + return r +} + +func (r ApiTenantsTenantsCreateAdminGroupCreateRequest) Execute() (*http.Response, error) { + return r.ApiService.TenantsTenantsCreateAdminGroupCreateExecute(r) +} + +/* +TenantsTenantsCreateAdminGroupCreate Method for TenantsTenantsCreateAdminGroupCreate + +Create admin group and add user to it. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsCreateAdminGroupCreateRequest +*/ +func (a *TenantsAPIService) TenantsTenantsCreateAdminGroupCreate(ctx context.Context, tenantUuid string) ApiTenantsTenantsCreateAdminGroupCreateRequest { + return ApiTenantsTenantsCreateAdminGroupCreateRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +func (a *TenantsAPIService) TenantsTenantsCreateAdminGroupCreateExecute(r ApiTenantsTenantsCreateAdminGroupCreateRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsCreateAdminGroupCreate") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/create_admin_group/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantAdminGroupRequestRequest == nil { + return nil, reportError("tenantAdminGroupRequestRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantAdminGroupRequestRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenantsTenantsCreateRecoveryKeyCreateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string + tenantRecoveryKeyRequestRequest *TenantRecoveryKeyRequestRequest +} + +func (r ApiTenantsTenantsCreateRecoveryKeyCreateRequest) TenantRecoveryKeyRequestRequest(tenantRecoveryKeyRequestRequest TenantRecoveryKeyRequestRequest) ApiTenantsTenantsCreateRecoveryKeyCreateRequest { + r.tenantRecoveryKeyRequestRequest = &tenantRecoveryKeyRequestRequest + return r +} + +func (r ApiTenantsTenantsCreateRecoveryKeyCreateRequest) Execute() (*TenantRecoveryKeyResponse, *http.Response, error) { + return r.ApiService.TenantsTenantsCreateRecoveryKeyCreateExecute(r) +} + +/* +TenantsTenantsCreateRecoveryKeyCreate Method for TenantsTenantsCreateRecoveryKeyCreate + +Create recovery key for user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsCreateRecoveryKeyCreateRequest +*/ +func (a *TenantsAPIService) TenantsTenantsCreateRecoveryKeyCreate(ctx context.Context, tenantUuid string) ApiTenantsTenantsCreateRecoveryKeyCreateRequest { + return ApiTenantsTenantsCreateRecoveryKeyCreateRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +// +// @return TenantRecoveryKeyResponse +func (a *TenantsAPIService) TenantsTenantsCreateRecoveryKeyCreateExecute(r ApiTenantsTenantsCreateRecoveryKeyCreateRequest) (*TenantRecoveryKeyResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *TenantRecoveryKeyResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsCreateRecoveryKeyCreate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/create_recovery_key/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRecoveryKeyRequestRequest == nil { + return localVarReturnValue, nil, reportError("tenantRecoveryKeyRequestRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRecoveryKeyRequestRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsDestroyRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string +} + +func (r ApiTenantsTenantsDestroyRequest) Execute() (*http.Response, error) { + return r.ApiService.TenantsTenantsDestroyExecute(r) +} + +/* +TenantsTenantsDestroy Method for TenantsTenantsDestroy + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsDestroyRequest +*/ +func (a *TenantsAPIService) TenantsTenantsDestroy(ctx context.Context, tenantUuid string) ApiTenantsTenantsDestroyRequest { + return ApiTenantsTenantsDestroyRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +func (a *TenantsAPIService) TenantsTenantsDestroyExecute(r ApiTenantsTenantsDestroyRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsDestroy") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiTenantsTenantsListRequest struct { + ctx context.Context + ApiService *TenantsAPIService + ordering *string + page *int32 + pageSize *int32 + search *string +} + +// Which field to use when ordering the results. +func (r ApiTenantsTenantsListRequest) Ordering(ordering string) ApiTenantsTenantsListRequest { + r.ordering = &ordering + return r +} + +// A page number within the paginated result set. +func (r ApiTenantsTenantsListRequest) Page(page int32) ApiTenantsTenantsListRequest { + r.page = &page + return r +} + +// Number of results to return per page. +func (r ApiTenantsTenantsListRequest) PageSize(pageSize int32) ApiTenantsTenantsListRequest { + r.pageSize = &pageSize + return r +} + +// A search term. +func (r ApiTenantsTenantsListRequest) Search(search string) ApiTenantsTenantsListRequest { + r.search = &search + return r +} + +func (r ApiTenantsTenantsListRequest) Execute() (*PaginatedTenantList, *http.Response, error) { + return r.ApiService.TenantsTenantsListExecute(r) +} + +/* +TenantsTenantsList Method for TenantsTenantsList + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiTenantsTenantsListRequest +*/ +func (a *TenantsAPIService) TenantsTenantsList(ctx context.Context) ApiTenantsTenantsListRequest { + return ApiTenantsTenantsListRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PaginatedTenantList +func (a *TenantsAPIService) TenantsTenantsListExecute(r ApiTenantsTenantsListRequest) (*PaginatedTenantList, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PaginatedTenantList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.ordering != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ordering", r.ordering, "form", "") + } + if r.page != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "form", "") + } + if r.pageSize != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "form", "") + } + if r.search != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "search", r.search, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsPartialUpdateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string + patchedTenantRequest *PatchedTenantRequest +} + +func (r ApiTenantsTenantsPartialUpdateRequest) PatchedTenantRequest(patchedTenantRequest PatchedTenantRequest) ApiTenantsTenantsPartialUpdateRequest { + r.patchedTenantRequest = &patchedTenantRequest + return r +} + +func (r ApiTenantsTenantsPartialUpdateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenantsTenantsPartialUpdateExecute(r) +} + +/* +TenantsTenantsPartialUpdate Method for TenantsTenantsPartialUpdate + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsPartialUpdateRequest +*/ +func (a *TenantsAPIService) TenantsTenantsPartialUpdate(ctx context.Context, tenantUuid string) ApiTenantsTenantsPartialUpdateRequest { + return ApiTenantsTenantsPartialUpdateRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenantsAPIService) TenantsTenantsPartialUpdateExecute(r ApiTenantsTenantsPartialUpdateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsPartialUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchedTenantRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsRetrieveRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string +} + +func (r ApiTenantsTenantsRetrieveRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenantsTenantsRetrieveExecute(r) +} + +/* +TenantsTenantsRetrieve Method for TenantsTenantsRetrieve + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsRetrieveRequest +*/ +func (a *TenantsAPIService) TenantsTenantsRetrieve(ctx context.Context, tenantUuid string) ApiTenantsTenantsRetrieveRequest { + return ApiTenantsTenantsRetrieveRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenantsAPIService) TenantsTenantsRetrieveExecute(r ApiTenantsTenantsRetrieveRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsRetrieve") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiTenantsTenantsUpdateRequest struct { + ctx context.Context + ApiService *TenantsAPIService + tenantUuid string + tenantRequest *TenantRequest +} + +func (r ApiTenantsTenantsUpdateRequest) TenantRequest(tenantRequest TenantRequest) ApiTenantsTenantsUpdateRequest { + r.tenantRequest = &tenantRequest + return r +} + +func (r ApiTenantsTenantsUpdateRequest) Execute() (*Tenant, *http.Response, error) { + return r.ApiService.TenantsTenantsUpdateExecute(r) +} + +/* +TenantsTenantsUpdate Method for TenantsTenantsUpdate + +Tenant Viewset + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param tenantUuid A UUID string identifying this Tenant. + @return ApiTenantsTenantsUpdateRequest +*/ +func (a *TenantsAPIService) TenantsTenantsUpdate(ctx context.Context, tenantUuid string) ApiTenantsTenantsUpdateRequest { + return ApiTenantsTenantsUpdateRequest{ + ApiService: a, + ctx: ctx, + tenantUuid: tenantUuid, + } +} + +// Execute executes the request +// +// @return Tenant +func (a *TenantsAPIService) TenantsTenantsUpdateExecute(r ApiTenantsTenantsUpdateRequest) (*Tenant, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Tenant + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TenantsAPIService.TenantsTenantsUpdate") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/tenants/tenants/{tenant_uuid}/" + localVarPath = strings.Replace(localVarPath, "{"+"tenant_uuid"+"}", url.PathEscape(parameterValueToString(r.tenantUuid, "tenantUuid")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.tenantRequest == nil { + return localVarReturnValue, nil, reportError("tenantRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.tenantRequest + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/packages/client-go/client.go b/packages/client-go/client.go new file mode 100644 index 0000000000..ed9899e794 --- /dev/null +++ b/packages/client-go/client.go @@ -0,0 +1,730 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the authentik API v2026.5.0-rc1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AdminAPI *AdminAPIService + + AuthenticatorsAPI *AuthenticatorsAPIService + + CoreAPI *CoreAPIService + + CryptoAPI *CryptoAPIService + + EndpointsAPI *EndpointsAPIService + + EnterpriseAPI *EnterpriseAPIService + + EventsAPI *EventsAPIService + + FlowsAPI *FlowsAPIService + + LifecycleAPI *LifecycleAPIService + + ManagedAPI *ManagedAPIService + + Oauth2API *Oauth2APIService + + OutpostsAPI *OutpostsAPIService + + PoliciesAPI *PoliciesAPIService + + PropertymappingsAPI *PropertymappingsAPIService + + ProvidersAPI *ProvidersAPIService + + RacAPI *RacAPIService + + RbacAPI *RbacAPIService + + ReportsAPI *ReportsAPIService + + RootAPI *RootAPIService + + SchemaAPI *SchemaAPIService + + SourcesAPI *SourcesAPIService + + SsfAPI *SsfAPIService + + StagesAPI *StagesAPIService + + TasksAPI *TasksAPIService + + TenantsAPI *TenantsAPIService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AdminAPI = (*AdminAPIService)(&c.common) + c.AuthenticatorsAPI = (*AuthenticatorsAPIService)(&c.common) + c.CoreAPI = (*CoreAPIService)(&c.common) + c.CryptoAPI = (*CryptoAPIService)(&c.common) + c.EndpointsAPI = (*EndpointsAPIService)(&c.common) + c.EnterpriseAPI = (*EnterpriseAPIService)(&c.common) + c.EventsAPI = (*EventsAPIService)(&c.common) + c.FlowsAPI = (*FlowsAPIService)(&c.common) + c.LifecycleAPI = (*LifecycleAPIService)(&c.common) + c.ManagedAPI = (*ManagedAPIService)(&c.common) + c.Oauth2API = (*Oauth2APIService)(&c.common) + c.OutpostsAPI = (*OutpostsAPIService)(&c.common) + c.PoliciesAPI = (*PoliciesAPIService)(&c.common) + c.PropertymappingsAPI = (*PropertymappingsAPIService)(&c.common) + c.ProvidersAPI = (*ProvidersAPIService)(&c.common) + c.RacAPI = (*RacAPIService)(&c.common) + c.RbacAPI = (*RbacAPIService)(&c.common) + c.ReportsAPI = (*ReportsAPIService)(&c.common) + c.RootAPI = (*RootAPIService)(&c.common) + c.SchemaAPI = (*SchemaAPIService)(&c.common) + c.SourcesAPI = (*SourcesAPIService)(&c.common) + c.SsfAPI = (*SsfAPIService)(&c.common) + c.StagesAPI = (*StagesAPIService)(&c.common) + c.TasksAPI = (*TasksAPIService)(&c.common) + c.TenantsAPI = (*TenantsAPIService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/packages/client-go/compose.yml b/packages/client-go/compose.yml new file mode 100644 index 0000000000..fd3ad5c8bb --- /dev/null +++ b/packages/client-go/compose.yml @@ -0,0 +1,9 @@ +--- +services: + gen: + image: docker.io/openapitools/openapi-generator-cli:v7.20.0 + restart: never + network_mode: none + volumes: + - ./:/local + - ../../schema.yml:/schema.yml:ro diff --git a/packages/client-go/config.yaml b/packages/client-go/config.yaml new file mode 100644 index 0000000000..b203fc2857 --- /dev/null +++ b/packages/client-go/config.yaml @@ -0,0 +1,7 @@ +--- +# templateDir: /local/templates/ +additionalProperties: + packageName: api + enumClassPrefix: true + useOneOfDiscriminatorLookup: true + disallowAdditionalPropertiesIfNotPresent: false diff --git a/packages/client-go/configuration.go b/packages/client-go/configuration.go new file mode 100644 index 0000000000..754d7bed2b --- /dev/null +++ b/packages/client-go/configuration.go @@ -0,0 +1,218 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "/api/v3", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/packages/client-go/model_access_denied_challenge.go b/packages/client-go/model_access_denied_challenge.go new file mode 100644 index 0000000000..d6e887360d --- /dev/null +++ b/packages/client-go/model_access_denied_challenge.go @@ -0,0 +1,348 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AccessDeniedChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AccessDeniedChallenge{} + +// AccessDeniedChallenge Challenge when a flow's active stage calls `stage_invalid()`. +type AccessDeniedChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + ErrorMessage *string `json:"error_message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AccessDeniedChallenge AccessDeniedChallenge + +// NewAccessDeniedChallenge instantiates a new AccessDeniedChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAccessDeniedChallenge(pendingUser string, pendingUserAvatar string) *AccessDeniedChallenge { + this := AccessDeniedChallenge{} + var component string = "ak-stage-access-denied" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + return &this +} + +// NewAccessDeniedChallengeWithDefaults instantiates a new AccessDeniedChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAccessDeniedChallengeWithDefaults() *AccessDeniedChallenge { + this := AccessDeniedChallenge{} + var component string = "ak-stage-access-denied" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AccessDeniedChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AccessDeniedChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AccessDeniedChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AccessDeniedChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AccessDeniedChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AccessDeniedChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AccessDeniedChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AccessDeniedChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AccessDeniedChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AccessDeniedChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AccessDeniedChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AccessDeniedChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AccessDeniedChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *AccessDeniedChallenge) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AccessDeniedChallenge) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *AccessDeniedChallenge) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *AccessDeniedChallenge) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +func (o AccessDeniedChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AccessDeniedChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if !IsNil(o.ErrorMessage) { + toSerialize["error_message"] = o.ErrorMessage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AccessDeniedChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAccessDeniedChallenge := _AccessDeniedChallenge{} + + err = json.Unmarshal(data, &varAccessDeniedChallenge) + + if err != nil { + return err + } + + *o = AccessDeniedChallenge(varAccessDeniedChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "error_message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAccessDeniedChallenge struct { + value *AccessDeniedChallenge + isSet bool +} + +func (v NullableAccessDeniedChallenge) Get() *AccessDeniedChallenge { + return v.value +} + +func (v *NullableAccessDeniedChallenge) Set(val *AccessDeniedChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAccessDeniedChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAccessDeniedChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAccessDeniedChallenge(val *AccessDeniedChallenge) *NullableAccessDeniedChallenge { + return &NullableAccessDeniedChallenge{value: val, isSet: true} +} + +func (v NullableAccessDeniedChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAccessDeniedChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_authentication_response.go b/packages/client-go/model_agent_authentication_response.go new file mode 100644 index 0000000000..c662e3ff5e --- /dev/null +++ b/packages/client-go/model_agent_authentication_response.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentAuthenticationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentAuthenticationResponse{} + +// AgentAuthenticationResponse Base serializer class which doesn't implement create/update methods +type AgentAuthenticationResponse struct { + Url string `json:"url"` + AdditionalProperties map[string]interface{} +} + +type _AgentAuthenticationResponse AgentAuthenticationResponse + +// NewAgentAuthenticationResponse instantiates a new AgentAuthenticationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentAuthenticationResponse(url string) *AgentAuthenticationResponse { + this := AgentAuthenticationResponse{} + this.Url = url + return &this +} + +// NewAgentAuthenticationResponseWithDefaults instantiates a new AgentAuthenticationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentAuthenticationResponseWithDefaults() *AgentAuthenticationResponse { + this := AgentAuthenticationResponse{} + return &this +} + +// GetUrl returns the Url field value +func (o *AgentAuthenticationResponse) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *AgentAuthenticationResponse) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *AgentAuthenticationResponse) SetUrl(v string) { + o.Url = v +} + +func (o AgentAuthenticationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentAuthenticationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentAuthenticationResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentAuthenticationResponse := _AgentAuthenticationResponse{} + + err = json.Unmarshal(data, &varAgentAuthenticationResponse) + + if err != nil { + return err + } + + *o = AgentAuthenticationResponse(varAgentAuthenticationResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentAuthenticationResponse struct { + value *AgentAuthenticationResponse + isSet bool +} + +func (v NullableAgentAuthenticationResponse) Get() *AgentAuthenticationResponse { + return v.value +} + +func (v *NullableAgentAuthenticationResponse) Set(val *AgentAuthenticationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAgentAuthenticationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentAuthenticationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentAuthenticationResponse(val *AgentAuthenticationResponse) *NullableAgentAuthenticationResponse { + return &NullableAgentAuthenticationResponse{value: val, isSet: true} +} + +func (v NullableAgentAuthenticationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentAuthenticationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_config.go b/packages/client-go/model_agent_config.go new file mode 100644 index 0000000000..c87c533dd4 --- /dev/null +++ b/packages/client-go/model_agent_config.go @@ -0,0 +1,436 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentConfig{} + +// AgentConfig Base serializer class which doesn't implement create/update methods +type AgentConfig struct { + DeviceId string `json:"device_id"` + RefreshInterval int32 `json:"refresh_interval"` + AuthorizationFlow NullableString `json:"authorization_flow"` + JwksAuth map[string]interface{} `json:"jwks_auth"` + JwksChallenge map[string]interface{} `json:"jwks_challenge"` + NssUidOffset int32 `json:"nss_uid_offset"` + NssGidOffset int32 `json:"nss_gid_offset"` + AuthTerminateSessionOnExpiry bool `json:"auth_terminate_session_on_expiry"` + SystemConfig Config `json:"system_config"` + LicenseStatus NullableLicenseStatusEnum `json:"license_status"` + AdditionalProperties map[string]interface{} +} + +type _AgentConfig AgentConfig + +// NewAgentConfig instantiates a new AgentConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentConfig(deviceId string, refreshInterval int32, authorizationFlow NullableString, jwksAuth map[string]interface{}, jwksChallenge map[string]interface{}, nssUidOffset int32, nssGidOffset int32, authTerminateSessionOnExpiry bool, systemConfig Config, licenseStatus NullableLicenseStatusEnum) *AgentConfig { + this := AgentConfig{} + this.DeviceId = deviceId + this.RefreshInterval = refreshInterval + this.AuthorizationFlow = authorizationFlow + this.JwksAuth = jwksAuth + this.JwksChallenge = jwksChallenge + this.NssUidOffset = nssUidOffset + this.NssGidOffset = nssGidOffset + this.AuthTerminateSessionOnExpiry = authTerminateSessionOnExpiry + this.SystemConfig = systemConfig + this.LicenseStatus = licenseStatus + return &this +} + +// NewAgentConfigWithDefaults instantiates a new AgentConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentConfigWithDefaults() *AgentConfig { + this := AgentConfig{} + return &this +} + +// GetDeviceId returns the DeviceId field value +func (o *AgentConfig) GetDeviceId() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceId +} + +// GetDeviceIdOk returns a tuple with the DeviceId field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetDeviceIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceId, true +} + +// SetDeviceId sets field value +func (o *AgentConfig) SetDeviceId(v string) { + o.DeviceId = v +} + +// GetRefreshInterval returns the RefreshInterval field value +func (o *AgentConfig) GetRefreshInterval() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RefreshInterval +} + +// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetRefreshIntervalOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RefreshInterval, true +} + +// SetRefreshInterval sets field value +func (o *AgentConfig) SetRefreshInterval(v int32) { + o.RefreshInterval = v +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AgentConfig) GetAuthorizationFlow() string { + if o == nil || o.AuthorizationFlow.Get() == nil { + var ret string + return ret + } + + return *o.AuthorizationFlow.Get() +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConfig) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationFlow.Get(), o.AuthorizationFlow.IsSet() +} + +// SetAuthorizationFlow sets field value +func (o *AgentConfig) SetAuthorizationFlow(v string) { + o.AuthorizationFlow.Set(&v) +} + +// GetJwksAuth returns the JwksAuth field value +func (o *AgentConfig) GetJwksAuth() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.JwksAuth +} + +// GetJwksAuthOk returns a tuple with the JwksAuth field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetJwksAuthOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.JwksAuth, true +} + +// SetJwksAuth sets field value +func (o *AgentConfig) SetJwksAuth(v map[string]interface{}) { + o.JwksAuth = v +} + +// GetJwksChallenge returns the JwksChallenge field value +// If the value is explicit nil, the zero value for map[string]interface{} will be returned +func (o *AgentConfig) GetJwksChallenge() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.JwksChallenge +} + +// GetJwksChallengeOk returns a tuple with the JwksChallenge field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConfig) GetJwksChallengeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.JwksChallenge) { + return map[string]interface{}{}, false + } + return o.JwksChallenge, true +} + +// SetJwksChallenge sets field value +func (o *AgentConfig) SetJwksChallenge(v map[string]interface{}) { + o.JwksChallenge = v +} + +// GetNssUidOffset returns the NssUidOffset field value +func (o *AgentConfig) GetNssUidOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NssUidOffset +} + +// GetNssUidOffsetOk returns a tuple with the NssUidOffset field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetNssUidOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NssUidOffset, true +} + +// SetNssUidOffset sets field value +func (o *AgentConfig) SetNssUidOffset(v int32) { + o.NssUidOffset = v +} + +// GetNssGidOffset returns the NssGidOffset field value +func (o *AgentConfig) GetNssGidOffset() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NssGidOffset +} + +// GetNssGidOffsetOk returns a tuple with the NssGidOffset field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetNssGidOffsetOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NssGidOffset, true +} + +// SetNssGidOffset sets field value +func (o *AgentConfig) SetNssGidOffset(v int32) { + o.NssGidOffset = v +} + +// GetAuthTerminateSessionOnExpiry returns the AuthTerminateSessionOnExpiry field value +func (o *AgentConfig) GetAuthTerminateSessionOnExpiry() bool { + if o == nil { + var ret bool + return ret + } + + return o.AuthTerminateSessionOnExpiry +} + +// GetAuthTerminateSessionOnExpiryOk returns a tuple with the AuthTerminateSessionOnExpiry field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetAuthTerminateSessionOnExpiryOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.AuthTerminateSessionOnExpiry, true +} + +// SetAuthTerminateSessionOnExpiry sets field value +func (o *AgentConfig) SetAuthTerminateSessionOnExpiry(v bool) { + o.AuthTerminateSessionOnExpiry = v +} + +// GetSystemConfig returns the SystemConfig field value +func (o *AgentConfig) GetSystemConfig() Config { + if o == nil { + var ret Config + return ret + } + + return o.SystemConfig +} + +// GetSystemConfigOk returns a tuple with the SystemConfig field value +// and a boolean to check if the value has been set. +func (o *AgentConfig) GetSystemConfigOk() (*Config, bool) { + if o == nil { + return nil, false + } + return &o.SystemConfig, true +} + +// SetSystemConfig sets field value +func (o *AgentConfig) SetSystemConfig(v Config) { + o.SystemConfig = v +} + +// GetLicenseStatus returns the LicenseStatus field value +// If the value is explicit nil, the zero value for LicenseStatusEnum will be returned +func (o *AgentConfig) GetLicenseStatus() LicenseStatusEnum { + if o == nil || o.LicenseStatus.Get() == nil { + var ret LicenseStatusEnum + return ret + } + + return *o.LicenseStatus.Get() +} + +// GetLicenseStatusOk returns a tuple with the LicenseStatus field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConfig) GetLicenseStatusOk() (*LicenseStatusEnum, bool) { + if o == nil { + return nil, false + } + return o.LicenseStatus.Get(), o.LicenseStatus.IsSet() +} + +// SetLicenseStatus sets field value +func (o *AgentConfig) SetLicenseStatus(v LicenseStatusEnum) { + o.LicenseStatus.Set(&v) +} + +func (o AgentConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_id"] = o.DeviceId + toSerialize["refresh_interval"] = o.RefreshInterval + toSerialize["authorization_flow"] = o.AuthorizationFlow.Get() + toSerialize["jwks_auth"] = o.JwksAuth + if o.JwksChallenge != nil { + toSerialize["jwks_challenge"] = o.JwksChallenge + } + toSerialize["nss_uid_offset"] = o.NssUidOffset + toSerialize["nss_gid_offset"] = o.NssGidOffset + toSerialize["auth_terminate_session_on_expiry"] = o.AuthTerminateSessionOnExpiry + toSerialize["system_config"] = o.SystemConfig + toSerialize["license_status"] = o.LicenseStatus.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_id", + "refresh_interval", + "authorization_flow", + "jwks_auth", + "jwks_challenge", + "nss_uid_offset", + "nss_gid_offset", + "auth_terminate_session_on_expiry", + "system_config", + "license_status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentConfig := _AgentConfig{} + + err = json.Unmarshal(data, &varAgentConfig) + + if err != nil { + return err + } + + *o = AgentConfig(varAgentConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_id") + delete(additionalProperties, "refresh_interval") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "jwks_auth") + delete(additionalProperties, "jwks_challenge") + delete(additionalProperties, "nss_uid_offset") + delete(additionalProperties, "nss_gid_offset") + delete(additionalProperties, "auth_terminate_session_on_expiry") + delete(additionalProperties, "system_config") + delete(additionalProperties, "license_status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentConfig struct { + value *AgentConfig + isSet bool +} + +func (v NullableAgentConfig) Get() *AgentConfig { + return v.value +} + +func (v *NullableAgentConfig) Set(val *AgentConfig) { + v.value = val + v.isSet = true +} + +func (v NullableAgentConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentConfig(val *AgentConfig) *NullableAgentConfig { + return &NullableAgentConfig{value: val, isSet: true} +} + +func (v NullableAgentConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_connector.go b/packages/client-go/model_agent_connector.go new file mode 100644 index 0000000000..7c4e977c33 --- /dev/null +++ b/packages/client-go/model_agent_connector.go @@ -0,0 +1,790 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentConnector type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentConnector{} + +// AgentConnector struct for AgentConnector +type AgentConnector struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + SnapshotExpiry *string `json:"snapshot_expiry,omitempty"` + AuthSessionDuration *string `json:"auth_session_duration,omitempty"` + AuthTerminateSessionOnExpiry *bool `json:"auth_terminate_session_on_expiry,omitempty"` + RefreshInterval *string `json:"refresh_interval,omitempty"` + AuthorizationFlow NullableString `json:"authorization_flow,omitempty"` + NssUidOffset *int32 `json:"nss_uid_offset,omitempty"` + NssGidOffset *int32 `json:"nss_gid_offset,omitempty"` + ChallengeKey NullableString `json:"challenge_key,omitempty"` + ChallengeIdleTimeout *string `json:"challenge_idle_timeout,omitempty"` + ChallengeTriggerCheckIn *bool `json:"challenge_trigger_check_in,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AgentConnector AgentConnector + +// NewAgentConnector instantiates a new AgentConnector object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentConnector(name string, component string, verboseName string, verboseNamePlural string, metaModelName string) *AgentConnector { + this := AgentConnector{} + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewAgentConnectorWithDefaults instantiates a new AgentConnector object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentConnectorWithDefaults() *AgentConnector { + this := AgentConnector{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *AgentConnector) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *AgentConnector) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *AgentConnector) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *AgentConnector) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AgentConnector) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *AgentConnector) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *AgentConnector) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *AgentConnector) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetComponent returns the Component field value +func (o *AgentConnector) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AgentConnector) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AgentConnector) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AgentConnector) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AgentConnector) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AgentConnector) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AgentConnector) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AgentConnector) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetSnapshotExpiry returns the SnapshotExpiry field value if set, zero value otherwise. +func (o *AgentConnector) GetSnapshotExpiry() string { + if o == nil || IsNil(o.SnapshotExpiry) { + var ret string + return ret + } + return *o.SnapshotExpiry +} + +// GetSnapshotExpiryOk returns a tuple with the SnapshotExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetSnapshotExpiryOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotExpiry) { + return nil, false + } + return o.SnapshotExpiry, true +} + +// HasSnapshotExpiry returns a boolean if a field has been set. +func (o *AgentConnector) HasSnapshotExpiry() bool { + if o != nil && !IsNil(o.SnapshotExpiry) { + return true + } + + return false +} + +// SetSnapshotExpiry gets a reference to the given string and assigns it to the SnapshotExpiry field. +func (o *AgentConnector) SetSnapshotExpiry(v string) { + o.SnapshotExpiry = &v +} + +// GetAuthSessionDuration returns the AuthSessionDuration field value if set, zero value otherwise. +func (o *AgentConnector) GetAuthSessionDuration() string { + if o == nil || IsNil(o.AuthSessionDuration) { + var ret string + return ret + } + return *o.AuthSessionDuration +} + +// GetAuthSessionDurationOk returns a tuple with the AuthSessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetAuthSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.AuthSessionDuration) { + return nil, false + } + return o.AuthSessionDuration, true +} + +// HasAuthSessionDuration returns a boolean if a field has been set. +func (o *AgentConnector) HasAuthSessionDuration() bool { + if o != nil && !IsNil(o.AuthSessionDuration) { + return true + } + + return false +} + +// SetAuthSessionDuration gets a reference to the given string and assigns it to the AuthSessionDuration field. +func (o *AgentConnector) SetAuthSessionDuration(v string) { + o.AuthSessionDuration = &v +} + +// GetAuthTerminateSessionOnExpiry returns the AuthTerminateSessionOnExpiry field value if set, zero value otherwise. +func (o *AgentConnector) GetAuthTerminateSessionOnExpiry() bool { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + var ret bool + return ret + } + return *o.AuthTerminateSessionOnExpiry +} + +// GetAuthTerminateSessionOnExpiryOk returns a tuple with the AuthTerminateSessionOnExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetAuthTerminateSessionOnExpiryOk() (*bool, bool) { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + return nil, false + } + return o.AuthTerminateSessionOnExpiry, true +} + +// HasAuthTerminateSessionOnExpiry returns a boolean if a field has been set. +func (o *AgentConnector) HasAuthTerminateSessionOnExpiry() bool { + if o != nil && !IsNil(o.AuthTerminateSessionOnExpiry) { + return true + } + + return false +} + +// SetAuthTerminateSessionOnExpiry gets a reference to the given bool and assigns it to the AuthTerminateSessionOnExpiry field. +func (o *AgentConnector) SetAuthTerminateSessionOnExpiry(v bool) { + o.AuthTerminateSessionOnExpiry = &v +} + +// GetRefreshInterval returns the RefreshInterval field value if set, zero value otherwise. +func (o *AgentConnector) GetRefreshInterval() string { + if o == nil || IsNil(o.RefreshInterval) { + var ret string + return ret + } + return *o.RefreshInterval +} + +// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetRefreshIntervalOk() (*string, bool) { + if o == nil || IsNil(o.RefreshInterval) { + return nil, false + } + return o.RefreshInterval, true +} + +// HasRefreshInterval returns a boolean if a field has been set. +func (o *AgentConnector) HasRefreshInterval() bool { + if o != nil && !IsNil(o.RefreshInterval) { + return true + } + + return false +} + +// SetRefreshInterval gets a reference to the given string and assigns it to the RefreshInterval field. +func (o *AgentConnector) SetRefreshInterval(v string) { + o.RefreshInterval = &v +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AgentConnector) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow.Get()) { + var ret string + return ret + } + return *o.AuthorizationFlow.Get() +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConnector) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationFlow.Get(), o.AuthorizationFlow.IsSet() +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *AgentConnector) HasAuthorizationFlow() bool { + if o != nil && o.AuthorizationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given NullableString and assigns it to the AuthorizationFlow field. +func (o *AgentConnector) SetAuthorizationFlow(v string) { + o.AuthorizationFlow.Set(&v) +} + +// SetAuthorizationFlowNil sets the value for AuthorizationFlow to be an explicit nil +func (o *AgentConnector) SetAuthorizationFlowNil() { + o.AuthorizationFlow.Set(nil) +} + +// UnsetAuthorizationFlow ensures that no value is present for AuthorizationFlow, not even an explicit nil +func (o *AgentConnector) UnsetAuthorizationFlow() { + o.AuthorizationFlow.Unset() +} + +// GetNssUidOffset returns the NssUidOffset field value if set, zero value otherwise. +func (o *AgentConnector) GetNssUidOffset() int32 { + if o == nil || IsNil(o.NssUidOffset) { + var ret int32 + return ret + } + return *o.NssUidOffset +} + +// GetNssUidOffsetOk returns a tuple with the NssUidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetNssUidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssUidOffset) { + return nil, false + } + return o.NssUidOffset, true +} + +// HasNssUidOffset returns a boolean if a field has been set. +func (o *AgentConnector) HasNssUidOffset() bool { + if o != nil && !IsNil(o.NssUidOffset) { + return true + } + + return false +} + +// SetNssUidOffset gets a reference to the given int32 and assigns it to the NssUidOffset field. +func (o *AgentConnector) SetNssUidOffset(v int32) { + o.NssUidOffset = &v +} + +// GetNssGidOffset returns the NssGidOffset field value if set, zero value otherwise. +func (o *AgentConnector) GetNssGidOffset() int32 { + if o == nil || IsNil(o.NssGidOffset) { + var ret int32 + return ret + } + return *o.NssGidOffset +} + +// GetNssGidOffsetOk returns a tuple with the NssGidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetNssGidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssGidOffset) { + return nil, false + } + return o.NssGidOffset, true +} + +// HasNssGidOffset returns a boolean if a field has been set. +func (o *AgentConnector) HasNssGidOffset() bool { + if o != nil && !IsNil(o.NssGidOffset) { + return true + } + + return false +} + +// SetNssGidOffset gets a reference to the given int32 and assigns it to the NssGidOffset field. +func (o *AgentConnector) SetNssGidOffset(v int32) { + o.NssGidOffset = &v +} + +// GetChallengeKey returns the ChallengeKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AgentConnector) GetChallengeKey() string { + if o == nil || IsNil(o.ChallengeKey.Get()) { + var ret string + return ret + } + return *o.ChallengeKey.Get() +} + +// GetChallengeKeyOk returns a tuple with the ChallengeKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConnector) GetChallengeKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChallengeKey.Get(), o.ChallengeKey.IsSet() +} + +// HasChallengeKey returns a boolean if a field has been set. +func (o *AgentConnector) HasChallengeKey() bool { + if o != nil && o.ChallengeKey.IsSet() { + return true + } + + return false +} + +// SetChallengeKey gets a reference to the given NullableString and assigns it to the ChallengeKey field. +func (o *AgentConnector) SetChallengeKey(v string) { + o.ChallengeKey.Set(&v) +} + +// SetChallengeKeyNil sets the value for ChallengeKey to be an explicit nil +func (o *AgentConnector) SetChallengeKeyNil() { + o.ChallengeKey.Set(nil) +} + +// UnsetChallengeKey ensures that no value is present for ChallengeKey, not even an explicit nil +func (o *AgentConnector) UnsetChallengeKey() { + o.ChallengeKey.Unset() +} + +// GetChallengeIdleTimeout returns the ChallengeIdleTimeout field value if set, zero value otherwise. +func (o *AgentConnector) GetChallengeIdleTimeout() string { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + var ret string + return ret + } + return *o.ChallengeIdleTimeout +} + +// GetChallengeIdleTimeoutOk returns a tuple with the ChallengeIdleTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetChallengeIdleTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + return nil, false + } + return o.ChallengeIdleTimeout, true +} + +// HasChallengeIdleTimeout returns a boolean if a field has been set. +func (o *AgentConnector) HasChallengeIdleTimeout() bool { + if o != nil && !IsNil(o.ChallengeIdleTimeout) { + return true + } + + return false +} + +// SetChallengeIdleTimeout gets a reference to the given string and assigns it to the ChallengeIdleTimeout field. +func (o *AgentConnector) SetChallengeIdleTimeout(v string) { + o.ChallengeIdleTimeout = &v +} + +// GetChallengeTriggerCheckIn returns the ChallengeTriggerCheckIn field value if set, zero value otherwise. +func (o *AgentConnector) GetChallengeTriggerCheckIn() bool { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + var ret bool + return ret + } + return *o.ChallengeTriggerCheckIn +} + +// GetChallengeTriggerCheckInOk returns a tuple with the ChallengeTriggerCheckIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetChallengeTriggerCheckInOk() (*bool, bool) { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + return nil, false + } + return o.ChallengeTriggerCheckIn, true +} + +// HasChallengeTriggerCheckIn returns a boolean if a field has been set. +func (o *AgentConnector) HasChallengeTriggerCheckIn() bool { + if o != nil && !IsNil(o.ChallengeTriggerCheckIn) { + return true + } + + return false +} + +// SetChallengeTriggerCheckIn gets a reference to the given bool and assigns it to the ChallengeTriggerCheckIn field. +func (o *AgentConnector) SetChallengeTriggerCheckIn(v bool) { + o.ChallengeTriggerCheckIn = &v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *AgentConnector) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnector) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *AgentConnector) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *AgentConnector) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o AgentConnector) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentConnector) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.SnapshotExpiry) { + toSerialize["snapshot_expiry"] = o.SnapshotExpiry + } + if !IsNil(o.AuthSessionDuration) { + toSerialize["auth_session_duration"] = o.AuthSessionDuration + } + if !IsNil(o.AuthTerminateSessionOnExpiry) { + toSerialize["auth_terminate_session_on_expiry"] = o.AuthTerminateSessionOnExpiry + } + if !IsNil(o.RefreshInterval) { + toSerialize["refresh_interval"] = o.RefreshInterval + } + if o.AuthorizationFlow.IsSet() { + toSerialize["authorization_flow"] = o.AuthorizationFlow.Get() + } + if !IsNil(o.NssUidOffset) { + toSerialize["nss_uid_offset"] = o.NssUidOffset + } + if !IsNil(o.NssGidOffset) { + toSerialize["nss_gid_offset"] = o.NssGidOffset + } + if o.ChallengeKey.IsSet() { + toSerialize["challenge_key"] = o.ChallengeKey.Get() + } + if !IsNil(o.ChallengeIdleTimeout) { + toSerialize["challenge_idle_timeout"] = o.ChallengeIdleTimeout + } + if !IsNil(o.ChallengeTriggerCheckIn) { + toSerialize["challenge_trigger_check_in"] = o.ChallengeTriggerCheckIn + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentConnector) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentConnector := _AgentConnector{} + + err = json.Unmarshal(data, &varAgentConnector) + + if err != nil { + return err + } + + *o = AgentConnector(varAgentConnector) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "snapshot_expiry") + delete(additionalProperties, "auth_session_duration") + delete(additionalProperties, "auth_terminate_session_on_expiry") + delete(additionalProperties, "refresh_interval") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "nss_uid_offset") + delete(additionalProperties, "nss_gid_offset") + delete(additionalProperties, "challenge_key") + delete(additionalProperties, "challenge_idle_timeout") + delete(additionalProperties, "challenge_trigger_check_in") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentConnector struct { + value *AgentConnector + isSet bool +} + +func (v NullableAgentConnector) Get() *AgentConnector { + return v.value +} + +func (v *NullableAgentConnector) Set(val *AgentConnector) { + v.value = val + v.isSet = true +} + +func (v NullableAgentConnector) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentConnector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentConnector(val *AgentConnector) *NullableAgentConnector { + return &NullableAgentConnector{value: val, isSet: true} +} + +func (v NullableAgentConnector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentConnector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_connector_request.go b/packages/client-go/model_agent_connector_request.go new file mode 100644 index 0000000000..4e56b5806b --- /dev/null +++ b/packages/client-go/model_agent_connector_request.go @@ -0,0 +1,670 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentConnectorRequest{} + +// AgentConnectorRequest struct for AgentConnectorRequest +type AgentConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + SnapshotExpiry *string `json:"snapshot_expiry,omitempty"` + AuthSessionDuration *string `json:"auth_session_duration,omitempty"` + AuthTerminateSessionOnExpiry *bool `json:"auth_terminate_session_on_expiry,omitempty"` + RefreshInterval *string `json:"refresh_interval,omitempty"` + AuthorizationFlow NullableString `json:"authorization_flow,omitempty"` + NssUidOffset *int32 `json:"nss_uid_offset,omitempty"` + NssGidOffset *int32 `json:"nss_gid_offset,omitempty"` + ChallengeKey NullableString `json:"challenge_key,omitempty"` + ChallengeIdleTimeout *string `json:"challenge_idle_timeout,omitempty"` + ChallengeTriggerCheckIn *bool `json:"challenge_trigger_check_in,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AgentConnectorRequest AgentConnectorRequest + +// NewAgentConnectorRequest instantiates a new AgentConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentConnectorRequest(name string) *AgentConnectorRequest { + this := AgentConnectorRequest{} + this.Name = name + return &this +} + +// NewAgentConnectorRequestWithDefaults instantiates a new AgentConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentConnectorRequestWithDefaults() *AgentConnectorRequest { + this := AgentConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *AgentConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *AgentConnectorRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AgentConnectorRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *AgentConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetSnapshotExpiry returns the SnapshotExpiry field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetSnapshotExpiry() string { + if o == nil || IsNil(o.SnapshotExpiry) { + var ret string + return ret + } + return *o.SnapshotExpiry +} + +// GetSnapshotExpiryOk returns a tuple with the SnapshotExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetSnapshotExpiryOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotExpiry) { + return nil, false + } + return o.SnapshotExpiry, true +} + +// HasSnapshotExpiry returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasSnapshotExpiry() bool { + if o != nil && !IsNil(o.SnapshotExpiry) { + return true + } + + return false +} + +// SetSnapshotExpiry gets a reference to the given string and assigns it to the SnapshotExpiry field. +func (o *AgentConnectorRequest) SetSnapshotExpiry(v string) { + o.SnapshotExpiry = &v +} + +// GetAuthSessionDuration returns the AuthSessionDuration field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetAuthSessionDuration() string { + if o == nil || IsNil(o.AuthSessionDuration) { + var ret string + return ret + } + return *o.AuthSessionDuration +} + +// GetAuthSessionDurationOk returns a tuple with the AuthSessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetAuthSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.AuthSessionDuration) { + return nil, false + } + return o.AuthSessionDuration, true +} + +// HasAuthSessionDuration returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasAuthSessionDuration() bool { + if o != nil && !IsNil(o.AuthSessionDuration) { + return true + } + + return false +} + +// SetAuthSessionDuration gets a reference to the given string and assigns it to the AuthSessionDuration field. +func (o *AgentConnectorRequest) SetAuthSessionDuration(v string) { + o.AuthSessionDuration = &v +} + +// GetAuthTerminateSessionOnExpiry returns the AuthTerminateSessionOnExpiry field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetAuthTerminateSessionOnExpiry() bool { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + var ret bool + return ret + } + return *o.AuthTerminateSessionOnExpiry +} + +// GetAuthTerminateSessionOnExpiryOk returns a tuple with the AuthTerminateSessionOnExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetAuthTerminateSessionOnExpiryOk() (*bool, bool) { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + return nil, false + } + return o.AuthTerminateSessionOnExpiry, true +} + +// HasAuthTerminateSessionOnExpiry returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasAuthTerminateSessionOnExpiry() bool { + if o != nil && !IsNil(o.AuthTerminateSessionOnExpiry) { + return true + } + + return false +} + +// SetAuthTerminateSessionOnExpiry gets a reference to the given bool and assigns it to the AuthTerminateSessionOnExpiry field. +func (o *AgentConnectorRequest) SetAuthTerminateSessionOnExpiry(v bool) { + o.AuthTerminateSessionOnExpiry = &v +} + +// GetRefreshInterval returns the RefreshInterval field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetRefreshInterval() string { + if o == nil || IsNil(o.RefreshInterval) { + var ret string + return ret + } + return *o.RefreshInterval +} + +// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetRefreshIntervalOk() (*string, bool) { + if o == nil || IsNil(o.RefreshInterval) { + return nil, false + } + return o.RefreshInterval, true +} + +// HasRefreshInterval returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasRefreshInterval() bool { + if o != nil && !IsNil(o.RefreshInterval) { + return true + } + + return false +} + +// SetRefreshInterval gets a reference to the given string and assigns it to the RefreshInterval field. +func (o *AgentConnectorRequest) SetRefreshInterval(v string) { + o.RefreshInterval = &v +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AgentConnectorRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow.Get()) { + var ret string + return ret + } + return *o.AuthorizationFlow.Get() +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConnectorRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationFlow.Get(), o.AuthorizationFlow.IsSet() +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasAuthorizationFlow() bool { + if o != nil && o.AuthorizationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given NullableString and assigns it to the AuthorizationFlow field. +func (o *AgentConnectorRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow.Set(&v) +} + +// SetAuthorizationFlowNil sets the value for AuthorizationFlow to be an explicit nil +func (o *AgentConnectorRequest) SetAuthorizationFlowNil() { + o.AuthorizationFlow.Set(nil) +} + +// UnsetAuthorizationFlow ensures that no value is present for AuthorizationFlow, not even an explicit nil +func (o *AgentConnectorRequest) UnsetAuthorizationFlow() { + o.AuthorizationFlow.Unset() +} + +// GetNssUidOffset returns the NssUidOffset field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetNssUidOffset() int32 { + if o == nil || IsNil(o.NssUidOffset) { + var ret int32 + return ret + } + return *o.NssUidOffset +} + +// GetNssUidOffsetOk returns a tuple with the NssUidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetNssUidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssUidOffset) { + return nil, false + } + return o.NssUidOffset, true +} + +// HasNssUidOffset returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasNssUidOffset() bool { + if o != nil && !IsNil(o.NssUidOffset) { + return true + } + + return false +} + +// SetNssUidOffset gets a reference to the given int32 and assigns it to the NssUidOffset field. +func (o *AgentConnectorRequest) SetNssUidOffset(v int32) { + o.NssUidOffset = &v +} + +// GetNssGidOffset returns the NssGidOffset field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetNssGidOffset() int32 { + if o == nil || IsNil(o.NssGidOffset) { + var ret int32 + return ret + } + return *o.NssGidOffset +} + +// GetNssGidOffsetOk returns a tuple with the NssGidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetNssGidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssGidOffset) { + return nil, false + } + return o.NssGidOffset, true +} + +// HasNssGidOffset returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasNssGidOffset() bool { + if o != nil && !IsNil(o.NssGidOffset) { + return true + } + + return false +} + +// SetNssGidOffset gets a reference to the given int32 and assigns it to the NssGidOffset field. +func (o *AgentConnectorRequest) SetNssGidOffset(v int32) { + o.NssGidOffset = &v +} + +// GetChallengeKey returns the ChallengeKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AgentConnectorRequest) GetChallengeKey() string { + if o == nil || IsNil(o.ChallengeKey.Get()) { + var ret string + return ret + } + return *o.ChallengeKey.Get() +} + +// GetChallengeKeyOk returns a tuple with the ChallengeKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AgentConnectorRequest) GetChallengeKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChallengeKey.Get(), o.ChallengeKey.IsSet() +} + +// HasChallengeKey returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasChallengeKey() bool { + if o != nil && o.ChallengeKey.IsSet() { + return true + } + + return false +} + +// SetChallengeKey gets a reference to the given NullableString and assigns it to the ChallengeKey field. +func (o *AgentConnectorRequest) SetChallengeKey(v string) { + o.ChallengeKey.Set(&v) +} + +// SetChallengeKeyNil sets the value for ChallengeKey to be an explicit nil +func (o *AgentConnectorRequest) SetChallengeKeyNil() { + o.ChallengeKey.Set(nil) +} + +// UnsetChallengeKey ensures that no value is present for ChallengeKey, not even an explicit nil +func (o *AgentConnectorRequest) UnsetChallengeKey() { + o.ChallengeKey.Unset() +} + +// GetChallengeIdleTimeout returns the ChallengeIdleTimeout field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetChallengeIdleTimeout() string { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + var ret string + return ret + } + return *o.ChallengeIdleTimeout +} + +// GetChallengeIdleTimeoutOk returns a tuple with the ChallengeIdleTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetChallengeIdleTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + return nil, false + } + return o.ChallengeIdleTimeout, true +} + +// HasChallengeIdleTimeout returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasChallengeIdleTimeout() bool { + if o != nil && !IsNil(o.ChallengeIdleTimeout) { + return true + } + + return false +} + +// SetChallengeIdleTimeout gets a reference to the given string and assigns it to the ChallengeIdleTimeout field. +func (o *AgentConnectorRequest) SetChallengeIdleTimeout(v string) { + o.ChallengeIdleTimeout = &v +} + +// GetChallengeTriggerCheckIn returns the ChallengeTriggerCheckIn field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetChallengeTriggerCheckIn() bool { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + var ret bool + return ret + } + return *o.ChallengeTriggerCheckIn +} + +// GetChallengeTriggerCheckInOk returns a tuple with the ChallengeTriggerCheckIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetChallengeTriggerCheckInOk() (*bool, bool) { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + return nil, false + } + return o.ChallengeTriggerCheckIn, true +} + +// HasChallengeTriggerCheckIn returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasChallengeTriggerCheckIn() bool { + if o != nil && !IsNil(o.ChallengeTriggerCheckIn) { + return true + } + + return false +} + +// SetChallengeTriggerCheckIn gets a reference to the given bool and assigns it to the ChallengeTriggerCheckIn field. +func (o *AgentConnectorRequest) SetChallengeTriggerCheckIn(v bool) { + o.ChallengeTriggerCheckIn = &v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *AgentConnectorRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentConnectorRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *AgentConnectorRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *AgentConnectorRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o AgentConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.SnapshotExpiry) { + toSerialize["snapshot_expiry"] = o.SnapshotExpiry + } + if !IsNil(o.AuthSessionDuration) { + toSerialize["auth_session_duration"] = o.AuthSessionDuration + } + if !IsNil(o.AuthTerminateSessionOnExpiry) { + toSerialize["auth_terminate_session_on_expiry"] = o.AuthTerminateSessionOnExpiry + } + if !IsNil(o.RefreshInterval) { + toSerialize["refresh_interval"] = o.RefreshInterval + } + if o.AuthorizationFlow.IsSet() { + toSerialize["authorization_flow"] = o.AuthorizationFlow.Get() + } + if !IsNil(o.NssUidOffset) { + toSerialize["nss_uid_offset"] = o.NssUidOffset + } + if !IsNil(o.NssGidOffset) { + toSerialize["nss_gid_offset"] = o.NssGidOffset + } + if o.ChallengeKey.IsSet() { + toSerialize["challenge_key"] = o.ChallengeKey.Get() + } + if !IsNil(o.ChallengeIdleTimeout) { + toSerialize["challenge_idle_timeout"] = o.ChallengeIdleTimeout + } + if !IsNil(o.ChallengeTriggerCheckIn) { + toSerialize["challenge_trigger_check_in"] = o.ChallengeTriggerCheckIn + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentConnectorRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentConnectorRequest := _AgentConnectorRequest{} + + err = json.Unmarshal(data, &varAgentConnectorRequest) + + if err != nil { + return err + } + + *o = AgentConnectorRequest(varAgentConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "snapshot_expiry") + delete(additionalProperties, "auth_session_duration") + delete(additionalProperties, "auth_terminate_session_on_expiry") + delete(additionalProperties, "refresh_interval") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "nss_uid_offset") + delete(additionalProperties, "nss_gid_offset") + delete(additionalProperties, "challenge_key") + delete(additionalProperties, "challenge_idle_timeout") + delete(additionalProperties, "challenge_trigger_check_in") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentConnectorRequest struct { + value *AgentConnectorRequest + isSet bool +} + +func (v NullableAgentConnectorRequest) Get() *AgentConnectorRequest { + return v.value +} + +func (v *NullableAgentConnectorRequest) Set(val *AgentConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAgentConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentConnectorRequest(val *AgentConnectorRequest) *NullableAgentConnectorRequest { + return &NullableAgentConnectorRequest{value: val, isSet: true} +} + +func (v NullableAgentConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_psso_device_registration_request.go b/packages/client-go/model_agent_psso_device_registration_request.go new file mode 100644 index 0000000000..ad106c3f70 --- /dev/null +++ b/packages/client-go/model_agent_psso_device_registration_request.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentPSSODeviceRegistrationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentPSSODeviceRegistrationRequest{} + +// AgentPSSODeviceRegistrationRequest Register Apple device via Platform SSO +type AgentPSSODeviceRegistrationRequest struct { + DeviceSigningKey string `json:"device_signing_key"` + DeviceEncryptionKey string `json:"device_encryption_key"` + SignKeyId string `json:"sign_key_id"` + EncKeyId string `json:"enc_key_id"` + AdditionalProperties map[string]interface{} +} + +type _AgentPSSODeviceRegistrationRequest AgentPSSODeviceRegistrationRequest + +// NewAgentPSSODeviceRegistrationRequest instantiates a new AgentPSSODeviceRegistrationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentPSSODeviceRegistrationRequest(deviceSigningKey string, deviceEncryptionKey string, signKeyId string, encKeyId string) *AgentPSSODeviceRegistrationRequest { + this := AgentPSSODeviceRegistrationRequest{} + this.DeviceSigningKey = deviceSigningKey + this.DeviceEncryptionKey = deviceEncryptionKey + this.SignKeyId = signKeyId + this.EncKeyId = encKeyId + return &this +} + +// NewAgentPSSODeviceRegistrationRequestWithDefaults instantiates a new AgentPSSODeviceRegistrationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentPSSODeviceRegistrationRequestWithDefaults() *AgentPSSODeviceRegistrationRequest { + this := AgentPSSODeviceRegistrationRequest{} + return &this +} + +// GetDeviceSigningKey returns the DeviceSigningKey field value +func (o *AgentPSSODeviceRegistrationRequest) GetDeviceSigningKey() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceSigningKey +} + +// GetDeviceSigningKeyOk returns a tuple with the DeviceSigningKey field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationRequest) GetDeviceSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceSigningKey, true +} + +// SetDeviceSigningKey sets field value +func (o *AgentPSSODeviceRegistrationRequest) SetDeviceSigningKey(v string) { + o.DeviceSigningKey = v +} + +// GetDeviceEncryptionKey returns the DeviceEncryptionKey field value +func (o *AgentPSSODeviceRegistrationRequest) GetDeviceEncryptionKey() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceEncryptionKey +} + +// GetDeviceEncryptionKeyOk returns a tuple with the DeviceEncryptionKey field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationRequest) GetDeviceEncryptionKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceEncryptionKey, true +} + +// SetDeviceEncryptionKey sets field value +func (o *AgentPSSODeviceRegistrationRequest) SetDeviceEncryptionKey(v string) { + o.DeviceEncryptionKey = v +} + +// GetSignKeyId returns the SignKeyId field value +func (o *AgentPSSODeviceRegistrationRequest) GetSignKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.SignKeyId +} + +// GetSignKeyIdOk returns a tuple with the SignKeyId field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationRequest) GetSignKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SignKeyId, true +} + +// SetSignKeyId sets field value +func (o *AgentPSSODeviceRegistrationRequest) SetSignKeyId(v string) { + o.SignKeyId = v +} + +// GetEncKeyId returns the EncKeyId field value +func (o *AgentPSSODeviceRegistrationRequest) GetEncKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.EncKeyId +} + +// GetEncKeyIdOk returns a tuple with the EncKeyId field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationRequest) GetEncKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EncKeyId, true +} + +// SetEncKeyId sets field value +func (o *AgentPSSODeviceRegistrationRequest) SetEncKeyId(v string) { + o.EncKeyId = v +} + +func (o AgentPSSODeviceRegistrationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentPSSODeviceRegistrationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_signing_key"] = o.DeviceSigningKey + toSerialize["device_encryption_key"] = o.DeviceEncryptionKey + toSerialize["sign_key_id"] = o.SignKeyId + toSerialize["enc_key_id"] = o.EncKeyId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentPSSODeviceRegistrationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_signing_key", + "device_encryption_key", + "sign_key_id", + "enc_key_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentPSSODeviceRegistrationRequest := _AgentPSSODeviceRegistrationRequest{} + + err = json.Unmarshal(data, &varAgentPSSODeviceRegistrationRequest) + + if err != nil { + return err + } + + *o = AgentPSSODeviceRegistrationRequest(varAgentPSSODeviceRegistrationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_signing_key") + delete(additionalProperties, "device_encryption_key") + delete(additionalProperties, "sign_key_id") + delete(additionalProperties, "enc_key_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentPSSODeviceRegistrationRequest struct { + value *AgentPSSODeviceRegistrationRequest + isSet bool +} + +func (v NullableAgentPSSODeviceRegistrationRequest) Get() *AgentPSSODeviceRegistrationRequest { + return v.value +} + +func (v *NullableAgentPSSODeviceRegistrationRequest) Set(val *AgentPSSODeviceRegistrationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAgentPSSODeviceRegistrationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentPSSODeviceRegistrationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentPSSODeviceRegistrationRequest(val *AgentPSSODeviceRegistrationRequest) *NullableAgentPSSODeviceRegistrationRequest { + return &NullableAgentPSSODeviceRegistrationRequest{value: val, isSet: true} +} + +func (v NullableAgentPSSODeviceRegistrationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentPSSODeviceRegistrationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_psso_device_registration_response.go b/packages/client-go/model_agent_psso_device_registration_response.go new file mode 100644 index 0000000000..37d46f1ed0 --- /dev/null +++ b/packages/client-go/model_agent_psso_device_registration_response.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentPSSODeviceRegistrationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentPSSODeviceRegistrationResponse{} + +// AgentPSSODeviceRegistrationResponse authentik settings for Platform SSO tokens +type AgentPSSODeviceRegistrationResponse struct { + ClientId string `json:"client_id"` + Issuer string `json:"issuer"` + TokenEndpoint string `json:"token_endpoint"` + JwksEndpoint string `json:"jwks_endpoint"` + Audience string `json:"audience"` + NonceEndpoint string `json:"nonce_endpoint"` + AdditionalProperties map[string]interface{} +} + +type _AgentPSSODeviceRegistrationResponse AgentPSSODeviceRegistrationResponse + +// NewAgentPSSODeviceRegistrationResponse instantiates a new AgentPSSODeviceRegistrationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentPSSODeviceRegistrationResponse(clientId string, issuer string, tokenEndpoint string, jwksEndpoint string, audience string, nonceEndpoint string) *AgentPSSODeviceRegistrationResponse { + this := AgentPSSODeviceRegistrationResponse{} + this.ClientId = clientId + this.Issuer = issuer + this.TokenEndpoint = tokenEndpoint + this.JwksEndpoint = jwksEndpoint + this.Audience = audience + this.NonceEndpoint = nonceEndpoint + return &this +} + +// NewAgentPSSODeviceRegistrationResponseWithDefaults instantiates a new AgentPSSODeviceRegistrationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentPSSODeviceRegistrationResponseWithDefaults() *AgentPSSODeviceRegistrationResponse { + this := AgentPSSODeviceRegistrationResponse{} + return &this +} + +// GetClientId returns the ClientId field value +func (o *AgentPSSODeviceRegistrationResponse) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetClientId(v string) { + o.ClientId = v +} + +// GetIssuer returns the Issuer field value +func (o *AgentPSSODeviceRegistrationResponse) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetIssuer(v string) { + o.Issuer = v +} + +// GetTokenEndpoint returns the TokenEndpoint field value +func (o *AgentPSSODeviceRegistrationResponse) GetTokenEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.TokenEndpoint +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetTokenEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenEndpoint, true +} + +// SetTokenEndpoint sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetTokenEndpoint(v string) { + o.TokenEndpoint = v +} + +// GetJwksEndpoint returns the JwksEndpoint field value +func (o *AgentPSSODeviceRegistrationResponse) GetJwksEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.JwksEndpoint +} + +// GetJwksEndpointOk returns a tuple with the JwksEndpoint field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetJwksEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JwksEndpoint, true +} + +// SetJwksEndpoint sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetJwksEndpoint(v string) { + o.JwksEndpoint = v +} + +// GetAudience returns the Audience field value +func (o *AgentPSSODeviceRegistrationResponse) GetAudience() string { + if o == nil { + var ret string + return ret + } + + return o.Audience +} + +// GetAudienceOk returns a tuple with the Audience field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetAudienceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Audience, true +} + +// SetAudience sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetAudience(v string) { + o.Audience = v +} + +// GetNonceEndpoint returns the NonceEndpoint field value +func (o *AgentPSSODeviceRegistrationResponse) GetNonceEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.NonceEndpoint +} + +// GetNonceEndpointOk returns a tuple with the NonceEndpoint field value +// and a boolean to check if the value has been set. +func (o *AgentPSSODeviceRegistrationResponse) GetNonceEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NonceEndpoint, true +} + +// SetNonceEndpoint sets field value +func (o *AgentPSSODeviceRegistrationResponse) SetNonceEndpoint(v string) { + o.NonceEndpoint = v +} + +func (o AgentPSSODeviceRegistrationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentPSSODeviceRegistrationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["client_id"] = o.ClientId + toSerialize["issuer"] = o.Issuer + toSerialize["token_endpoint"] = o.TokenEndpoint + toSerialize["jwks_endpoint"] = o.JwksEndpoint + toSerialize["audience"] = o.Audience + toSerialize["nonce_endpoint"] = o.NonceEndpoint + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentPSSODeviceRegistrationResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "issuer", + "token_endpoint", + "jwks_endpoint", + "audience", + "nonce_endpoint", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentPSSODeviceRegistrationResponse := _AgentPSSODeviceRegistrationResponse{} + + err = json.Unmarshal(data, &varAgentPSSODeviceRegistrationResponse) + + if err != nil { + return err + } + + *o = AgentPSSODeviceRegistrationResponse(varAgentPSSODeviceRegistrationResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "client_id") + delete(additionalProperties, "issuer") + delete(additionalProperties, "token_endpoint") + delete(additionalProperties, "jwks_endpoint") + delete(additionalProperties, "audience") + delete(additionalProperties, "nonce_endpoint") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentPSSODeviceRegistrationResponse struct { + value *AgentPSSODeviceRegistrationResponse + isSet bool +} + +func (v NullableAgentPSSODeviceRegistrationResponse) Get() *AgentPSSODeviceRegistrationResponse { + return v.value +} + +func (v *NullableAgentPSSODeviceRegistrationResponse) Set(val *AgentPSSODeviceRegistrationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAgentPSSODeviceRegistrationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentPSSODeviceRegistrationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentPSSODeviceRegistrationResponse(val *AgentPSSODeviceRegistrationResponse) *NullableAgentPSSODeviceRegistrationResponse { + return &NullableAgentPSSODeviceRegistrationResponse{value: val, isSet: true} +} + +func (v NullableAgentPSSODeviceRegistrationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentPSSODeviceRegistrationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_psso_user_registration_request.go b/packages/client-go/model_agent_psso_user_registration_request.go new file mode 100644 index 0000000000..edcb1ac472 --- /dev/null +++ b/packages/client-go/model_agent_psso_user_registration_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentPSSOUserRegistrationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentPSSOUserRegistrationRequest{} + +// AgentPSSOUserRegistrationRequest Register Apple device user via Platform SSO +type AgentPSSOUserRegistrationRequest struct { + UserAuth string `json:"user_auth"` + UserSecureEnclaveKey string `json:"user_secure_enclave_key"` + EnclaveKeyId string `json:"enclave_key_id"` + AdditionalProperties map[string]interface{} +} + +type _AgentPSSOUserRegistrationRequest AgentPSSOUserRegistrationRequest + +// NewAgentPSSOUserRegistrationRequest instantiates a new AgentPSSOUserRegistrationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentPSSOUserRegistrationRequest(userAuth string, userSecureEnclaveKey string, enclaveKeyId string) *AgentPSSOUserRegistrationRequest { + this := AgentPSSOUserRegistrationRequest{} + this.UserAuth = userAuth + this.UserSecureEnclaveKey = userSecureEnclaveKey + this.EnclaveKeyId = enclaveKeyId + return &this +} + +// NewAgentPSSOUserRegistrationRequestWithDefaults instantiates a new AgentPSSOUserRegistrationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentPSSOUserRegistrationRequestWithDefaults() *AgentPSSOUserRegistrationRequest { + this := AgentPSSOUserRegistrationRequest{} + return &this +} + +// GetUserAuth returns the UserAuth field value +func (o *AgentPSSOUserRegistrationRequest) GetUserAuth() string { + if o == nil { + var ret string + return ret + } + + return o.UserAuth +} + +// GetUserAuthOk returns a tuple with the UserAuth field value +// and a boolean to check if the value has been set. +func (o *AgentPSSOUserRegistrationRequest) GetUserAuthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserAuth, true +} + +// SetUserAuth sets field value +func (o *AgentPSSOUserRegistrationRequest) SetUserAuth(v string) { + o.UserAuth = v +} + +// GetUserSecureEnclaveKey returns the UserSecureEnclaveKey field value +func (o *AgentPSSOUserRegistrationRequest) GetUserSecureEnclaveKey() string { + if o == nil { + var ret string + return ret + } + + return o.UserSecureEnclaveKey +} + +// GetUserSecureEnclaveKeyOk returns a tuple with the UserSecureEnclaveKey field value +// and a boolean to check if the value has been set. +func (o *AgentPSSOUserRegistrationRequest) GetUserSecureEnclaveKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserSecureEnclaveKey, true +} + +// SetUserSecureEnclaveKey sets field value +func (o *AgentPSSOUserRegistrationRequest) SetUserSecureEnclaveKey(v string) { + o.UserSecureEnclaveKey = v +} + +// GetEnclaveKeyId returns the EnclaveKeyId field value +func (o *AgentPSSOUserRegistrationRequest) GetEnclaveKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.EnclaveKeyId +} + +// GetEnclaveKeyIdOk returns a tuple with the EnclaveKeyId field value +// and a boolean to check if the value has been set. +func (o *AgentPSSOUserRegistrationRequest) GetEnclaveKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EnclaveKeyId, true +} + +// SetEnclaveKeyId sets field value +func (o *AgentPSSOUserRegistrationRequest) SetEnclaveKeyId(v string) { + o.EnclaveKeyId = v +} + +func (o AgentPSSOUserRegistrationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentPSSOUserRegistrationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user_auth"] = o.UserAuth + toSerialize["user_secure_enclave_key"] = o.UserSecureEnclaveKey + toSerialize["enclave_key_id"] = o.EnclaveKeyId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentPSSOUserRegistrationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user_auth", + "user_secure_enclave_key", + "enclave_key_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentPSSOUserRegistrationRequest := _AgentPSSOUserRegistrationRequest{} + + err = json.Unmarshal(data, &varAgentPSSOUserRegistrationRequest) + + if err != nil { + return err + } + + *o = AgentPSSOUserRegistrationRequest(varAgentPSSOUserRegistrationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user_auth") + delete(additionalProperties, "user_secure_enclave_key") + delete(additionalProperties, "enclave_key_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentPSSOUserRegistrationRequest struct { + value *AgentPSSOUserRegistrationRequest + isSet bool +} + +func (v NullableAgentPSSOUserRegistrationRequest) Get() *AgentPSSOUserRegistrationRequest { + return v.value +} + +func (v *NullableAgentPSSOUserRegistrationRequest) Set(val *AgentPSSOUserRegistrationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAgentPSSOUserRegistrationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentPSSOUserRegistrationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentPSSOUserRegistrationRequest(val *AgentPSSOUserRegistrationRequest) *NullableAgentPSSOUserRegistrationRequest { + return &NullableAgentPSSOUserRegistrationRequest{value: val, isSet: true} +} + +func (v NullableAgentPSSOUserRegistrationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentPSSOUserRegistrationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_agent_token_response.go b/packages/client-go/model_agent_token_response.go new file mode 100644 index 0000000000..e4447d2cc6 --- /dev/null +++ b/packages/client-go/model_agent_token_response.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AgentTokenResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AgentTokenResponse{} + +// AgentTokenResponse Base serializer class which doesn't implement create/update methods +type AgentTokenResponse struct { + Token string `json:"token"` + ExpiresIn *int32 `json:"expires_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AgentTokenResponse AgentTokenResponse + +// NewAgentTokenResponse instantiates a new AgentTokenResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAgentTokenResponse(token string) *AgentTokenResponse { + this := AgentTokenResponse{} + this.Token = token + return &this +} + +// NewAgentTokenResponseWithDefaults instantiates a new AgentTokenResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAgentTokenResponseWithDefaults() *AgentTokenResponse { + this := AgentTokenResponse{} + return &this +} + +// GetToken returns the Token field value +func (o *AgentTokenResponse) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *AgentTokenResponse) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *AgentTokenResponse) SetToken(v string) { + o.Token = v +} + +// GetExpiresIn returns the ExpiresIn field value if set, zero value otherwise. +func (o *AgentTokenResponse) GetExpiresIn() int32 { + if o == nil || IsNil(o.ExpiresIn) { + var ret int32 + return ret + } + return *o.ExpiresIn +} + +// GetExpiresInOk returns a tuple with the ExpiresIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AgentTokenResponse) GetExpiresInOk() (*int32, bool) { + if o == nil || IsNil(o.ExpiresIn) { + return nil, false + } + return o.ExpiresIn, true +} + +// HasExpiresIn returns a boolean if a field has been set. +func (o *AgentTokenResponse) HasExpiresIn() bool { + if o != nil && !IsNil(o.ExpiresIn) { + return true + } + + return false +} + +// SetExpiresIn gets a reference to the given int32 and assigns it to the ExpiresIn field. +func (o *AgentTokenResponse) SetExpiresIn(v int32) { + o.ExpiresIn = &v +} + +func (o AgentTokenResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AgentTokenResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token"] = o.Token + if !IsNil(o.ExpiresIn) { + toSerialize["expires_in"] = o.ExpiresIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AgentTokenResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAgentTokenResponse := _AgentTokenResponse{} + + err = json.Unmarshal(data, &varAgentTokenResponse) + + if err != nil { + return err + } + + *o = AgentTokenResponse(varAgentTokenResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token") + delete(additionalProperties, "expires_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAgentTokenResponse struct { + value *AgentTokenResponse + isSet bool +} + +func (v NullableAgentTokenResponse) Get() *AgentTokenResponse { + return v.value +} + +func (v *NullableAgentTokenResponse) Set(val *AgentTokenResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAgentTokenResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAgentTokenResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAgentTokenResponse(val *AgentTokenResponse) *NullableAgentTokenResponse { + return &NullableAgentTokenResponse{value: val, isSet: true} +} + +func (v NullableAgentTokenResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAgentTokenResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_alg_enum.go b/packages/client-go/model_alg_enum.go new file mode 100644 index 0000000000..7bf2fba25a --- /dev/null +++ b/packages/client-go/model_alg_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AlgEnum the model 'AlgEnum' +type AlgEnum string + +// List of AlgEnum +const ( + ALGENUM_RSA AlgEnum = "rsa" + ALGENUM_ECDSA AlgEnum = "ecdsa" + ALGENUM_ED25519 AlgEnum = "ed25519" + ALGENUM_ED448 AlgEnum = "ed448" +) + +// All allowed values of AlgEnum enum +var AllowedAlgEnumEnumValues = []AlgEnum{ + "rsa", + "ecdsa", + "ed25519", + "ed448", +} + +func (v *AlgEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AlgEnum(value) + for _, existing := range AllowedAlgEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AlgEnum", value) +} + +// NewAlgEnumFromValue returns a pointer to a valid AlgEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAlgEnumFromValue(v string) (*AlgEnum, error) { + ev := AlgEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AlgEnum: valid values are %v", v, AllowedAlgEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AlgEnum) IsValid() bool { + for _, existing := range AllowedAlgEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AlgEnum value +func (v AlgEnum) Ptr() *AlgEnum { + return &v +} + +type NullableAlgEnum struct { + value *AlgEnum + isSet bool +} + +func (v NullableAlgEnum) Get() *AlgEnum { + return v.value +} + +func (v *NullableAlgEnum) Set(val *AlgEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAlgEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAlgEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlgEnum(val *AlgEnum) *NullableAlgEnum { + return &NullableAlgEnum{value: val, isSet: true} +} + +func (v NullableAlgEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlgEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_app.go b/packages/client-go/model_app.go new file mode 100644 index 0000000000..8d60ecbf5e --- /dev/null +++ b/packages/client-go/model_app.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the App type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &App{} + +// App Serialize Application info +type App struct { + Name string `json:"name"` + Label string `json:"label"` + AdditionalProperties map[string]interface{} +} + +type _App App + +// NewApp instantiates a new App object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApp(name string, label string) *App { + this := App{} + this.Name = name + this.Label = label + return &this +} + +// NewAppWithDefaults instantiates a new App object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAppWithDefaults() *App { + this := App{} + return &this +} + +// GetName returns the Name field value +func (o *App) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *App) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *App) SetName(v string) { + o.Name = v +} + +// GetLabel returns the Label field value +func (o *App) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *App) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *App) SetLabel(v string) { + o.Label = v +} + +func (o App) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o App) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["label"] = o.Label + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *App) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "label", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApp := _App{} + + err = json.Unmarshal(data, &varApp) + + if err != nil { + return err + } + + *o = App(varApp) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApp struct { + value *App + isSet bool +} + +func (v NullableApp) Get() *App { + return v.value +} + +func (v *NullableApp) Set(val *App) { + v.value = val + v.isSet = true +} + +func (v NullableApp) IsSet() bool { + return v.isSet +} + +func (v *NullableApp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApp(val *App) *NullableApp { + return &NullableApp{value: val, isSet: true} +} + +func (v NullableApp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_app_enum.go b/packages/client-go/model_app_enum.go new file mode 100644 index 0000000000..af645bba9b --- /dev/null +++ b/packages/client-go/model_app_enum.go @@ -0,0 +1,267 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AppEnum the model 'AppEnum' +type AppEnum string + +// List of AppEnum +const ( + APPENUM_AUTHENTIK_COMMANDS AppEnum = "authentik.commands" + APPENUM_AUTHENTIK_TENANTS AppEnum = "authentik.tenants" + APPENUM_AUTHENTIK_TASKS AppEnum = "authentik.tasks" + APPENUM_AUTHENTIK_ADMIN AppEnum = "authentik.admin" + APPENUM_AUTHENTIK_API AppEnum = "authentik.api" + APPENUM_AUTHENTIK_CORE AppEnum = "authentik.core" + APPENUM_AUTHENTIK_CRYPTO AppEnum = "authentik.crypto" + APPENUM_AUTHENTIK_ENDPOINTS AppEnum = "authentik.endpoints" + APPENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_AGENT AppEnum = "authentik.endpoints.connectors.agent" + APPENUM_AUTHENTIK_ENTERPRISE AppEnum = "authentik.enterprise" + APPENUM_AUTHENTIK_EVENTS AppEnum = "authentik.events" + APPENUM_AUTHENTIK_ADMIN_FILES AppEnum = "authentik.admin.files" + APPENUM_AUTHENTIK_FLOWS AppEnum = "authentik.flows" + APPENUM_AUTHENTIK_OUTPOSTS AppEnum = "authentik.outposts" + APPENUM_AUTHENTIK_POLICIES_DUMMY AppEnum = "authentik.policies.dummy" + APPENUM_AUTHENTIK_POLICIES_EVENT_MATCHER AppEnum = "authentik.policies.event_matcher" + APPENUM_AUTHENTIK_POLICIES_EXPIRY AppEnum = "authentik.policies.expiry" + APPENUM_AUTHENTIK_POLICIES_EXPRESSION AppEnum = "authentik.policies.expression" + APPENUM_AUTHENTIK_POLICIES_GEOIP AppEnum = "authentik.policies.geoip" + APPENUM_AUTHENTIK_POLICIES_PASSWORD AppEnum = "authentik.policies.password" + APPENUM_AUTHENTIK_POLICIES_REPUTATION AppEnum = "authentik.policies.reputation" + APPENUM_AUTHENTIK_POLICIES AppEnum = "authentik.policies" + APPENUM_AUTHENTIK_PROVIDERS_LDAP AppEnum = "authentik.providers.ldap" + APPENUM_AUTHENTIK_PROVIDERS_OAUTH2 AppEnum = "authentik.providers.oauth2" + APPENUM_AUTHENTIK_PROVIDERS_PROXY AppEnum = "authentik.providers.proxy" + APPENUM_AUTHENTIK_PROVIDERS_RAC AppEnum = "authentik.providers.rac" + APPENUM_AUTHENTIK_PROVIDERS_RADIUS AppEnum = "authentik.providers.radius" + APPENUM_AUTHENTIK_PROVIDERS_SAML AppEnum = "authentik.providers.saml" + APPENUM_AUTHENTIK_PROVIDERS_SCIM AppEnum = "authentik.providers.scim" + APPENUM_AUTHENTIK_RBAC AppEnum = "authentik.rbac" + APPENUM_AUTHENTIK_RECOVERY AppEnum = "authentik.recovery" + APPENUM_AUTHENTIK_SOURCES_KERBEROS AppEnum = "authentik.sources.kerberos" + APPENUM_AUTHENTIK_SOURCES_LDAP AppEnum = "authentik.sources.ldap" + APPENUM_AUTHENTIK_SOURCES_OAUTH AppEnum = "authentik.sources.oauth" + APPENUM_AUTHENTIK_SOURCES_PLEX AppEnum = "authentik.sources.plex" + APPENUM_AUTHENTIK_SOURCES_SAML AppEnum = "authentik.sources.saml" + APPENUM_AUTHENTIK_SOURCES_SCIM AppEnum = "authentik.sources.scim" + APPENUM_AUTHENTIK_SOURCES_TELEGRAM AppEnum = "authentik.sources.telegram" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR AppEnum = "authentik.stages.authenticator" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_DUO AppEnum = "authentik.stages.authenticator_duo" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_EMAIL AppEnum = "authentik.stages.authenticator_email" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_SMS AppEnum = "authentik.stages.authenticator_sms" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_STATIC AppEnum = "authentik.stages.authenticator_static" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_TOTP AppEnum = "authentik.stages.authenticator_totp" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_VALIDATE AppEnum = "authentik.stages.authenticator_validate" + APPENUM_AUTHENTIK_STAGES_AUTHENTICATOR_WEBAUTHN AppEnum = "authentik.stages.authenticator_webauthn" + APPENUM_AUTHENTIK_STAGES_CAPTCHA AppEnum = "authentik.stages.captcha" + APPENUM_AUTHENTIK_STAGES_CONSENT AppEnum = "authentik.stages.consent" + APPENUM_AUTHENTIK_STAGES_DENY AppEnum = "authentik.stages.deny" + APPENUM_AUTHENTIK_STAGES_DUMMY AppEnum = "authentik.stages.dummy" + APPENUM_AUTHENTIK_STAGES_EMAIL AppEnum = "authentik.stages.email" + APPENUM_AUTHENTIK_STAGES_IDENTIFICATION AppEnum = "authentik.stages.identification" + APPENUM_AUTHENTIK_STAGES_INVITATION AppEnum = "authentik.stages.invitation" + APPENUM_AUTHENTIK_STAGES_PASSWORD AppEnum = "authentik.stages.password" + APPENUM_AUTHENTIK_STAGES_PROMPT AppEnum = "authentik.stages.prompt" + APPENUM_AUTHENTIK_STAGES_REDIRECT AppEnum = "authentik.stages.redirect" + APPENUM_AUTHENTIK_STAGES_USER_DELETE AppEnum = "authentik.stages.user_delete" + APPENUM_AUTHENTIK_STAGES_USER_LOGIN AppEnum = "authentik.stages.user_login" + APPENUM_AUTHENTIK_STAGES_USER_LOGOUT AppEnum = "authentik.stages.user_logout" + APPENUM_AUTHENTIK_STAGES_USER_WRITE AppEnum = "authentik.stages.user_write" + APPENUM_AUTHENTIK_TASKS_SCHEDULES AppEnum = "authentik.tasks.schedules" + APPENUM_AUTHENTIK_BRANDS AppEnum = "authentik.brands" + APPENUM_AUTHENTIK_BLUEPRINTS AppEnum = "authentik.blueprints" + APPENUM_AUTHENTIK_ENTERPRISE_AUDIT AppEnum = "authentik.enterprise.audit" + APPENUM_AUTHENTIK_ENTERPRISE_ENDPOINTS_CONNECTORS_AGENT AppEnum = "authentik.enterprise.endpoints.connectors.agent" + APPENUM_AUTHENTIK_ENTERPRISE_ENDPOINTS_CONNECTORS_FLEET AppEnum = "authentik.enterprise.endpoints.connectors.fleet" + APPENUM_AUTHENTIK_ENTERPRISE_ENDPOINTS_CONNECTORS_GOOGLE_CHROME AppEnum = "authentik.enterprise.endpoints.connectors.google_chrome" + APPENUM_AUTHENTIK_ENTERPRISE_LIFECYCLE AppEnum = "authentik.enterprise.lifecycle" + APPENUM_AUTHENTIK_ENTERPRISE_POLICIES_UNIQUE_PASSWORD AppEnum = "authentik.enterprise.policies.unique_password" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_GOOGLE_WORKSPACE AppEnum = "authentik.enterprise.providers.google_workspace" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_MICROSOFT_ENTRA AppEnum = "authentik.enterprise.providers.microsoft_entra" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_RADIUS AppEnum = "authentik.enterprise.providers.radius" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_SCIM AppEnum = "authentik.enterprise.providers.scim" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_SSF AppEnum = "authentik.enterprise.providers.ssf" + APPENUM_AUTHENTIK_ENTERPRISE_PROVIDERS_WS_FEDERATION AppEnum = "authentik.enterprise.providers.ws_federation" + APPENUM_AUTHENTIK_ENTERPRISE_REPORTS AppEnum = "authentik.enterprise.reports" + APPENUM_AUTHENTIK_ENTERPRISE_SEARCH AppEnum = "authentik.enterprise.search" + APPENUM_AUTHENTIK_ENTERPRISE_STAGES_AUTHENTICATOR_ENDPOINT_GDTC AppEnum = "authentik.enterprise.stages.authenticator_endpoint_gdtc" + APPENUM_AUTHENTIK_ENTERPRISE_STAGES_MTLS AppEnum = "authentik.enterprise.stages.mtls" + APPENUM_AUTHENTIK_ENTERPRISE_STAGES_SOURCE AppEnum = "authentik.enterprise.stages.source" +) + +// All allowed values of AppEnum enum +var AllowedAppEnumEnumValues = []AppEnum{ + "authentik.commands", + "authentik.tenants", + "authentik.tasks", + "authentik.admin", + "authentik.api", + "authentik.core", + "authentik.crypto", + "authentik.endpoints", + "authentik.endpoints.connectors.agent", + "authentik.enterprise", + "authentik.events", + "authentik.admin.files", + "authentik.flows", + "authentik.outposts", + "authentik.policies.dummy", + "authentik.policies.event_matcher", + "authentik.policies.expiry", + "authentik.policies.expression", + "authentik.policies.geoip", + "authentik.policies.password", + "authentik.policies.reputation", + "authentik.policies", + "authentik.providers.ldap", + "authentik.providers.oauth2", + "authentik.providers.proxy", + "authentik.providers.rac", + "authentik.providers.radius", + "authentik.providers.saml", + "authentik.providers.scim", + "authentik.rbac", + "authentik.recovery", + "authentik.sources.kerberos", + "authentik.sources.ldap", + "authentik.sources.oauth", + "authentik.sources.plex", + "authentik.sources.saml", + "authentik.sources.scim", + "authentik.sources.telegram", + "authentik.stages.authenticator", + "authentik.stages.authenticator_duo", + "authentik.stages.authenticator_email", + "authentik.stages.authenticator_sms", + "authentik.stages.authenticator_static", + "authentik.stages.authenticator_totp", + "authentik.stages.authenticator_validate", + "authentik.stages.authenticator_webauthn", + "authentik.stages.captcha", + "authentik.stages.consent", + "authentik.stages.deny", + "authentik.stages.dummy", + "authentik.stages.email", + "authentik.stages.identification", + "authentik.stages.invitation", + "authentik.stages.password", + "authentik.stages.prompt", + "authentik.stages.redirect", + "authentik.stages.user_delete", + "authentik.stages.user_login", + "authentik.stages.user_logout", + "authentik.stages.user_write", + "authentik.tasks.schedules", + "authentik.brands", + "authentik.blueprints", + "authentik.enterprise.audit", + "authentik.enterprise.endpoints.connectors.agent", + "authentik.enterprise.endpoints.connectors.fleet", + "authentik.enterprise.endpoints.connectors.google_chrome", + "authentik.enterprise.lifecycle", + "authentik.enterprise.policies.unique_password", + "authentik.enterprise.providers.google_workspace", + "authentik.enterprise.providers.microsoft_entra", + "authentik.enterprise.providers.radius", + "authentik.enterprise.providers.scim", + "authentik.enterprise.providers.ssf", + "authentik.enterprise.providers.ws_federation", + "authentik.enterprise.reports", + "authentik.enterprise.search", + "authentik.enterprise.stages.authenticator_endpoint_gdtc", + "authentik.enterprise.stages.mtls", + "authentik.enterprise.stages.source", +} + +func (v *AppEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AppEnum(value) + for _, existing := range AllowedAppEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AppEnum", value) +} + +// NewAppEnumFromValue returns a pointer to a valid AppEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAppEnumFromValue(v string) (*AppEnum, error) { + ev := AppEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AppEnum: valid values are %v", v, AllowedAppEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AppEnum) IsValid() bool { + for _, existing := range AllowedAppEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AppEnum value +func (v AppEnum) Ptr() *AppEnum { + return &v +} + +type NullableAppEnum struct { + value *AppEnum + isSet bool +} + +func (v NullableAppEnum) Get() *AppEnum { + return v.value +} + +func (v *NullableAppEnum) Set(val *AppEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAppEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAppEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAppEnum(val *AppEnum) *NullableAppEnum { + return &NullableAppEnum{value: val, isSet: true} +} + +func (v NullableAppEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAppEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_apple_challenge_response_request.go b/packages/client-go/model_apple_challenge_response_request.go new file mode 100644 index 0000000000..e57ccbfada --- /dev/null +++ b/packages/client-go/model_apple_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AppleChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppleChallengeResponseRequest{} + +// AppleChallengeResponseRequest Pseudo class for apple response +type AppleChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AppleChallengeResponseRequest AppleChallengeResponseRequest + +// NewAppleChallengeResponseRequest instantiates a new AppleChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAppleChallengeResponseRequest() *AppleChallengeResponseRequest { + this := AppleChallengeResponseRequest{} + var component string = "ak-source-oauth-apple" + this.Component = &component + return &this +} + +// NewAppleChallengeResponseRequestWithDefaults instantiates a new AppleChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAppleChallengeResponseRequestWithDefaults() *AppleChallengeResponseRequest { + this := AppleChallengeResponseRequest{} + var component string = "ak-source-oauth-apple" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AppleChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppleChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AppleChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AppleChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o AppleChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppleChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AppleChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAppleChallengeResponseRequest := _AppleChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAppleChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AppleChallengeResponseRequest(varAppleChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAppleChallengeResponseRequest struct { + value *AppleChallengeResponseRequest + isSet bool +} + +func (v NullableAppleChallengeResponseRequest) Get() *AppleChallengeResponseRequest { + return v.value +} + +func (v *NullableAppleChallengeResponseRequest) Set(val *AppleChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAppleChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAppleChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAppleChallengeResponseRequest(val *AppleChallengeResponseRequest) *NullableAppleChallengeResponseRequest { + return &NullableAppleChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAppleChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAppleChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_apple_login_challenge.go b/packages/client-go/model_apple_login_challenge.go new file mode 100644 index 0000000000..5b7f20c179 --- /dev/null +++ b/packages/client-go/model_apple_login_challenge.go @@ -0,0 +1,369 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AppleLoginChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AppleLoginChallenge{} + +// AppleLoginChallenge Special challenge for apple-native authentication flow, which happens on the client. +type AppleLoginChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + ClientId string `json:"client_id"` + Scope string `json:"scope"` + RedirectUri string `json:"redirect_uri"` + State string `json:"state"` + AdditionalProperties map[string]interface{} +} + +type _AppleLoginChallenge AppleLoginChallenge + +// NewAppleLoginChallenge instantiates a new AppleLoginChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAppleLoginChallenge(clientId string, scope string, redirectUri string, state string) *AppleLoginChallenge { + this := AppleLoginChallenge{} + var component string = "ak-source-oauth-apple" + this.Component = &component + this.ClientId = clientId + this.Scope = scope + this.RedirectUri = redirectUri + this.State = state + return &this +} + +// NewAppleLoginChallengeWithDefaults instantiates a new AppleLoginChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAppleLoginChallengeWithDefaults() *AppleLoginChallenge { + this := AppleLoginChallenge{} + var component string = "ak-source-oauth-apple" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AppleLoginChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AppleLoginChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AppleLoginChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AppleLoginChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AppleLoginChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AppleLoginChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AppleLoginChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AppleLoginChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AppleLoginChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetClientId returns the ClientId field value +func (o *AppleLoginChallenge) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *AppleLoginChallenge) SetClientId(v string) { + o.ClientId = v +} + +// GetScope returns the Scope field value +func (o *AppleLoginChallenge) GetScope() string { + if o == nil { + var ret string + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetScopeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Scope, true +} + +// SetScope sets field value +func (o *AppleLoginChallenge) SetScope(v string) { + o.Scope = v +} + +// GetRedirectUri returns the RedirectUri field value +func (o *AppleLoginChallenge) GetRedirectUri() string { + if o == nil { + var ret string + return ret + } + + return o.RedirectUri +} + +// GetRedirectUriOk returns a tuple with the RedirectUri field value +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetRedirectUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RedirectUri, true +} + +// SetRedirectUri sets field value +func (o *AppleLoginChallenge) SetRedirectUri(v string) { + o.RedirectUri = v +} + +// GetState returns the State field value +func (o *AppleLoginChallenge) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *AppleLoginChallenge) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *AppleLoginChallenge) SetState(v string) { + o.State = v +} + +func (o AppleLoginChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AppleLoginChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["client_id"] = o.ClientId + toSerialize["scope"] = o.Scope + toSerialize["redirect_uri"] = o.RedirectUri + toSerialize["state"] = o.State + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AppleLoginChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "scope", + "redirect_uri", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAppleLoginChallenge := _AppleLoginChallenge{} + + err = json.Unmarshal(data, &varAppleLoginChallenge) + + if err != nil { + return err + } + + *o = AppleLoginChallenge(varAppleLoginChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "client_id") + delete(additionalProperties, "scope") + delete(additionalProperties, "redirect_uri") + delete(additionalProperties, "state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAppleLoginChallenge struct { + value *AppleLoginChallenge + isSet bool +} + +func (v NullableAppleLoginChallenge) Get() *AppleLoginChallenge { + return v.value +} + +func (v *NullableAppleLoginChallenge) Set(val *AppleLoginChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAppleLoginChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAppleLoginChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAppleLoginChallenge(val *AppleLoginChallenge) *NullableAppleLoginChallenge { + return &NullableAppleLoginChallenge{value: val, isSet: true} +} + +func (v NullableAppleLoginChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAppleLoginChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_application.go b/packages/client-go/model_application.go new file mode 100644 index 0000000000..2ebd97b7c1 --- /dev/null +++ b/packages/client-go/model_application.go @@ -0,0 +1,725 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Application type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Application{} + +// Application Application Serializer +type Application struct { + Pk string `json:"pk"` + // Application's display Name. + Name string `json:"name"` + // Internal application name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Provider NullableInt32 `json:"provider,omitempty"` + ProviderObj Provider `json:"provider_obj"` + BackchannelProviders []int32 `json:"backchannel_providers,omitempty"` + BackchannelProvidersObj []Provider `json:"backchannel_providers_obj"` + // Allow formatting of launch URL + LaunchUrl NullableString `json:"launch_url"` + // Open launch URL in a new browser tab or window. + OpenInNewTab *bool `json:"open_in_new_tab,omitempty"` + MetaLaunchUrl *string `json:"meta_launch_url,omitempty"` + MetaIcon *string `json:"meta_icon,omitempty"` + // Get the URL to the App Icon image + MetaIconUrl NullableString `json:"meta_icon_url"` + MetaIconThemedUrls NullableThemedUrls `json:"meta_icon_themed_urls"` + MetaDescription *string `json:"meta_description,omitempty"` + MetaPublisher *string `json:"meta_publisher,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + Group *string `json:"group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Application Application + +// NewApplication instantiates a new Application object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplication(pk string, name string, slug string, providerObj Provider, backchannelProvidersObj []Provider, launchUrl NullableString, metaIconUrl NullableString, metaIconThemedUrls NullableThemedUrls) *Application { + this := Application{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.ProviderObj = providerObj + this.BackchannelProvidersObj = backchannelProvidersObj + this.LaunchUrl = launchUrl + this.MetaIconUrl = metaIconUrl + this.MetaIconThemedUrls = metaIconThemedUrls + return &this +} + +// NewApplicationWithDefaults instantiates a new Application object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationWithDefaults() *Application { + this := Application{} + return &this +} + +// GetPk returns the Pk field value +func (o *Application) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Application) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Application) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Application) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Application) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Application) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Application) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Application) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Application) SetSlug(v string) { + o.Slug = v +} + +// GetProvider returns the Provider field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Application) GetProvider() int32 { + if o == nil || IsNil(o.Provider.Get()) { + var ret int32 + return ret + } + return *o.Provider.Get() +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Application) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Provider.Get(), o.Provider.IsSet() +} + +// HasProvider returns a boolean if a field has been set. +func (o *Application) HasProvider() bool { + if o != nil && o.Provider.IsSet() { + return true + } + + return false +} + +// SetProvider gets a reference to the given NullableInt32 and assigns it to the Provider field. +func (o *Application) SetProvider(v int32) { + o.Provider.Set(&v) +} + +// SetProviderNil sets the value for Provider to be an explicit nil +func (o *Application) SetProviderNil() { + o.Provider.Set(nil) +} + +// UnsetProvider ensures that no value is present for Provider, not even an explicit nil +func (o *Application) UnsetProvider() { + o.Provider.Unset() +} + +// GetProviderObj returns the ProviderObj field value +func (o *Application) GetProviderObj() Provider { + if o == nil { + var ret Provider + return ret + } + + return o.ProviderObj +} + +// GetProviderObjOk returns a tuple with the ProviderObj field value +// and a boolean to check if the value has been set. +func (o *Application) GetProviderObjOk() (*Provider, bool) { + if o == nil { + return nil, false + } + return &o.ProviderObj, true +} + +// SetProviderObj sets field value +func (o *Application) SetProviderObj(v Provider) { + o.ProviderObj = v +} + +// GetBackchannelProviders returns the BackchannelProviders field value if set, zero value otherwise. +func (o *Application) GetBackchannelProviders() []int32 { + if o == nil || IsNil(o.BackchannelProviders) { + var ret []int32 + return ret + } + return o.BackchannelProviders +} + +// GetBackchannelProvidersOk returns a tuple with the BackchannelProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetBackchannelProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.BackchannelProviders) { + return nil, false + } + return o.BackchannelProviders, true +} + +// HasBackchannelProviders returns a boolean if a field has been set. +func (o *Application) HasBackchannelProviders() bool { + if o != nil && !IsNil(o.BackchannelProviders) { + return true + } + + return false +} + +// SetBackchannelProviders gets a reference to the given []int32 and assigns it to the BackchannelProviders field. +func (o *Application) SetBackchannelProviders(v []int32) { + o.BackchannelProviders = v +} + +// GetBackchannelProvidersObj returns the BackchannelProvidersObj field value +func (o *Application) GetBackchannelProvidersObj() []Provider { + if o == nil { + var ret []Provider + return ret + } + + return o.BackchannelProvidersObj +} + +// GetBackchannelProvidersObjOk returns a tuple with the BackchannelProvidersObj field value +// and a boolean to check if the value has been set. +func (o *Application) GetBackchannelProvidersObjOk() ([]Provider, bool) { + if o == nil { + return nil, false + } + return o.BackchannelProvidersObj, true +} + +// SetBackchannelProvidersObj sets field value +func (o *Application) SetBackchannelProvidersObj(v []Provider) { + o.BackchannelProvidersObj = v +} + +// GetLaunchUrl returns the LaunchUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Application) GetLaunchUrl() string { + if o == nil || o.LaunchUrl.Get() == nil { + var ret string + return ret + } + + return *o.LaunchUrl.Get() +} + +// GetLaunchUrlOk returns a tuple with the LaunchUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Application) GetLaunchUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LaunchUrl.Get(), o.LaunchUrl.IsSet() +} + +// SetLaunchUrl sets field value +func (o *Application) SetLaunchUrl(v string) { + o.LaunchUrl.Set(&v) +} + +// GetOpenInNewTab returns the OpenInNewTab field value if set, zero value otherwise. +func (o *Application) GetOpenInNewTab() bool { + if o == nil || IsNil(o.OpenInNewTab) { + var ret bool + return ret + } + return *o.OpenInNewTab +} + +// GetOpenInNewTabOk returns a tuple with the OpenInNewTab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetOpenInNewTabOk() (*bool, bool) { + if o == nil || IsNil(o.OpenInNewTab) { + return nil, false + } + return o.OpenInNewTab, true +} + +// HasOpenInNewTab returns a boolean if a field has been set. +func (o *Application) HasOpenInNewTab() bool { + if o != nil && !IsNil(o.OpenInNewTab) { + return true + } + + return false +} + +// SetOpenInNewTab gets a reference to the given bool and assigns it to the OpenInNewTab field. +func (o *Application) SetOpenInNewTab(v bool) { + o.OpenInNewTab = &v +} + +// GetMetaLaunchUrl returns the MetaLaunchUrl field value if set, zero value otherwise. +func (o *Application) GetMetaLaunchUrl() string { + if o == nil || IsNil(o.MetaLaunchUrl) { + var ret string + return ret + } + return *o.MetaLaunchUrl +} + +// GetMetaLaunchUrlOk returns a tuple with the MetaLaunchUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetMetaLaunchUrlOk() (*string, bool) { + if o == nil || IsNil(o.MetaLaunchUrl) { + return nil, false + } + return o.MetaLaunchUrl, true +} + +// HasMetaLaunchUrl returns a boolean if a field has been set. +func (o *Application) HasMetaLaunchUrl() bool { + if o != nil && !IsNil(o.MetaLaunchUrl) { + return true + } + + return false +} + +// SetMetaLaunchUrl gets a reference to the given string and assigns it to the MetaLaunchUrl field. +func (o *Application) SetMetaLaunchUrl(v string) { + o.MetaLaunchUrl = &v +} + +// GetMetaIcon returns the MetaIcon field value if set, zero value otherwise. +func (o *Application) GetMetaIcon() string { + if o == nil || IsNil(o.MetaIcon) { + var ret string + return ret + } + return *o.MetaIcon +} + +// GetMetaIconOk returns a tuple with the MetaIcon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetMetaIconOk() (*string, bool) { + if o == nil || IsNil(o.MetaIcon) { + return nil, false + } + return o.MetaIcon, true +} + +// HasMetaIcon returns a boolean if a field has been set. +func (o *Application) HasMetaIcon() bool { + if o != nil && !IsNil(o.MetaIcon) { + return true + } + + return false +} + +// SetMetaIcon gets a reference to the given string and assigns it to the MetaIcon field. +func (o *Application) SetMetaIcon(v string) { + o.MetaIcon = &v +} + +// GetMetaIconUrl returns the MetaIconUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Application) GetMetaIconUrl() string { + if o == nil || o.MetaIconUrl.Get() == nil { + var ret string + return ret + } + + return *o.MetaIconUrl.Get() +} + +// GetMetaIconUrlOk returns a tuple with the MetaIconUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Application) GetMetaIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.MetaIconUrl.Get(), o.MetaIconUrl.IsSet() +} + +// SetMetaIconUrl sets field value +func (o *Application) SetMetaIconUrl(v string) { + o.MetaIconUrl.Set(&v) +} + +// GetMetaIconThemedUrls returns the MetaIconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *Application) GetMetaIconThemedUrls() ThemedUrls { + if o == nil || o.MetaIconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.MetaIconThemedUrls.Get() +} + +// GetMetaIconThemedUrlsOk returns a tuple with the MetaIconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Application) GetMetaIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.MetaIconThemedUrls.Get(), o.MetaIconThemedUrls.IsSet() +} + +// SetMetaIconThemedUrls sets field value +func (o *Application) SetMetaIconThemedUrls(v ThemedUrls) { + o.MetaIconThemedUrls.Set(&v) +} + +// GetMetaDescription returns the MetaDescription field value if set, zero value otherwise. +func (o *Application) GetMetaDescription() string { + if o == nil || IsNil(o.MetaDescription) { + var ret string + return ret + } + return *o.MetaDescription +} + +// GetMetaDescriptionOk returns a tuple with the MetaDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetMetaDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.MetaDescription) { + return nil, false + } + return o.MetaDescription, true +} + +// HasMetaDescription returns a boolean if a field has been set. +func (o *Application) HasMetaDescription() bool { + if o != nil && !IsNil(o.MetaDescription) { + return true + } + + return false +} + +// SetMetaDescription gets a reference to the given string and assigns it to the MetaDescription field. +func (o *Application) SetMetaDescription(v string) { + o.MetaDescription = &v +} + +// GetMetaPublisher returns the MetaPublisher field value if set, zero value otherwise. +func (o *Application) GetMetaPublisher() string { + if o == nil || IsNil(o.MetaPublisher) { + var ret string + return ret + } + return *o.MetaPublisher +} + +// GetMetaPublisherOk returns a tuple with the MetaPublisher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetMetaPublisherOk() (*string, bool) { + if o == nil || IsNil(o.MetaPublisher) { + return nil, false + } + return o.MetaPublisher, true +} + +// HasMetaPublisher returns a boolean if a field has been set. +func (o *Application) HasMetaPublisher() bool { + if o != nil && !IsNil(o.MetaPublisher) { + return true + } + + return false +} + +// SetMetaPublisher gets a reference to the given string and assigns it to the MetaPublisher field. +func (o *Application) SetMetaPublisher(v string) { + o.MetaPublisher = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *Application) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *Application) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *Application) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *Application) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Application) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *Application) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *Application) SetGroup(v string) { + o.Group = &v +} + +func (o Application) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Application) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Provider.IsSet() { + toSerialize["provider"] = o.Provider.Get() + } + toSerialize["provider_obj"] = o.ProviderObj + if !IsNil(o.BackchannelProviders) { + toSerialize["backchannel_providers"] = o.BackchannelProviders + } + toSerialize["backchannel_providers_obj"] = o.BackchannelProvidersObj + toSerialize["launch_url"] = o.LaunchUrl.Get() + if !IsNil(o.OpenInNewTab) { + toSerialize["open_in_new_tab"] = o.OpenInNewTab + } + if !IsNil(o.MetaLaunchUrl) { + toSerialize["meta_launch_url"] = o.MetaLaunchUrl + } + if !IsNil(o.MetaIcon) { + toSerialize["meta_icon"] = o.MetaIcon + } + toSerialize["meta_icon_url"] = o.MetaIconUrl.Get() + toSerialize["meta_icon_themed_urls"] = o.MetaIconThemedUrls.Get() + if !IsNil(o.MetaDescription) { + toSerialize["meta_description"] = o.MetaDescription + } + if !IsNil(o.MetaPublisher) { + toSerialize["meta_publisher"] = o.MetaPublisher + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Application) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "provider_obj", + "backchannel_providers_obj", + "launch_url", + "meta_icon_url", + "meta_icon_themed_urls", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplication := _Application{} + + err = json.Unmarshal(data, &varApplication) + + if err != nil { + return err + } + + *o = Application(varApplication) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_obj") + delete(additionalProperties, "backchannel_providers") + delete(additionalProperties, "backchannel_providers_obj") + delete(additionalProperties, "launch_url") + delete(additionalProperties, "open_in_new_tab") + delete(additionalProperties, "meta_launch_url") + delete(additionalProperties, "meta_icon") + delete(additionalProperties, "meta_icon_url") + delete(additionalProperties, "meta_icon_themed_urls") + delete(additionalProperties, "meta_description") + delete(additionalProperties, "meta_publisher") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplication struct { + value *Application + isSet bool +} + +func (v NullableApplication) Get() *Application { + return v.value +} + +func (v *NullableApplication) Set(val *Application) { + v.value = val + v.isSet = true +} + +func (v NullableApplication) IsSet() bool { + return v.isSet +} + +func (v *NullableApplication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplication(val *Application) *NullableApplication { + return &NullableApplication{value: val, isSet: true} +} + +func (v NullableApplication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_application_entitlement.go b/packages/client-go/model_application_entitlement.go new file mode 100644 index 0000000000..e2094fd585 --- /dev/null +++ b/packages/client-go/model_application_entitlement.go @@ -0,0 +1,262 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationEntitlement type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationEntitlement{} + +// ApplicationEntitlement ApplicationEntitlement Serializer +type ApplicationEntitlement struct { + PbmUuid string `json:"pbm_uuid"` + Name string `json:"name"` + App string `json:"app"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationEntitlement ApplicationEntitlement + +// NewApplicationEntitlement instantiates a new ApplicationEntitlement object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplicationEntitlement(pbmUuid string, name string, app string) *ApplicationEntitlement { + this := ApplicationEntitlement{} + this.PbmUuid = pbmUuid + this.Name = name + this.App = app + return &this +} + +// NewApplicationEntitlementWithDefaults instantiates a new ApplicationEntitlement object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationEntitlementWithDefaults() *ApplicationEntitlement { + this := ApplicationEntitlement{} + return &this +} + +// GetPbmUuid returns the PbmUuid field value +func (o *ApplicationEntitlement) GetPbmUuid() string { + if o == nil { + var ret string + return ret + } + + return o.PbmUuid +} + +// GetPbmUuidOk returns a tuple with the PbmUuid field value +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlement) GetPbmUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PbmUuid, true +} + +// SetPbmUuid sets field value +func (o *ApplicationEntitlement) SetPbmUuid(v string) { + o.PbmUuid = v +} + +// GetName returns the Name field value +func (o *ApplicationEntitlement) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlement) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ApplicationEntitlement) SetName(v string) { + o.Name = v +} + +// GetApp returns the App field value +func (o *ApplicationEntitlement) GetApp() string { + if o == nil { + var ret string + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlement) GetAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *ApplicationEntitlement) SetApp(v string) { + o.App = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *ApplicationEntitlement) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlement) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *ApplicationEntitlement) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *ApplicationEntitlement) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o ApplicationEntitlement) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationEntitlement) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pbm_uuid"] = o.PbmUuid + toSerialize["name"] = o.Name + toSerialize["app"] = o.App + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationEntitlement) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pbm_uuid", + "name", + "app", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationEntitlement := _ApplicationEntitlement{} + + err = json.Unmarshal(data, &varApplicationEntitlement) + + if err != nil { + return err + } + + *o = ApplicationEntitlement(varApplicationEntitlement) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pbm_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "app") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationEntitlement struct { + value *ApplicationEntitlement + isSet bool +} + +func (v NullableApplicationEntitlement) Get() *ApplicationEntitlement { + return v.value +} + +func (v *NullableApplicationEntitlement) Set(val *ApplicationEntitlement) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationEntitlement) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationEntitlement) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationEntitlement(val *ApplicationEntitlement) *NullableApplicationEntitlement { + return &NullableApplicationEntitlement{value: val, isSet: true} +} + +func (v NullableApplicationEntitlement) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationEntitlement) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_application_entitlement_request.go b/packages/client-go/model_application_entitlement_request.go new file mode 100644 index 0000000000..d0bbc4006d --- /dev/null +++ b/packages/client-go/model_application_entitlement_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationEntitlementRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationEntitlementRequest{} + +// ApplicationEntitlementRequest ApplicationEntitlement Serializer +type ApplicationEntitlementRequest struct { + Name string `json:"name"` + App string `json:"app"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationEntitlementRequest ApplicationEntitlementRequest + +// NewApplicationEntitlementRequest instantiates a new ApplicationEntitlementRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplicationEntitlementRequest(name string, app string) *ApplicationEntitlementRequest { + this := ApplicationEntitlementRequest{} + this.Name = name + this.App = app + return &this +} + +// NewApplicationEntitlementRequestWithDefaults instantiates a new ApplicationEntitlementRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationEntitlementRequestWithDefaults() *ApplicationEntitlementRequest { + this := ApplicationEntitlementRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ApplicationEntitlementRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlementRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ApplicationEntitlementRequest) SetName(v string) { + o.Name = v +} + +// GetApp returns the App field value +func (o *ApplicationEntitlementRequest) GetApp() string { + if o == nil { + var ret string + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlementRequest) GetAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *ApplicationEntitlementRequest) SetApp(v string) { + o.App = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *ApplicationEntitlementRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationEntitlementRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *ApplicationEntitlementRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *ApplicationEntitlementRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o ApplicationEntitlementRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationEntitlementRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["app"] = o.App + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationEntitlementRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "app", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationEntitlementRequest := _ApplicationEntitlementRequest{} + + err = json.Unmarshal(data, &varApplicationEntitlementRequest) + + if err != nil { + return err + } + + *o = ApplicationEntitlementRequest(varApplicationEntitlementRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "app") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationEntitlementRequest struct { + value *ApplicationEntitlementRequest + isSet bool +} + +func (v NullableApplicationEntitlementRequest) Get() *ApplicationEntitlementRequest { + return v.value +} + +func (v *NullableApplicationEntitlementRequest) Set(val *ApplicationEntitlementRequest) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationEntitlementRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationEntitlementRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationEntitlementRequest(val *ApplicationEntitlementRequest) *NullableApplicationEntitlementRequest { + return &NullableApplicationEntitlementRequest{value: val, isSet: true} +} + +func (v NullableApplicationEntitlementRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationEntitlementRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_application_request.go b/packages/client-go/model_application_request.go new file mode 100644 index 0000000000..a51b63e9e5 --- /dev/null +++ b/packages/client-go/model_application_request.go @@ -0,0 +1,543 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ApplicationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ApplicationRequest{} + +// ApplicationRequest Application Serializer +type ApplicationRequest struct { + // Application's display Name. + Name string `json:"name"` + // Internal application name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Provider NullableInt32 `json:"provider,omitempty"` + BackchannelProviders []int32 `json:"backchannel_providers,omitempty"` + // Open launch URL in a new browser tab or window. + OpenInNewTab *bool `json:"open_in_new_tab,omitempty"` + MetaLaunchUrl *string `json:"meta_launch_url,omitempty"` + MetaIcon *string `json:"meta_icon,omitempty"` + MetaDescription *string `json:"meta_description,omitempty"` + MetaPublisher *string `json:"meta_publisher,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + Group *string `json:"group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ApplicationRequest ApplicationRequest + +// NewApplicationRequest instantiates a new ApplicationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewApplicationRequest(name string, slug string) *ApplicationRequest { + this := ApplicationRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewApplicationRequestWithDefaults instantiates a new ApplicationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewApplicationRequestWithDefaults() *ApplicationRequest { + this := ApplicationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ApplicationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ApplicationRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *ApplicationRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *ApplicationRequest) SetSlug(v string) { + o.Slug = v +} + +// GetProvider returns the Provider field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ApplicationRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider.Get()) { + var ret int32 + return ret + } + return *o.Provider.Get() +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ApplicationRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Provider.Get(), o.Provider.IsSet() +} + +// HasProvider returns a boolean if a field has been set. +func (o *ApplicationRequest) HasProvider() bool { + if o != nil && o.Provider.IsSet() { + return true + } + + return false +} + +// SetProvider gets a reference to the given NullableInt32 and assigns it to the Provider field. +func (o *ApplicationRequest) SetProvider(v int32) { + o.Provider.Set(&v) +} + +// SetProviderNil sets the value for Provider to be an explicit nil +func (o *ApplicationRequest) SetProviderNil() { + o.Provider.Set(nil) +} + +// UnsetProvider ensures that no value is present for Provider, not even an explicit nil +func (o *ApplicationRequest) UnsetProvider() { + o.Provider.Unset() +} + +// GetBackchannelProviders returns the BackchannelProviders field value if set, zero value otherwise. +func (o *ApplicationRequest) GetBackchannelProviders() []int32 { + if o == nil || IsNil(o.BackchannelProviders) { + var ret []int32 + return ret + } + return o.BackchannelProviders +} + +// GetBackchannelProvidersOk returns a tuple with the BackchannelProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetBackchannelProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.BackchannelProviders) { + return nil, false + } + return o.BackchannelProviders, true +} + +// HasBackchannelProviders returns a boolean if a field has been set. +func (o *ApplicationRequest) HasBackchannelProviders() bool { + if o != nil && !IsNil(o.BackchannelProviders) { + return true + } + + return false +} + +// SetBackchannelProviders gets a reference to the given []int32 and assigns it to the BackchannelProviders field. +func (o *ApplicationRequest) SetBackchannelProviders(v []int32) { + o.BackchannelProviders = v +} + +// GetOpenInNewTab returns the OpenInNewTab field value if set, zero value otherwise. +func (o *ApplicationRequest) GetOpenInNewTab() bool { + if o == nil || IsNil(o.OpenInNewTab) { + var ret bool + return ret + } + return *o.OpenInNewTab +} + +// GetOpenInNewTabOk returns a tuple with the OpenInNewTab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetOpenInNewTabOk() (*bool, bool) { + if o == nil || IsNil(o.OpenInNewTab) { + return nil, false + } + return o.OpenInNewTab, true +} + +// HasOpenInNewTab returns a boolean if a field has been set. +func (o *ApplicationRequest) HasOpenInNewTab() bool { + if o != nil && !IsNil(o.OpenInNewTab) { + return true + } + + return false +} + +// SetOpenInNewTab gets a reference to the given bool and assigns it to the OpenInNewTab field. +func (o *ApplicationRequest) SetOpenInNewTab(v bool) { + o.OpenInNewTab = &v +} + +// GetMetaLaunchUrl returns the MetaLaunchUrl field value if set, zero value otherwise. +func (o *ApplicationRequest) GetMetaLaunchUrl() string { + if o == nil || IsNil(o.MetaLaunchUrl) { + var ret string + return ret + } + return *o.MetaLaunchUrl +} + +// GetMetaLaunchUrlOk returns a tuple with the MetaLaunchUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetMetaLaunchUrlOk() (*string, bool) { + if o == nil || IsNil(o.MetaLaunchUrl) { + return nil, false + } + return o.MetaLaunchUrl, true +} + +// HasMetaLaunchUrl returns a boolean if a field has been set. +func (o *ApplicationRequest) HasMetaLaunchUrl() bool { + if o != nil && !IsNil(o.MetaLaunchUrl) { + return true + } + + return false +} + +// SetMetaLaunchUrl gets a reference to the given string and assigns it to the MetaLaunchUrl field. +func (o *ApplicationRequest) SetMetaLaunchUrl(v string) { + o.MetaLaunchUrl = &v +} + +// GetMetaIcon returns the MetaIcon field value if set, zero value otherwise. +func (o *ApplicationRequest) GetMetaIcon() string { + if o == nil || IsNil(o.MetaIcon) { + var ret string + return ret + } + return *o.MetaIcon +} + +// GetMetaIconOk returns a tuple with the MetaIcon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetMetaIconOk() (*string, bool) { + if o == nil || IsNil(o.MetaIcon) { + return nil, false + } + return o.MetaIcon, true +} + +// HasMetaIcon returns a boolean if a field has been set. +func (o *ApplicationRequest) HasMetaIcon() bool { + if o != nil && !IsNil(o.MetaIcon) { + return true + } + + return false +} + +// SetMetaIcon gets a reference to the given string and assigns it to the MetaIcon field. +func (o *ApplicationRequest) SetMetaIcon(v string) { + o.MetaIcon = &v +} + +// GetMetaDescription returns the MetaDescription field value if set, zero value otherwise. +func (o *ApplicationRequest) GetMetaDescription() string { + if o == nil || IsNil(o.MetaDescription) { + var ret string + return ret + } + return *o.MetaDescription +} + +// GetMetaDescriptionOk returns a tuple with the MetaDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetMetaDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.MetaDescription) { + return nil, false + } + return o.MetaDescription, true +} + +// HasMetaDescription returns a boolean if a field has been set. +func (o *ApplicationRequest) HasMetaDescription() bool { + if o != nil && !IsNil(o.MetaDescription) { + return true + } + + return false +} + +// SetMetaDescription gets a reference to the given string and assigns it to the MetaDescription field. +func (o *ApplicationRequest) SetMetaDescription(v string) { + o.MetaDescription = &v +} + +// GetMetaPublisher returns the MetaPublisher field value if set, zero value otherwise. +func (o *ApplicationRequest) GetMetaPublisher() string { + if o == nil || IsNil(o.MetaPublisher) { + var ret string + return ret + } + return *o.MetaPublisher +} + +// GetMetaPublisherOk returns a tuple with the MetaPublisher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetMetaPublisherOk() (*string, bool) { + if o == nil || IsNil(o.MetaPublisher) { + return nil, false + } + return o.MetaPublisher, true +} + +// HasMetaPublisher returns a boolean if a field has been set. +func (o *ApplicationRequest) HasMetaPublisher() bool { + if o != nil && !IsNil(o.MetaPublisher) { + return true + } + + return false +} + +// SetMetaPublisher gets a reference to the given string and assigns it to the MetaPublisher field. +func (o *ApplicationRequest) SetMetaPublisher(v string) { + o.MetaPublisher = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *ApplicationRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *ApplicationRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *ApplicationRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *ApplicationRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ApplicationRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *ApplicationRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *ApplicationRequest) SetGroup(v string) { + o.Group = &v +} + +func (o ApplicationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ApplicationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if o.Provider.IsSet() { + toSerialize["provider"] = o.Provider.Get() + } + if !IsNil(o.BackchannelProviders) { + toSerialize["backchannel_providers"] = o.BackchannelProviders + } + if !IsNil(o.OpenInNewTab) { + toSerialize["open_in_new_tab"] = o.OpenInNewTab + } + if !IsNil(o.MetaLaunchUrl) { + toSerialize["meta_launch_url"] = o.MetaLaunchUrl + } + if !IsNil(o.MetaIcon) { + toSerialize["meta_icon"] = o.MetaIcon + } + if !IsNil(o.MetaDescription) { + toSerialize["meta_description"] = o.MetaDescription + } + if !IsNil(o.MetaPublisher) { + toSerialize["meta_publisher"] = o.MetaPublisher + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ApplicationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varApplicationRequest := _ApplicationRequest{} + + err = json.Unmarshal(data, &varApplicationRequest) + + if err != nil { + return err + } + + *o = ApplicationRequest(varApplicationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "provider") + delete(additionalProperties, "backchannel_providers") + delete(additionalProperties, "open_in_new_tab") + delete(additionalProperties, "meta_launch_url") + delete(additionalProperties, "meta_icon") + delete(additionalProperties, "meta_description") + delete(additionalProperties, "meta_publisher") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableApplicationRequest struct { + value *ApplicationRequest + isSet bool +} + +func (v NullableApplicationRequest) Get() *ApplicationRequest { + return v.value +} + +func (v *NullableApplicationRequest) Set(val *ApplicationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableApplicationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableApplicationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableApplicationRequest(val *ApplicationRequest) *NullableApplicationRequest { + return &NullableApplicationRequest{value: val, isSet: true} +} + +func (v NullableApplicationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableApplicationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_auth_type_enum.go b/packages/client-go/model_auth_type_enum.go new file mode 100644 index 0000000000..0ca91ac490 --- /dev/null +++ b/packages/client-go/model_auth_type_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AuthTypeEnum the model 'AuthTypeEnum' +type AuthTypeEnum string + +// List of AuthTypeEnum +const ( + AUTHTYPEENUM_BASIC AuthTypeEnum = "basic" + AUTHTYPEENUM_BEARER AuthTypeEnum = "bearer" +) + +// All allowed values of AuthTypeEnum enum +var AllowedAuthTypeEnumEnumValues = []AuthTypeEnum{ + "basic", + "bearer", +} + +func (v *AuthTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthTypeEnum(value) + for _, existing := range AllowedAuthTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthTypeEnum", value) +} + +// NewAuthTypeEnumFromValue returns a pointer to a valid AuthTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthTypeEnumFromValue(v string) (*AuthTypeEnum, error) { + ev := AuthTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthTypeEnum: valid values are %v", v, AllowedAuthTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthTypeEnum) IsValid() bool { + for _, existing := range AllowedAuthTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuthTypeEnum value +func (v AuthTypeEnum) Ptr() *AuthTypeEnum { + return &v +} + +type NullableAuthTypeEnum struct { + value *AuthTypeEnum + isSet bool +} + +func (v NullableAuthTypeEnum) Get() *AuthTypeEnum { + return v.value +} + +func (v *NullableAuthTypeEnum) Set(val *AuthTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAuthTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthTypeEnum(val *AuthTypeEnum) *NullableAuthTypeEnum { + return &NullableAuthTypeEnum{value: val, isSet: true} +} + +func (v NullableAuthTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session.go b/packages/client-go/model_authenticated_session.go new file mode 100644 index 0000000000..0b3919ea9d --- /dev/null +++ b/packages/client-go/model_authenticated_session.go @@ -0,0 +1,442 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the AuthenticatedSession type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSession{} + +// AuthenticatedSession AuthenticatedSession Serializer +type AuthenticatedSession struct { + Uuid *string `json:"uuid,omitempty"` + // Check if session is currently active session + Current bool `json:"current"` + UserAgent AuthenticatedSessionUserAgent `json:"user_agent"` + GeoIp NullableAuthenticatedSessionGeoIp `json:"geo_ip"` + Asn NullableAuthenticatedSessionAsn `json:"asn"` + User int32 `json:"user"` + LastIp string `json:"last_ip"` + LastUserAgent string `json:"last_user_agent"` + LastUsed time.Time `json:"last_used"` + Expires time.Time `json:"expires"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSession AuthenticatedSession + +// NewAuthenticatedSession instantiates a new AuthenticatedSession object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSession(current bool, userAgent AuthenticatedSessionUserAgent, geoIp NullableAuthenticatedSessionGeoIp, asn NullableAuthenticatedSessionAsn, user int32, lastIp string, lastUserAgent string, lastUsed time.Time, expires time.Time) *AuthenticatedSession { + this := AuthenticatedSession{} + this.Current = current + this.UserAgent = userAgent + this.GeoIp = geoIp + this.Asn = asn + this.User = user + this.LastIp = lastIp + this.LastUserAgent = lastUserAgent + this.LastUsed = lastUsed + this.Expires = expires + return &this +} + +// NewAuthenticatedSessionWithDefaults instantiates a new AuthenticatedSession object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionWithDefaults() *AuthenticatedSession { + this := AuthenticatedSession{} + return &this +} + +// GetUuid returns the Uuid field value if set, zero value otherwise. +func (o *AuthenticatedSession) GetUuid() string { + if o == nil || IsNil(o.Uuid) { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetUuidOk() (*string, bool) { + if o == nil || IsNil(o.Uuid) { + return nil, false + } + return o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *AuthenticatedSession) HasUuid() bool { + if o != nil && !IsNil(o.Uuid) { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *AuthenticatedSession) SetUuid(v string) { + o.Uuid = &v +} + +// GetCurrent returns the Current field value +func (o *AuthenticatedSession) GetCurrent() bool { + if o == nil { + var ret bool + return ret + } + + return o.Current +} + +// GetCurrentOk returns a tuple with the Current field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetCurrentOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Current, true +} + +// SetCurrent sets field value +func (o *AuthenticatedSession) SetCurrent(v bool) { + o.Current = v +} + +// GetUserAgent returns the UserAgent field value +func (o *AuthenticatedSession) GetUserAgent() AuthenticatedSessionUserAgent { + if o == nil { + var ret AuthenticatedSessionUserAgent + return ret + } + + return o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetUserAgentOk() (*AuthenticatedSessionUserAgent, bool) { + if o == nil { + return nil, false + } + return &o.UserAgent, true +} + +// SetUserAgent sets field value +func (o *AuthenticatedSession) SetUserAgent(v AuthenticatedSessionUserAgent) { + o.UserAgent = v +} + +// GetGeoIp returns the GeoIp field value +// If the value is explicit nil, the zero value for AuthenticatedSessionGeoIp will be returned +func (o *AuthenticatedSession) GetGeoIp() AuthenticatedSessionGeoIp { + if o == nil || o.GeoIp.Get() == nil { + var ret AuthenticatedSessionGeoIp + return ret + } + + return *o.GeoIp.Get() +} + +// GetGeoIpOk returns a tuple with the GeoIp field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSession) GetGeoIpOk() (*AuthenticatedSessionGeoIp, bool) { + if o == nil { + return nil, false + } + return o.GeoIp.Get(), o.GeoIp.IsSet() +} + +// SetGeoIp sets field value +func (o *AuthenticatedSession) SetGeoIp(v AuthenticatedSessionGeoIp) { + o.GeoIp.Set(&v) +} + +// GetAsn returns the Asn field value +// If the value is explicit nil, the zero value for AuthenticatedSessionAsn will be returned +func (o *AuthenticatedSession) GetAsn() AuthenticatedSessionAsn { + if o == nil || o.Asn.Get() == nil { + var ret AuthenticatedSessionAsn + return ret + } + + return *o.Asn.Get() +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSession) GetAsnOk() (*AuthenticatedSessionAsn, bool) { + if o == nil { + return nil, false + } + return o.Asn.Get(), o.Asn.IsSet() +} + +// SetAsn sets field value +func (o *AuthenticatedSession) SetAsn(v AuthenticatedSessionAsn) { + o.Asn.Set(&v) +} + +// GetUser returns the User field value +func (o *AuthenticatedSession) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *AuthenticatedSession) SetUser(v int32) { + o.User = v +} + +// GetLastIp returns the LastIp field value +func (o *AuthenticatedSession) GetLastIp() string { + if o == nil { + var ret string + return ret + } + + return o.LastIp +} + +// GetLastIpOk returns a tuple with the LastIp field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetLastIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastIp, true +} + +// SetLastIp sets field value +func (o *AuthenticatedSession) SetLastIp(v string) { + o.LastIp = v +} + +// GetLastUserAgent returns the LastUserAgent field value +func (o *AuthenticatedSession) GetLastUserAgent() string { + if o == nil { + var ret string + return ret + } + + return o.LastUserAgent +} + +// GetLastUserAgentOk returns a tuple with the LastUserAgent field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetLastUserAgentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastUserAgent, true +} + +// SetLastUserAgent sets field value +func (o *AuthenticatedSession) SetLastUserAgent(v string) { + o.LastUserAgent = v +} + +// GetLastUsed returns the LastUsed field value +func (o *AuthenticatedSession) GetLastUsed() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUsed +} + +// GetLastUsedOk returns a tuple with the LastUsed field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUsed, true +} + +// SetLastUsed sets field value +func (o *AuthenticatedSession) SetLastUsed(v time.Time) { + o.LastUsed = v +} + +// GetExpires returns the Expires field value +func (o *AuthenticatedSession) GetExpires() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSession) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Expires, true +} + +// SetExpires sets field value +func (o *AuthenticatedSession) SetExpires(v time.Time) { + o.Expires = v +} + +func (o AuthenticatedSession) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSession) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Uuid) { + toSerialize["uuid"] = o.Uuid + } + toSerialize["current"] = o.Current + toSerialize["user_agent"] = o.UserAgent + toSerialize["geo_ip"] = o.GeoIp.Get() + toSerialize["asn"] = o.Asn.Get() + toSerialize["user"] = o.User + toSerialize["last_ip"] = o.LastIp + toSerialize["last_user_agent"] = o.LastUserAgent + toSerialize["last_used"] = o.LastUsed + toSerialize["expires"] = o.Expires + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSession) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "current", + "user_agent", + "geo_ip", + "asn", + "user", + "last_ip", + "last_user_agent", + "last_used", + "expires", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSession := _AuthenticatedSession{} + + err = json.Unmarshal(data, &varAuthenticatedSession) + + if err != nil { + return err + } + + *o = AuthenticatedSession(varAuthenticatedSession) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "uuid") + delete(additionalProperties, "current") + delete(additionalProperties, "user_agent") + delete(additionalProperties, "geo_ip") + delete(additionalProperties, "asn") + delete(additionalProperties, "user") + delete(additionalProperties, "last_ip") + delete(additionalProperties, "last_user_agent") + delete(additionalProperties, "last_used") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSession struct { + value *AuthenticatedSession + isSet bool +} + +func (v NullableAuthenticatedSession) Get() *AuthenticatedSession { + return v.value +} + +func (v *NullableAuthenticatedSession) Set(val *AuthenticatedSession) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSession) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSession) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSession(val *AuthenticatedSession) *NullableAuthenticatedSession { + return &NullableAuthenticatedSession{value: val, isSet: true} +} + +func (v NullableAuthenticatedSession) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSession) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_asn.go b/packages/client-go/model_authenticated_session_asn.go new file mode 100644 index 0000000000..5eb0d1a227 --- /dev/null +++ b/packages/client-go/model_authenticated_session_asn.go @@ -0,0 +1,231 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionAsn type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionAsn{} + +// AuthenticatedSessionAsn Get ASN Data +type AuthenticatedSessionAsn struct { + Asn NullableInt32 `json:"asn"` + AsOrg NullableString `json:"as_org"` + Network NullableString `json:"network"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionAsn AuthenticatedSessionAsn + +// NewAuthenticatedSessionAsn instantiates a new AuthenticatedSessionAsn object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionAsn(asn NullableInt32, asOrg NullableString, network NullableString) *AuthenticatedSessionAsn { + this := AuthenticatedSessionAsn{} + this.Asn = asn + this.AsOrg = asOrg + this.Network = network + return &this +} + +// NewAuthenticatedSessionAsnWithDefaults instantiates a new AuthenticatedSessionAsn object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionAsnWithDefaults() *AuthenticatedSessionAsn { + this := AuthenticatedSessionAsn{} + return &this +} + +// GetAsn returns the Asn field value +// If the value is explicit nil, the zero value for int32 will be returned +func (o *AuthenticatedSessionAsn) GetAsn() int32 { + if o == nil || o.Asn.Get() == nil { + var ret int32 + return ret + } + + return *o.Asn.Get() +} + +// GetAsnOk returns a tuple with the Asn field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionAsn) GetAsnOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Asn.Get(), o.Asn.IsSet() +} + +// SetAsn sets field value +func (o *AuthenticatedSessionAsn) SetAsn(v int32) { + o.Asn.Set(&v) +} + +// GetAsOrg returns the AsOrg field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AuthenticatedSessionAsn) GetAsOrg() string { + if o == nil || o.AsOrg.Get() == nil { + var ret string + return ret + } + + return *o.AsOrg.Get() +} + +// GetAsOrgOk returns a tuple with the AsOrg field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionAsn) GetAsOrgOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AsOrg.Get(), o.AsOrg.IsSet() +} + +// SetAsOrg sets field value +func (o *AuthenticatedSessionAsn) SetAsOrg(v string) { + o.AsOrg.Set(&v) +} + +// GetNetwork returns the Network field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AuthenticatedSessionAsn) GetNetwork() string { + if o == nil || o.Network.Get() == nil { + var ret string + return ret + } + + return *o.Network.Get() +} + +// GetNetworkOk returns a tuple with the Network field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionAsn) GetNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Network.Get(), o.Network.IsSet() +} + +// SetNetwork sets field value +func (o *AuthenticatedSessionAsn) SetNetwork(v string) { + o.Network.Set(&v) +} + +func (o AuthenticatedSessionAsn) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionAsn) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["asn"] = o.Asn.Get() + toSerialize["as_org"] = o.AsOrg.Get() + toSerialize["network"] = o.Network.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionAsn) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "asn", + "as_org", + "network", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionAsn := _AuthenticatedSessionAsn{} + + err = json.Unmarshal(data, &varAuthenticatedSessionAsn) + + if err != nil { + return err + } + + *o = AuthenticatedSessionAsn(varAuthenticatedSessionAsn) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "asn") + delete(additionalProperties, "as_org") + delete(additionalProperties, "network") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionAsn struct { + value *AuthenticatedSessionAsn + isSet bool +} + +func (v NullableAuthenticatedSessionAsn) Get() *AuthenticatedSessionAsn { + return v.value +} + +func (v *NullableAuthenticatedSessionAsn) Set(val *AuthenticatedSessionAsn) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionAsn) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionAsn) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionAsn(val *AuthenticatedSessionAsn) *NullableAuthenticatedSessionAsn { + return &NullableAuthenticatedSessionAsn{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionAsn) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionAsn) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_geo_ip.go b/packages/client-go/model_authenticated_session_geo_ip.go new file mode 100644 index 0000000000..baf03450a0 --- /dev/null +++ b/packages/client-go/model_authenticated_session_geo_ip.go @@ -0,0 +1,291 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionGeoIp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionGeoIp{} + +// AuthenticatedSessionGeoIp Get GeoIP Data +type AuthenticatedSessionGeoIp struct { + Continent NullableString `json:"continent"` + Country NullableString `json:"country"` + Lat NullableFloat64 `json:"lat"` + Long NullableFloat64 `json:"long"` + City string `json:"city"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionGeoIp AuthenticatedSessionGeoIp + +// NewAuthenticatedSessionGeoIp instantiates a new AuthenticatedSessionGeoIp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionGeoIp(continent NullableString, country NullableString, lat NullableFloat64, long NullableFloat64, city string) *AuthenticatedSessionGeoIp { + this := AuthenticatedSessionGeoIp{} + this.Continent = continent + this.Country = country + this.Lat = lat + this.Long = long + this.City = city + return &this +} + +// NewAuthenticatedSessionGeoIpWithDefaults instantiates a new AuthenticatedSessionGeoIp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionGeoIpWithDefaults() *AuthenticatedSessionGeoIp { + this := AuthenticatedSessionGeoIp{} + return &this +} + +// GetContinent returns the Continent field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AuthenticatedSessionGeoIp) GetContinent() string { + if o == nil || o.Continent.Get() == nil { + var ret string + return ret + } + + return *o.Continent.Get() +} + +// GetContinentOk returns a tuple with the Continent field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionGeoIp) GetContinentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Continent.Get(), o.Continent.IsSet() +} + +// SetContinent sets field value +func (o *AuthenticatedSessionGeoIp) SetContinent(v string) { + o.Continent.Set(&v) +} + +// GetCountry returns the Country field value +// If the value is explicit nil, the zero value for string will be returned +func (o *AuthenticatedSessionGeoIp) GetCountry() string { + if o == nil || o.Country.Get() == nil { + var ret string + return ret + } + + return *o.Country.Get() +} + +// GetCountryOk returns a tuple with the Country field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionGeoIp) GetCountryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Country.Get(), o.Country.IsSet() +} + +// SetCountry sets field value +func (o *AuthenticatedSessionGeoIp) SetCountry(v string) { + o.Country.Set(&v) +} + +// GetLat returns the Lat field value +// If the value is explicit nil, the zero value for float64 will be returned +func (o *AuthenticatedSessionGeoIp) GetLat() float64 { + if o == nil || o.Lat.Get() == nil { + var ret float64 + return ret + } + + return *o.Lat.Get() +} + +// GetLatOk returns a tuple with the Lat field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionGeoIp) GetLatOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Lat.Get(), o.Lat.IsSet() +} + +// SetLat sets field value +func (o *AuthenticatedSessionGeoIp) SetLat(v float64) { + o.Lat.Set(&v) +} + +// GetLong returns the Long field value +// If the value is explicit nil, the zero value for float64 will be returned +func (o *AuthenticatedSessionGeoIp) GetLong() float64 { + if o == nil || o.Long.Get() == nil { + var ret float64 + return ret + } + + return *o.Long.Get() +} + +// GetLongOk returns a tuple with the Long field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatedSessionGeoIp) GetLongOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.Long.Get(), o.Long.IsSet() +} + +// SetLong sets field value +func (o *AuthenticatedSessionGeoIp) SetLong(v float64) { + o.Long.Set(&v) +} + +// GetCity returns the City field value +func (o *AuthenticatedSessionGeoIp) GetCity() string { + if o == nil { + var ret string + return ret + } + + return o.City +} + +// GetCityOk returns a tuple with the City field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionGeoIp) GetCityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.City, true +} + +// SetCity sets field value +func (o *AuthenticatedSessionGeoIp) SetCity(v string) { + o.City = v +} + +func (o AuthenticatedSessionGeoIp) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionGeoIp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["continent"] = o.Continent.Get() + toSerialize["country"] = o.Country.Get() + toSerialize["lat"] = o.Lat.Get() + toSerialize["long"] = o.Long.Get() + toSerialize["city"] = o.City + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionGeoIp) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "continent", + "country", + "lat", + "long", + "city", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionGeoIp := _AuthenticatedSessionGeoIp{} + + err = json.Unmarshal(data, &varAuthenticatedSessionGeoIp) + + if err != nil { + return err + } + + *o = AuthenticatedSessionGeoIp(varAuthenticatedSessionGeoIp) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "continent") + delete(additionalProperties, "country") + delete(additionalProperties, "lat") + delete(additionalProperties, "long") + delete(additionalProperties, "city") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionGeoIp struct { + value *AuthenticatedSessionGeoIp + isSet bool +} + +func (v NullableAuthenticatedSessionGeoIp) Get() *AuthenticatedSessionGeoIp { + return v.value +} + +func (v *NullableAuthenticatedSessionGeoIp) Set(val *AuthenticatedSessionGeoIp) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionGeoIp) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionGeoIp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionGeoIp(val *AuthenticatedSessionGeoIp) *NullableAuthenticatedSessionGeoIp { + return &NullableAuthenticatedSessionGeoIp{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionGeoIp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionGeoIp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_user_agent.go b/packages/client-go/model_authenticated_session_user_agent.go new file mode 100644 index 0000000000..3e0d6eabb7 --- /dev/null +++ b/packages/client-go/model_authenticated_session_user_agent.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionUserAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionUserAgent{} + +// AuthenticatedSessionUserAgent Get parsed user agent +type AuthenticatedSessionUserAgent struct { + Device AuthenticatedSessionUserAgentDevice `json:"device"` + Os AuthenticatedSessionUserAgentOs `json:"os"` + UserAgent AuthenticatedSessionUserAgentUserAgent `json:"user_agent"` + String string `json:"string"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionUserAgent AuthenticatedSessionUserAgent + +// NewAuthenticatedSessionUserAgent instantiates a new AuthenticatedSessionUserAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionUserAgent(device AuthenticatedSessionUserAgentDevice, os AuthenticatedSessionUserAgentOs, userAgent AuthenticatedSessionUserAgentUserAgent, string_ string) *AuthenticatedSessionUserAgent { + this := AuthenticatedSessionUserAgent{} + this.Device = device + this.Os = os + this.UserAgent = userAgent + this.String = string_ + return &this +} + +// NewAuthenticatedSessionUserAgentWithDefaults instantiates a new AuthenticatedSessionUserAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionUserAgentWithDefaults() *AuthenticatedSessionUserAgent { + this := AuthenticatedSessionUserAgent{} + return &this +} + +// GetDevice returns the Device field value +func (o *AuthenticatedSessionUserAgent) GetDevice() AuthenticatedSessionUserAgentDevice { + if o == nil { + var ret AuthenticatedSessionUserAgentDevice + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgent) GetDeviceOk() (*AuthenticatedSessionUserAgentDevice, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *AuthenticatedSessionUserAgent) SetDevice(v AuthenticatedSessionUserAgentDevice) { + o.Device = v +} + +// GetOs returns the Os field value +func (o *AuthenticatedSessionUserAgent) GetOs() AuthenticatedSessionUserAgentOs { + if o == nil { + var ret AuthenticatedSessionUserAgentOs + return ret + } + + return o.Os +} + +// GetOsOk returns a tuple with the Os field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgent) GetOsOk() (*AuthenticatedSessionUserAgentOs, bool) { + if o == nil { + return nil, false + } + return &o.Os, true +} + +// SetOs sets field value +func (o *AuthenticatedSessionUserAgent) SetOs(v AuthenticatedSessionUserAgentOs) { + o.Os = v +} + +// GetUserAgent returns the UserAgent field value +func (o *AuthenticatedSessionUserAgent) GetUserAgent() AuthenticatedSessionUserAgentUserAgent { + if o == nil { + var ret AuthenticatedSessionUserAgentUserAgent + return ret + } + + return o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgent) GetUserAgentOk() (*AuthenticatedSessionUserAgentUserAgent, bool) { + if o == nil { + return nil, false + } + return &o.UserAgent, true +} + +// SetUserAgent sets field value +func (o *AuthenticatedSessionUserAgent) SetUserAgent(v AuthenticatedSessionUserAgentUserAgent) { + o.UserAgent = v +} + +// GetString returns the String field value +func (o *AuthenticatedSessionUserAgent) GetString() string { + if o == nil { + var ret string + return ret + } + + return o.String +} + +// GetStringOk returns a tuple with the String field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgent) GetStringOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.String, true +} + +// SetString sets field value +func (o *AuthenticatedSessionUserAgent) SetString(v string) { + o.String = v +} + +func (o AuthenticatedSessionUserAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionUserAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["os"] = o.Os + toSerialize["user_agent"] = o.UserAgent + toSerialize["string"] = o.String + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionUserAgent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "os", + "user_agent", + "string", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionUserAgent := _AuthenticatedSessionUserAgent{} + + err = json.Unmarshal(data, &varAuthenticatedSessionUserAgent) + + if err != nil { + return err + } + + *o = AuthenticatedSessionUserAgent(varAuthenticatedSessionUserAgent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "os") + delete(additionalProperties, "user_agent") + delete(additionalProperties, "string") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionUserAgent struct { + value *AuthenticatedSessionUserAgent + isSet bool +} + +func (v NullableAuthenticatedSessionUserAgent) Get() *AuthenticatedSessionUserAgent { + return v.value +} + +func (v *NullableAuthenticatedSessionUserAgent) Set(val *AuthenticatedSessionUserAgent) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionUserAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionUserAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionUserAgent(val *AuthenticatedSessionUserAgent) *NullableAuthenticatedSessionUserAgent { + return &NullableAuthenticatedSessionUserAgent{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionUserAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionUserAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_user_agent_device.go b/packages/client-go/model_authenticated_session_user_agent_device.go new file mode 100644 index 0000000000..e17f6673d9 --- /dev/null +++ b/packages/client-go/model_authenticated_session_user_agent_device.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionUserAgentDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionUserAgentDevice{} + +// AuthenticatedSessionUserAgentDevice User agent device +type AuthenticatedSessionUserAgentDevice struct { + Brand string `json:"brand"` + Family string `json:"family"` + Model string `json:"model"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionUserAgentDevice AuthenticatedSessionUserAgentDevice + +// NewAuthenticatedSessionUserAgentDevice instantiates a new AuthenticatedSessionUserAgentDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionUserAgentDevice(brand string, family string, model string) *AuthenticatedSessionUserAgentDevice { + this := AuthenticatedSessionUserAgentDevice{} + this.Brand = brand + this.Family = family + this.Model = model + return &this +} + +// NewAuthenticatedSessionUserAgentDeviceWithDefaults instantiates a new AuthenticatedSessionUserAgentDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionUserAgentDeviceWithDefaults() *AuthenticatedSessionUserAgentDevice { + this := AuthenticatedSessionUserAgentDevice{} + return &this +} + +// GetBrand returns the Brand field value +func (o *AuthenticatedSessionUserAgentDevice) GetBrand() string { + if o == nil { + var ret string + return ret + } + + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentDevice) GetBrandOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Brand, true +} + +// SetBrand sets field value +func (o *AuthenticatedSessionUserAgentDevice) SetBrand(v string) { + o.Brand = v +} + +// GetFamily returns the Family field value +func (o *AuthenticatedSessionUserAgentDevice) GetFamily() string { + if o == nil { + var ret string + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentDevice) GetFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *AuthenticatedSessionUserAgentDevice) SetFamily(v string) { + o.Family = v +} + +// GetModel returns the Model field value +func (o *AuthenticatedSessionUserAgentDevice) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentDevice) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *AuthenticatedSessionUserAgentDevice) SetModel(v string) { + o.Model = v +} + +func (o AuthenticatedSessionUserAgentDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionUserAgentDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["brand"] = o.Brand + toSerialize["family"] = o.Family + toSerialize["model"] = o.Model + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionUserAgentDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "brand", + "family", + "model", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionUserAgentDevice := _AuthenticatedSessionUserAgentDevice{} + + err = json.Unmarshal(data, &varAuthenticatedSessionUserAgentDevice) + + if err != nil { + return err + } + + *o = AuthenticatedSessionUserAgentDevice(varAuthenticatedSessionUserAgentDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "brand") + delete(additionalProperties, "family") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionUserAgentDevice struct { + value *AuthenticatedSessionUserAgentDevice + isSet bool +} + +func (v NullableAuthenticatedSessionUserAgentDevice) Get() *AuthenticatedSessionUserAgentDevice { + return v.value +} + +func (v *NullableAuthenticatedSessionUserAgentDevice) Set(val *AuthenticatedSessionUserAgentDevice) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionUserAgentDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionUserAgentDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionUserAgentDevice(val *AuthenticatedSessionUserAgentDevice) *NullableAuthenticatedSessionUserAgentDevice { + return &NullableAuthenticatedSessionUserAgentDevice{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionUserAgentDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionUserAgentDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_user_agent_os.go b/packages/client-go/model_authenticated_session_user_agent_os.go new file mode 100644 index 0000000000..4593ba3ff6 --- /dev/null +++ b/packages/client-go/model_authenticated_session_user_agent_os.go @@ -0,0 +1,283 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionUserAgentOs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionUserAgentOs{} + +// AuthenticatedSessionUserAgentOs User agent os +type AuthenticatedSessionUserAgentOs struct { + Family string `json:"family"` + Major string `json:"major"` + Minor string `json:"minor"` + Patch string `json:"patch"` + PatchMinor string `json:"patch_minor"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionUserAgentOs AuthenticatedSessionUserAgentOs + +// NewAuthenticatedSessionUserAgentOs instantiates a new AuthenticatedSessionUserAgentOs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionUserAgentOs(family string, major string, minor string, patch string, patchMinor string) *AuthenticatedSessionUserAgentOs { + this := AuthenticatedSessionUserAgentOs{} + this.Family = family + this.Major = major + this.Minor = minor + this.Patch = patch + this.PatchMinor = patchMinor + return &this +} + +// NewAuthenticatedSessionUserAgentOsWithDefaults instantiates a new AuthenticatedSessionUserAgentOs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionUserAgentOsWithDefaults() *AuthenticatedSessionUserAgentOs { + this := AuthenticatedSessionUserAgentOs{} + return &this +} + +// GetFamily returns the Family field value +func (o *AuthenticatedSessionUserAgentOs) GetFamily() string { + if o == nil { + var ret string + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentOs) GetFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *AuthenticatedSessionUserAgentOs) SetFamily(v string) { + o.Family = v +} + +// GetMajor returns the Major field value +func (o *AuthenticatedSessionUserAgentOs) GetMajor() string { + if o == nil { + var ret string + return ret + } + + return o.Major +} + +// GetMajorOk returns a tuple with the Major field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentOs) GetMajorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Major, true +} + +// SetMajor sets field value +func (o *AuthenticatedSessionUserAgentOs) SetMajor(v string) { + o.Major = v +} + +// GetMinor returns the Minor field value +func (o *AuthenticatedSessionUserAgentOs) GetMinor() string { + if o == nil { + var ret string + return ret + } + + return o.Minor +} + +// GetMinorOk returns a tuple with the Minor field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentOs) GetMinorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Minor, true +} + +// SetMinor sets field value +func (o *AuthenticatedSessionUserAgentOs) SetMinor(v string) { + o.Minor = v +} + +// GetPatch returns the Patch field value +func (o *AuthenticatedSessionUserAgentOs) GetPatch() string { + if o == nil { + var ret string + return ret + } + + return o.Patch +} + +// GetPatchOk returns a tuple with the Patch field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentOs) GetPatchOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Patch, true +} + +// SetPatch sets field value +func (o *AuthenticatedSessionUserAgentOs) SetPatch(v string) { + o.Patch = v +} + +// GetPatchMinor returns the PatchMinor field value +func (o *AuthenticatedSessionUserAgentOs) GetPatchMinor() string { + if o == nil { + var ret string + return ret + } + + return o.PatchMinor +} + +// GetPatchMinorOk returns a tuple with the PatchMinor field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentOs) GetPatchMinorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PatchMinor, true +} + +// SetPatchMinor sets field value +func (o *AuthenticatedSessionUserAgentOs) SetPatchMinor(v string) { + o.PatchMinor = v +} + +func (o AuthenticatedSessionUserAgentOs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionUserAgentOs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + toSerialize["major"] = o.Major + toSerialize["minor"] = o.Minor + toSerialize["patch"] = o.Patch + toSerialize["patch_minor"] = o.PatchMinor + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionUserAgentOs) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + "major", + "minor", + "patch", + "patch_minor", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionUserAgentOs := _AuthenticatedSessionUserAgentOs{} + + err = json.Unmarshal(data, &varAuthenticatedSessionUserAgentOs) + + if err != nil { + return err + } + + *o = AuthenticatedSessionUserAgentOs(varAuthenticatedSessionUserAgentOs) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "major") + delete(additionalProperties, "minor") + delete(additionalProperties, "patch") + delete(additionalProperties, "patch_minor") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionUserAgentOs struct { + value *AuthenticatedSessionUserAgentOs + isSet bool +} + +func (v NullableAuthenticatedSessionUserAgentOs) Get() *AuthenticatedSessionUserAgentOs { + return v.value +} + +func (v *NullableAuthenticatedSessionUserAgentOs) Set(val *AuthenticatedSessionUserAgentOs) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionUserAgentOs) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionUserAgentOs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionUserAgentOs(val *AuthenticatedSessionUserAgentOs) *NullableAuthenticatedSessionUserAgentOs { + return &NullableAuthenticatedSessionUserAgentOs{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionUserAgentOs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionUserAgentOs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticated_session_user_agent_user_agent.go b/packages/client-go/model_authenticated_session_user_agent_user_agent.go new file mode 100644 index 0000000000..07470e0525 --- /dev/null +++ b/packages/client-go/model_authenticated_session_user_agent_user_agent.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatedSessionUserAgentUserAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatedSessionUserAgentUserAgent{} + +// AuthenticatedSessionUserAgentUserAgent User agent browser +type AuthenticatedSessionUserAgentUserAgent struct { + Family string `json:"family"` + Major string `json:"major"` + Minor string `json:"minor"` + Patch string `json:"patch"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatedSessionUserAgentUserAgent AuthenticatedSessionUserAgentUserAgent + +// NewAuthenticatedSessionUserAgentUserAgent instantiates a new AuthenticatedSessionUserAgentUserAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatedSessionUserAgentUserAgent(family string, major string, minor string, patch string) *AuthenticatedSessionUserAgentUserAgent { + this := AuthenticatedSessionUserAgentUserAgent{} + this.Family = family + this.Major = major + this.Minor = minor + this.Patch = patch + return &this +} + +// NewAuthenticatedSessionUserAgentUserAgentWithDefaults instantiates a new AuthenticatedSessionUserAgentUserAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatedSessionUserAgentUserAgentWithDefaults() *AuthenticatedSessionUserAgentUserAgent { + this := AuthenticatedSessionUserAgentUserAgent{} + return &this +} + +// GetFamily returns the Family field value +func (o *AuthenticatedSessionUserAgentUserAgent) GetFamily() string { + if o == nil { + var ret string + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentUserAgent) GetFamilyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *AuthenticatedSessionUserAgentUserAgent) SetFamily(v string) { + o.Family = v +} + +// GetMajor returns the Major field value +func (o *AuthenticatedSessionUserAgentUserAgent) GetMajor() string { + if o == nil { + var ret string + return ret + } + + return o.Major +} + +// GetMajorOk returns a tuple with the Major field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentUserAgent) GetMajorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Major, true +} + +// SetMajor sets field value +func (o *AuthenticatedSessionUserAgentUserAgent) SetMajor(v string) { + o.Major = v +} + +// GetMinor returns the Minor field value +func (o *AuthenticatedSessionUserAgentUserAgent) GetMinor() string { + if o == nil { + var ret string + return ret + } + + return o.Minor +} + +// GetMinorOk returns a tuple with the Minor field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentUserAgent) GetMinorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Minor, true +} + +// SetMinor sets field value +func (o *AuthenticatedSessionUserAgentUserAgent) SetMinor(v string) { + o.Minor = v +} + +// GetPatch returns the Patch field value +func (o *AuthenticatedSessionUserAgentUserAgent) GetPatch() string { + if o == nil { + var ret string + return ret + } + + return o.Patch +} + +// GetPatchOk returns a tuple with the Patch field value +// and a boolean to check if the value has been set. +func (o *AuthenticatedSessionUserAgentUserAgent) GetPatchOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Patch, true +} + +// SetPatch sets field value +func (o *AuthenticatedSessionUserAgentUserAgent) SetPatch(v string) { + o.Patch = v +} + +func (o AuthenticatedSessionUserAgentUserAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatedSessionUserAgentUserAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + toSerialize["major"] = o.Major + toSerialize["minor"] = o.Minor + toSerialize["patch"] = o.Patch + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatedSessionUserAgentUserAgent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + "major", + "minor", + "patch", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatedSessionUserAgentUserAgent := _AuthenticatedSessionUserAgentUserAgent{} + + err = json.Unmarshal(data, &varAuthenticatedSessionUserAgentUserAgent) + + if err != nil { + return err + } + + *o = AuthenticatedSessionUserAgentUserAgent(varAuthenticatedSessionUserAgentUserAgent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "major") + delete(additionalProperties, "minor") + delete(additionalProperties, "patch") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatedSessionUserAgentUserAgent struct { + value *AuthenticatedSessionUserAgentUserAgent + isSet bool +} + +func (v NullableAuthenticatedSessionUserAgentUserAgent) Get() *AuthenticatedSessionUserAgentUserAgent { + return v.value +} + +func (v *NullableAuthenticatedSessionUserAgentUserAgent) Set(val *AuthenticatedSessionUserAgentUserAgent) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatedSessionUserAgentUserAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatedSessionUserAgentUserAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatedSessionUserAgentUserAgent(val *AuthenticatedSessionUserAgentUserAgent) *NullableAuthenticatedSessionUserAgentUserAgent { + return &NullableAuthenticatedSessionUserAgentUserAgent{value: val, isSet: true} +} + +func (v NullableAuthenticatedSessionUserAgentUserAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatedSessionUserAgentUserAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authentication_enum.go b/packages/client-go/model_authentication_enum.go new file mode 100644 index 0000000000..aed22046f8 --- /dev/null +++ b/packages/client-go/model_authentication_enum.go @@ -0,0 +1,119 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AuthenticationEnum the model 'AuthenticationEnum' +type AuthenticationEnum string + +// List of AuthenticationEnum +const ( + AUTHENTICATIONENUM_NONE AuthenticationEnum = "none" + AUTHENTICATIONENUM_REQUIRE_AUTHENTICATED AuthenticationEnum = "require_authenticated" + AUTHENTICATIONENUM_REQUIRE_UNAUTHENTICATED AuthenticationEnum = "require_unauthenticated" + AUTHENTICATIONENUM_REQUIRE_SUPERUSER AuthenticationEnum = "require_superuser" + AUTHENTICATIONENUM_REQUIRE_REDIRECT AuthenticationEnum = "require_redirect" + AUTHENTICATIONENUM_REQUIRE_OUTPOST AuthenticationEnum = "require_outpost" +) + +// All allowed values of AuthenticationEnum enum +var AllowedAuthenticationEnumEnumValues = []AuthenticationEnum{ + "none", + "require_authenticated", + "require_unauthenticated", + "require_superuser", + "require_redirect", + "require_outpost", +} + +func (v *AuthenticationEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticationEnum(value) + for _, existing := range AllowedAuthenticationEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthenticationEnum", value) +} + +// NewAuthenticationEnumFromValue returns a pointer to a valid AuthenticationEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticationEnumFromValue(v string) (*AuthenticationEnum, error) { + ev := AuthenticationEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticationEnum: valid values are %v", v, AllowedAuthenticationEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticationEnum) IsValid() bool { + for _, existing := range AllowedAuthenticationEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuthenticationEnum value +func (v AuthenticationEnum) Ptr() *AuthenticationEnum { + return &v +} + +type NullableAuthenticationEnum struct { + value *AuthenticationEnum + isSet bool +} + +func (v NullableAuthenticationEnum) Get() *AuthenticationEnum { + return v.value +} + +func (v *NullableAuthenticationEnum) Set(val *AuthenticationEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationEnum(val *AuthenticationEnum) *NullableAuthenticationEnum { + return &NullableAuthenticationEnum{value: val, isSet: true} +} + +func (v NullableAuthenticationEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_attachment_enum.go b/packages/client-go/model_authenticator_attachment_enum.go new file mode 100644 index 0000000000..7a83640f6a --- /dev/null +++ b/packages/client-go/model_authenticator_attachment_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AuthenticatorAttachmentEnum the model 'AuthenticatorAttachmentEnum' +type AuthenticatorAttachmentEnum string + +// List of AuthenticatorAttachmentEnum +const ( + AUTHENTICATORATTACHMENTENUM_PLATFORM AuthenticatorAttachmentEnum = "platform" + AUTHENTICATORATTACHMENTENUM_CROSS_PLATFORM AuthenticatorAttachmentEnum = "cross-platform" +) + +// All allowed values of AuthenticatorAttachmentEnum enum +var AllowedAuthenticatorAttachmentEnumEnumValues = []AuthenticatorAttachmentEnum{ + "platform", + "cross-platform", +} + +func (v *AuthenticatorAttachmentEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthenticatorAttachmentEnum(value) + for _, existing := range AllowedAuthenticatorAttachmentEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthenticatorAttachmentEnum", value) +} + +// NewAuthenticatorAttachmentEnumFromValue returns a pointer to a valid AuthenticatorAttachmentEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthenticatorAttachmentEnumFromValue(v string) (*AuthenticatorAttachmentEnum, error) { + ev := AuthenticatorAttachmentEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthenticatorAttachmentEnum: valid values are %v", v, AllowedAuthenticatorAttachmentEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthenticatorAttachmentEnum) IsValid() bool { + for _, existing := range AllowedAuthenticatorAttachmentEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuthenticatorAttachmentEnum value +func (v AuthenticatorAttachmentEnum) Ptr() *AuthenticatorAttachmentEnum { + return &v +} + +type NullableAuthenticatorAttachmentEnum struct { + value *AuthenticatorAttachmentEnum + isSet bool +} + +func (v NullableAuthenticatorAttachmentEnum) Get() *AuthenticatorAttachmentEnum { + return v.value +} + +func (v *NullableAuthenticatorAttachmentEnum) Set(val *AuthenticatorAttachmentEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorAttachmentEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorAttachmentEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorAttachmentEnum(val *AuthenticatorAttachmentEnum) *NullableAuthenticatorAttachmentEnum { + return &NullableAuthenticatorAttachmentEnum{value: val, isSet: true} +} + +func (v NullableAuthenticatorAttachmentEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorAttachmentEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_challenge.go b/packages/client-go/model_authenticator_duo_challenge.go new file mode 100644 index 0000000000..19a5a378b1 --- /dev/null +++ b/packages/client-go/model_authenticator_duo_challenge.go @@ -0,0 +1,398 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorDuoChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoChallenge{} + +// AuthenticatorDuoChallenge Duo Challenge +type AuthenticatorDuoChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + ActivationBarcode string `json:"activation_barcode"` + ActivationCode string `json:"activation_code"` + StageUuid string `json:"stage_uuid"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoChallenge AuthenticatorDuoChallenge + +// NewAuthenticatorDuoChallenge instantiates a new AuthenticatorDuoChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoChallenge(pendingUser string, pendingUserAvatar string, activationBarcode string, activationCode string, stageUuid string) *AuthenticatorDuoChallenge { + this := AuthenticatorDuoChallenge{} + var component string = "ak-stage-authenticator-duo" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.ActivationBarcode = activationBarcode + this.ActivationCode = activationCode + this.StageUuid = stageUuid + return &this +} + +// NewAuthenticatorDuoChallengeWithDefaults instantiates a new AuthenticatorDuoChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoChallengeWithDefaults() *AuthenticatorDuoChallenge { + this := AuthenticatorDuoChallenge{} + var component string = "ak-stage-authenticator-duo" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorDuoChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorDuoChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorDuoChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorDuoChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorDuoChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorDuoChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorDuoChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorDuoChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorDuoChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorDuoChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorDuoChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorDuoChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorDuoChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetActivationBarcode returns the ActivationBarcode field value +func (o *AuthenticatorDuoChallenge) GetActivationBarcode() string { + if o == nil { + var ret string + return ret + } + + return o.ActivationBarcode +} + +// GetActivationBarcodeOk returns a tuple with the ActivationBarcode field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetActivationBarcodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActivationBarcode, true +} + +// SetActivationBarcode sets field value +func (o *AuthenticatorDuoChallenge) SetActivationBarcode(v string) { + o.ActivationBarcode = v +} + +// GetActivationCode returns the ActivationCode field value +func (o *AuthenticatorDuoChallenge) GetActivationCode() string { + if o == nil { + var ret string + return ret + } + + return o.ActivationCode +} + +// GetActivationCodeOk returns a tuple with the ActivationCode field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetActivationCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActivationCode, true +} + +// SetActivationCode sets field value +func (o *AuthenticatorDuoChallenge) SetActivationCode(v string) { + o.ActivationCode = v +} + +// GetStageUuid returns the StageUuid field value +func (o *AuthenticatorDuoChallenge) GetStageUuid() string { + if o == nil { + var ret string + return ret + } + + return o.StageUuid +} + +// GetStageUuidOk returns a tuple with the StageUuid field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallenge) GetStageUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.StageUuid, true +} + +// SetStageUuid sets field value +func (o *AuthenticatorDuoChallenge) SetStageUuid(v string) { + o.StageUuid = v +} + +func (o AuthenticatorDuoChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["activation_barcode"] = o.ActivationBarcode + toSerialize["activation_code"] = o.ActivationCode + toSerialize["stage_uuid"] = o.StageUuid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "activation_barcode", + "activation_code", + "stage_uuid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorDuoChallenge := _AuthenticatorDuoChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorDuoChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorDuoChallenge(varAuthenticatorDuoChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "activation_barcode") + delete(additionalProperties, "activation_code") + delete(additionalProperties, "stage_uuid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoChallenge struct { + value *AuthenticatorDuoChallenge + isSet bool +} + +func (v NullableAuthenticatorDuoChallenge) Get() *AuthenticatorDuoChallenge { + return v.value +} + +func (v *NullableAuthenticatorDuoChallenge) Set(val *AuthenticatorDuoChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoChallenge(val *AuthenticatorDuoChallenge) *NullableAuthenticatorDuoChallenge { + return &NullableAuthenticatorDuoChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_challenge_response_request.go b/packages/client-go/model_authenticator_duo_challenge_response_request.go new file mode 100644 index 0000000000..fade6671d4 --- /dev/null +++ b/packages/client-go/model_authenticator_duo_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AuthenticatorDuoChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoChallengeResponseRequest{} + +// AuthenticatorDuoChallengeResponseRequest Pseudo class for duo response +type AuthenticatorDuoChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoChallengeResponseRequest AuthenticatorDuoChallengeResponseRequest + +// NewAuthenticatorDuoChallengeResponseRequest instantiates a new AuthenticatorDuoChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoChallengeResponseRequest() *AuthenticatorDuoChallengeResponseRequest { + this := AuthenticatorDuoChallengeResponseRequest{} + var component string = "ak-stage-authenticator-duo" + this.Component = &component + return &this +} + +// NewAuthenticatorDuoChallengeResponseRequestWithDefaults instantiates a new AuthenticatorDuoChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoChallengeResponseRequestWithDefaults() *AuthenticatorDuoChallengeResponseRequest { + this := AuthenticatorDuoChallengeResponseRequest{} + var component string = "ak-stage-authenticator-duo" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorDuoChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorDuoChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorDuoChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o AuthenticatorDuoChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAuthenticatorDuoChallengeResponseRequest := _AuthenticatorDuoChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorDuoChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorDuoChallengeResponseRequest(varAuthenticatorDuoChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoChallengeResponseRequest struct { + value *AuthenticatorDuoChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorDuoChallengeResponseRequest) Get() *AuthenticatorDuoChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorDuoChallengeResponseRequest) Set(val *AuthenticatorDuoChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoChallengeResponseRequest(val *AuthenticatorDuoChallengeResponseRequest) *NullableAuthenticatorDuoChallengeResponseRequest { + return &NullableAuthenticatorDuoChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_stage.go b/packages/client-go/model_authenticator_duo_stage.go new file mode 100644 index 0000000000..d07f4e0541 --- /dev/null +++ b/packages/client-go/model_authenticator_duo_stage.go @@ -0,0 +1,526 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorDuoStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoStage{} + +// AuthenticatorDuoStage AuthenticatorDuoStage Serializer +type AuthenticatorDuoStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + ClientId string `json:"client_id"` + ApiHostname string `json:"api_hostname"` + AdminIntegrationKey *string `json:"admin_integration_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoStage AuthenticatorDuoStage + +// NewAuthenticatorDuoStage instantiates a new AuthenticatorDuoStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, clientId string, apiHostname string) *AuthenticatorDuoStage { + this := AuthenticatorDuoStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.ClientId = clientId + this.ApiHostname = apiHostname + return &this +} + +// NewAuthenticatorDuoStageWithDefaults instantiates a new AuthenticatorDuoStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoStageWithDefaults() *AuthenticatorDuoStage { + this := AuthenticatorDuoStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorDuoStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorDuoStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorDuoStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorDuoStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorDuoStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorDuoStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorDuoStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorDuoStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorDuoStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorDuoStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorDuoStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorDuoStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorDuoStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorDuoStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorDuoStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorDuoStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorDuoStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorDuoStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorDuoStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorDuoStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorDuoStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorDuoStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorDuoStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetClientId returns the ClientId field value +func (o *AuthenticatorDuoStage) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *AuthenticatorDuoStage) SetClientId(v string) { + o.ClientId = v +} + +// GetApiHostname returns the ApiHostname field value +func (o *AuthenticatorDuoStage) GetApiHostname() string { + if o == nil { + var ret string + return ret + } + + return o.ApiHostname +} + +// GetApiHostnameOk returns a tuple with the ApiHostname field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetApiHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApiHostname, true +} + +// SetApiHostname sets field value +func (o *AuthenticatorDuoStage) SetApiHostname(v string) { + o.ApiHostname = v +} + +// GetAdminIntegrationKey returns the AdminIntegrationKey field value if set, zero value otherwise. +func (o *AuthenticatorDuoStage) GetAdminIntegrationKey() string { + if o == nil || IsNil(o.AdminIntegrationKey) { + var ret string + return ret + } + return *o.AdminIntegrationKey +} + +// GetAdminIntegrationKeyOk returns a tuple with the AdminIntegrationKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStage) GetAdminIntegrationKeyOk() (*string, bool) { + if o == nil || IsNil(o.AdminIntegrationKey) { + return nil, false + } + return o.AdminIntegrationKey, true +} + +// HasAdminIntegrationKey returns a boolean if a field has been set. +func (o *AuthenticatorDuoStage) HasAdminIntegrationKey() bool { + if o != nil && !IsNil(o.AdminIntegrationKey) { + return true + } + + return false +} + +// SetAdminIntegrationKey gets a reference to the given string and assigns it to the AdminIntegrationKey field. +func (o *AuthenticatorDuoStage) SetAdminIntegrationKey(v string) { + o.AdminIntegrationKey = &v +} + +func (o AuthenticatorDuoStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["client_id"] = o.ClientId + toSerialize["api_hostname"] = o.ApiHostname + if !IsNil(o.AdminIntegrationKey) { + toSerialize["admin_integration_key"] = o.AdminIntegrationKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "client_id", + "api_hostname", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorDuoStage := _AuthenticatorDuoStage{} + + err = json.Unmarshal(data, &varAuthenticatorDuoStage) + + if err != nil { + return err + } + + *o = AuthenticatorDuoStage(varAuthenticatorDuoStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "client_id") + delete(additionalProperties, "api_hostname") + delete(additionalProperties, "admin_integration_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoStage struct { + value *AuthenticatorDuoStage + isSet bool +} + +func (v NullableAuthenticatorDuoStage) Get() *AuthenticatorDuoStage { + return v.value +} + +func (v *NullableAuthenticatorDuoStage) Set(val *AuthenticatorDuoStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoStage(val *AuthenticatorDuoStage) *NullableAuthenticatorDuoStage { + return &NullableAuthenticatorDuoStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_stage_device_import_response.go b/packages/client-go/model_authenticator_duo_stage_device_import_response.go new file mode 100644 index 0000000000..ae896f6b6d --- /dev/null +++ b/packages/client-go/model_authenticator_duo_stage_device_import_response.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorDuoStageDeviceImportResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoStageDeviceImportResponse{} + +// AuthenticatorDuoStageDeviceImportResponse struct for AuthenticatorDuoStageDeviceImportResponse +type AuthenticatorDuoStageDeviceImportResponse struct { + Count int32 `json:"count"` + Error string `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoStageDeviceImportResponse AuthenticatorDuoStageDeviceImportResponse + +// NewAuthenticatorDuoStageDeviceImportResponse instantiates a new AuthenticatorDuoStageDeviceImportResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoStageDeviceImportResponse(count int32, error_ string) *AuthenticatorDuoStageDeviceImportResponse { + this := AuthenticatorDuoStageDeviceImportResponse{} + this.Count = count + this.Error = error_ + return &this +} + +// NewAuthenticatorDuoStageDeviceImportResponseWithDefaults instantiates a new AuthenticatorDuoStageDeviceImportResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoStageDeviceImportResponseWithDefaults() *AuthenticatorDuoStageDeviceImportResponse { + this := AuthenticatorDuoStageDeviceImportResponse{} + return &this +} + +// GetCount returns the Count field value +func (o *AuthenticatorDuoStageDeviceImportResponse) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageDeviceImportResponse) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *AuthenticatorDuoStageDeviceImportResponse) SetCount(v int32) { + o.Count = v +} + +// GetError returns the Error field value +func (o *AuthenticatorDuoStageDeviceImportResponse) GetError() string { + if o == nil { + var ret string + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageDeviceImportResponse) GetErrorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *AuthenticatorDuoStageDeviceImportResponse) SetError(v string) { + o.Error = v +} + +func (o AuthenticatorDuoStageDeviceImportResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoStageDeviceImportResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["count"] = o.Count + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoStageDeviceImportResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "count", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorDuoStageDeviceImportResponse := _AuthenticatorDuoStageDeviceImportResponse{} + + err = json.Unmarshal(data, &varAuthenticatorDuoStageDeviceImportResponse) + + if err != nil { + return err + } + + *o = AuthenticatorDuoStageDeviceImportResponse(varAuthenticatorDuoStageDeviceImportResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoStageDeviceImportResponse struct { + value *AuthenticatorDuoStageDeviceImportResponse + isSet bool +} + +func (v NullableAuthenticatorDuoStageDeviceImportResponse) Get() *AuthenticatorDuoStageDeviceImportResponse { + return v.value +} + +func (v *NullableAuthenticatorDuoStageDeviceImportResponse) Set(val *AuthenticatorDuoStageDeviceImportResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoStageDeviceImportResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoStageDeviceImportResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoStageDeviceImportResponse(val *AuthenticatorDuoStageDeviceImportResponse) *NullableAuthenticatorDuoStageDeviceImportResponse { + return &NullableAuthenticatorDuoStageDeviceImportResponse{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoStageDeviceImportResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoStageDeviceImportResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_stage_manual_device_import_request.go b/packages/client-go/model_authenticator_duo_stage_manual_device_import_request.go new file mode 100644 index 0000000000..9a27605841 --- /dev/null +++ b/packages/client-go/model_authenticator_duo_stage_manual_device_import_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorDuoStageManualDeviceImportRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoStageManualDeviceImportRequest{} + +// AuthenticatorDuoStageManualDeviceImportRequest struct for AuthenticatorDuoStageManualDeviceImportRequest +type AuthenticatorDuoStageManualDeviceImportRequest struct { + DuoUserId string `json:"duo_user_id"` + Username string `json:"username"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoStageManualDeviceImportRequest AuthenticatorDuoStageManualDeviceImportRequest + +// NewAuthenticatorDuoStageManualDeviceImportRequest instantiates a new AuthenticatorDuoStageManualDeviceImportRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoStageManualDeviceImportRequest(duoUserId string, username string) *AuthenticatorDuoStageManualDeviceImportRequest { + this := AuthenticatorDuoStageManualDeviceImportRequest{} + this.DuoUserId = duoUserId + this.Username = username + return &this +} + +// NewAuthenticatorDuoStageManualDeviceImportRequestWithDefaults instantiates a new AuthenticatorDuoStageManualDeviceImportRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoStageManualDeviceImportRequestWithDefaults() *AuthenticatorDuoStageManualDeviceImportRequest { + this := AuthenticatorDuoStageManualDeviceImportRequest{} + return &this +} + +// GetDuoUserId returns the DuoUserId field value +func (o *AuthenticatorDuoStageManualDeviceImportRequest) GetDuoUserId() string { + if o == nil { + var ret string + return ret + } + + return o.DuoUserId +} + +// GetDuoUserIdOk returns a tuple with the DuoUserId field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageManualDeviceImportRequest) GetDuoUserIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DuoUserId, true +} + +// SetDuoUserId sets field value +func (o *AuthenticatorDuoStageManualDeviceImportRequest) SetDuoUserId(v string) { + o.DuoUserId = v +} + +// GetUsername returns the Username field value +func (o *AuthenticatorDuoStageManualDeviceImportRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageManualDeviceImportRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *AuthenticatorDuoStageManualDeviceImportRequest) SetUsername(v string) { + o.Username = v +} + +func (o AuthenticatorDuoStageManualDeviceImportRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoStageManualDeviceImportRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["duo_user_id"] = o.DuoUserId + toSerialize["username"] = o.Username + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoStageManualDeviceImportRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "duo_user_id", + "username", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorDuoStageManualDeviceImportRequest := _AuthenticatorDuoStageManualDeviceImportRequest{} + + err = json.Unmarshal(data, &varAuthenticatorDuoStageManualDeviceImportRequest) + + if err != nil { + return err + } + + *o = AuthenticatorDuoStageManualDeviceImportRequest(varAuthenticatorDuoStageManualDeviceImportRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "duo_user_id") + delete(additionalProperties, "username") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoStageManualDeviceImportRequest struct { + value *AuthenticatorDuoStageManualDeviceImportRequest + isSet bool +} + +func (v NullableAuthenticatorDuoStageManualDeviceImportRequest) Get() *AuthenticatorDuoStageManualDeviceImportRequest { + return v.value +} + +func (v *NullableAuthenticatorDuoStageManualDeviceImportRequest) Set(val *AuthenticatorDuoStageManualDeviceImportRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoStageManualDeviceImportRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoStageManualDeviceImportRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoStageManualDeviceImportRequest(val *AuthenticatorDuoStageManualDeviceImportRequest) *NullableAuthenticatorDuoStageManualDeviceImportRequest { + return &NullableAuthenticatorDuoStageManualDeviceImportRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoStageManualDeviceImportRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoStageManualDeviceImportRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_duo_stage_request.go b/packages/client-go/model_authenticator_duo_stage_request.go new file mode 100644 index 0000000000..2a80a9efb8 --- /dev/null +++ b/packages/client-go/model_authenticator_duo_stage_request.go @@ -0,0 +1,414 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorDuoStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorDuoStageRequest{} + +// AuthenticatorDuoStageRequest AuthenticatorDuoStage Serializer +type AuthenticatorDuoStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + ClientId string `json:"client_id"` + ClientSecret string `json:"client_secret"` + ApiHostname string `json:"api_hostname"` + AdminIntegrationKey *string `json:"admin_integration_key,omitempty"` + AdminSecretKey *string `json:"admin_secret_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorDuoStageRequest AuthenticatorDuoStageRequest + +// NewAuthenticatorDuoStageRequest instantiates a new AuthenticatorDuoStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorDuoStageRequest(name string, clientId string, clientSecret string, apiHostname string) *AuthenticatorDuoStageRequest { + this := AuthenticatorDuoStageRequest{} + this.Name = name + this.ClientId = clientId + this.ClientSecret = clientSecret + this.ApiHostname = apiHostname + return &this +} + +// NewAuthenticatorDuoStageRequestWithDefaults instantiates a new AuthenticatorDuoStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorDuoStageRequestWithDefaults() *AuthenticatorDuoStageRequest { + this := AuthenticatorDuoStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorDuoStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorDuoStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorDuoStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorDuoStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorDuoStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorDuoStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorDuoStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorDuoStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorDuoStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorDuoStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorDuoStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetClientId returns the ClientId field value +func (o *AuthenticatorDuoStageRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *AuthenticatorDuoStageRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *AuthenticatorDuoStageRequest) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *AuthenticatorDuoStageRequest) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetApiHostname returns the ApiHostname field value +func (o *AuthenticatorDuoStageRequest) GetApiHostname() string { + if o == nil { + var ret string + return ret + } + + return o.ApiHostname +} + +// GetApiHostnameOk returns a tuple with the ApiHostname field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetApiHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApiHostname, true +} + +// SetApiHostname sets field value +func (o *AuthenticatorDuoStageRequest) SetApiHostname(v string) { + o.ApiHostname = v +} + +// GetAdminIntegrationKey returns the AdminIntegrationKey field value if set, zero value otherwise. +func (o *AuthenticatorDuoStageRequest) GetAdminIntegrationKey() string { + if o == nil || IsNil(o.AdminIntegrationKey) { + var ret string + return ret + } + return *o.AdminIntegrationKey +} + +// GetAdminIntegrationKeyOk returns a tuple with the AdminIntegrationKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetAdminIntegrationKeyOk() (*string, bool) { + if o == nil || IsNil(o.AdminIntegrationKey) { + return nil, false + } + return o.AdminIntegrationKey, true +} + +// HasAdminIntegrationKey returns a boolean if a field has been set. +func (o *AuthenticatorDuoStageRequest) HasAdminIntegrationKey() bool { + if o != nil && !IsNil(o.AdminIntegrationKey) { + return true + } + + return false +} + +// SetAdminIntegrationKey gets a reference to the given string and assigns it to the AdminIntegrationKey field. +func (o *AuthenticatorDuoStageRequest) SetAdminIntegrationKey(v string) { + o.AdminIntegrationKey = &v +} + +// GetAdminSecretKey returns the AdminSecretKey field value if set, zero value otherwise. +func (o *AuthenticatorDuoStageRequest) GetAdminSecretKey() string { + if o == nil || IsNil(o.AdminSecretKey) { + var ret string + return ret + } + return *o.AdminSecretKey +} + +// GetAdminSecretKeyOk returns a tuple with the AdminSecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorDuoStageRequest) GetAdminSecretKeyOk() (*string, bool) { + if o == nil || IsNil(o.AdminSecretKey) { + return nil, false + } + return o.AdminSecretKey, true +} + +// HasAdminSecretKey returns a boolean if a field has been set. +func (o *AuthenticatorDuoStageRequest) HasAdminSecretKey() bool { + if o != nil && !IsNil(o.AdminSecretKey) { + return true + } + + return false +} + +// SetAdminSecretKey gets a reference to the given string and assigns it to the AdminSecretKey field. +func (o *AuthenticatorDuoStageRequest) SetAdminSecretKey(v string) { + o.AdminSecretKey = &v +} + +func (o AuthenticatorDuoStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorDuoStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["api_hostname"] = o.ApiHostname + if !IsNil(o.AdminIntegrationKey) { + toSerialize["admin_integration_key"] = o.AdminIntegrationKey + } + if !IsNil(o.AdminSecretKey) { + toSerialize["admin_secret_key"] = o.AdminSecretKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorDuoStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "client_id", + "client_secret", + "api_hostname", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorDuoStageRequest := _AuthenticatorDuoStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorDuoStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorDuoStageRequest(varAuthenticatorDuoStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "api_hostname") + delete(additionalProperties, "admin_integration_key") + delete(additionalProperties, "admin_secret_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorDuoStageRequest struct { + value *AuthenticatorDuoStageRequest + isSet bool +} + +func (v NullableAuthenticatorDuoStageRequest) Get() *AuthenticatorDuoStageRequest { + return v.value +} + +func (v *NullableAuthenticatorDuoStageRequest) Set(val *AuthenticatorDuoStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorDuoStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorDuoStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorDuoStageRequest(val *AuthenticatorDuoStageRequest) *NullableAuthenticatorDuoStageRequest { + return &NullableAuthenticatorDuoStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorDuoStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorDuoStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_email_challenge.go b/packages/client-go/model_authenticator_email_challenge.go new file mode 100644 index 0000000000..6e20b077a7 --- /dev/null +++ b/packages/client-go/model_authenticator_email_challenge.go @@ -0,0 +1,400 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorEmailChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEmailChallenge{} + +// AuthenticatorEmailChallenge Authenticator Email Setup challenge +type AuthenticatorEmailChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + Email NullableString `json:"email,omitempty"` + EmailRequired *bool `json:"email_required,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEmailChallenge AuthenticatorEmailChallenge + +// NewAuthenticatorEmailChallenge instantiates a new AuthenticatorEmailChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEmailChallenge(pendingUser string, pendingUserAvatar string) *AuthenticatorEmailChallenge { + this := AuthenticatorEmailChallenge{} + var component string = "ak-stage-authenticator-email" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + var emailRequired bool = true + this.EmailRequired = &emailRequired + return &this +} + +// NewAuthenticatorEmailChallengeWithDefaults instantiates a new AuthenticatorEmailChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEmailChallengeWithDefaults() *AuthenticatorEmailChallenge { + this := AuthenticatorEmailChallenge{} + var component string = "ak-stage-authenticator-email" + this.Component = &component + var emailRequired bool = true + this.EmailRequired = &emailRequired + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorEmailChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorEmailChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorEmailChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorEmailChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorEmailChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorEmailChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorEmailChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorEmailChallenge) GetEmail() string { + if o == nil || IsNil(o.Email.Get()) { + var ret string + return ret + } + return *o.Email.Get() +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorEmailChallenge) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Email.Get(), o.Email.IsSet() +} + +// HasEmail returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallenge) HasEmail() bool { + if o != nil && o.Email.IsSet() { + return true + } + + return false +} + +// SetEmail gets a reference to the given NullableString and assigns it to the Email field. +func (o *AuthenticatorEmailChallenge) SetEmail(v string) { + o.Email.Set(&v) +} + +// SetEmailNil sets the value for Email to be an explicit nil +func (o *AuthenticatorEmailChallenge) SetEmailNil() { + o.Email.Set(nil) +} + +// UnsetEmail ensures that no value is present for Email, not even an explicit nil +func (o *AuthenticatorEmailChallenge) UnsetEmail() { + o.Email.Unset() +} + +// GetEmailRequired returns the EmailRequired field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallenge) GetEmailRequired() bool { + if o == nil || IsNil(o.EmailRequired) { + var ret bool + return ret + } + return *o.EmailRequired +} + +// GetEmailRequiredOk returns a tuple with the EmailRequired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallenge) GetEmailRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.EmailRequired) { + return nil, false + } + return o.EmailRequired, true +} + +// HasEmailRequired returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallenge) HasEmailRequired() bool { + if o != nil && !IsNil(o.EmailRequired) { + return true + } + + return false +} + +// SetEmailRequired gets a reference to the given bool and assigns it to the EmailRequired field. +func (o *AuthenticatorEmailChallenge) SetEmailRequired(v bool) { + o.EmailRequired = &v +} + +func (o AuthenticatorEmailChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEmailChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if o.Email.IsSet() { + toSerialize["email"] = o.Email.Get() + } + if !IsNil(o.EmailRequired) { + toSerialize["email_required"] = o.EmailRequired + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEmailChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorEmailChallenge := _AuthenticatorEmailChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorEmailChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorEmailChallenge(varAuthenticatorEmailChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "email") + delete(additionalProperties, "email_required") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEmailChallenge struct { + value *AuthenticatorEmailChallenge + isSet bool +} + +func (v NullableAuthenticatorEmailChallenge) Get() *AuthenticatorEmailChallenge { + return v.value +} + +func (v *NullableAuthenticatorEmailChallenge) Set(val *AuthenticatorEmailChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEmailChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEmailChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEmailChallenge(val *AuthenticatorEmailChallenge) *NullableAuthenticatorEmailChallenge { + return &NullableAuthenticatorEmailChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorEmailChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEmailChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_email_challenge_response_request.go b/packages/client-go/model_authenticator_email_challenge_response_request.go new file mode 100644 index 0000000000..489fb46bbb --- /dev/null +++ b/packages/client-go/model_authenticator_email_challenge_response_request.go @@ -0,0 +1,232 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AuthenticatorEmailChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEmailChallengeResponseRequest{} + +// AuthenticatorEmailChallengeResponseRequest Authenticator Email Challenge response, device is set by get_response_instance +type AuthenticatorEmailChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Code *string `json:"code,omitempty"` + Email *string `json:"email,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEmailChallengeResponseRequest AuthenticatorEmailChallengeResponseRequest + +// NewAuthenticatorEmailChallengeResponseRequest instantiates a new AuthenticatorEmailChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEmailChallengeResponseRequest() *AuthenticatorEmailChallengeResponseRequest { + this := AuthenticatorEmailChallengeResponseRequest{} + var component string = "ak-stage-authenticator-email" + this.Component = &component + return &this +} + +// NewAuthenticatorEmailChallengeResponseRequestWithDefaults instantiates a new AuthenticatorEmailChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEmailChallengeResponseRequestWithDefaults() *AuthenticatorEmailChallengeResponseRequest { + this := AuthenticatorEmailChallengeResponseRequest{} + var component string = "ak-stage-authenticator-email" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorEmailChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallengeResponseRequest) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *AuthenticatorEmailChallengeResponseRequest) SetCode(v string) { + o.Code = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *AuthenticatorEmailChallengeResponseRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *AuthenticatorEmailChallengeResponseRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *AuthenticatorEmailChallengeResponseRequest) SetEmail(v string) { + o.Email = &v +} + +func (o AuthenticatorEmailChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEmailChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEmailChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAuthenticatorEmailChallengeResponseRequest := _AuthenticatorEmailChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorEmailChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorEmailChallengeResponseRequest(varAuthenticatorEmailChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "code") + delete(additionalProperties, "email") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEmailChallengeResponseRequest struct { + value *AuthenticatorEmailChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorEmailChallengeResponseRequest) Get() *AuthenticatorEmailChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorEmailChallengeResponseRequest) Set(val *AuthenticatorEmailChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEmailChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEmailChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEmailChallengeResponseRequest(val *AuthenticatorEmailChallengeResponseRequest) *NullableAuthenticatorEmailChallengeResponseRequest { + return &NullableAuthenticatorEmailChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorEmailChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEmailChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_email_stage.go b/packages/client-go/model_authenticator_email_stage.go new file mode 100644 index 0000000000..ccfa7fc327 --- /dev/null +++ b/packages/client-go/model_authenticator_email_stage.go @@ -0,0 +1,877 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorEmailStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEmailStage{} + +// AuthenticatorEmailStage AuthenticatorEmailStage Serializer +type AuthenticatorEmailStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + Subject *string `json:"subject,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Template *string `json:"template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEmailStage AuthenticatorEmailStage + +// NewAuthenticatorEmailStage instantiates a new AuthenticatorEmailStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEmailStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *AuthenticatorEmailStage { + this := AuthenticatorEmailStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewAuthenticatorEmailStageWithDefaults instantiates a new AuthenticatorEmailStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEmailStageWithDefaults() *AuthenticatorEmailStage { + this := AuthenticatorEmailStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorEmailStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorEmailStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorEmailStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorEmailStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorEmailStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorEmailStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorEmailStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorEmailStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorEmailStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorEmailStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorEmailStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorEmailStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorEmailStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorEmailStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorEmailStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorEmailStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorEmailStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorEmailStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorEmailStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorEmailStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *AuthenticatorEmailStage) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *AuthenticatorEmailStage) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *AuthenticatorEmailStage) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *AuthenticatorEmailStage) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *AuthenticatorEmailStage) SetPassword(v string) { + o.Password = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *AuthenticatorEmailStage) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *AuthenticatorEmailStage) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *AuthenticatorEmailStage) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *AuthenticatorEmailStage) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *AuthenticatorEmailStage) SetSubject(v string) { + o.Subject = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *AuthenticatorEmailStage) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *AuthenticatorEmailStage) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStage) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *AuthenticatorEmailStage) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *AuthenticatorEmailStage) SetTemplate(v string) { + o.Template = &v +} + +func (o AuthenticatorEmailStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEmailStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEmailStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorEmailStage := _AuthenticatorEmailStage{} + + err = json.Unmarshal(data, &varAuthenticatorEmailStage) + + if err != nil { + return err + } + + *o = AuthenticatorEmailStage(varAuthenticatorEmailStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "subject") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEmailStage struct { + value *AuthenticatorEmailStage + isSet bool +} + +func (v NullableAuthenticatorEmailStage) Get() *AuthenticatorEmailStage { + return v.value +} + +func (v *NullableAuthenticatorEmailStage) Set(val *AuthenticatorEmailStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEmailStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEmailStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEmailStage(val *AuthenticatorEmailStage) *NullableAuthenticatorEmailStage { + return &NullableAuthenticatorEmailStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorEmailStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEmailStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_email_stage_request.go b/packages/client-go/model_authenticator_email_stage_request.go new file mode 100644 index 0000000000..368091d5b8 --- /dev/null +++ b/packages/client-go/model_authenticator_email_stage_request.go @@ -0,0 +1,699 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorEmailStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEmailStageRequest{} + +// AuthenticatorEmailStageRequest AuthenticatorEmailStage Serializer +type AuthenticatorEmailStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + Subject *string `json:"subject,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Template *string `json:"template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEmailStageRequest AuthenticatorEmailStageRequest + +// NewAuthenticatorEmailStageRequest instantiates a new AuthenticatorEmailStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEmailStageRequest(name string) *AuthenticatorEmailStageRequest { + this := AuthenticatorEmailStageRequest{} + this.Name = name + return &this +} + +// NewAuthenticatorEmailStageRequestWithDefaults instantiates a new AuthenticatorEmailStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEmailStageRequestWithDefaults() *AuthenticatorEmailStageRequest { + this := AuthenticatorEmailStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorEmailStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorEmailStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorEmailStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorEmailStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorEmailStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorEmailStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorEmailStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorEmailStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *AuthenticatorEmailStageRequest) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *AuthenticatorEmailStageRequest) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *AuthenticatorEmailStageRequest) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *AuthenticatorEmailStageRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *AuthenticatorEmailStageRequest) SetPassword(v string) { + o.Password = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *AuthenticatorEmailStageRequest) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *AuthenticatorEmailStageRequest) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *AuthenticatorEmailStageRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *AuthenticatorEmailStageRequest) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *AuthenticatorEmailStageRequest) SetSubject(v string) { + o.Subject = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *AuthenticatorEmailStageRequest) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *AuthenticatorEmailStageRequest) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEmailStageRequest) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *AuthenticatorEmailStageRequest) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *AuthenticatorEmailStageRequest) SetTemplate(v string) { + o.Template = &v +} + +func (o AuthenticatorEmailStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEmailStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEmailStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorEmailStageRequest := _AuthenticatorEmailStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorEmailStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorEmailStageRequest(varAuthenticatorEmailStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "subject") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEmailStageRequest struct { + value *AuthenticatorEmailStageRequest + isSet bool +} + +func (v NullableAuthenticatorEmailStageRequest) Get() *AuthenticatorEmailStageRequest { + return v.value +} + +func (v *NullableAuthenticatorEmailStageRequest) Set(val *AuthenticatorEmailStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEmailStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEmailStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEmailStageRequest(val *AuthenticatorEmailStageRequest) *NullableAuthenticatorEmailStageRequest { + return &NullableAuthenticatorEmailStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorEmailStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEmailStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_endpoint_gdtc_stage.go b/packages/client-go/model_authenticator_endpoint_gdtc_stage.go new file mode 100644 index 0000000000..60c62b02f5 --- /dev/null +++ b/packages/client-go/model_authenticator_endpoint_gdtc_stage.go @@ -0,0 +1,460 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorEndpointGDTCStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEndpointGDTCStage{} + +// AuthenticatorEndpointGDTCStage AuthenticatorEndpointGDTCStage Serializer +type AuthenticatorEndpointGDTCStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Credentials map[string]interface{} `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEndpointGDTCStage AuthenticatorEndpointGDTCStage + +// NewAuthenticatorEndpointGDTCStage instantiates a new AuthenticatorEndpointGDTCStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEndpointGDTCStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, credentials map[string]interface{}) *AuthenticatorEndpointGDTCStage { + this := AuthenticatorEndpointGDTCStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Credentials = credentials + return &this +} + +// NewAuthenticatorEndpointGDTCStageWithDefaults instantiates a new AuthenticatorEndpointGDTCStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEndpointGDTCStageWithDefaults() *AuthenticatorEndpointGDTCStage { + this := AuthenticatorEndpointGDTCStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorEndpointGDTCStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorEndpointGDTCStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorEndpointGDTCStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorEndpointGDTCStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorEndpointGDTCStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorEndpointGDTCStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorEndpointGDTCStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorEndpointGDTCStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorEndpointGDTCStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorEndpointGDTCStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorEndpointGDTCStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorEndpointGDTCStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorEndpointGDTCStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorEndpointGDTCStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorEndpointGDTCStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorEndpointGDTCStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorEndpointGDTCStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorEndpointGDTCStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorEndpointGDTCStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorEndpointGDTCStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorEndpointGDTCStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorEndpointGDTCStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorEndpointGDTCStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetCredentials returns the Credentials field value +func (o *AuthenticatorEndpointGDTCStage) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStage) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *AuthenticatorEndpointGDTCStage) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +func (o AuthenticatorEndpointGDTCStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEndpointGDTCStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEndpointGDTCStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorEndpointGDTCStage := _AuthenticatorEndpointGDTCStage{} + + err = json.Unmarshal(data, &varAuthenticatorEndpointGDTCStage) + + if err != nil { + return err + } + + *o = AuthenticatorEndpointGDTCStage(varAuthenticatorEndpointGDTCStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEndpointGDTCStage struct { + value *AuthenticatorEndpointGDTCStage + isSet bool +} + +func (v NullableAuthenticatorEndpointGDTCStage) Get() *AuthenticatorEndpointGDTCStage { + return v.value +} + +func (v *NullableAuthenticatorEndpointGDTCStage) Set(val *AuthenticatorEndpointGDTCStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEndpointGDTCStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEndpointGDTCStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEndpointGDTCStage(val *AuthenticatorEndpointGDTCStage) *NullableAuthenticatorEndpointGDTCStage { + return &NullableAuthenticatorEndpointGDTCStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorEndpointGDTCStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEndpointGDTCStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_endpoint_gdtc_stage_request.go b/packages/client-go/model_authenticator_endpoint_gdtc_stage_request.go new file mode 100644 index 0000000000..a5cf66b540 --- /dev/null +++ b/packages/client-go/model_authenticator_endpoint_gdtc_stage_request.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorEndpointGDTCStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorEndpointGDTCStageRequest{} + +// AuthenticatorEndpointGDTCStageRequest AuthenticatorEndpointGDTCStage Serializer +type AuthenticatorEndpointGDTCStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Credentials map[string]interface{} `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorEndpointGDTCStageRequest AuthenticatorEndpointGDTCStageRequest + +// NewAuthenticatorEndpointGDTCStageRequest instantiates a new AuthenticatorEndpointGDTCStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorEndpointGDTCStageRequest(name string, credentials map[string]interface{}) *AuthenticatorEndpointGDTCStageRequest { + this := AuthenticatorEndpointGDTCStageRequest{} + this.Name = name + this.Credentials = credentials + return &this +} + +// NewAuthenticatorEndpointGDTCStageRequestWithDefaults instantiates a new AuthenticatorEndpointGDTCStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorEndpointGDTCStageRequestWithDefaults() *AuthenticatorEndpointGDTCStageRequest { + this := AuthenticatorEndpointGDTCStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorEndpointGDTCStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorEndpointGDTCStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorEndpointGDTCStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorEndpointGDTCStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorEndpointGDTCStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorEndpointGDTCStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorEndpointGDTCStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorEndpointGDTCStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorEndpointGDTCStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorEndpointGDTCStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorEndpointGDTCStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetCredentials returns the Credentials field value +func (o *AuthenticatorEndpointGDTCStageRequest) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorEndpointGDTCStageRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *AuthenticatorEndpointGDTCStageRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +func (o AuthenticatorEndpointGDTCStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorEndpointGDTCStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorEndpointGDTCStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorEndpointGDTCStageRequest := _AuthenticatorEndpointGDTCStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorEndpointGDTCStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorEndpointGDTCStageRequest(varAuthenticatorEndpointGDTCStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorEndpointGDTCStageRequest struct { + value *AuthenticatorEndpointGDTCStageRequest + isSet bool +} + +func (v NullableAuthenticatorEndpointGDTCStageRequest) Get() *AuthenticatorEndpointGDTCStageRequest { + return v.value +} + +func (v *NullableAuthenticatorEndpointGDTCStageRequest) Set(val *AuthenticatorEndpointGDTCStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorEndpointGDTCStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorEndpointGDTCStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorEndpointGDTCStageRequest(val *AuthenticatorEndpointGDTCStageRequest) *NullableAuthenticatorEndpointGDTCStageRequest { + return &NullableAuthenticatorEndpointGDTCStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorEndpointGDTCStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorEndpointGDTCStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_sms_challenge.go b/packages/client-go/model_authenticator_sms_challenge.go new file mode 100644 index 0000000000..3a3d9e9ae8 --- /dev/null +++ b/packages/client-go/model_authenticator_sms_challenge.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorSMSChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorSMSChallenge{} + +// AuthenticatorSMSChallenge SMS Setup challenge +type AuthenticatorSMSChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + PhoneNumberRequired *bool `json:"phone_number_required,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorSMSChallenge AuthenticatorSMSChallenge + +// NewAuthenticatorSMSChallenge instantiates a new AuthenticatorSMSChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorSMSChallenge(pendingUser string, pendingUserAvatar string) *AuthenticatorSMSChallenge { + this := AuthenticatorSMSChallenge{} + var component string = "ak-stage-authenticator-sms" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + var phoneNumberRequired bool = true + this.PhoneNumberRequired = &phoneNumberRequired + return &this +} + +// NewAuthenticatorSMSChallengeWithDefaults instantiates a new AuthenticatorSMSChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorSMSChallengeWithDefaults() *AuthenticatorSMSChallenge { + this := AuthenticatorSMSChallenge{} + var component string = "ak-stage-authenticator-sms" + this.Component = &component + var phoneNumberRequired bool = true + this.PhoneNumberRequired = &phoneNumberRequired + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorSMSChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorSMSChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorSMSChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorSMSChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorSMSChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorSMSChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorSMSChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetPhoneNumberRequired returns the PhoneNumberRequired field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallenge) GetPhoneNumberRequired() bool { + if o == nil || IsNil(o.PhoneNumberRequired) { + var ret bool + return ret + } + return *o.PhoneNumberRequired +} + +// GetPhoneNumberRequiredOk returns a tuple with the PhoneNumberRequired field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallenge) GetPhoneNumberRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.PhoneNumberRequired) { + return nil, false + } + return o.PhoneNumberRequired, true +} + +// HasPhoneNumberRequired returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallenge) HasPhoneNumberRequired() bool { + if o != nil && !IsNil(o.PhoneNumberRequired) { + return true + } + + return false +} + +// SetPhoneNumberRequired gets a reference to the given bool and assigns it to the PhoneNumberRequired field. +func (o *AuthenticatorSMSChallenge) SetPhoneNumberRequired(v bool) { + o.PhoneNumberRequired = &v +} + +func (o AuthenticatorSMSChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorSMSChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if !IsNil(o.PhoneNumberRequired) { + toSerialize["phone_number_required"] = o.PhoneNumberRequired + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorSMSChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorSMSChallenge := _AuthenticatorSMSChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorSMSChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorSMSChallenge(varAuthenticatorSMSChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "phone_number_required") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorSMSChallenge struct { + value *AuthenticatorSMSChallenge + isSet bool +} + +func (v NullableAuthenticatorSMSChallenge) Get() *AuthenticatorSMSChallenge { + return v.value +} + +func (v *NullableAuthenticatorSMSChallenge) Set(val *AuthenticatorSMSChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorSMSChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorSMSChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorSMSChallenge(val *AuthenticatorSMSChallenge) *NullableAuthenticatorSMSChallenge { + return &NullableAuthenticatorSMSChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorSMSChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorSMSChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_sms_challenge_response_request.go b/packages/client-go/model_authenticator_sms_challenge_response_request.go new file mode 100644 index 0000000000..9af2ec0448 --- /dev/null +++ b/packages/client-go/model_authenticator_sms_challenge_response_request.go @@ -0,0 +1,232 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AuthenticatorSMSChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorSMSChallengeResponseRequest{} + +// AuthenticatorSMSChallengeResponseRequest SMS Challenge response, device is set by get_response_instance +type AuthenticatorSMSChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Code *string `json:"code,omitempty"` + PhoneNumber *string `json:"phone_number,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorSMSChallengeResponseRequest AuthenticatorSMSChallengeResponseRequest + +// NewAuthenticatorSMSChallengeResponseRequest instantiates a new AuthenticatorSMSChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorSMSChallengeResponseRequest() *AuthenticatorSMSChallengeResponseRequest { + this := AuthenticatorSMSChallengeResponseRequest{} + var component string = "ak-stage-authenticator-sms" + this.Component = &component + return &this +} + +// NewAuthenticatorSMSChallengeResponseRequestWithDefaults instantiates a new AuthenticatorSMSChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorSMSChallengeResponseRequestWithDefaults() *AuthenticatorSMSChallengeResponseRequest { + this := AuthenticatorSMSChallengeResponseRequest{} + var component string = "ak-stage-authenticator-sms" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorSMSChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallengeResponseRequest) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *AuthenticatorSMSChallengeResponseRequest) SetCode(v string) { + o.Code = &v +} + +// GetPhoneNumber returns the PhoneNumber field value if set, zero value otherwise. +func (o *AuthenticatorSMSChallengeResponseRequest) GetPhoneNumber() string { + if o == nil || IsNil(o.PhoneNumber) { + var ret string + return ret + } + return *o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) GetPhoneNumberOk() (*string, bool) { + if o == nil || IsNil(o.PhoneNumber) { + return nil, false + } + return o.PhoneNumber, true +} + +// HasPhoneNumber returns a boolean if a field has been set. +func (o *AuthenticatorSMSChallengeResponseRequest) HasPhoneNumber() bool { + if o != nil && !IsNil(o.PhoneNumber) { + return true + } + + return false +} + +// SetPhoneNumber gets a reference to the given string and assigns it to the PhoneNumber field. +func (o *AuthenticatorSMSChallengeResponseRequest) SetPhoneNumber(v string) { + o.PhoneNumber = &v +} + +func (o AuthenticatorSMSChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorSMSChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.PhoneNumber) { + toSerialize["phone_number"] = o.PhoneNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorSMSChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAuthenticatorSMSChallengeResponseRequest := _AuthenticatorSMSChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorSMSChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorSMSChallengeResponseRequest(varAuthenticatorSMSChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "code") + delete(additionalProperties, "phone_number") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorSMSChallengeResponseRequest struct { + value *AuthenticatorSMSChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorSMSChallengeResponseRequest) Get() *AuthenticatorSMSChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorSMSChallengeResponseRequest) Set(val *AuthenticatorSMSChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorSMSChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorSMSChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorSMSChallengeResponseRequest(val *AuthenticatorSMSChallengeResponseRequest) *NullableAuthenticatorSMSChallengeResponseRequest { + return &NullableAuthenticatorSMSChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorSMSChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorSMSChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_sms_stage.go b/packages/client-go/model_authenticator_sms_stage.go new file mode 100644 index 0000000000..ca3ae2596f --- /dev/null +++ b/packages/client-go/model_authenticator_sms_stage.go @@ -0,0 +1,708 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorSMSStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorSMSStage{} + +// AuthenticatorSMSStage AuthenticatorSMSStage Serializer +type AuthenticatorSMSStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Provider ProviderEnum `json:"provider"` + FromNumber string `json:"from_number"` + AccountSid string `json:"account_sid"` + Auth string `json:"auth"` + AuthPassword *string `json:"auth_password,omitempty"` + AuthType *AuthTypeEnum `json:"auth_type,omitempty"` + // When enabled, the Phone number is only used during enrollment to verify the users authenticity. Only a hash of the phone number is saved to ensure it is not reused in the future. + VerifyOnly *bool `json:"verify_only,omitempty"` + // Optionally modify the payload being sent to custom providers. + Mapping NullableString `json:"mapping,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorSMSStage AuthenticatorSMSStage + +// NewAuthenticatorSMSStage instantiates a new AuthenticatorSMSStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorSMSStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, provider ProviderEnum, fromNumber string, accountSid string, auth string) *AuthenticatorSMSStage { + this := AuthenticatorSMSStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Provider = provider + this.FromNumber = fromNumber + this.AccountSid = accountSid + this.Auth = auth + return &this +} + +// NewAuthenticatorSMSStageWithDefaults instantiates a new AuthenticatorSMSStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorSMSStageWithDefaults() *AuthenticatorSMSStage { + this := AuthenticatorSMSStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorSMSStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorSMSStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorSMSStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorSMSStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorSMSStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorSMSStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorSMSStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorSMSStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorSMSStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorSMSStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorSMSStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorSMSStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorSMSStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorSMSStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorSMSStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorSMSStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorSMSStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorSMSStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorSMSStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorSMSStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorSMSStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetProvider returns the Provider field value +func (o *AuthenticatorSMSStage) GetProvider() ProviderEnum { + if o == nil { + var ret ProviderEnum + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetProviderOk() (*ProviderEnum, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *AuthenticatorSMSStage) SetProvider(v ProviderEnum) { + o.Provider = v +} + +// GetFromNumber returns the FromNumber field value +func (o *AuthenticatorSMSStage) GetFromNumber() string { + if o == nil { + var ret string + return ret + } + + return o.FromNumber +} + +// GetFromNumberOk returns a tuple with the FromNumber field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetFromNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FromNumber, true +} + +// SetFromNumber sets field value +func (o *AuthenticatorSMSStage) SetFromNumber(v string) { + o.FromNumber = v +} + +// GetAccountSid returns the AccountSid field value +func (o *AuthenticatorSMSStage) GetAccountSid() string { + if o == nil { + var ret string + return ret + } + + return o.AccountSid +} + +// GetAccountSidOk returns a tuple with the AccountSid field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetAccountSidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountSid, true +} + +// SetAccountSid sets field value +func (o *AuthenticatorSMSStage) SetAccountSid(v string) { + o.AccountSid = v +} + +// GetAuth returns the Auth field value +func (o *AuthenticatorSMSStage) GetAuth() string { + if o == nil { + var ret string + return ret + } + + return o.Auth +} + +// GetAuthOk returns a tuple with the Auth field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetAuthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Auth, true +} + +// SetAuth sets field value +func (o *AuthenticatorSMSStage) SetAuth(v string) { + o.Auth = v +} + +// GetAuthPassword returns the AuthPassword field value if set, zero value otherwise. +func (o *AuthenticatorSMSStage) GetAuthPassword() string { + if o == nil || IsNil(o.AuthPassword) { + var ret string + return ret + } + return *o.AuthPassword +} + +// GetAuthPasswordOk returns a tuple with the AuthPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetAuthPasswordOk() (*string, bool) { + if o == nil || IsNil(o.AuthPassword) { + return nil, false + } + return o.AuthPassword, true +} + +// HasAuthPassword returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasAuthPassword() bool { + if o != nil && !IsNil(o.AuthPassword) { + return true + } + + return false +} + +// SetAuthPassword gets a reference to the given string and assigns it to the AuthPassword field. +func (o *AuthenticatorSMSStage) SetAuthPassword(v string) { + o.AuthPassword = &v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *AuthenticatorSMSStage) GetAuthType() AuthTypeEnum { + if o == nil || IsNil(o.AuthType) { + var ret AuthTypeEnum + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetAuthTypeOk() (*AuthTypeEnum, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthTypeEnum and assigns it to the AuthType field. +func (o *AuthenticatorSMSStage) SetAuthType(v AuthTypeEnum) { + o.AuthType = &v +} + +// GetVerifyOnly returns the VerifyOnly field value if set, zero value otherwise. +func (o *AuthenticatorSMSStage) GetVerifyOnly() bool { + if o == nil || IsNil(o.VerifyOnly) { + var ret bool + return ret + } + return *o.VerifyOnly +} + +// GetVerifyOnlyOk returns a tuple with the VerifyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStage) GetVerifyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyOnly) { + return nil, false + } + return o.VerifyOnly, true +} + +// HasVerifyOnly returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasVerifyOnly() bool { + if o != nil && !IsNil(o.VerifyOnly) { + return true + } + + return false +} + +// SetVerifyOnly gets a reference to the given bool and assigns it to the VerifyOnly field. +func (o *AuthenticatorSMSStage) SetVerifyOnly(v bool) { + o.VerifyOnly = &v +} + +// GetMapping returns the Mapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorSMSStage) GetMapping() string { + if o == nil || IsNil(o.Mapping.Get()) { + var ret string + return ret + } + return *o.Mapping.Get() +} + +// GetMappingOk returns a tuple with the Mapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorSMSStage) GetMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Mapping.Get(), o.Mapping.IsSet() +} + +// HasMapping returns a boolean if a field has been set. +func (o *AuthenticatorSMSStage) HasMapping() bool { + if o != nil && o.Mapping.IsSet() { + return true + } + + return false +} + +// SetMapping gets a reference to the given NullableString and assigns it to the Mapping field. +func (o *AuthenticatorSMSStage) SetMapping(v string) { + o.Mapping.Set(&v) +} + +// SetMappingNil sets the value for Mapping to be an explicit nil +func (o *AuthenticatorSMSStage) SetMappingNil() { + o.Mapping.Set(nil) +} + +// UnsetMapping ensures that no value is present for Mapping, not even an explicit nil +func (o *AuthenticatorSMSStage) UnsetMapping() { + o.Mapping.Unset() +} + +func (o AuthenticatorSMSStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorSMSStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["provider"] = o.Provider + toSerialize["from_number"] = o.FromNumber + toSerialize["account_sid"] = o.AccountSid + toSerialize["auth"] = o.Auth + if !IsNil(o.AuthPassword) { + toSerialize["auth_password"] = o.AuthPassword + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.VerifyOnly) { + toSerialize["verify_only"] = o.VerifyOnly + } + if o.Mapping.IsSet() { + toSerialize["mapping"] = o.Mapping.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorSMSStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "provider", + "from_number", + "account_sid", + "auth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorSMSStage := _AuthenticatorSMSStage{} + + err = json.Unmarshal(data, &varAuthenticatorSMSStage) + + if err != nil { + return err + } + + *o = AuthenticatorSMSStage(varAuthenticatorSMSStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "provider") + delete(additionalProperties, "from_number") + delete(additionalProperties, "account_sid") + delete(additionalProperties, "auth") + delete(additionalProperties, "auth_password") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "verify_only") + delete(additionalProperties, "mapping") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorSMSStage struct { + value *AuthenticatorSMSStage + isSet bool +} + +func (v NullableAuthenticatorSMSStage) Get() *AuthenticatorSMSStage { + return v.value +} + +func (v *NullableAuthenticatorSMSStage) Set(val *AuthenticatorSMSStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorSMSStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorSMSStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorSMSStage(val *AuthenticatorSMSStage) *NullableAuthenticatorSMSStage { + return &NullableAuthenticatorSMSStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorSMSStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorSMSStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_sms_stage_request.go b/packages/client-go/model_authenticator_sms_stage_request.go new file mode 100644 index 0000000000..4d15983d3d --- /dev/null +++ b/packages/client-go/model_authenticator_sms_stage_request.go @@ -0,0 +1,530 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorSMSStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorSMSStageRequest{} + +// AuthenticatorSMSStageRequest AuthenticatorSMSStage Serializer +type AuthenticatorSMSStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Provider ProviderEnum `json:"provider"` + FromNumber string `json:"from_number"` + AccountSid string `json:"account_sid"` + Auth string `json:"auth"` + AuthPassword *string `json:"auth_password,omitempty"` + AuthType *AuthTypeEnum `json:"auth_type,omitempty"` + // When enabled, the Phone number is only used during enrollment to verify the users authenticity. Only a hash of the phone number is saved to ensure it is not reused in the future. + VerifyOnly *bool `json:"verify_only,omitempty"` + // Optionally modify the payload being sent to custom providers. + Mapping NullableString `json:"mapping,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorSMSStageRequest AuthenticatorSMSStageRequest + +// NewAuthenticatorSMSStageRequest instantiates a new AuthenticatorSMSStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorSMSStageRequest(name string, provider ProviderEnum, fromNumber string, accountSid string, auth string) *AuthenticatorSMSStageRequest { + this := AuthenticatorSMSStageRequest{} + this.Name = name + this.Provider = provider + this.FromNumber = fromNumber + this.AccountSid = accountSid + this.Auth = auth + return &this +} + +// NewAuthenticatorSMSStageRequestWithDefaults instantiates a new AuthenticatorSMSStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorSMSStageRequestWithDefaults() *AuthenticatorSMSStageRequest { + this := AuthenticatorSMSStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorSMSStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorSMSStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorSMSStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorSMSStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorSMSStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorSMSStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorSMSStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorSMSStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorSMSStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetProvider returns the Provider field value +func (o *AuthenticatorSMSStageRequest) GetProvider() ProviderEnum { + if o == nil { + var ret ProviderEnum + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetProviderOk() (*ProviderEnum, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *AuthenticatorSMSStageRequest) SetProvider(v ProviderEnum) { + o.Provider = v +} + +// GetFromNumber returns the FromNumber field value +func (o *AuthenticatorSMSStageRequest) GetFromNumber() string { + if o == nil { + var ret string + return ret + } + + return o.FromNumber +} + +// GetFromNumberOk returns a tuple with the FromNumber field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetFromNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FromNumber, true +} + +// SetFromNumber sets field value +func (o *AuthenticatorSMSStageRequest) SetFromNumber(v string) { + o.FromNumber = v +} + +// GetAccountSid returns the AccountSid field value +func (o *AuthenticatorSMSStageRequest) GetAccountSid() string { + if o == nil { + var ret string + return ret + } + + return o.AccountSid +} + +// GetAccountSidOk returns a tuple with the AccountSid field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetAccountSidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AccountSid, true +} + +// SetAccountSid sets field value +func (o *AuthenticatorSMSStageRequest) SetAccountSid(v string) { + o.AccountSid = v +} + +// GetAuth returns the Auth field value +func (o *AuthenticatorSMSStageRequest) GetAuth() string { + if o == nil { + var ret string + return ret + } + + return o.Auth +} + +// GetAuthOk returns a tuple with the Auth field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetAuthOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Auth, true +} + +// SetAuth sets field value +func (o *AuthenticatorSMSStageRequest) SetAuth(v string) { + o.Auth = v +} + +// GetAuthPassword returns the AuthPassword field value if set, zero value otherwise. +func (o *AuthenticatorSMSStageRequest) GetAuthPassword() string { + if o == nil || IsNil(o.AuthPassword) { + var ret string + return ret + } + return *o.AuthPassword +} + +// GetAuthPasswordOk returns a tuple with the AuthPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetAuthPasswordOk() (*string, bool) { + if o == nil || IsNil(o.AuthPassword) { + return nil, false + } + return o.AuthPassword, true +} + +// HasAuthPassword returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasAuthPassword() bool { + if o != nil && !IsNil(o.AuthPassword) { + return true + } + + return false +} + +// SetAuthPassword gets a reference to the given string and assigns it to the AuthPassword field. +func (o *AuthenticatorSMSStageRequest) SetAuthPassword(v string) { + o.AuthPassword = &v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *AuthenticatorSMSStageRequest) GetAuthType() AuthTypeEnum { + if o == nil || IsNil(o.AuthType) { + var ret AuthTypeEnum + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetAuthTypeOk() (*AuthTypeEnum, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthTypeEnum and assigns it to the AuthType field. +func (o *AuthenticatorSMSStageRequest) SetAuthType(v AuthTypeEnum) { + o.AuthType = &v +} + +// GetVerifyOnly returns the VerifyOnly field value if set, zero value otherwise. +func (o *AuthenticatorSMSStageRequest) GetVerifyOnly() bool { + if o == nil || IsNil(o.VerifyOnly) { + var ret bool + return ret + } + return *o.VerifyOnly +} + +// GetVerifyOnlyOk returns a tuple with the VerifyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorSMSStageRequest) GetVerifyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyOnly) { + return nil, false + } + return o.VerifyOnly, true +} + +// HasVerifyOnly returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasVerifyOnly() bool { + if o != nil && !IsNil(o.VerifyOnly) { + return true + } + + return false +} + +// SetVerifyOnly gets a reference to the given bool and assigns it to the VerifyOnly field. +func (o *AuthenticatorSMSStageRequest) SetVerifyOnly(v bool) { + o.VerifyOnly = &v +} + +// GetMapping returns the Mapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorSMSStageRequest) GetMapping() string { + if o == nil || IsNil(o.Mapping.Get()) { + var ret string + return ret + } + return *o.Mapping.Get() +} + +// GetMappingOk returns a tuple with the Mapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorSMSStageRequest) GetMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Mapping.Get(), o.Mapping.IsSet() +} + +// HasMapping returns a boolean if a field has been set. +func (o *AuthenticatorSMSStageRequest) HasMapping() bool { + if o != nil && o.Mapping.IsSet() { + return true + } + + return false +} + +// SetMapping gets a reference to the given NullableString and assigns it to the Mapping field. +func (o *AuthenticatorSMSStageRequest) SetMapping(v string) { + o.Mapping.Set(&v) +} + +// SetMappingNil sets the value for Mapping to be an explicit nil +func (o *AuthenticatorSMSStageRequest) SetMappingNil() { + o.Mapping.Set(nil) +} + +// UnsetMapping ensures that no value is present for Mapping, not even an explicit nil +func (o *AuthenticatorSMSStageRequest) UnsetMapping() { + o.Mapping.Unset() +} + +func (o AuthenticatorSMSStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorSMSStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["provider"] = o.Provider + toSerialize["from_number"] = o.FromNumber + toSerialize["account_sid"] = o.AccountSid + toSerialize["auth"] = o.Auth + if !IsNil(o.AuthPassword) { + toSerialize["auth_password"] = o.AuthPassword + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.VerifyOnly) { + toSerialize["verify_only"] = o.VerifyOnly + } + if o.Mapping.IsSet() { + toSerialize["mapping"] = o.Mapping.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorSMSStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "provider", + "from_number", + "account_sid", + "auth", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorSMSStageRequest := _AuthenticatorSMSStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorSMSStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorSMSStageRequest(varAuthenticatorSMSStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "provider") + delete(additionalProperties, "from_number") + delete(additionalProperties, "account_sid") + delete(additionalProperties, "auth") + delete(additionalProperties, "auth_password") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "verify_only") + delete(additionalProperties, "mapping") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorSMSStageRequest struct { + value *AuthenticatorSMSStageRequest + isSet bool +} + +func (v NullableAuthenticatorSMSStageRequest) Get() *AuthenticatorSMSStageRequest { + return v.value +} + +func (v *NullableAuthenticatorSMSStageRequest) Set(val *AuthenticatorSMSStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorSMSStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorSMSStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorSMSStageRequest(val *AuthenticatorSMSStageRequest) *NullableAuthenticatorSMSStageRequest { + return &NullableAuthenticatorSMSStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorSMSStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorSMSStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_static_challenge.go b/packages/client-go/model_authenticator_static_challenge.go new file mode 100644 index 0000000000..2c5b2f5d31 --- /dev/null +++ b/packages/client-go/model_authenticator_static_challenge.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorStaticChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorStaticChallenge{} + +// AuthenticatorStaticChallenge Static authenticator challenge +type AuthenticatorStaticChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + Codes []string `json:"codes"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorStaticChallenge AuthenticatorStaticChallenge + +// NewAuthenticatorStaticChallenge instantiates a new AuthenticatorStaticChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorStaticChallenge(pendingUser string, pendingUserAvatar string, codes []string) *AuthenticatorStaticChallenge { + this := AuthenticatorStaticChallenge{} + var component string = "ak-stage-authenticator-static" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.Codes = codes + return &this +} + +// NewAuthenticatorStaticChallengeWithDefaults instantiates a new AuthenticatorStaticChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorStaticChallengeWithDefaults() *AuthenticatorStaticChallenge { + this := AuthenticatorStaticChallenge{} + var component string = "ak-stage-authenticator-static" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorStaticChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorStaticChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorStaticChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorStaticChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorStaticChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorStaticChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorStaticChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorStaticChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorStaticChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorStaticChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorStaticChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorStaticChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorStaticChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetCodes returns the Codes field value +func (o *AuthenticatorStaticChallenge) GetCodes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Codes +} + +// GetCodesOk returns a tuple with the Codes field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallenge) GetCodesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Codes, true +} + +// SetCodes sets field value +func (o *AuthenticatorStaticChallenge) SetCodes(v []string) { + o.Codes = v +} + +func (o AuthenticatorStaticChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorStaticChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["codes"] = o.Codes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorStaticChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "codes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorStaticChallenge := _AuthenticatorStaticChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorStaticChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorStaticChallenge(varAuthenticatorStaticChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "codes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorStaticChallenge struct { + value *AuthenticatorStaticChallenge + isSet bool +} + +func (v NullableAuthenticatorStaticChallenge) Get() *AuthenticatorStaticChallenge { + return v.value +} + +func (v *NullableAuthenticatorStaticChallenge) Set(val *AuthenticatorStaticChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorStaticChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorStaticChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorStaticChallenge(val *AuthenticatorStaticChallenge) *NullableAuthenticatorStaticChallenge { + return &NullableAuthenticatorStaticChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorStaticChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorStaticChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_static_challenge_response_request.go b/packages/client-go/model_authenticator_static_challenge_response_request.go new file mode 100644 index 0000000000..0dfab2b100 --- /dev/null +++ b/packages/client-go/model_authenticator_static_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AuthenticatorStaticChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorStaticChallengeResponseRequest{} + +// AuthenticatorStaticChallengeResponseRequest Pseudo class for static response +type AuthenticatorStaticChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorStaticChallengeResponseRequest AuthenticatorStaticChallengeResponseRequest + +// NewAuthenticatorStaticChallengeResponseRequest instantiates a new AuthenticatorStaticChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorStaticChallengeResponseRequest() *AuthenticatorStaticChallengeResponseRequest { + this := AuthenticatorStaticChallengeResponseRequest{} + var component string = "ak-stage-authenticator-static" + this.Component = &component + return &this +} + +// NewAuthenticatorStaticChallengeResponseRequestWithDefaults instantiates a new AuthenticatorStaticChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorStaticChallengeResponseRequestWithDefaults() *AuthenticatorStaticChallengeResponseRequest { + this := AuthenticatorStaticChallengeResponseRequest{} + var component string = "ak-stage-authenticator-static" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorStaticChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorStaticChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorStaticChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o AuthenticatorStaticChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorStaticChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorStaticChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAuthenticatorStaticChallengeResponseRequest := _AuthenticatorStaticChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorStaticChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorStaticChallengeResponseRequest(varAuthenticatorStaticChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorStaticChallengeResponseRequest struct { + value *AuthenticatorStaticChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorStaticChallengeResponseRequest) Get() *AuthenticatorStaticChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorStaticChallengeResponseRequest) Set(val *AuthenticatorStaticChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorStaticChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorStaticChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorStaticChallengeResponseRequest(val *AuthenticatorStaticChallengeResponseRequest) *NullableAuthenticatorStaticChallengeResponseRequest { + return &NullableAuthenticatorStaticChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorStaticChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorStaticChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_static_stage.go b/packages/client-go/model_authenticator_static_stage.go new file mode 100644 index 0000000000..2f8f293d7f --- /dev/null +++ b/packages/client-go/model_authenticator_static_stage.go @@ -0,0 +1,505 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorStaticStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorStaticStage{} + +// AuthenticatorStaticStage AuthenticatorStaticStage Serializer +type AuthenticatorStaticStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + TokenCount *int32 `json:"token_count,omitempty"` + TokenLength *int32 `json:"token_length,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorStaticStage AuthenticatorStaticStage + +// NewAuthenticatorStaticStage instantiates a new AuthenticatorStaticStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorStaticStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *AuthenticatorStaticStage { + this := AuthenticatorStaticStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewAuthenticatorStaticStageWithDefaults instantiates a new AuthenticatorStaticStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorStaticStageWithDefaults() *AuthenticatorStaticStage { + this := AuthenticatorStaticStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorStaticStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorStaticStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorStaticStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorStaticStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorStaticStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorStaticStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorStaticStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorStaticStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorStaticStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorStaticStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorStaticStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorStaticStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorStaticStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorStaticStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorStaticStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorStaticStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorStaticStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorStaticStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorStaticStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorStaticStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorStaticStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorStaticStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorStaticStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetTokenCount returns the TokenCount field value if set, zero value otherwise. +func (o *AuthenticatorStaticStage) GetTokenCount() int32 { + if o == nil || IsNil(o.TokenCount) { + var ret int32 + return ret + } + return *o.TokenCount +} + +// GetTokenCountOk returns a tuple with the TokenCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetTokenCountOk() (*int32, bool) { + if o == nil || IsNil(o.TokenCount) { + return nil, false + } + return o.TokenCount, true +} + +// HasTokenCount returns a boolean if a field has been set. +func (o *AuthenticatorStaticStage) HasTokenCount() bool { + if o != nil && !IsNil(o.TokenCount) { + return true + } + + return false +} + +// SetTokenCount gets a reference to the given int32 and assigns it to the TokenCount field. +func (o *AuthenticatorStaticStage) SetTokenCount(v int32) { + o.TokenCount = &v +} + +// GetTokenLength returns the TokenLength field value if set, zero value otherwise. +func (o *AuthenticatorStaticStage) GetTokenLength() int32 { + if o == nil || IsNil(o.TokenLength) { + var ret int32 + return ret + } + return *o.TokenLength +} + +// GetTokenLengthOk returns a tuple with the TokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStage) GetTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.TokenLength) { + return nil, false + } + return o.TokenLength, true +} + +// HasTokenLength returns a boolean if a field has been set. +func (o *AuthenticatorStaticStage) HasTokenLength() bool { + if o != nil && !IsNil(o.TokenLength) { + return true + } + + return false +} + +// SetTokenLength gets a reference to the given int32 and assigns it to the TokenLength field. +func (o *AuthenticatorStaticStage) SetTokenLength(v int32) { + o.TokenLength = &v +} + +func (o AuthenticatorStaticStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorStaticStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.TokenCount) { + toSerialize["token_count"] = o.TokenCount + } + if !IsNil(o.TokenLength) { + toSerialize["token_length"] = o.TokenLength + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorStaticStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorStaticStage := _AuthenticatorStaticStage{} + + err = json.Unmarshal(data, &varAuthenticatorStaticStage) + + if err != nil { + return err + } + + *o = AuthenticatorStaticStage(varAuthenticatorStaticStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "token_count") + delete(additionalProperties, "token_length") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorStaticStage struct { + value *AuthenticatorStaticStage + isSet bool +} + +func (v NullableAuthenticatorStaticStage) Get() *AuthenticatorStaticStage { + return v.value +} + +func (v *NullableAuthenticatorStaticStage) Set(val *AuthenticatorStaticStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorStaticStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorStaticStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorStaticStage(val *AuthenticatorStaticStage) *NullableAuthenticatorStaticStage { + return &NullableAuthenticatorStaticStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorStaticStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorStaticStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_static_stage_request.go b/packages/client-go/model_authenticator_static_stage_request.go new file mode 100644 index 0000000000..c9f39b8c97 --- /dev/null +++ b/packages/client-go/model_authenticator_static_stage_request.go @@ -0,0 +1,327 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorStaticStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorStaticStageRequest{} + +// AuthenticatorStaticStageRequest AuthenticatorStaticStage Serializer +type AuthenticatorStaticStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + TokenCount *int32 `json:"token_count,omitempty"` + TokenLength *int32 `json:"token_length,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorStaticStageRequest AuthenticatorStaticStageRequest + +// NewAuthenticatorStaticStageRequest instantiates a new AuthenticatorStaticStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorStaticStageRequest(name string) *AuthenticatorStaticStageRequest { + this := AuthenticatorStaticStageRequest{} + this.Name = name + return &this +} + +// NewAuthenticatorStaticStageRequestWithDefaults instantiates a new AuthenticatorStaticStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorStaticStageRequestWithDefaults() *AuthenticatorStaticStageRequest { + this := AuthenticatorStaticStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorStaticStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorStaticStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorStaticStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorStaticStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorStaticStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorStaticStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorStaticStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorStaticStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorStaticStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorStaticStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorStaticStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetTokenCount returns the TokenCount field value if set, zero value otherwise. +func (o *AuthenticatorStaticStageRequest) GetTokenCount() int32 { + if o == nil || IsNil(o.TokenCount) { + var ret int32 + return ret + } + return *o.TokenCount +} + +// GetTokenCountOk returns a tuple with the TokenCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStageRequest) GetTokenCountOk() (*int32, bool) { + if o == nil || IsNil(o.TokenCount) { + return nil, false + } + return o.TokenCount, true +} + +// HasTokenCount returns a boolean if a field has been set. +func (o *AuthenticatorStaticStageRequest) HasTokenCount() bool { + if o != nil && !IsNil(o.TokenCount) { + return true + } + + return false +} + +// SetTokenCount gets a reference to the given int32 and assigns it to the TokenCount field. +func (o *AuthenticatorStaticStageRequest) SetTokenCount(v int32) { + o.TokenCount = &v +} + +// GetTokenLength returns the TokenLength field value if set, zero value otherwise. +func (o *AuthenticatorStaticStageRequest) GetTokenLength() int32 { + if o == nil || IsNil(o.TokenLength) { + var ret int32 + return ret + } + return *o.TokenLength +} + +// GetTokenLengthOk returns a tuple with the TokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorStaticStageRequest) GetTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.TokenLength) { + return nil, false + } + return o.TokenLength, true +} + +// HasTokenLength returns a boolean if a field has been set. +func (o *AuthenticatorStaticStageRequest) HasTokenLength() bool { + if o != nil && !IsNil(o.TokenLength) { + return true + } + + return false +} + +// SetTokenLength gets a reference to the given int32 and assigns it to the TokenLength field. +func (o *AuthenticatorStaticStageRequest) SetTokenLength(v int32) { + o.TokenLength = &v +} + +func (o AuthenticatorStaticStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorStaticStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.TokenCount) { + toSerialize["token_count"] = o.TokenCount + } + if !IsNil(o.TokenLength) { + toSerialize["token_length"] = o.TokenLength + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorStaticStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorStaticStageRequest := _AuthenticatorStaticStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorStaticStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorStaticStageRequest(varAuthenticatorStaticStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "token_count") + delete(additionalProperties, "token_length") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorStaticStageRequest struct { + value *AuthenticatorStaticStageRequest + isSet bool +} + +func (v NullableAuthenticatorStaticStageRequest) Get() *AuthenticatorStaticStageRequest { + return v.value +} + +func (v *NullableAuthenticatorStaticStageRequest) Set(val *AuthenticatorStaticStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorStaticStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorStaticStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorStaticStageRequest(val *AuthenticatorStaticStageRequest) *NullableAuthenticatorStaticStageRequest { + return &NullableAuthenticatorStaticStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorStaticStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorStaticStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_totp_challenge.go b/packages/client-go/model_authenticator_totp_challenge.go new file mode 100644 index 0000000000..4e52087606 --- /dev/null +++ b/packages/client-go/model_authenticator_totp_challenge.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorTOTPChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorTOTPChallenge{} + +// AuthenticatorTOTPChallenge TOTP Setup challenge +type AuthenticatorTOTPChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + ConfigUrl string `json:"config_url"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorTOTPChallenge AuthenticatorTOTPChallenge + +// NewAuthenticatorTOTPChallenge instantiates a new AuthenticatorTOTPChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorTOTPChallenge(pendingUser string, pendingUserAvatar string, configUrl string) *AuthenticatorTOTPChallenge { + this := AuthenticatorTOTPChallenge{} + var component string = "ak-stage-authenticator-totp" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.ConfigUrl = configUrl + return &this +} + +// NewAuthenticatorTOTPChallengeWithDefaults instantiates a new AuthenticatorTOTPChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorTOTPChallengeWithDefaults() *AuthenticatorTOTPChallenge { + this := AuthenticatorTOTPChallenge{} + var component string = "ak-stage-authenticator-totp" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorTOTPChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorTOTPChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorTOTPChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorTOTPChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorTOTPChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorTOTPChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorTOTPChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorTOTPChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorTOTPChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorTOTPChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorTOTPChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorTOTPChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorTOTPChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetConfigUrl returns the ConfigUrl field value +func (o *AuthenticatorTOTPChallenge) GetConfigUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ConfigUrl +} + +// GetConfigUrlOk returns a tuple with the ConfigUrl field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallenge) GetConfigUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConfigUrl, true +} + +// SetConfigUrl sets field value +func (o *AuthenticatorTOTPChallenge) SetConfigUrl(v string) { + o.ConfigUrl = v +} + +func (o AuthenticatorTOTPChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorTOTPChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["config_url"] = o.ConfigUrl + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorTOTPChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "config_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorTOTPChallenge := _AuthenticatorTOTPChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorTOTPChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorTOTPChallenge(varAuthenticatorTOTPChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "config_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorTOTPChallenge struct { + value *AuthenticatorTOTPChallenge + isSet bool +} + +func (v NullableAuthenticatorTOTPChallenge) Get() *AuthenticatorTOTPChallenge { + return v.value +} + +func (v *NullableAuthenticatorTOTPChallenge) Set(val *AuthenticatorTOTPChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorTOTPChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorTOTPChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorTOTPChallenge(val *AuthenticatorTOTPChallenge) *NullableAuthenticatorTOTPChallenge { + return &NullableAuthenticatorTOTPChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorTOTPChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorTOTPChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_totp_challenge_response_request.go b/packages/client-go/model_authenticator_totp_challenge_response_request.go new file mode 100644 index 0000000000..02881b9e53 --- /dev/null +++ b/packages/client-go/model_authenticator_totp_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorTOTPChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorTOTPChallengeResponseRequest{} + +// AuthenticatorTOTPChallengeResponseRequest TOTP Challenge response, device is set by get_response_instance +type AuthenticatorTOTPChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Code string `json:"code"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorTOTPChallengeResponseRequest AuthenticatorTOTPChallengeResponseRequest + +// NewAuthenticatorTOTPChallengeResponseRequest instantiates a new AuthenticatorTOTPChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorTOTPChallengeResponseRequest(code string) *AuthenticatorTOTPChallengeResponseRequest { + this := AuthenticatorTOTPChallengeResponseRequest{} + var component string = "ak-stage-authenticator-totp" + this.Component = &component + this.Code = code + return &this +} + +// NewAuthenticatorTOTPChallengeResponseRequestWithDefaults instantiates a new AuthenticatorTOTPChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorTOTPChallengeResponseRequestWithDefaults() *AuthenticatorTOTPChallengeResponseRequest { + this := AuthenticatorTOTPChallengeResponseRequest{} + var component string = "ak-stage-authenticator-totp" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorTOTPChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorTOTPChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorTOTPChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetCode returns the Code field value +func (o *AuthenticatorTOTPChallengeResponseRequest) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPChallengeResponseRequest) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *AuthenticatorTOTPChallengeResponseRequest) SetCode(v string) { + o.Code = v +} + +func (o AuthenticatorTOTPChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorTOTPChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["code"] = o.Code + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorTOTPChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorTOTPChallengeResponseRequest := _AuthenticatorTOTPChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorTOTPChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorTOTPChallengeResponseRequest(varAuthenticatorTOTPChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorTOTPChallengeResponseRequest struct { + value *AuthenticatorTOTPChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorTOTPChallengeResponseRequest) Get() *AuthenticatorTOTPChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorTOTPChallengeResponseRequest) Set(val *AuthenticatorTOTPChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorTOTPChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorTOTPChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorTOTPChallengeResponseRequest(val *AuthenticatorTOTPChallengeResponseRequest) *NullableAuthenticatorTOTPChallengeResponseRequest { + return &NullableAuthenticatorTOTPChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorTOTPChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorTOTPChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_totp_stage.go b/packages/client-go/model_authenticator_totp_stage.go new file mode 100644 index 0000000000..efb8d556ba --- /dev/null +++ b/packages/client-go/model_authenticator_totp_stage.go @@ -0,0 +1,460 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorTOTPStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorTOTPStage{} + +// AuthenticatorTOTPStage AuthenticatorTOTPStage Serializer +type AuthenticatorTOTPStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Digits DigitsEnum `json:"digits"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorTOTPStage AuthenticatorTOTPStage + +// NewAuthenticatorTOTPStage instantiates a new AuthenticatorTOTPStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorTOTPStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, digits DigitsEnum) *AuthenticatorTOTPStage { + this := AuthenticatorTOTPStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Digits = digits + return &this +} + +// NewAuthenticatorTOTPStageWithDefaults instantiates a new AuthenticatorTOTPStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorTOTPStageWithDefaults() *AuthenticatorTOTPStage { + this := AuthenticatorTOTPStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorTOTPStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorTOTPStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorTOTPStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorTOTPStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorTOTPStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorTOTPStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorTOTPStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorTOTPStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorTOTPStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorTOTPStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorTOTPStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorTOTPStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorTOTPStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorTOTPStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorTOTPStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorTOTPStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorTOTPStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorTOTPStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorTOTPStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorTOTPStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorTOTPStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorTOTPStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorTOTPStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetDigits returns the Digits field value +func (o *AuthenticatorTOTPStage) GetDigits() DigitsEnum { + if o == nil { + var ret DigitsEnum + return ret + } + + return o.Digits +} + +// GetDigitsOk returns a tuple with the Digits field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStage) GetDigitsOk() (*DigitsEnum, bool) { + if o == nil { + return nil, false + } + return &o.Digits, true +} + +// SetDigits sets field value +func (o *AuthenticatorTOTPStage) SetDigits(v DigitsEnum) { + o.Digits = v +} + +func (o AuthenticatorTOTPStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorTOTPStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["digits"] = o.Digits + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorTOTPStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "digits", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorTOTPStage := _AuthenticatorTOTPStage{} + + err = json.Unmarshal(data, &varAuthenticatorTOTPStage) + + if err != nil { + return err + } + + *o = AuthenticatorTOTPStage(varAuthenticatorTOTPStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "digits") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorTOTPStage struct { + value *AuthenticatorTOTPStage + isSet bool +} + +func (v NullableAuthenticatorTOTPStage) Get() *AuthenticatorTOTPStage { + return v.value +} + +func (v *NullableAuthenticatorTOTPStage) Set(val *AuthenticatorTOTPStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorTOTPStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorTOTPStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorTOTPStage(val *AuthenticatorTOTPStage) *NullableAuthenticatorTOTPStage { + return &NullableAuthenticatorTOTPStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorTOTPStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorTOTPStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_totp_stage_request.go b/packages/client-go/model_authenticator_totp_stage_request.go new file mode 100644 index 0000000000..c1e128d0cf --- /dev/null +++ b/packages/client-go/model_authenticator_totp_stage_request.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorTOTPStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorTOTPStageRequest{} + +// AuthenticatorTOTPStageRequest AuthenticatorTOTPStage Serializer +type AuthenticatorTOTPStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Digits DigitsEnum `json:"digits"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorTOTPStageRequest AuthenticatorTOTPStageRequest + +// NewAuthenticatorTOTPStageRequest instantiates a new AuthenticatorTOTPStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorTOTPStageRequest(name string, digits DigitsEnum) *AuthenticatorTOTPStageRequest { + this := AuthenticatorTOTPStageRequest{} + this.Name = name + this.Digits = digits + return &this +} + +// NewAuthenticatorTOTPStageRequestWithDefaults instantiates a new AuthenticatorTOTPStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorTOTPStageRequestWithDefaults() *AuthenticatorTOTPStageRequest { + this := AuthenticatorTOTPStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorTOTPStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorTOTPStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorTOTPStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorTOTPStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorTOTPStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorTOTPStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorTOTPStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorTOTPStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorTOTPStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorTOTPStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorTOTPStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetDigits returns the Digits field value +func (o *AuthenticatorTOTPStageRequest) GetDigits() DigitsEnum { + if o == nil { + var ret DigitsEnum + return ret + } + + return o.Digits +} + +// GetDigitsOk returns a tuple with the Digits field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorTOTPStageRequest) GetDigitsOk() (*DigitsEnum, bool) { + if o == nil { + return nil, false + } + return &o.Digits, true +} + +// SetDigits sets field value +func (o *AuthenticatorTOTPStageRequest) SetDigits(v DigitsEnum) { + o.Digits = v +} + +func (o AuthenticatorTOTPStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorTOTPStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + toSerialize["digits"] = o.Digits + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorTOTPStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "digits", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorTOTPStageRequest := _AuthenticatorTOTPStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorTOTPStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorTOTPStageRequest(varAuthenticatorTOTPStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "digits") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorTOTPStageRequest struct { + value *AuthenticatorTOTPStageRequest + isSet bool +} + +func (v NullableAuthenticatorTOTPStageRequest) Get() *AuthenticatorTOTPStageRequest { + return v.value +} + +func (v *NullableAuthenticatorTOTPStageRequest) Set(val *AuthenticatorTOTPStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorTOTPStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorTOTPStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorTOTPStageRequest(val *AuthenticatorTOTPStageRequest) *NullableAuthenticatorTOTPStageRequest { + return &NullableAuthenticatorTOTPStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorTOTPStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorTOTPStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_validate_stage.go b/packages/client-go/model_authenticator_validate_stage.go new file mode 100644 index 0000000000..934e9eae35 --- /dev/null +++ b/packages/client-go/model_authenticator_validate_stage.go @@ -0,0 +1,637 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorValidateStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorValidateStage{} + +// AuthenticatorValidateStage AuthenticatorValidateStage Serializer +type AuthenticatorValidateStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + NotConfiguredAction *NotConfiguredActionEnum `json:"not_configured_action,omitempty"` + // Device classes which can be used to authenticate + DeviceClasses []DeviceClassesEnum `json:"device_classes,omitempty"` + // Stages used to configure Authenticator when user doesn't have any compatible devices. After this configuration Stage passes, the user is not prompted again. + ConfigurationStages []string `json:"configuration_stages,omitempty"` + // If any of the user's device has been used within this threshold, this stage will be skipped + LastAuthThreshold *string `json:"last_auth_threshold,omitempty"` + // Enforce user verification for WebAuthn devices. + WebauthnUserVerification *UserVerificationEnum `json:"webauthn_user_verification,omitempty"` + WebauthnHints []WebAuthnHintEnum `json:"webauthn_hints,omitempty"` + WebauthnAllowedDeviceTypes []string `json:"webauthn_allowed_device_types,omitempty"` + WebauthnAllowedDeviceTypesObj []WebAuthnDeviceType `json:"webauthn_allowed_device_types_obj"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorValidateStage AuthenticatorValidateStage + +// NewAuthenticatorValidateStage instantiates a new AuthenticatorValidateStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorValidateStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, webauthnAllowedDeviceTypesObj []WebAuthnDeviceType) *AuthenticatorValidateStage { + this := AuthenticatorValidateStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.WebauthnAllowedDeviceTypesObj = webauthnAllowedDeviceTypesObj + return &this +} + +// NewAuthenticatorValidateStageWithDefaults instantiates a new AuthenticatorValidateStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorValidateStageWithDefaults() *AuthenticatorValidateStage { + this := AuthenticatorValidateStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorValidateStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorValidateStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorValidateStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorValidateStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorValidateStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorValidateStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorValidateStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorValidateStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorValidateStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorValidateStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorValidateStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorValidateStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorValidateStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorValidateStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetNotConfiguredAction returns the NotConfiguredAction field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetNotConfiguredAction() NotConfiguredActionEnum { + if o == nil || IsNil(o.NotConfiguredAction) { + var ret NotConfiguredActionEnum + return ret + } + return *o.NotConfiguredAction +} + +// GetNotConfiguredActionOk returns a tuple with the NotConfiguredAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetNotConfiguredActionOk() (*NotConfiguredActionEnum, bool) { + if o == nil || IsNil(o.NotConfiguredAction) { + return nil, false + } + return o.NotConfiguredAction, true +} + +// HasNotConfiguredAction returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasNotConfiguredAction() bool { + if o != nil && !IsNil(o.NotConfiguredAction) { + return true + } + + return false +} + +// SetNotConfiguredAction gets a reference to the given NotConfiguredActionEnum and assigns it to the NotConfiguredAction field. +func (o *AuthenticatorValidateStage) SetNotConfiguredAction(v NotConfiguredActionEnum) { + o.NotConfiguredAction = &v +} + +// GetDeviceClasses returns the DeviceClasses field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetDeviceClasses() []DeviceClassesEnum { + if o == nil || IsNil(o.DeviceClasses) { + var ret []DeviceClassesEnum + return ret + } + return o.DeviceClasses +} + +// GetDeviceClassesOk returns a tuple with the DeviceClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetDeviceClassesOk() ([]DeviceClassesEnum, bool) { + if o == nil || IsNil(o.DeviceClasses) { + return nil, false + } + return o.DeviceClasses, true +} + +// HasDeviceClasses returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasDeviceClasses() bool { + if o != nil && !IsNil(o.DeviceClasses) { + return true + } + + return false +} + +// SetDeviceClasses gets a reference to the given []DeviceClassesEnum and assigns it to the DeviceClasses field. +func (o *AuthenticatorValidateStage) SetDeviceClasses(v []DeviceClassesEnum) { + o.DeviceClasses = v +} + +// GetConfigurationStages returns the ConfigurationStages field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetConfigurationStages() []string { + if o == nil || IsNil(o.ConfigurationStages) { + var ret []string + return ret + } + return o.ConfigurationStages +} + +// GetConfigurationStagesOk returns a tuple with the ConfigurationStages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetConfigurationStagesOk() ([]string, bool) { + if o == nil || IsNil(o.ConfigurationStages) { + return nil, false + } + return o.ConfigurationStages, true +} + +// HasConfigurationStages returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasConfigurationStages() bool { + if o != nil && !IsNil(o.ConfigurationStages) { + return true + } + + return false +} + +// SetConfigurationStages gets a reference to the given []string and assigns it to the ConfigurationStages field. +func (o *AuthenticatorValidateStage) SetConfigurationStages(v []string) { + o.ConfigurationStages = v +} + +// GetLastAuthThreshold returns the LastAuthThreshold field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetLastAuthThreshold() string { + if o == nil || IsNil(o.LastAuthThreshold) { + var ret string + return ret + } + return *o.LastAuthThreshold +} + +// GetLastAuthThresholdOk returns a tuple with the LastAuthThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetLastAuthThresholdOk() (*string, bool) { + if o == nil || IsNil(o.LastAuthThreshold) { + return nil, false + } + return o.LastAuthThreshold, true +} + +// HasLastAuthThreshold returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasLastAuthThreshold() bool { + if o != nil && !IsNil(o.LastAuthThreshold) { + return true + } + + return false +} + +// SetLastAuthThreshold gets a reference to the given string and assigns it to the LastAuthThreshold field. +func (o *AuthenticatorValidateStage) SetLastAuthThreshold(v string) { + o.LastAuthThreshold = &v +} + +// GetWebauthnUserVerification returns the WebauthnUserVerification field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetWebauthnUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.WebauthnUserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.WebauthnUserVerification +} + +// GetWebauthnUserVerificationOk returns a tuple with the WebauthnUserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetWebauthnUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.WebauthnUserVerification) { + return nil, false + } + return o.WebauthnUserVerification, true +} + +// HasWebauthnUserVerification returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasWebauthnUserVerification() bool { + if o != nil && !IsNil(o.WebauthnUserVerification) { + return true + } + + return false +} + +// SetWebauthnUserVerification gets a reference to the given UserVerificationEnum and assigns it to the WebauthnUserVerification field. +func (o *AuthenticatorValidateStage) SetWebauthnUserVerification(v UserVerificationEnum) { + o.WebauthnUserVerification = &v +} + +// GetWebauthnHints returns the WebauthnHints field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetWebauthnHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.WebauthnHints) { + var ret []WebAuthnHintEnum + return ret + } + return o.WebauthnHints +} + +// GetWebauthnHintsOk returns a tuple with the WebauthnHints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetWebauthnHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.WebauthnHints) { + return nil, false + } + return o.WebauthnHints, true +} + +// HasWebauthnHints returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasWebauthnHints() bool { + if o != nil && !IsNil(o.WebauthnHints) { + return true + } + + return false +} + +// SetWebauthnHints gets a reference to the given []WebAuthnHintEnum and assigns it to the WebauthnHints field. +func (o *AuthenticatorValidateStage) SetWebauthnHints(v []WebAuthnHintEnum) { + o.WebauthnHints = v +} + +// GetWebauthnAllowedDeviceTypes returns the WebauthnAllowedDeviceTypes field value if set, zero value otherwise. +func (o *AuthenticatorValidateStage) GetWebauthnAllowedDeviceTypes() []string { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + var ret []string + return ret + } + return o.WebauthnAllowedDeviceTypes +} + +// GetWebauthnAllowedDeviceTypesOk returns a tuple with the WebauthnAllowedDeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetWebauthnAllowedDeviceTypesOk() ([]string, bool) { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + return nil, false + } + return o.WebauthnAllowedDeviceTypes, true +} + +// HasWebauthnAllowedDeviceTypes returns a boolean if a field has been set. +func (o *AuthenticatorValidateStage) HasWebauthnAllowedDeviceTypes() bool { + if o != nil && !IsNil(o.WebauthnAllowedDeviceTypes) { + return true + } + + return false +} + +// SetWebauthnAllowedDeviceTypes gets a reference to the given []string and assigns it to the WebauthnAllowedDeviceTypes field. +func (o *AuthenticatorValidateStage) SetWebauthnAllowedDeviceTypes(v []string) { + o.WebauthnAllowedDeviceTypes = v +} + +// GetWebauthnAllowedDeviceTypesObj returns the WebauthnAllowedDeviceTypesObj field value +func (o *AuthenticatorValidateStage) GetWebauthnAllowedDeviceTypesObj() []WebAuthnDeviceType { + if o == nil { + var ret []WebAuthnDeviceType + return ret + } + + return o.WebauthnAllowedDeviceTypesObj +} + +// GetWebauthnAllowedDeviceTypesObjOk returns a tuple with the WebauthnAllowedDeviceTypesObj field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStage) GetWebauthnAllowedDeviceTypesObjOk() ([]WebAuthnDeviceType, bool) { + if o == nil { + return nil, false + } + return o.WebauthnAllowedDeviceTypesObj, true +} + +// SetWebauthnAllowedDeviceTypesObj sets field value +func (o *AuthenticatorValidateStage) SetWebauthnAllowedDeviceTypesObj(v []WebAuthnDeviceType) { + o.WebauthnAllowedDeviceTypesObj = v +} + +func (o AuthenticatorValidateStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorValidateStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.NotConfiguredAction) { + toSerialize["not_configured_action"] = o.NotConfiguredAction + } + if !IsNil(o.DeviceClasses) { + toSerialize["device_classes"] = o.DeviceClasses + } + if !IsNil(o.ConfigurationStages) { + toSerialize["configuration_stages"] = o.ConfigurationStages + } + if !IsNil(o.LastAuthThreshold) { + toSerialize["last_auth_threshold"] = o.LastAuthThreshold + } + if !IsNil(o.WebauthnUserVerification) { + toSerialize["webauthn_user_verification"] = o.WebauthnUserVerification + } + if !IsNil(o.WebauthnHints) { + toSerialize["webauthn_hints"] = o.WebauthnHints + } + if !IsNil(o.WebauthnAllowedDeviceTypes) { + toSerialize["webauthn_allowed_device_types"] = o.WebauthnAllowedDeviceTypes + } + toSerialize["webauthn_allowed_device_types_obj"] = o.WebauthnAllowedDeviceTypesObj + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorValidateStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "webauthn_allowed_device_types_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorValidateStage := _AuthenticatorValidateStage{} + + err = json.Unmarshal(data, &varAuthenticatorValidateStage) + + if err != nil { + return err + } + + *o = AuthenticatorValidateStage(varAuthenticatorValidateStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "not_configured_action") + delete(additionalProperties, "device_classes") + delete(additionalProperties, "configuration_stages") + delete(additionalProperties, "last_auth_threshold") + delete(additionalProperties, "webauthn_user_verification") + delete(additionalProperties, "webauthn_hints") + delete(additionalProperties, "webauthn_allowed_device_types") + delete(additionalProperties, "webauthn_allowed_device_types_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorValidateStage struct { + value *AuthenticatorValidateStage + isSet bool +} + +func (v NullableAuthenticatorValidateStage) Get() *AuthenticatorValidateStage { + return v.value +} + +func (v *NullableAuthenticatorValidateStage) Set(val *AuthenticatorValidateStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorValidateStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorValidateStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorValidateStage(val *AuthenticatorValidateStage) *NullableAuthenticatorValidateStage { + return &NullableAuthenticatorValidateStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorValidateStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorValidateStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_validate_stage_request.go b/packages/client-go/model_authenticator_validate_stage_request.go new file mode 100644 index 0000000000..08fb2e1e2e --- /dev/null +++ b/packages/client-go/model_authenticator_validate_stage_request.go @@ -0,0 +1,430 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorValidateStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorValidateStageRequest{} + +// AuthenticatorValidateStageRequest AuthenticatorValidateStage Serializer +type AuthenticatorValidateStageRequest struct { + Name string `json:"name"` + NotConfiguredAction *NotConfiguredActionEnum `json:"not_configured_action,omitempty"` + // Device classes which can be used to authenticate + DeviceClasses []DeviceClassesEnum `json:"device_classes,omitempty"` + // Stages used to configure Authenticator when user doesn't have any compatible devices. After this configuration Stage passes, the user is not prompted again. + ConfigurationStages []string `json:"configuration_stages,omitempty"` + // If any of the user's device has been used within this threshold, this stage will be skipped + LastAuthThreshold *string `json:"last_auth_threshold,omitempty"` + // Enforce user verification for WebAuthn devices. + WebauthnUserVerification *UserVerificationEnum `json:"webauthn_user_verification,omitempty"` + WebauthnHints []WebAuthnHintEnum `json:"webauthn_hints,omitempty"` + WebauthnAllowedDeviceTypes []string `json:"webauthn_allowed_device_types,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorValidateStageRequest AuthenticatorValidateStageRequest + +// NewAuthenticatorValidateStageRequest instantiates a new AuthenticatorValidateStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorValidateStageRequest(name string) *AuthenticatorValidateStageRequest { + this := AuthenticatorValidateStageRequest{} + this.Name = name + return &this +} + +// NewAuthenticatorValidateStageRequestWithDefaults instantiates a new AuthenticatorValidateStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorValidateStageRequestWithDefaults() *AuthenticatorValidateStageRequest { + this := AuthenticatorValidateStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorValidateStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorValidateStageRequest) SetName(v string) { + o.Name = v +} + +// GetNotConfiguredAction returns the NotConfiguredAction field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetNotConfiguredAction() NotConfiguredActionEnum { + if o == nil || IsNil(o.NotConfiguredAction) { + var ret NotConfiguredActionEnum + return ret + } + return *o.NotConfiguredAction +} + +// GetNotConfiguredActionOk returns a tuple with the NotConfiguredAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetNotConfiguredActionOk() (*NotConfiguredActionEnum, bool) { + if o == nil || IsNil(o.NotConfiguredAction) { + return nil, false + } + return o.NotConfiguredAction, true +} + +// HasNotConfiguredAction returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasNotConfiguredAction() bool { + if o != nil && !IsNil(o.NotConfiguredAction) { + return true + } + + return false +} + +// SetNotConfiguredAction gets a reference to the given NotConfiguredActionEnum and assigns it to the NotConfiguredAction field. +func (o *AuthenticatorValidateStageRequest) SetNotConfiguredAction(v NotConfiguredActionEnum) { + o.NotConfiguredAction = &v +} + +// GetDeviceClasses returns the DeviceClasses field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetDeviceClasses() []DeviceClassesEnum { + if o == nil || IsNil(o.DeviceClasses) { + var ret []DeviceClassesEnum + return ret + } + return o.DeviceClasses +} + +// GetDeviceClassesOk returns a tuple with the DeviceClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetDeviceClassesOk() ([]DeviceClassesEnum, bool) { + if o == nil || IsNil(o.DeviceClasses) { + return nil, false + } + return o.DeviceClasses, true +} + +// HasDeviceClasses returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasDeviceClasses() bool { + if o != nil && !IsNil(o.DeviceClasses) { + return true + } + + return false +} + +// SetDeviceClasses gets a reference to the given []DeviceClassesEnum and assigns it to the DeviceClasses field. +func (o *AuthenticatorValidateStageRequest) SetDeviceClasses(v []DeviceClassesEnum) { + o.DeviceClasses = v +} + +// GetConfigurationStages returns the ConfigurationStages field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetConfigurationStages() []string { + if o == nil || IsNil(o.ConfigurationStages) { + var ret []string + return ret + } + return o.ConfigurationStages +} + +// GetConfigurationStagesOk returns a tuple with the ConfigurationStages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetConfigurationStagesOk() ([]string, bool) { + if o == nil || IsNil(o.ConfigurationStages) { + return nil, false + } + return o.ConfigurationStages, true +} + +// HasConfigurationStages returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasConfigurationStages() bool { + if o != nil && !IsNil(o.ConfigurationStages) { + return true + } + + return false +} + +// SetConfigurationStages gets a reference to the given []string and assigns it to the ConfigurationStages field. +func (o *AuthenticatorValidateStageRequest) SetConfigurationStages(v []string) { + o.ConfigurationStages = v +} + +// GetLastAuthThreshold returns the LastAuthThreshold field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetLastAuthThreshold() string { + if o == nil || IsNil(o.LastAuthThreshold) { + var ret string + return ret + } + return *o.LastAuthThreshold +} + +// GetLastAuthThresholdOk returns a tuple with the LastAuthThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetLastAuthThresholdOk() (*string, bool) { + if o == nil || IsNil(o.LastAuthThreshold) { + return nil, false + } + return o.LastAuthThreshold, true +} + +// HasLastAuthThreshold returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasLastAuthThreshold() bool { + if o != nil && !IsNil(o.LastAuthThreshold) { + return true + } + + return false +} + +// SetLastAuthThreshold gets a reference to the given string and assigns it to the LastAuthThreshold field. +func (o *AuthenticatorValidateStageRequest) SetLastAuthThreshold(v string) { + o.LastAuthThreshold = &v +} + +// GetWebauthnUserVerification returns the WebauthnUserVerification field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetWebauthnUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.WebauthnUserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.WebauthnUserVerification +} + +// GetWebauthnUserVerificationOk returns a tuple with the WebauthnUserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetWebauthnUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.WebauthnUserVerification) { + return nil, false + } + return o.WebauthnUserVerification, true +} + +// HasWebauthnUserVerification returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasWebauthnUserVerification() bool { + if o != nil && !IsNil(o.WebauthnUserVerification) { + return true + } + + return false +} + +// SetWebauthnUserVerification gets a reference to the given UserVerificationEnum and assigns it to the WebauthnUserVerification field. +func (o *AuthenticatorValidateStageRequest) SetWebauthnUserVerification(v UserVerificationEnum) { + o.WebauthnUserVerification = &v +} + +// GetWebauthnHints returns the WebauthnHints field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetWebauthnHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.WebauthnHints) { + var ret []WebAuthnHintEnum + return ret + } + return o.WebauthnHints +} + +// GetWebauthnHintsOk returns a tuple with the WebauthnHints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetWebauthnHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.WebauthnHints) { + return nil, false + } + return o.WebauthnHints, true +} + +// HasWebauthnHints returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasWebauthnHints() bool { + if o != nil && !IsNil(o.WebauthnHints) { + return true + } + + return false +} + +// SetWebauthnHints gets a reference to the given []WebAuthnHintEnum and assigns it to the WebauthnHints field. +func (o *AuthenticatorValidateStageRequest) SetWebauthnHints(v []WebAuthnHintEnum) { + o.WebauthnHints = v +} + +// GetWebauthnAllowedDeviceTypes returns the WebauthnAllowedDeviceTypes field value if set, zero value otherwise. +func (o *AuthenticatorValidateStageRequest) GetWebauthnAllowedDeviceTypes() []string { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + var ret []string + return ret + } + return o.WebauthnAllowedDeviceTypes +} + +// GetWebauthnAllowedDeviceTypesOk returns a tuple with the WebauthnAllowedDeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidateStageRequest) GetWebauthnAllowedDeviceTypesOk() ([]string, bool) { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + return nil, false + } + return o.WebauthnAllowedDeviceTypes, true +} + +// HasWebauthnAllowedDeviceTypes returns a boolean if a field has been set. +func (o *AuthenticatorValidateStageRequest) HasWebauthnAllowedDeviceTypes() bool { + if o != nil && !IsNil(o.WebauthnAllowedDeviceTypes) { + return true + } + + return false +} + +// SetWebauthnAllowedDeviceTypes gets a reference to the given []string and assigns it to the WebauthnAllowedDeviceTypes field. +func (o *AuthenticatorValidateStageRequest) SetWebauthnAllowedDeviceTypes(v []string) { + o.WebauthnAllowedDeviceTypes = v +} + +func (o AuthenticatorValidateStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorValidateStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.NotConfiguredAction) { + toSerialize["not_configured_action"] = o.NotConfiguredAction + } + if !IsNil(o.DeviceClasses) { + toSerialize["device_classes"] = o.DeviceClasses + } + if !IsNil(o.ConfigurationStages) { + toSerialize["configuration_stages"] = o.ConfigurationStages + } + if !IsNil(o.LastAuthThreshold) { + toSerialize["last_auth_threshold"] = o.LastAuthThreshold + } + if !IsNil(o.WebauthnUserVerification) { + toSerialize["webauthn_user_verification"] = o.WebauthnUserVerification + } + if !IsNil(o.WebauthnHints) { + toSerialize["webauthn_hints"] = o.WebauthnHints + } + if !IsNil(o.WebauthnAllowedDeviceTypes) { + toSerialize["webauthn_allowed_device_types"] = o.WebauthnAllowedDeviceTypes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorValidateStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorValidateStageRequest := _AuthenticatorValidateStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorValidateStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorValidateStageRequest(varAuthenticatorValidateStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "not_configured_action") + delete(additionalProperties, "device_classes") + delete(additionalProperties, "configuration_stages") + delete(additionalProperties, "last_auth_threshold") + delete(additionalProperties, "webauthn_user_verification") + delete(additionalProperties, "webauthn_hints") + delete(additionalProperties, "webauthn_allowed_device_types") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorValidateStageRequest struct { + value *AuthenticatorValidateStageRequest + isSet bool +} + +func (v NullableAuthenticatorValidateStageRequest) Get() *AuthenticatorValidateStageRequest { + return v.value +} + +func (v *NullableAuthenticatorValidateStageRequest) Set(val *AuthenticatorValidateStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorValidateStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorValidateStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorValidateStageRequest(val *AuthenticatorValidateStageRequest) *NullableAuthenticatorValidateStageRequest { + return &NullableAuthenticatorValidateStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorValidateStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorValidateStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_validation_challenge.go b/packages/client-go/model_authenticator_validation_challenge.go new file mode 100644 index 0000000000..a2d04fc3bb --- /dev/null +++ b/packages/client-go/model_authenticator_validation_challenge.go @@ -0,0 +1,369 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorValidationChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorValidationChallenge{} + +// AuthenticatorValidationChallenge Authenticator challenge +type AuthenticatorValidationChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + DeviceChallenges []DeviceChallenge `json:"device_challenges"` + ConfigurationStages []SelectableStage `json:"configuration_stages"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorValidationChallenge AuthenticatorValidationChallenge + +// NewAuthenticatorValidationChallenge instantiates a new AuthenticatorValidationChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorValidationChallenge(pendingUser string, pendingUserAvatar string, deviceChallenges []DeviceChallenge, configurationStages []SelectableStage) *AuthenticatorValidationChallenge { + this := AuthenticatorValidationChallenge{} + var component string = "ak-stage-authenticator-validate" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.DeviceChallenges = deviceChallenges + this.ConfigurationStages = configurationStages + return &this +} + +// NewAuthenticatorValidationChallengeWithDefaults instantiates a new AuthenticatorValidationChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorValidationChallengeWithDefaults() *AuthenticatorValidationChallenge { + this := AuthenticatorValidationChallenge{} + var component string = "ak-stage-authenticator-validate" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorValidationChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorValidationChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorValidationChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorValidationChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorValidationChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorValidationChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorValidationChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetDeviceChallenges returns the DeviceChallenges field value +func (o *AuthenticatorValidationChallenge) GetDeviceChallenges() []DeviceChallenge { + if o == nil { + var ret []DeviceChallenge + return ret + } + + return o.DeviceChallenges +} + +// GetDeviceChallengesOk returns a tuple with the DeviceChallenges field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetDeviceChallengesOk() ([]DeviceChallenge, bool) { + if o == nil { + return nil, false + } + return o.DeviceChallenges, true +} + +// SetDeviceChallenges sets field value +func (o *AuthenticatorValidationChallenge) SetDeviceChallenges(v []DeviceChallenge) { + o.DeviceChallenges = v +} + +// GetConfigurationStages returns the ConfigurationStages field value +func (o *AuthenticatorValidationChallenge) GetConfigurationStages() []SelectableStage { + if o == nil { + var ret []SelectableStage + return ret + } + + return o.ConfigurationStages +} + +// GetConfigurationStagesOk returns a tuple with the ConfigurationStages field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallenge) GetConfigurationStagesOk() ([]SelectableStage, bool) { + if o == nil { + return nil, false + } + return o.ConfigurationStages, true +} + +// SetConfigurationStages sets field value +func (o *AuthenticatorValidationChallenge) SetConfigurationStages(v []SelectableStage) { + o.ConfigurationStages = v +} + +func (o AuthenticatorValidationChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorValidationChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["device_challenges"] = o.DeviceChallenges + toSerialize["configuration_stages"] = o.ConfigurationStages + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorValidationChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "device_challenges", + "configuration_stages", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorValidationChallenge := _AuthenticatorValidationChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorValidationChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorValidationChallenge(varAuthenticatorValidationChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "device_challenges") + delete(additionalProperties, "configuration_stages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorValidationChallenge struct { + value *AuthenticatorValidationChallenge + isSet bool +} + +func (v NullableAuthenticatorValidationChallenge) Get() *AuthenticatorValidationChallenge { + return v.value +} + +func (v *NullableAuthenticatorValidationChallenge) Set(val *AuthenticatorValidationChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorValidationChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorValidationChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorValidationChallenge(val *AuthenticatorValidationChallenge) *NullableAuthenticatorValidationChallenge { + return &NullableAuthenticatorValidationChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorValidationChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorValidationChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_validation_challenge_response_request.go b/packages/client-go/model_authenticator_validation_challenge_response_request.go new file mode 100644 index 0000000000..7067c3dfe2 --- /dev/null +++ b/packages/client-go/model_authenticator_validation_challenge_response_request.go @@ -0,0 +1,343 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AuthenticatorValidationChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorValidationChallengeResponseRequest{} + +// AuthenticatorValidationChallengeResponseRequest Challenge used for Code-based and WebAuthn authenticators +type AuthenticatorValidationChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + SelectedChallenge *DeviceChallengeRequest `json:"selected_challenge,omitempty"` + SelectedStage *string `json:"selected_stage,omitempty"` + Code *string `json:"code,omitempty"` + Webauthn map[string]interface{} `json:"webauthn,omitempty"` + Duo *int32 `json:"duo,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorValidationChallengeResponseRequest AuthenticatorValidationChallengeResponseRequest + +// NewAuthenticatorValidationChallengeResponseRequest instantiates a new AuthenticatorValidationChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorValidationChallengeResponseRequest() *AuthenticatorValidationChallengeResponseRequest { + this := AuthenticatorValidationChallengeResponseRequest{} + var component string = "ak-stage-authenticator-validate" + this.Component = &component + return &this +} + +// NewAuthenticatorValidationChallengeResponseRequestWithDefaults instantiates a new AuthenticatorValidationChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorValidationChallengeResponseRequestWithDefaults() *AuthenticatorValidationChallengeResponseRequest { + this := AuthenticatorValidationChallengeResponseRequest{} + var component string = "ak-stage-authenticator-validate" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetSelectedChallenge returns the SelectedChallenge field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetSelectedChallenge() DeviceChallengeRequest { + if o == nil || IsNil(o.SelectedChallenge) { + var ret DeviceChallengeRequest + return ret + } + return *o.SelectedChallenge +} + +// GetSelectedChallengeOk returns a tuple with the SelectedChallenge field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetSelectedChallengeOk() (*DeviceChallengeRequest, bool) { + if o == nil || IsNil(o.SelectedChallenge) { + return nil, false + } + return o.SelectedChallenge, true +} + +// HasSelectedChallenge returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasSelectedChallenge() bool { + if o != nil && !IsNil(o.SelectedChallenge) { + return true + } + + return false +} + +// SetSelectedChallenge gets a reference to the given DeviceChallengeRequest and assigns it to the SelectedChallenge field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetSelectedChallenge(v DeviceChallengeRequest) { + o.SelectedChallenge = &v +} + +// GetSelectedStage returns the SelectedStage field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetSelectedStage() string { + if o == nil || IsNil(o.SelectedStage) { + var ret string + return ret + } + return *o.SelectedStage +} + +// GetSelectedStageOk returns a tuple with the SelectedStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetSelectedStageOk() (*string, bool) { + if o == nil || IsNil(o.SelectedStage) { + return nil, false + } + return o.SelectedStage, true +} + +// HasSelectedStage returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasSelectedStage() bool { + if o != nil && !IsNil(o.SelectedStage) { + return true + } + + return false +} + +// SetSelectedStage gets a reference to the given string and assigns it to the SelectedStage field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetSelectedStage(v string) { + o.SelectedStage = &v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetCode(v string) { + o.Code = &v +} + +// GetWebauthn returns the Webauthn field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetWebauthn() map[string]interface{} { + if o == nil || IsNil(o.Webauthn) { + var ret map[string]interface{} + return ret + } + return o.Webauthn +} + +// GetWebauthnOk returns a tuple with the Webauthn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetWebauthnOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Webauthn) { + return map[string]interface{}{}, false + } + return o.Webauthn, true +} + +// HasWebauthn returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasWebauthn() bool { + if o != nil && !IsNil(o.Webauthn) { + return true + } + + return false +} + +// SetWebauthn gets a reference to the given map[string]interface{} and assigns it to the Webauthn field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetWebauthn(v map[string]interface{}) { + o.Webauthn = v +} + +// GetDuo returns the Duo field value if set, zero value otherwise. +func (o *AuthenticatorValidationChallengeResponseRequest) GetDuo() int32 { + if o == nil || IsNil(o.Duo) { + var ret int32 + return ret + } + return *o.Duo +} + +// GetDuoOk returns a tuple with the Duo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) GetDuoOk() (*int32, bool) { + if o == nil || IsNil(o.Duo) { + return nil, false + } + return o.Duo, true +} + +// HasDuo returns a boolean if a field has been set. +func (o *AuthenticatorValidationChallengeResponseRequest) HasDuo() bool { + if o != nil && !IsNil(o.Duo) { + return true + } + + return false +} + +// SetDuo gets a reference to the given int32 and assigns it to the Duo field. +func (o *AuthenticatorValidationChallengeResponseRequest) SetDuo(v int32) { + o.Duo = &v +} + +func (o AuthenticatorValidationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorValidationChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.SelectedChallenge) { + toSerialize["selected_challenge"] = o.SelectedChallenge + } + if !IsNil(o.SelectedStage) { + toSerialize["selected_stage"] = o.SelectedStage + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + if !IsNil(o.Webauthn) { + toSerialize["webauthn"] = o.Webauthn + } + if !IsNil(o.Duo) { + toSerialize["duo"] = o.Duo + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorValidationChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAuthenticatorValidationChallengeResponseRequest := _AuthenticatorValidationChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorValidationChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorValidationChallengeResponseRequest(varAuthenticatorValidationChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "selected_challenge") + delete(additionalProperties, "selected_stage") + delete(additionalProperties, "code") + delete(additionalProperties, "webauthn") + delete(additionalProperties, "duo") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorValidationChallengeResponseRequest struct { + value *AuthenticatorValidationChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorValidationChallengeResponseRequest) Get() *AuthenticatorValidationChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorValidationChallengeResponseRequest) Set(val *AuthenticatorValidationChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorValidationChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorValidationChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorValidationChallengeResponseRequest(val *AuthenticatorValidationChallengeResponseRequest) *NullableAuthenticatorValidationChallengeResponseRequest { + return &NullableAuthenticatorValidationChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorValidationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorValidationChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_web_authn_challenge.go b/packages/client-go/model_authenticator_web_authn_challenge.go new file mode 100644 index 0000000000..a61c12d1c5 --- /dev/null +++ b/packages/client-go/model_authenticator_web_authn_challenge.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorWebAuthnChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorWebAuthnChallenge{} + +// AuthenticatorWebAuthnChallenge WebAuthn Challenge +type AuthenticatorWebAuthnChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + Registration map[string]interface{} `json:"registration"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorWebAuthnChallenge AuthenticatorWebAuthnChallenge + +// NewAuthenticatorWebAuthnChallenge instantiates a new AuthenticatorWebAuthnChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorWebAuthnChallenge(pendingUser string, pendingUserAvatar string, registration map[string]interface{}) *AuthenticatorWebAuthnChallenge { + this := AuthenticatorWebAuthnChallenge{} + var component string = "ak-stage-authenticator-webauthn" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.Registration = registration + return &this +} + +// NewAuthenticatorWebAuthnChallengeWithDefaults instantiates a new AuthenticatorWebAuthnChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorWebAuthnChallengeWithDefaults() *AuthenticatorWebAuthnChallenge { + this := AuthenticatorWebAuthnChallenge{} + var component string = "ak-stage-authenticator-webauthn" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AuthenticatorWebAuthnChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorWebAuthnChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AuthenticatorWebAuthnChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *AuthenticatorWebAuthnChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *AuthenticatorWebAuthnChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *AuthenticatorWebAuthnChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *AuthenticatorWebAuthnChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetRegistration returns the Registration field value +func (o *AuthenticatorWebAuthnChallenge) GetRegistration() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Registration +} + +// GetRegistrationOk returns a tuple with the Registration field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallenge) GetRegistrationOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Registration, true +} + +// SetRegistration sets field value +func (o *AuthenticatorWebAuthnChallenge) SetRegistration(v map[string]interface{}) { + o.Registration = v +} + +func (o AuthenticatorWebAuthnChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorWebAuthnChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["registration"] = o.Registration + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorWebAuthnChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "registration", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorWebAuthnChallenge := _AuthenticatorWebAuthnChallenge{} + + err = json.Unmarshal(data, &varAuthenticatorWebAuthnChallenge) + + if err != nil { + return err + } + + *o = AuthenticatorWebAuthnChallenge(varAuthenticatorWebAuthnChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "registration") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorWebAuthnChallenge struct { + value *AuthenticatorWebAuthnChallenge + isSet bool +} + +func (v NullableAuthenticatorWebAuthnChallenge) Get() *AuthenticatorWebAuthnChallenge { + return v.value +} + +func (v *NullableAuthenticatorWebAuthnChallenge) Set(val *AuthenticatorWebAuthnChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorWebAuthnChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorWebAuthnChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorWebAuthnChallenge(val *AuthenticatorWebAuthnChallenge) *NullableAuthenticatorWebAuthnChallenge { + return &NullableAuthenticatorWebAuthnChallenge{value: val, isSet: true} +} + +func (v NullableAuthenticatorWebAuthnChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorWebAuthnChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_web_authn_challenge_response_request.go b/packages/client-go/model_authenticator_web_authn_challenge_response_request.go new file mode 100644 index 0000000000..7def4f40a3 --- /dev/null +++ b/packages/client-go/model_authenticator_web_authn_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorWebAuthnChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorWebAuthnChallengeResponseRequest{} + +// AuthenticatorWebAuthnChallengeResponseRequest WebAuthn Challenge response +type AuthenticatorWebAuthnChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Response map[string]interface{} `json:"response"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorWebAuthnChallengeResponseRequest AuthenticatorWebAuthnChallengeResponseRequest + +// NewAuthenticatorWebAuthnChallengeResponseRequest instantiates a new AuthenticatorWebAuthnChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorWebAuthnChallengeResponseRequest(response map[string]interface{}) *AuthenticatorWebAuthnChallengeResponseRequest { + this := AuthenticatorWebAuthnChallengeResponseRequest{} + var component string = "ak-stage-authenticator-webauthn" + this.Component = &component + this.Response = response + return &this +} + +// NewAuthenticatorWebAuthnChallengeResponseRequestWithDefaults instantiates a new AuthenticatorWebAuthnChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorWebAuthnChallengeResponseRequestWithDefaults() *AuthenticatorWebAuthnChallengeResponseRequest { + this := AuthenticatorWebAuthnChallengeResponseRequest{} + var component string = "ak-stage-authenticator-webauthn" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AuthenticatorWebAuthnChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetResponse returns the Response field value +func (o *AuthenticatorWebAuthnChallengeResponseRequest) GetResponse() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Response +} + +// GetResponseOk returns a tuple with the Response field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnChallengeResponseRequest) GetResponseOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Response, true +} + +// SetResponse sets field value +func (o *AuthenticatorWebAuthnChallengeResponseRequest) SetResponse(v map[string]interface{}) { + o.Response = v +} + +func (o AuthenticatorWebAuthnChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorWebAuthnChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["response"] = o.Response + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorWebAuthnChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "response", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorWebAuthnChallengeResponseRequest := _AuthenticatorWebAuthnChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAuthenticatorWebAuthnChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AuthenticatorWebAuthnChallengeResponseRequest(varAuthenticatorWebAuthnChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorWebAuthnChallengeResponseRequest struct { + value *AuthenticatorWebAuthnChallengeResponseRequest + isSet bool +} + +func (v NullableAuthenticatorWebAuthnChallengeResponseRequest) Get() *AuthenticatorWebAuthnChallengeResponseRequest { + return v.value +} + +func (v *NullableAuthenticatorWebAuthnChallengeResponseRequest) Set(val *AuthenticatorWebAuthnChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorWebAuthnChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorWebAuthnChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorWebAuthnChallengeResponseRequest(val *AuthenticatorWebAuthnChallengeResponseRequest) *NullableAuthenticatorWebAuthnChallengeResponseRequest { + return &NullableAuthenticatorWebAuthnChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorWebAuthnChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorWebAuthnChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_web_authn_stage.go b/packages/client-go/model_authenticator_web_authn_stage.go new file mode 100644 index 0000000000..883c61f8c1 --- /dev/null +++ b/packages/client-go/model_authenticator_web_authn_stage.go @@ -0,0 +1,693 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorWebAuthnStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorWebAuthnStage{} + +// AuthenticatorWebAuthnStage AuthenticatorWebAuthnStage Serializer +type AuthenticatorWebAuthnStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + UserVerification *UserVerificationEnum `json:"user_verification,omitempty"` + AuthenticatorAttachment NullableAuthenticatorAttachmentEnum `json:"authenticator_attachment,omitempty"` + ResidentKeyRequirement *ResidentKeyRequirementEnum `json:"resident_key_requirement,omitempty"` + Hints []WebAuthnHintEnum `json:"hints,omitempty"` + DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` + DeviceTypeRestrictionsObj []WebAuthnDeviceType `json:"device_type_restrictions_obj"` + MaxAttempts *int32 `json:"max_attempts,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorWebAuthnStage AuthenticatorWebAuthnStage + +// NewAuthenticatorWebAuthnStage instantiates a new AuthenticatorWebAuthnStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorWebAuthnStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, deviceTypeRestrictionsObj []WebAuthnDeviceType) *AuthenticatorWebAuthnStage { + this := AuthenticatorWebAuthnStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.DeviceTypeRestrictionsObj = deviceTypeRestrictionsObj + return &this +} + +// NewAuthenticatorWebAuthnStageWithDefaults instantiates a new AuthenticatorWebAuthnStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorWebAuthnStageWithDefaults() *AuthenticatorWebAuthnStage { + this := AuthenticatorWebAuthnStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *AuthenticatorWebAuthnStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *AuthenticatorWebAuthnStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *AuthenticatorWebAuthnStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorWebAuthnStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *AuthenticatorWebAuthnStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *AuthenticatorWebAuthnStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *AuthenticatorWebAuthnStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *AuthenticatorWebAuthnStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *AuthenticatorWebAuthnStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *AuthenticatorWebAuthnStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *AuthenticatorWebAuthnStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *AuthenticatorWebAuthnStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *AuthenticatorWebAuthnStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *AuthenticatorWebAuthnStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorWebAuthnStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorWebAuthnStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorWebAuthnStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorWebAuthnStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorWebAuthnStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorWebAuthnStage) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUserVerification returns the UserVerification field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.UserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.UserVerification +} + +// GetUserVerificationOk returns a tuple with the UserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.UserVerification) { + return nil, false + } + return o.UserVerification, true +} + +// HasUserVerification returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasUserVerification() bool { + if o != nil && !IsNil(o.UserVerification) { + return true + } + + return false +} + +// SetUserVerification gets a reference to the given UserVerificationEnum and assigns it to the UserVerification field. +func (o *AuthenticatorWebAuthnStage) SetUserVerification(v UserVerificationEnum) { + o.UserVerification = &v +} + +// GetAuthenticatorAttachment returns the AuthenticatorAttachment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorWebAuthnStage) GetAuthenticatorAttachment() AuthenticatorAttachmentEnum { + if o == nil || IsNil(o.AuthenticatorAttachment.Get()) { + var ret AuthenticatorAttachmentEnum + return ret + } + return *o.AuthenticatorAttachment.Get() +} + +// GetAuthenticatorAttachmentOk returns a tuple with the AuthenticatorAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorWebAuthnStage) GetAuthenticatorAttachmentOk() (*AuthenticatorAttachmentEnum, bool) { + if o == nil { + return nil, false + } + return o.AuthenticatorAttachment.Get(), o.AuthenticatorAttachment.IsSet() +} + +// HasAuthenticatorAttachment returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasAuthenticatorAttachment() bool { + if o != nil && o.AuthenticatorAttachment.IsSet() { + return true + } + + return false +} + +// SetAuthenticatorAttachment gets a reference to the given NullableAuthenticatorAttachmentEnum and assigns it to the AuthenticatorAttachment field. +func (o *AuthenticatorWebAuthnStage) SetAuthenticatorAttachment(v AuthenticatorAttachmentEnum) { + o.AuthenticatorAttachment.Set(&v) +} + +// SetAuthenticatorAttachmentNil sets the value for AuthenticatorAttachment to be an explicit nil +func (o *AuthenticatorWebAuthnStage) SetAuthenticatorAttachmentNil() { + o.AuthenticatorAttachment.Set(nil) +} + +// UnsetAuthenticatorAttachment ensures that no value is present for AuthenticatorAttachment, not even an explicit nil +func (o *AuthenticatorWebAuthnStage) UnsetAuthenticatorAttachment() { + o.AuthenticatorAttachment.Unset() +} + +// GetResidentKeyRequirement returns the ResidentKeyRequirement field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetResidentKeyRequirement() ResidentKeyRequirementEnum { + if o == nil || IsNil(o.ResidentKeyRequirement) { + var ret ResidentKeyRequirementEnum + return ret + } + return *o.ResidentKeyRequirement +} + +// GetResidentKeyRequirementOk returns a tuple with the ResidentKeyRequirement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetResidentKeyRequirementOk() (*ResidentKeyRequirementEnum, bool) { + if o == nil || IsNil(o.ResidentKeyRequirement) { + return nil, false + } + return o.ResidentKeyRequirement, true +} + +// HasResidentKeyRequirement returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasResidentKeyRequirement() bool { + if o != nil && !IsNil(o.ResidentKeyRequirement) { + return true + } + + return false +} + +// SetResidentKeyRequirement gets a reference to the given ResidentKeyRequirementEnum and assigns it to the ResidentKeyRequirement field. +func (o *AuthenticatorWebAuthnStage) SetResidentKeyRequirement(v ResidentKeyRequirementEnum) { + o.ResidentKeyRequirement = &v +} + +// GetHints returns the Hints field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.Hints) { + var ret []WebAuthnHintEnum + return ret + } + return o.Hints +} + +// GetHintsOk returns a tuple with the Hints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.Hints) { + return nil, false + } + return o.Hints, true +} + +// HasHints returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasHints() bool { + if o != nil && !IsNil(o.Hints) { + return true + } + + return false +} + +// SetHints gets a reference to the given []WebAuthnHintEnum and assigns it to the Hints field. +func (o *AuthenticatorWebAuthnStage) SetHints(v []WebAuthnHintEnum) { + o.Hints = v +} + +// GetDeviceTypeRestrictions returns the DeviceTypeRestrictions field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetDeviceTypeRestrictions() []string { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + var ret []string + return ret + } + return o.DeviceTypeRestrictions +} + +// GetDeviceTypeRestrictionsOk returns a tuple with the DeviceTypeRestrictions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetDeviceTypeRestrictionsOk() ([]string, bool) { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + return nil, false + } + return o.DeviceTypeRestrictions, true +} + +// HasDeviceTypeRestrictions returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasDeviceTypeRestrictions() bool { + if o != nil && !IsNil(o.DeviceTypeRestrictions) { + return true + } + + return false +} + +// SetDeviceTypeRestrictions gets a reference to the given []string and assigns it to the DeviceTypeRestrictions field. +func (o *AuthenticatorWebAuthnStage) SetDeviceTypeRestrictions(v []string) { + o.DeviceTypeRestrictions = v +} + +// GetDeviceTypeRestrictionsObj returns the DeviceTypeRestrictionsObj field value +func (o *AuthenticatorWebAuthnStage) GetDeviceTypeRestrictionsObj() []WebAuthnDeviceType { + if o == nil { + var ret []WebAuthnDeviceType + return ret + } + + return o.DeviceTypeRestrictionsObj +} + +// GetDeviceTypeRestrictionsObjOk returns a tuple with the DeviceTypeRestrictionsObj field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetDeviceTypeRestrictionsObjOk() ([]WebAuthnDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceTypeRestrictionsObj, true +} + +// SetDeviceTypeRestrictionsObj sets field value +func (o *AuthenticatorWebAuthnStage) SetDeviceTypeRestrictionsObj(v []WebAuthnDeviceType) { + o.DeviceTypeRestrictionsObj = v +} + +// GetMaxAttempts returns the MaxAttempts field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStage) GetMaxAttempts() int32 { + if o == nil || IsNil(o.MaxAttempts) { + var ret int32 + return ret + } + return *o.MaxAttempts +} + +// GetMaxAttemptsOk returns a tuple with the MaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStage) GetMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxAttempts) { + return nil, false + } + return o.MaxAttempts, true +} + +// HasMaxAttempts returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStage) HasMaxAttempts() bool { + if o != nil && !IsNil(o.MaxAttempts) { + return true + } + + return false +} + +// SetMaxAttempts gets a reference to the given int32 and assigns it to the MaxAttempts field. +func (o *AuthenticatorWebAuthnStage) SetMaxAttempts(v int32) { + o.MaxAttempts = &v +} + +func (o AuthenticatorWebAuthnStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorWebAuthnStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UserVerification) { + toSerialize["user_verification"] = o.UserVerification + } + if o.AuthenticatorAttachment.IsSet() { + toSerialize["authenticator_attachment"] = o.AuthenticatorAttachment.Get() + } + if !IsNil(o.ResidentKeyRequirement) { + toSerialize["resident_key_requirement"] = o.ResidentKeyRequirement + } + if !IsNil(o.Hints) { + toSerialize["hints"] = o.Hints + } + if !IsNil(o.DeviceTypeRestrictions) { + toSerialize["device_type_restrictions"] = o.DeviceTypeRestrictions + } + toSerialize["device_type_restrictions_obj"] = o.DeviceTypeRestrictionsObj + if !IsNil(o.MaxAttempts) { + toSerialize["max_attempts"] = o.MaxAttempts + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorWebAuthnStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "device_type_restrictions_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorWebAuthnStage := _AuthenticatorWebAuthnStage{} + + err = json.Unmarshal(data, &varAuthenticatorWebAuthnStage) + + if err != nil { + return err + } + + *o = AuthenticatorWebAuthnStage(varAuthenticatorWebAuthnStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "user_verification") + delete(additionalProperties, "authenticator_attachment") + delete(additionalProperties, "resident_key_requirement") + delete(additionalProperties, "hints") + delete(additionalProperties, "device_type_restrictions") + delete(additionalProperties, "device_type_restrictions_obj") + delete(additionalProperties, "max_attempts") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorWebAuthnStage struct { + value *AuthenticatorWebAuthnStage + isSet bool +} + +func (v NullableAuthenticatorWebAuthnStage) Get() *AuthenticatorWebAuthnStage { + return v.value +} + +func (v *NullableAuthenticatorWebAuthnStage) Set(val *AuthenticatorWebAuthnStage) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorWebAuthnStage) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorWebAuthnStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorWebAuthnStage(val *AuthenticatorWebAuthnStage) *NullableAuthenticatorWebAuthnStage { + return &NullableAuthenticatorWebAuthnStage{value: val, isSet: true} +} + +func (v NullableAuthenticatorWebAuthnStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorWebAuthnStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authenticator_web_authn_stage_request.go b/packages/client-go/model_authenticator_web_authn_stage_request.go new file mode 100644 index 0000000000..7c564897d4 --- /dev/null +++ b/packages/client-go/model_authenticator_web_authn_stage_request.go @@ -0,0 +1,486 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AuthenticatorWebAuthnStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticatorWebAuthnStageRequest{} + +// AuthenticatorWebAuthnStageRequest AuthenticatorWebAuthnStage Serializer +type AuthenticatorWebAuthnStageRequest struct { + Name string `json:"name"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + UserVerification *UserVerificationEnum `json:"user_verification,omitempty"` + AuthenticatorAttachment NullableAuthenticatorAttachmentEnum `json:"authenticator_attachment,omitempty"` + ResidentKeyRequirement *ResidentKeyRequirementEnum `json:"resident_key_requirement,omitempty"` + Hints []WebAuthnHintEnum `json:"hints,omitempty"` + DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` + MaxAttempts *int32 `json:"max_attempts,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AuthenticatorWebAuthnStageRequest AuthenticatorWebAuthnStageRequest + +// NewAuthenticatorWebAuthnStageRequest instantiates a new AuthenticatorWebAuthnStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticatorWebAuthnStageRequest(name string) *AuthenticatorWebAuthnStageRequest { + this := AuthenticatorWebAuthnStageRequest{} + this.Name = name + return &this +} + +// NewAuthenticatorWebAuthnStageRequestWithDefaults instantiates a new AuthenticatorWebAuthnStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticatorWebAuthnStageRequestWithDefaults() *AuthenticatorWebAuthnStageRequest { + this := AuthenticatorWebAuthnStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *AuthenticatorWebAuthnStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AuthenticatorWebAuthnStageRequest) SetName(v string) { + o.Name = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorWebAuthnStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorWebAuthnStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *AuthenticatorWebAuthnStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *AuthenticatorWebAuthnStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *AuthenticatorWebAuthnStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *AuthenticatorWebAuthnStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUserVerification returns the UserVerification field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.UserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.UserVerification +} + +// GetUserVerificationOk returns a tuple with the UserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.UserVerification) { + return nil, false + } + return o.UserVerification, true +} + +// HasUserVerification returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasUserVerification() bool { + if o != nil && !IsNil(o.UserVerification) { + return true + } + + return false +} + +// SetUserVerification gets a reference to the given UserVerificationEnum and assigns it to the UserVerification field. +func (o *AuthenticatorWebAuthnStageRequest) SetUserVerification(v UserVerificationEnum) { + o.UserVerification = &v +} + +// GetAuthenticatorAttachment returns the AuthenticatorAttachment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *AuthenticatorWebAuthnStageRequest) GetAuthenticatorAttachment() AuthenticatorAttachmentEnum { + if o == nil || IsNil(o.AuthenticatorAttachment.Get()) { + var ret AuthenticatorAttachmentEnum + return ret + } + return *o.AuthenticatorAttachment.Get() +} + +// GetAuthenticatorAttachmentOk returns a tuple with the AuthenticatorAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *AuthenticatorWebAuthnStageRequest) GetAuthenticatorAttachmentOk() (*AuthenticatorAttachmentEnum, bool) { + if o == nil { + return nil, false + } + return o.AuthenticatorAttachment.Get(), o.AuthenticatorAttachment.IsSet() +} + +// HasAuthenticatorAttachment returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasAuthenticatorAttachment() bool { + if o != nil && o.AuthenticatorAttachment.IsSet() { + return true + } + + return false +} + +// SetAuthenticatorAttachment gets a reference to the given NullableAuthenticatorAttachmentEnum and assigns it to the AuthenticatorAttachment field. +func (o *AuthenticatorWebAuthnStageRequest) SetAuthenticatorAttachment(v AuthenticatorAttachmentEnum) { + o.AuthenticatorAttachment.Set(&v) +} + +// SetAuthenticatorAttachmentNil sets the value for AuthenticatorAttachment to be an explicit nil +func (o *AuthenticatorWebAuthnStageRequest) SetAuthenticatorAttachmentNil() { + o.AuthenticatorAttachment.Set(nil) +} + +// UnsetAuthenticatorAttachment ensures that no value is present for AuthenticatorAttachment, not even an explicit nil +func (o *AuthenticatorWebAuthnStageRequest) UnsetAuthenticatorAttachment() { + o.AuthenticatorAttachment.Unset() +} + +// GetResidentKeyRequirement returns the ResidentKeyRequirement field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetResidentKeyRequirement() ResidentKeyRequirementEnum { + if o == nil || IsNil(o.ResidentKeyRequirement) { + var ret ResidentKeyRequirementEnum + return ret + } + return *o.ResidentKeyRequirement +} + +// GetResidentKeyRequirementOk returns a tuple with the ResidentKeyRequirement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetResidentKeyRequirementOk() (*ResidentKeyRequirementEnum, bool) { + if o == nil || IsNil(o.ResidentKeyRequirement) { + return nil, false + } + return o.ResidentKeyRequirement, true +} + +// HasResidentKeyRequirement returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasResidentKeyRequirement() bool { + if o != nil && !IsNil(o.ResidentKeyRequirement) { + return true + } + + return false +} + +// SetResidentKeyRequirement gets a reference to the given ResidentKeyRequirementEnum and assigns it to the ResidentKeyRequirement field. +func (o *AuthenticatorWebAuthnStageRequest) SetResidentKeyRequirement(v ResidentKeyRequirementEnum) { + o.ResidentKeyRequirement = &v +} + +// GetHints returns the Hints field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.Hints) { + var ret []WebAuthnHintEnum + return ret + } + return o.Hints +} + +// GetHintsOk returns a tuple with the Hints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.Hints) { + return nil, false + } + return o.Hints, true +} + +// HasHints returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasHints() bool { + if o != nil && !IsNil(o.Hints) { + return true + } + + return false +} + +// SetHints gets a reference to the given []WebAuthnHintEnum and assigns it to the Hints field. +func (o *AuthenticatorWebAuthnStageRequest) SetHints(v []WebAuthnHintEnum) { + o.Hints = v +} + +// GetDeviceTypeRestrictions returns the DeviceTypeRestrictions field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetDeviceTypeRestrictions() []string { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + var ret []string + return ret + } + return o.DeviceTypeRestrictions +} + +// GetDeviceTypeRestrictionsOk returns a tuple with the DeviceTypeRestrictions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetDeviceTypeRestrictionsOk() ([]string, bool) { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + return nil, false + } + return o.DeviceTypeRestrictions, true +} + +// HasDeviceTypeRestrictions returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasDeviceTypeRestrictions() bool { + if o != nil && !IsNil(o.DeviceTypeRestrictions) { + return true + } + + return false +} + +// SetDeviceTypeRestrictions gets a reference to the given []string and assigns it to the DeviceTypeRestrictions field. +func (o *AuthenticatorWebAuthnStageRequest) SetDeviceTypeRestrictions(v []string) { + o.DeviceTypeRestrictions = v +} + +// GetMaxAttempts returns the MaxAttempts field value if set, zero value otherwise. +func (o *AuthenticatorWebAuthnStageRequest) GetMaxAttempts() int32 { + if o == nil || IsNil(o.MaxAttempts) { + var ret int32 + return ret + } + return *o.MaxAttempts +} + +// GetMaxAttemptsOk returns a tuple with the MaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AuthenticatorWebAuthnStageRequest) GetMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxAttempts) { + return nil, false + } + return o.MaxAttempts, true +} + +// HasMaxAttempts returns a boolean if a field has been set. +func (o *AuthenticatorWebAuthnStageRequest) HasMaxAttempts() bool { + if o != nil && !IsNil(o.MaxAttempts) { + return true + } + + return false +} + +// SetMaxAttempts gets a reference to the given int32 and assigns it to the MaxAttempts field. +func (o *AuthenticatorWebAuthnStageRequest) SetMaxAttempts(v int32) { + o.MaxAttempts = &v +} + +func (o AuthenticatorWebAuthnStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticatorWebAuthnStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UserVerification) { + toSerialize["user_verification"] = o.UserVerification + } + if o.AuthenticatorAttachment.IsSet() { + toSerialize["authenticator_attachment"] = o.AuthenticatorAttachment.Get() + } + if !IsNil(o.ResidentKeyRequirement) { + toSerialize["resident_key_requirement"] = o.ResidentKeyRequirement + } + if !IsNil(o.Hints) { + toSerialize["hints"] = o.Hints + } + if !IsNil(o.DeviceTypeRestrictions) { + toSerialize["device_type_restrictions"] = o.DeviceTypeRestrictions + } + if !IsNil(o.MaxAttempts) { + toSerialize["max_attempts"] = o.MaxAttempts + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AuthenticatorWebAuthnStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticatorWebAuthnStageRequest := _AuthenticatorWebAuthnStageRequest{} + + err = json.Unmarshal(data, &varAuthenticatorWebAuthnStageRequest) + + if err != nil { + return err + } + + *o = AuthenticatorWebAuthnStageRequest(varAuthenticatorWebAuthnStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "user_verification") + delete(additionalProperties, "authenticator_attachment") + delete(additionalProperties, "resident_key_requirement") + delete(additionalProperties, "hints") + delete(additionalProperties, "device_type_restrictions") + delete(additionalProperties, "max_attempts") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAuthenticatorWebAuthnStageRequest struct { + value *AuthenticatorWebAuthnStageRequest + isSet bool +} + +func (v NullableAuthenticatorWebAuthnStageRequest) Get() *AuthenticatorWebAuthnStageRequest { + return v.value +} + +func (v *NullableAuthenticatorWebAuthnStageRequest) Set(val *AuthenticatorWebAuthnStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticatorWebAuthnStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticatorWebAuthnStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticatorWebAuthnStageRequest(val *AuthenticatorWebAuthnStageRequest) *NullableAuthenticatorWebAuthnStageRequest { + return &NullableAuthenticatorWebAuthnStageRequest{value: val, isSet: true} +} + +func (v NullableAuthenticatorWebAuthnStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticatorWebAuthnStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_authorization_code_auth_method_enum.go b/packages/client-go/model_authorization_code_auth_method_enum.go new file mode 100644 index 0000000000..6b4ab0a19c --- /dev/null +++ b/packages/client-go/model_authorization_code_auth_method_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// AuthorizationCodeAuthMethodEnum the model 'AuthorizationCodeAuthMethodEnum' +type AuthorizationCodeAuthMethodEnum string + +// List of AuthorizationCodeAuthMethodEnum +const ( + AUTHORIZATIONCODEAUTHMETHODENUM_BASIC_AUTH AuthorizationCodeAuthMethodEnum = "basic_auth" + AUTHORIZATIONCODEAUTHMETHODENUM_POST_BODY AuthorizationCodeAuthMethodEnum = "post_body" +) + +// All allowed values of AuthorizationCodeAuthMethodEnum enum +var AllowedAuthorizationCodeAuthMethodEnumEnumValues = []AuthorizationCodeAuthMethodEnum{ + "basic_auth", + "post_body", +} + +func (v *AuthorizationCodeAuthMethodEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := AuthorizationCodeAuthMethodEnum(value) + for _, existing := range AllowedAuthorizationCodeAuthMethodEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid AuthorizationCodeAuthMethodEnum", value) +} + +// NewAuthorizationCodeAuthMethodEnumFromValue returns a pointer to a valid AuthorizationCodeAuthMethodEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewAuthorizationCodeAuthMethodEnumFromValue(v string) (*AuthorizationCodeAuthMethodEnum, error) { + ev := AuthorizationCodeAuthMethodEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for AuthorizationCodeAuthMethodEnum: valid values are %v", v, AllowedAuthorizationCodeAuthMethodEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v AuthorizationCodeAuthMethodEnum) IsValid() bool { + for _, existing := range AllowedAuthorizationCodeAuthMethodEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to AuthorizationCodeAuthMethodEnum value +func (v AuthorizationCodeAuthMethodEnum) Ptr() *AuthorizationCodeAuthMethodEnum { + return &v +} + +type NullableAuthorizationCodeAuthMethodEnum struct { + value *AuthorizationCodeAuthMethodEnum + isSet bool +} + +func (v NullableAuthorizationCodeAuthMethodEnum) Get() *AuthorizationCodeAuthMethodEnum { + return v.value +} + +func (v *NullableAuthorizationCodeAuthMethodEnum) Set(val *AuthorizationCodeAuthMethodEnum) { + v.value = val + v.isSet = true +} + +func (v NullableAuthorizationCodeAuthMethodEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthorizationCodeAuthMethodEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthorizationCodeAuthMethodEnum(val *AuthorizationCodeAuthMethodEnum) *NullableAuthorizationCodeAuthMethodEnum { + return &NullableAuthorizationCodeAuthMethodEnum{value: val, isSet: true} +} + +func (v NullableAuthorizationCodeAuthMethodEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthorizationCodeAuthMethodEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_auto_submit_challenge_response_request.go b/packages/client-go/model_auto_submit_challenge_response_request.go new file mode 100644 index 0000000000..519eb4d409 --- /dev/null +++ b/packages/client-go/model_auto_submit_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the AutoSubmitChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutoSubmitChallengeResponseRequest{} + +// AutoSubmitChallengeResponseRequest Pseudo class for autosubmit response +type AutoSubmitChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AutoSubmitChallengeResponseRequest AutoSubmitChallengeResponseRequest + +// NewAutoSubmitChallengeResponseRequest instantiates a new AutoSubmitChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutoSubmitChallengeResponseRequest() *AutoSubmitChallengeResponseRequest { + this := AutoSubmitChallengeResponseRequest{} + var component string = "ak-stage-autosubmit" + this.Component = &component + return &this +} + +// NewAutoSubmitChallengeResponseRequestWithDefaults instantiates a new AutoSubmitChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutoSubmitChallengeResponseRequestWithDefaults() *AutoSubmitChallengeResponseRequest { + this := AutoSubmitChallengeResponseRequest{} + var component string = "ak-stage-autosubmit" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AutoSubmitChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutoSubmitChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AutoSubmitChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AutoSubmitChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o AutoSubmitChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AutoSubmitChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AutoSubmitChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varAutoSubmitChallengeResponseRequest := _AutoSubmitChallengeResponseRequest{} + + err = json.Unmarshal(data, &varAutoSubmitChallengeResponseRequest) + + if err != nil { + return err + } + + *o = AutoSubmitChallengeResponseRequest(varAutoSubmitChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAutoSubmitChallengeResponseRequest struct { + value *AutoSubmitChallengeResponseRequest + isSet bool +} + +func (v NullableAutoSubmitChallengeResponseRequest) Get() *AutoSubmitChallengeResponseRequest { + return v.value +} + +func (v *NullableAutoSubmitChallengeResponseRequest) Set(val *AutoSubmitChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableAutoSubmitChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableAutoSubmitChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAutoSubmitChallengeResponseRequest(val *AutoSubmitChallengeResponseRequest) *NullableAutoSubmitChallengeResponseRequest { + return &NullableAutoSubmitChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableAutoSubmitChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAutoSubmitChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_autosubmit_challenge.go b/packages/client-go/model_autosubmit_challenge.go new file mode 100644 index 0000000000..3b96c28f7b --- /dev/null +++ b/packages/client-go/model_autosubmit_challenge.go @@ -0,0 +1,348 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the AutosubmitChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AutosubmitChallenge{} + +// AutosubmitChallenge Autosubmit challenge used to send and navigate a POST request +type AutosubmitChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Url string `json:"url"` + Attrs map[string]string `json:"attrs"` + Title *string `json:"title,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _AutosubmitChallenge AutosubmitChallenge + +// NewAutosubmitChallenge instantiates a new AutosubmitChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAutosubmitChallenge(url string, attrs map[string]string) *AutosubmitChallenge { + this := AutosubmitChallenge{} + var component string = "ak-stage-autosubmit" + this.Component = &component + this.Url = url + this.Attrs = attrs + return &this +} + +// NewAutosubmitChallengeWithDefaults instantiates a new AutosubmitChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAutosubmitChallengeWithDefaults() *AutosubmitChallenge { + this := AutosubmitChallenge{} + var component string = "ak-stage-autosubmit" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *AutosubmitChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *AutosubmitChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *AutosubmitChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *AutosubmitChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *AutosubmitChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *AutosubmitChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *AutosubmitChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *AutosubmitChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *AutosubmitChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetUrl returns the Url field value +func (o *AutosubmitChallenge) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *AutosubmitChallenge) SetUrl(v string) { + o.Url = v +} + +// GetAttrs returns the Attrs field value +func (o *AutosubmitChallenge) GetAttrs() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Attrs +} + +// GetAttrsOk returns a tuple with the Attrs field value +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetAttrsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Attrs, true +} + +// SetAttrs sets field value +func (o *AutosubmitChallenge) SetAttrs(v map[string]string) { + o.Attrs = v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *AutosubmitChallenge) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AutosubmitChallenge) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *AutosubmitChallenge) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *AutosubmitChallenge) SetTitle(v string) { + o.Title = &v +} + +func (o AutosubmitChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AutosubmitChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["url"] = o.Url + toSerialize["attrs"] = o.Attrs + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *AutosubmitChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + "attrs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAutosubmitChallenge := _AutosubmitChallenge{} + + err = json.Unmarshal(data, &varAutosubmitChallenge) + + if err != nil { + return err + } + + *o = AutosubmitChallenge(varAutosubmitChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "url") + delete(additionalProperties, "attrs") + delete(additionalProperties, "title") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableAutosubmitChallenge struct { + value *AutosubmitChallenge + isSet bool +} + +func (v NullableAutosubmitChallenge) Get() *AutosubmitChallenge { + return v.value +} + +func (v *NullableAutosubmitChallenge) Set(val *AutosubmitChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableAutosubmitChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableAutosubmitChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAutosubmitChallenge(val *AutosubmitChallenge) *NullableAutosubmitChallenge { + return &NullableAutosubmitChallenge{value: val, isSet: true} +} + +func (v NullableAutosubmitChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAutosubmitChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_backends_enum.go b/packages/client-go/model_backends_enum.go new file mode 100644 index 0000000000..5cc966ec8f --- /dev/null +++ b/packages/client-go/model_backends_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// BackendsEnum the model 'BackendsEnum' +type BackendsEnum string + +// List of BackendsEnum +const ( + BACKENDSENUM_AUTHENTIK_CORE_AUTH_INBUILT_BACKEND BackendsEnum = "authentik.core.auth.InbuiltBackend" + BACKENDSENUM_AUTHENTIK_CORE_AUTH_TOKEN_BACKEND BackendsEnum = "authentik.core.auth.TokenBackend" + BACKENDSENUM_AUTHENTIK_SOURCES_LDAP_AUTH_LDAP_BACKEND BackendsEnum = "authentik.sources.ldap.auth.LDAPBackend" + BACKENDSENUM_AUTHENTIK_SOURCES_KERBEROS_AUTH_KERBEROS_BACKEND BackendsEnum = "authentik.sources.kerberos.auth.KerberosBackend" +) + +// All allowed values of BackendsEnum enum +var AllowedBackendsEnumEnumValues = []BackendsEnum{ + "authentik.core.auth.InbuiltBackend", + "authentik.core.auth.TokenBackend", + "authentik.sources.ldap.auth.LDAPBackend", + "authentik.sources.kerberos.auth.KerberosBackend", +} + +func (v *BackendsEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BackendsEnum(value) + for _, existing := range AllowedBackendsEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BackendsEnum", value) +} + +// NewBackendsEnumFromValue returns a pointer to a valid BackendsEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBackendsEnumFromValue(v string) (*BackendsEnum, error) { + ev := BackendsEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BackendsEnum: valid values are %v", v, AllowedBackendsEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BackendsEnum) IsValid() bool { + for _, existing := range AllowedBackendsEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BackendsEnum value +func (v BackendsEnum) Ptr() *BackendsEnum { + return &v +} + +type NullableBackendsEnum struct { + value *BackendsEnum + isSet bool +} + +func (v NullableBackendsEnum) Get() *BackendsEnum { + return v.value +} + +func (v *NullableBackendsEnum) Set(val *BackendsEnum) { + v.value = val + v.isSet = true +} + +func (v NullableBackendsEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableBackendsEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackendsEnum(val *BackendsEnum) *NullableBackendsEnum { + return &NullableBackendsEnum{value: val, isSet: true} +} + +func (v NullableBackendsEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackendsEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_binding_type_enum.go b/packages/client-go/model_binding_type_enum.go new file mode 100644 index 0000000000..cd503391b4 --- /dev/null +++ b/packages/client-go/model_binding_type_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// BindingTypeEnum the model 'BindingTypeEnum' +type BindingTypeEnum string + +// List of BindingTypeEnum +const ( + BINDINGTYPEENUM_REDIRECT BindingTypeEnum = "REDIRECT" + BINDINGTYPEENUM_POST BindingTypeEnum = "POST" + BINDINGTYPEENUM_POST_AUTO BindingTypeEnum = "POST_AUTO" +) + +// All allowed values of BindingTypeEnum enum +var AllowedBindingTypeEnumEnumValues = []BindingTypeEnum{ + "REDIRECT", + "POST", + "POST_AUTO", +} + +func (v *BindingTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BindingTypeEnum(value) + for _, existing := range AllowedBindingTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BindingTypeEnum", value) +} + +// NewBindingTypeEnumFromValue returns a pointer to a valid BindingTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBindingTypeEnumFromValue(v string) (*BindingTypeEnum, error) { + ev := BindingTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BindingTypeEnum: valid values are %v", v, AllowedBindingTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BindingTypeEnum) IsValid() bool { + for _, existing := range AllowedBindingTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BindingTypeEnum value +func (v BindingTypeEnum) Ptr() *BindingTypeEnum { + return &v +} + +type NullableBindingTypeEnum struct { + value *BindingTypeEnum + isSet bool +} + +func (v NullableBindingTypeEnum) Get() *BindingTypeEnum { + return v.value +} + +func (v *NullableBindingTypeEnum) Set(val *BindingTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableBindingTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableBindingTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBindingTypeEnum(val *BindingTypeEnum) *NullableBindingTypeEnum { + return &NullableBindingTypeEnum{value: val, isSet: true} +} + +func (v NullableBindingTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBindingTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_blueprint_file.go b/packages/client-go/model_blueprint_file.go new file mode 100644 index 0000000000..3db2ec20ea --- /dev/null +++ b/packages/client-go/model_blueprint_file.go @@ -0,0 +1,255 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the BlueprintFile type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlueprintFile{} + +// BlueprintFile struct for BlueprintFile +type BlueprintFile struct { + Path string `json:"path"` + LastM time.Time `json:"last_m"` + Hash string `json:"hash"` + Meta Metadata `json:"meta"` + AdditionalProperties map[string]interface{} +} + +type _BlueprintFile BlueprintFile + +// NewBlueprintFile instantiates a new BlueprintFile object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlueprintFile(path string, lastM time.Time, hash string, meta Metadata) *BlueprintFile { + this := BlueprintFile{} + this.Path = path + this.LastM = lastM + this.Hash = hash + this.Meta = meta + return &this +} + +// NewBlueprintFileWithDefaults instantiates a new BlueprintFile object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlueprintFileWithDefaults() *BlueprintFile { + this := BlueprintFile{} + return &this +} + +// GetPath returns the Path field value +func (o *BlueprintFile) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *BlueprintFile) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *BlueprintFile) SetPath(v string) { + o.Path = v +} + +// GetLastM returns the LastM field value +func (o *BlueprintFile) GetLastM() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastM +} + +// GetLastMOk returns a tuple with the LastM field value +// and a boolean to check if the value has been set. +func (o *BlueprintFile) GetLastMOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastM, true +} + +// SetLastM sets field value +func (o *BlueprintFile) SetLastM(v time.Time) { + o.LastM = v +} + +// GetHash returns the Hash field value +func (o *BlueprintFile) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *BlueprintFile) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *BlueprintFile) SetHash(v string) { + o.Hash = v +} + +// GetMeta returns the Meta field value +func (o *BlueprintFile) GetMeta() Metadata { + if o == nil { + var ret Metadata + return ret + } + + return o.Meta +} + +// GetMetaOk returns a tuple with the Meta field value +// and a boolean to check if the value has been set. +func (o *BlueprintFile) GetMetaOk() (*Metadata, bool) { + if o == nil { + return nil, false + } + return &o.Meta, true +} + +// SetMeta sets field value +func (o *BlueprintFile) SetMeta(v Metadata) { + o.Meta = v +} + +func (o BlueprintFile) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlueprintFile) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["path"] = o.Path + toSerialize["last_m"] = o.LastM + toSerialize["hash"] = o.Hash + toSerialize["meta"] = o.Meta + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BlueprintFile) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "path", + "last_m", + "hash", + "meta", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBlueprintFile := _BlueprintFile{} + + err = json.Unmarshal(data, &varBlueprintFile) + + if err != nil { + return err + } + + *o = BlueprintFile(varBlueprintFile) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "path") + delete(additionalProperties, "last_m") + delete(additionalProperties, "hash") + delete(additionalProperties, "meta") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBlueprintFile struct { + value *BlueprintFile + isSet bool +} + +func (v NullableBlueprintFile) Get() *BlueprintFile { + return v.value +} + +func (v *NullableBlueprintFile) Set(val *BlueprintFile) { + v.value = val + v.isSet = true +} + +func (v NullableBlueprintFile) IsSet() bool { + return v.isSet +} + +func (v *NullableBlueprintFile) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlueprintFile(val *BlueprintFile) *NullableBlueprintFile { + return &NullableBlueprintFile{value: val, isSet: true} +} + +func (v NullableBlueprintFile) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlueprintFile) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_blueprint_instance.go b/packages/client-go/model_blueprint_instance.go new file mode 100644 index 0000000000..836da4725d --- /dev/null +++ b/packages/client-go/model_blueprint_instance.go @@ -0,0 +1,494 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the BlueprintInstance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlueprintInstance{} + +// BlueprintInstance Info about a single blueprint instance file +type BlueprintInstance struct { + Pk string `json:"pk"` + Name string `json:"name"` + Path *string `json:"path,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + LastApplied time.Time `json:"last_applied"` + LastAppliedHash string `json:"last_applied_hash"` + Status BlueprintInstanceStatusEnum `json:"status"` + Enabled *bool `json:"enabled,omitempty"` + ManagedModels []string `json:"managed_models"` + Metadata map[string]interface{} `json:"metadata"` + Content *string `json:"content,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BlueprintInstance BlueprintInstance + +// NewBlueprintInstance instantiates a new BlueprintInstance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlueprintInstance(pk string, name string, lastApplied time.Time, lastAppliedHash string, status BlueprintInstanceStatusEnum, managedModels []string, metadata map[string]interface{}) *BlueprintInstance { + this := BlueprintInstance{} + this.Pk = pk + this.Name = name + var path string = "" + this.Path = &path + this.LastApplied = lastApplied + this.LastAppliedHash = lastAppliedHash + this.Status = status + this.ManagedModels = managedModels + this.Metadata = metadata + return &this +} + +// NewBlueprintInstanceWithDefaults instantiates a new BlueprintInstance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlueprintInstanceWithDefaults() *BlueprintInstance { + this := BlueprintInstance{} + var path string = "" + this.Path = &path + return &this +} + +// GetPk returns the Pk field value +func (o *BlueprintInstance) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *BlueprintInstance) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *BlueprintInstance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *BlueprintInstance) SetName(v string) { + o.Name = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *BlueprintInstance) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *BlueprintInstance) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *BlueprintInstance) SetPath(v string) { + o.Path = &v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *BlueprintInstance) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *BlueprintInstance) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *BlueprintInstance) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetLastApplied returns the LastApplied field value +func (o *BlueprintInstance) GetLastApplied() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastApplied +} + +// GetLastAppliedOk returns a tuple with the LastApplied field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetLastAppliedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastApplied, true +} + +// SetLastApplied sets field value +func (o *BlueprintInstance) SetLastApplied(v time.Time) { + o.LastApplied = v +} + +// GetLastAppliedHash returns the LastAppliedHash field value +func (o *BlueprintInstance) GetLastAppliedHash() string { + if o == nil { + var ret string + return ret + } + + return o.LastAppliedHash +} + +// GetLastAppliedHashOk returns a tuple with the LastAppliedHash field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetLastAppliedHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LastAppliedHash, true +} + +// SetLastAppliedHash sets field value +func (o *BlueprintInstance) SetLastAppliedHash(v string) { + o.LastAppliedHash = v +} + +// GetStatus returns the Status field value +func (o *BlueprintInstance) GetStatus() BlueprintInstanceStatusEnum { + if o == nil { + var ret BlueprintInstanceStatusEnum + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetStatusOk() (*BlueprintInstanceStatusEnum, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *BlueprintInstance) SetStatus(v BlueprintInstanceStatusEnum) { + o.Status = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *BlueprintInstance) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *BlueprintInstance) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *BlueprintInstance) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetManagedModels returns the ManagedModels field value +func (o *BlueprintInstance) GetManagedModels() []string { + if o == nil { + var ret []string + return ret + } + + return o.ManagedModels +} + +// GetManagedModelsOk returns a tuple with the ManagedModels field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetManagedModelsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ManagedModels, true +} + +// SetManagedModels sets field value +func (o *BlueprintInstance) SetManagedModels(v []string) { + o.ManagedModels = v +} + +// GetMetadata returns the Metadata field value +func (o *BlueprintInstance) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// SetMetadata sets field value +func (o *BlueprintInstance) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *BlueprintInstance) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstance) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *BlueprintInstance) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *BlueprintInstance) SetContent(v string) { + o.Content = &v +} + +func (o BlueprintInstance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlueprintInstance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + toSerialize["last_applied"] = o.LastApplied + toSerialize["last_applied_hash"] = o.LastAppliedHash + toSerialize["status"] = o.Status + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["managed_models"] = o.ManagedModels + toSerialize["metadata"] = o.Metadata + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BlueprintInstance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "last_applied", + "last_applied_hash", + "status", + "managed_models", + "metadata", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBlueprintInstance := _BlueprintInstance{} + + err = json.Unmarshal(data, &varBlueprintInstance) + + if err != nil { + return err + } + + *o = BlueprintInstance(varBlueprintInstance) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "path") + delete(additionalProperties, "context") + delete(additionalProperties, "last_applied") + delete(additionalProperties, "last_applied_hash") + delete(additionalProperties, "status") + delete(additionalProperties, "enabled") + delete(additionalProperties, "managed_models") + delete(additionalProperties, "metadata") + delete(additionalProperties, "content") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBlueprintInstance struct { + value *BlueprintInstance + isSet bool +} + +func (v NullableBlueprintInstance) Get() *BlueprintInstance { + return v.value +} + +func (v *NullableBlueprintInstance) Set(val *BlueprintInstance) { + v.value = val + v.isSet = true +} + +func (v NullableBlueprintInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableBlueprintInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlueprintInstance(val *BlueprintInstance) *NullableBlueprintInstance { + return &NullableBlueprintInstance{value: val, isSet: true} +} + +func (v NullableBlueprintInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlueprintInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_blueprint_instance_request.go b/packages/client-go/model_blueprint_instance_request.go new file mode 100644 index 0000000000..90d68de809 --- /dev/null +++ b/packages/client-go/model_blueprint_instance_request.go @@ -0,0 +1,319 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the BlueprintInstanceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BlueprintInstanceRequest{} + +// BlueprintInstanceRequest Info about a single blueprint instance file +type BlueprintInstanceRequest struct { + Name string `json:"name"` + Path *string `json:"path,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Content *string `json:"content,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BlueprintInstanceRequest BlueprintInstanceRequest + +// NewBlueprintInstanceRequest instantiates a new BlueprintInstanceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBlueprintInstanceRequest(name string) *BlueprintInstanceRequest { + this := BlueprintInstanceRequest{} + this.Name = name + var path string = "" + this.Path = &path + return &this +} + +// NewBlueprintInstanceRequestWithDefaults instantiates a new BlueprintInstanceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBlueprintInstanceRequestWithDefaults() *BlueprintInstanceRequest { + this := BlueprintInstanceRequest{} + var path string = "" + this.Path = &path + return &this +} + +// GetName returns the Name field value +func (o *BlueprintInstanceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BlueprintInstanceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *BlueprintInstanceRequest) SetName(v string) { + o.Name = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *BlueprintInstanceRequest) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstanceRequest) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *BlueprintInstanceRequest) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *BlueprintInstanceRequest) SetPath(v string) { + o.Path = &v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *BlueprintInstanceRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstanceRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *BlueprintInstanceRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *BlueprintInstanceRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *BlueprintInstanceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstanceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *BlueprintInstanceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *BlueprintInstanceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *BlueprintInstanceRequest) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BlueprintInstanceRequest) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *BlueprintInstanceRequest) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *BlueprintInstanceRequest) SetContent(v string) { + o.Content = &v +} + +func (o BlueprintInstanceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BlueprintInstanceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BlueprintInstanceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBlueprintInstanceRequest := _BlueprintInstanceRequest{} + + err = json.Unmarshal(data, &varBlueprintInstanceRequest) + + if err != nil { + return err + } + + *o = BlueprintInstanceRequest(varBlueprintInstanceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "path") + delete(additionalProperties, "context") + delete(additionalProperties, "enabled") + delete(additionalProperties, "content") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBlueprintInstanceRequest struct { + value *BlueprintInstanceRequest + isSet bool +} + +func (v NullableBlueprintInstanceRequest) Get() *BlueprintInstanceRequest { + return v.value +} + +func (v *NullableBlueprintInstanceRequest) Set(val *BlueprintInstanceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableBlueprintInstanceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableBlueprintInstanceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlueprintInstanceRequest(val *BlueprintInstanceRequest) *NullableBlueprintInstanceRequest { + return &NullableBlueprintInstanceRequest{value: val, isSet: true} +} + +func (v NullableBlueprintInstanceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlueprintInstanceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_blueprint_instance_status_enum.go b/packages/client-go/model_blueprint_instance_status_enum.go new file mode 100644 index 0000000000..ea05a74d3d --- /dev/null +++ b/packages/client-go/model_blueprint_instance_status_enum.go @@ -0,0 +1,117 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// BlueprintInstanceStatusEnum the model 'BlueprintInstanceStatusEnum' +type BlueprintInstanceStatusEnum string + +// List of BlueprintInstanceStatusEnum +const ( + BLUEPRINTINSTANCESTATUSENUM_SUCCESSFUL BlueprintInstanceStatusEnum = "successful" + BLUEPRINTINSTANCESTATUSENUM_WARNING BlueprintInstanceStatusEnum = "warning" + BLUEPRINTINSTANCESTATUSENUM_ERROR BlueprintInstanceStatusEnum = "error" + BLUEPRINTINSTANCESTATUSENUM_ORPHANED BlueprintInstanceStatusEnum = "orphaned" + BLUEPRINTINSTANCESTATUSENUM_UNKNOWN BlueprintInstanceStatusEnum = "unknown" +) + +// All allowed values of BlueprintInstanceStatusEnum enum +var AllowedBlueprintInstanceStatusEnumEnumValues = []BlueprintInstanceStatusEnum{ + "successful", + "warning", + "error", + "orphaned", + "unknown", +} + +func (v *BlueprintInstanceStatusEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := BlueprintInstanceStatusEnum(value) + for _, existing := range AllowedBlueprintInstanceStatusEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid BlueprintInstanceStatusEnum", value) +} + +// NewBlueprintInstanceStatusEnumFromValue returns a pointer to a valid BlueprintInstanceStatusEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewBlueprintInstanceStatusEnumFromValue(v string) (*BlueprintInstanceStatusEnum, error) { + ev := BlueprintInstanceStatusEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for BlueprintInstanceStatusEnum: valid values are %v", v, AllowedBlueprintInstanceStatusEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v BlueprintInstanceStatusEnum) IsValid() bool { + for _, existing := range AllowedBlueprintInstanceStatusEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to BlueprintInstanceStatusEnum value +func (v BlueprintInstanceStatusEnum) Ptr() *BlueprintInstanceStatusEnum { + return &v +} + +type NullableBlueprintInstanceStatusEnum struct { + value *BlueprintInstanceStatusEnum + isSet bool +} + +func (v NullableBlueprintInstanceStatusEnum) Get() *BlueprintInstanceStatusEnum { + return v.value +} + +func (v *NullableBlueprintInstanceStatusEnum) Set(val *BlueprintInstanceStatusEnum) { + v.value = val + v.isSet = true +} + +func (v NullableBlueprintInstanceStatusEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableBlueprintInstanceStatusEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBlueprintInstanceStatusEnum(val *BlueprintInstanceStatusEnum) *NullableBlueprintInstanceStatusEnum { + return &NullableBlueprintInstanceStatusEnum{value: val, isSet: true} +} + +func (v NullableBlueprintInstanceStatusEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBlueprintInstanceStatusEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_brand.go b/packages/client-go/model_brand.go new file mode 100644 index 0000000000..a8611d7842 --- /dev/null +++ b/packages/client-go/model_brand.go @@ -0,0 +1,880 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Brand type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Brand{} + +// Brand Brand Serializer +type Brand struct { + BrandUuid string `json:"brand_uuid"` + // Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + Domain string `json:"domain"` + Default *bool `json:"default,omitempty"` + BrandingTitle *string `json:"branding_title,omitempty"` + BrandingLogo *string `json:"branding_logo,omitempty"` + BrandingFavicon *string `json:"branding_favicon,omitempty"` + BrandingCustomCss *string `json:"branding_custom_css,omitempty"` + BrandingDefaultFlowBackground *string `json:"branding_default_flow_background,omitempty"` + FlowAuthentication NullableString `json:"flow_authentication,omitempty"` + FlowInvalidation NullableString `json:"flow_invalidation,omitempty"` + FlowRecovery NullableString `json:"flow_recovery,omitempty"` + FlowUnenrollment NullableString `json:"flow_unenrollment,omitempty"` + FlowUserSettings NullableString `json:"flow_user_settings,omitempty"` + FlowDeviceCode NullableString `json:"flow_device_code,omitempty"` + // When set, external users will be redirected to this application after authenticating. + DefaultApplication NullableString `json:"default_application,omitempty"` + // Web Certificate used by the authentik Core webserver. + WebCertificate NullableString `json:"web_certificate,omitempty"` + // Certificates used for client authentication. + ClientCertificates []string `json:"client_certificates,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Brand Brand + +// NewBrand instantiates a new Brand object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBrand(brandUuid string, domain string) *Brand { + this := Brand{} + this.BrandUuid = brandUuid + this.Domain = domain + return &this +} + +// NewBrandWithDefaults instantiates a new Brand object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBrandWithDefaults() *Brand { + this := Brand{} + return &this +} + +// GetBrandUuid returns the BrandUuid field value +func (o *Brand) GetBrandUuid() string { + if o == nil { + var ret string + return ret + } + + return o.BrandUuid +} + +// GetBrandUuidOk returns a tuple with the BrandUuid field value +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandUuid, true +} + +// SetBrandUuid sets field value +func (o *Brand) SetBrandUuid(v string) { + o.BrandUuid = v +} + +// GetDomain returns the Domain field value +func (o *Brand) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *Brand) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +func (o *Brand) SetDomain(v string) { + o.Domain = v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *Brand) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *Brand) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *Brand) SetDefault(v bool) { + o.Default = &v +} + +// GetBrandingTitle returns the BrandingTitle field value if set, zero value otherwise. +func (o *Brand) GetBrandingTitle() string { + if o == nil || IsNil(o.BrandingTitle) { + var ret string + return ret + } + return *o.BrandingTitle +} + +// GetBrandingTitleOk returns a tuple with the BrandingTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandingTitleOk() (*string, bool) { + if o == nil || IsNil(o.BrandingTitle) { + return nil, false + } + return o.BrandingTitle, true +} + +// HasBrandingTitle returns a boolean if a field has been set. +func (o *Brand) HasBrandingTitle() bool { + if o != nil && !IsNil(o.BrandingTitle) { + return true + } + + return false +} + +// SetBrandingTitle gets a reference to the given string and assigns it to the BrandingTitle field. +func (o *Brand) SetBrandingTitle(v string) { + o.BrandingTitle = &v +} + +// GetBrandingLogo returns the BrandingLogo field value if set, zero value otherwise. +func (o *Brand) GetBrandingLogo() string { + if o == nil || IsNil(o.BrandingLogo) { + var ret string + return ret + } + return *o.BrandingLogo +} + +// GetBrandingLogoOk returns a tuple with the BrandingLogo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandingLogoOk() (*string, bool) { + if o == nil || IsNil(o.BrandingLogo) { + return nil, false + } + return o.BrandingLogo, true +} + +// HasBrandingLogo returns a boolean if a field has been set. +func (o *Brand) HasBrandingLogo() bool { + if o != nil && !IsNil(o.BrandingLogo) { + return true + } + + return false +} + +// SetBrandingLogo gets a reference to the given string and assigns it to the BrandingLogo field. +func (o *Brand) SetBrandingLogo(v string) { + o.BrandingLogo = &v +} + +// GetBrandingFavicon returns the BrandingFavicon field value if set, zero value otherwise. +func (o *Brand) GetBrandingFavicon() string { + if o == nil || IsNil(o.BrandingFavicon) { + var ret string + return ret + } + return *o.BrandingFavicon +} + +// GetBrandingFaviconOk returns a tuple with the BrandingFavicon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandingFaviconOk() (*string, bool) { + if o == nil || IsNil(o.BrandingFavicon) { + return nil, false + } + return o.BrandingFavicon, true +} + +// HasBrandingFavicon returns a boolean if a field has been set. +func (o *Brand) HasBrandingFavicon() bool { + if o != nil && !IsNil(o.BrandingFavicon) { + return true + } + + return false +} + +// SetBrandingFavicon gets a reference to the given string and assigns it to the BrandingFavicon field. +func (o *Brand) SetBrandingFavicon(v string) { + o.BrandingFavicon = &v +} + +// GetBrandingCustomCss returns the BrandingCustomCss field value if set, zero value otherwise. +func (o *Brand) GetBrandingCustomCss() string { + if o == nil || IsNil(o.BrandingCustomCss) { + var ret string + return ret + } + return *o.BrandingCustomCss +} + +// GetBrandingCustomCssOk returns a tuple with the BrandingCustomCss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandingCustomCssOk() (*string, bool) { + if o == nil || IsNil(o.BrandingCustomCss) { + return nil, false + } + return o.BrandingCustomCss, true +} + +// HasBrandingCustomCss returns a boolean if a field has been set. +func (o *Brand) HasBrandingCustomCss() bool { + if o != nil && !IsNil(o.BrandingCustomCss) { + return true + } + + return false +} + +// SetBrandingCustomCss gets a reference to the given string and assigns it to the BrandingCustomCss field. +func (o *Brand) SetBrandingCustomCss(v string) { + o.BrandingCustomCss = &v +} + +// GetBrandingDefaultFlowBackground returns the BrandingDefaultFlowBackground field value if set, zero value otherwise. +func (o *Brand) GetBrandingDefaultFlowBackground() string { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + var ret string + return ret + } + return *o.BrandingDefaultFlowBackground +} + +// GetBrandingDefaultFlowBackgroundOk returns a tuple with the BrandingDefaultFlowBackground field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetBrandingDefaultFlowBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + return nil, false + } + return o.BrandingDefaultFlowBackground, true +} + +// HasBrandingDefaultFlowBackground returns a boolean if a field has been set. +func (o *Brand) HasBrandingDefaultFlowBackground() bool { + if o != nil && !IsNil(o.BrandingDefaultFlowBackground) { + return true + } + + return false +} + +// SetBrandingDefaultFlowBackground gets a reference to the given string and assigns it to the BrandingDefaultFlowBackground field. +func (o *Brand) SetBrandingDefaultFlowBackground(v string) { + o.BrandingDefaultFlowBackground = &v +} + +// GetFlowAuthentication returns the FlowAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowAuthentication() string { + if o == nil || IsNil(o.FlowAuthentication.Get()) { + var ret string + return ret + } + return *o.FlowAuthentication.Get() +} + +// GetFlowAuthenticationOk returns a tuple with the FlowAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowAuthentication.Get(), o.FlowAuthentication.IsSet() +} + +// HasFlowAuthentication returns a boolean if a field has been set. +func (o *Brand) HasFlowAuthentication() bool { + if o != nil && o.FlowAuthentication.IsSet() { + return true + } + + return false +} + +// SetFlowAuthentication gets a reference to the given NullableString and assigns it to the FlowAuthentication field. +func (o *Brand) SetFlowAuthentication(v string) { + o.FlowAuthentication.Set(&v) +} + +// SetFlowAuthenticationNil sets the value for FlowAuthentication to be an explicit nil +func (o *Brand) SetFlowAuthenticationNil() { + o.FlowAuthentication.Set(nil) +} + +// UnsetFlowAuthentication ensures that no value is present for FlowAuthentication, not even an explicit nil +func (o *Brand) UnsetFlowAuthentication() { + o.FlowAuthentication.Unset() +} + +// GetFlowInvalidation returns the FlowInvalidation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowInvalidation() string { + if o == nil || IsNil(o.FlowInvalidation.Get()) { + var ret string + return ret + } + return *o.FlowInvalidation.Get() +} + +// GetFlowInvalidationOk returns a tuple with the FlowInvalidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowInvalidationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowInvalidation.Get(), o.FlowInvalidation.IsSet() +} + +// HasFlowInvalidation returns a boolean if a field has been set. +func (o *Brand) HasFlowInvalidation() bool { + if o != nil && o.FlowInvalidation.IsSet() { + return true + } + + return false +} + +// SetFlowInvalidation gets a reference to the given NullableString and assigns it to the FlowInvalidation field. +func (o *Brand) SetFlowInvalidation(v string) { + o.FlowInvalidation.Set(&v) +} + +// SetFlowInvalidationNil sets the value for FlowInvalidation to be an explicit nil +func (o *Brand) SetFlowInvalidationNil() { + o.FlowInvalidation.Set(nil) +} + +// UnsetFlowInvalidation ensures that no value is present for FlowInvalidation, not even an explicit nil +func (o *Brand) UnsetFlowInvalidation() { + o.FlowInvalidation.Unset() +} + +// GetFlowRecovery returns the FlowRecovery field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowRecovery() string { + if o == nil || IsNil(o.FlowRecovery.Get()) { + var ret string + return ret + } + return *o.FlowRecovery.Get() +} + +// GetFlowRecoveryOk returns a tuple with the FlowRecovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowRecoveryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowRecovery.Get(), o.FlowRecovery.IsSet() +} + +// HasFlowRecovery returns a boolean if a field has been set. +func (o *Brand) HasFlowRecovery() bool { + if o != nil && o.FlowRecovery.IsSet() { + return true + } + + return false +} + +// SetFlowRecovery gets a reference to the given NullableString and assigns it to the FlowRecovery field. +func (o *Brand) SetFlowRecovery(v string) { + o.FlowRecovery.Set(&v) +} + +// SetFlowRecoveryNil sets the value for FlowRecovery to be an explicit nil +func (o *Brand) SetFlowRecoveryNil() { + o.FlowRecovery.Set(nil) +} + +// UnsetFlowRecovery ensures that no value is present for FlowRecovery, not even an explicit nil +func (o *Brand) UnsetFlowRecovery() { + o.FlowRecovery.Unset() +} + +// GetFlowUnenrollment returns the FlowUnenrollment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowUnenrollment() string { + if o == nil || IsNil(o.FlowUnenrollment.Get()) { + var ret string + return ret + } + return *o.FlowUnenrollment.Get() +} + +// GetFlowUnenrollmentOk returns a tuple with the FlowUnenrollment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowUnenrollmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUnenrollment.Get(), o.FlowUnenrollment.IsSet() +} + +// HasFlowUnenrollment returns a boolean if a field has been set. +func (o *Brand) HasFlowUnenrollment() bool { + if o != nil && o.FlowUnenrollment.IsSet() { + return true + } + + return false +} + +// SetFlowUnenrollment gets a reference to the given NullableString and assigns it to the FlowUnenrollment field. +func (o *Brand) SetFlowUnenrollment(v string) { + o.FlowUnenrollment.Set(&v) +} + +// SetFlowUnenrollmentNil sets the value for FlowUnenrollment to be an explicit nil +func (o *Brand) SetFlowUnenrollmentNil() { + o.FlowUnenrollment.Set(nil) +} + +// UnsetFlowUnenrollment ensures that no value is present for FlowUnenrollment, not even an explicit nil +func (o *Brand) UnsetFlowUnenrollment() { + o.FlowUnenrollment.Unset() +} + +// GetFlowUserSettings returns the FlowUserSettings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowUserSettings() string { + if o == nil || IsNil(o.FlowUserSettings.Get()) { + var ret string + return ret + } + return *o.FlowUserSettings.Get() +} + +// GetFlowUserSettingsOk returns a tuple with the FlowUserSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowUserSettingsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUserSettings.Get(), o.FlowUserSettings.IsSet() +} + +// HasFlowUserSettings returns a boolean if a field has been set. +func (o *Brand) HasFlowUserSettings() bool { + if o != nil && o.FlowUserSettings.IsSet() { + return true + } + + return false +} + +// SetFlowUserSettings gets a reference to the given NullableString and assigns it to the FlowUserSettings field. +func (o *Brand) SetFlowUserSettings(v string) { + o.FlowUserSettings.Set(&v) +} + +// SetFlowUserSettingsNil sets the value for FlowUserSettings to be an explicit nil +func (o *Brand) SetFlowUserSettingsNil() { + o.FlowUserSettings.Set(nil) +} + +// UnsetFlowUserSettings ensures that no value is present for FlowUserSettings, not even an explicit nil +func (o *Brand) UnsetFlowUserSettings() { + o.FlowUserSettings.Unset() +} + +// GetFlowDeviceCode returns the FlowDeviceCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetFlowDeviceCode() string { + if o == nil || IsNil(o.FlowDeviceCode.Get()) { + var ret string + return ret + } + return *o.FlowDeviceCode.Get() +} + +// GetFlowDeviceCodeOk returns a tuple with the FlowDeviceCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetFlowDeviceCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowDeviceCode.Get(), o.FlowDeviceCode.IsSet() +} + +// HasFlowDeviceCode returns a boolean if a field has been set. +func (o *Brand) HasFlowDeviceCode() bool { + if o != nil && o.FlowDeviceCode.IsSet() { + return true + } + + return false +} + +// SetFlowDeviceCode gets a reference to the given NullableString and assigns it to the FlowDeviceCode field. +func (o *Brand) SetFlowDeviceCode(v string) { + o.FlowDeviceCode.Set(&v) +} + +// SetFlowDeviceCodeNil sets the value for FlowDeviceCode to be an explicit nil +func (o *Brand) SetFlowDeviceCodeNil() { + o.FlowDeviceCode.Set(nil) +} + +// UnsetFlowDeviceCode ensures that no value is present for FlowDeviceCode, not even an explicit nil +func (o *Brand) UnsetFlowDeviceCode() { + o.FlowDeviceCode.Unset() +} + +// GetDefaultApplication returns the DefaultApplication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetDefaultApplication() string { + if o == nil || IsNil(o.DefaultApplication.Get()) { + var ret string + return ret + } + return *o.DefaultApplication.Get() +} + +// GetDefaultApplicationOk returns a tuple with the DefaultApplication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetDefaultApplicationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultApplication.Get(), o.DefaultApplication.IsSet() +} + +// HasDefaultApplication returns a boolean if a field has been set. +func (o *Brand) HasDefaultApplication() bool { + if o != nil && o.DefaultApplication.IsSet() { + return true + } + + return false +} + +// SetDefaultApplication gets a reference to the given NullableString and assigns it to the DefaultApplication field. +func (o *Brand) SetDefaultApplication(v string) { + o.DefaultApplication.Set(&v) +} + +// SetDefaultApplicationNil sets the value for DefaultApplication to be an explicit nil +func (o *Brand) SetDefaultApplicationNil() { + o.DefaultApplication.Set(nil) +} + +// UnsetDefaultApplication ensures that no value is present for DefaultApplication, not even an explicit nil +func (o *Brand) UnsetDefaultApplication() { + o.DefaultApplication.Unset() +} + +// GetWebCertificate returns the WebCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Brand) GetWebCertificate() string { + if o == nil || IsNil(o.WebCertificate.Get()) { + var ret string + return ret + } + return *o.WebCertificate.Get() +} + +// GetWebCertificateOk returns a tuple with the WebCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Brand) GetWebCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebCertificate.Get(), o.WebCertificate.IsSet() +} + +// HasWebCertificate returns a boolean if a field has been set. +func (o *Brand) HasWebCertificate() bool { + if o != nil && o.WebCertificate.IsSet() { + return true + } + + return false +} + +// SetWebCertificate gets a reference to the given NullableString and assigns it to the WebCertificate field. +func (o *Brand) SetWebCertificate(v string) { + o.WebCertificate.Set(&v) +} + +// SetWebCertificateNil sets the value for WebCertificate to be an explicit nil +func (o *Brand) SetWebCertificateNil() { + o.WebCertificate.Set(nil) +} + +// UnsetWebCertificate ensures that no value is present for WebCertificate, not even an explicit nil +func (o *Brand) UnsetWebCertificate() { + o.WebCertificate.Unset() +} + +// GetClientCertificates returns the ClientCertificates field value if set, zero value otherwise. +func (o *Brand) GetClientCertificates() []string { + if o == nil || IsNil(o.ClientCertificates) { + var ret []string + return ret + } + return o.ClientCertificates +} + +// GetClientCertificatesOk returns a tuple with the ClientCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetClientCertificatesOk() ([]string, bool) { + if o == nil || IsNil(o.ClientCertificates) { + return nil, false + } + return o.ClientCertificates, true +} + +// HasClientCertificates returns a boolean if a field has been set. +func (o *Brand) HasClientCertificates() bool { + if o != nil && !IsNil(o.ClientCertificates) { + return true + } + + return false +} + +// SetClientCertificates gets a reference to the given []string and assigns it to the ClientCertificates field. +func (o *Brand) SetClientCertificates(v []string) { + o.ClientCertificates = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *Brand) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Brand) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *Brand) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *Brand) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o Brand) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Brand) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["brand_uuid"] = o.BrandUuid + toSerialize["domain"] = o.Domain + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.BrandingTitle) { + toSerialize["branding_title"] = o.BrandingTitle + } + if !IsNil(o.BrandingLogo) { + toSerialize["branding_logo"] = o.BrandingLogo + } + if !IsNil(o.BrandingFavicon) { + toSerialize["branding_favicon"] = o.BrandingFavicon + } + if !IsNil(o.BrandingCustomCss) { + toSerialize["branding_custom_css"] = o.BrandingCustomCss + } + if !IsNil(o.BrandingDefaultFlowBackground) { + toSerialize["branding_default_flow_background"] = o.BrandingDefaultFlowBackground + } + if o.FlowAuthentication.IsSet() { + toSerialize["flow_authentication"] = o.FlowAuthentication.Get() + } + if o.FlowInvalidation.IsSet() { + toSerialize["flow_invalidation"] = o.FlowInvalidation.Get() + } + if o.FlowRecovery.IsSet() { + toSerialize["flow_recovery"] = o.FlowRecovery.Get() + } + if o.FlowUnenrollment.IsSet() { + toSerialize["flow_unenrollment"] = o.FlowUnenrollment.Get() + } + if o.FlowUserSettings.IsSet() { + toSerialize["flow_user_settings"] = o.FlowUserSettings.Get() + } + if o.FlowDeviceCode.IsSet() { + toSerialize["flow_device_code"] = o.FlowDeviceCode.Get() + } + if o.DefaultApplication.IsSet() { + toSerialize["default_application"] = o.DefaultApplication.Get() + } + if o.WebCertificate.IsSet() { + toSerialize["web_certificate"] = o.WebCertificate.Get() + } + if !IsNil(o.ClientCertificates) { + toSerialize["client_certificates"] = o.ClientCertificates + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Brand) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "brand_uuid", + "domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBrand := _Brand{} + + err = json.Unmarshal(data, &varBrand) + + if err != nil { + return err + } + + *o = Brand(varBrand) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "brand_uuid") + delete(additionalProperties, "domain") + delete(additionalProperties, "default") + delete(additionalProperties, "branding_title") + delete(additionalProperties, "branding_logo") + delete(additionalProperties, "branding_favicon") + delete(additionalProperties, "branding_custom_css") + delete(additionalProperties, "branding_default_flow_background") + delete(additionalProperties, "flow_authentication") + delete(additionalProperties, "flow_invalidation") + delete(additionalProperties, "flow_recovery") + delete(additionalProperties, "flow_unenrollment") + delete(additionalProperties, "flow_user_settings") + delete(additionalProperties, "flow_device_code") + delete(additionalProperties, "default_application") + delete(additionalProperties, "web_certificate") + delete(additionalProperties, "client_certificates") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBrand struct { + value *Brand + isSet bool +} + +func (v NullableBrand) Get() *Brand { + return v.value +} + +func (v *NullableBrand) Set(val *Brand) { + v.value = val + v.isSet = true +} + +func (v NullableBrand) IsSet() bool { + return v.isSet +} + +func (v *NullableBrand) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBrand(val *Brand) *NullableBrand { + return &NullableBrand{value: val, isSet: true} +} + +func (v NullableBrand) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBrand) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_brand_request.go b/packages/client-go/model_brand_request.go new file mode 100644 index 0000000000..55e4d0a550 --- /dev/null +++ b/packages/client-go/model_brand_request.go @@ -0,0 +1,851 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the BrandRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BrandRequest{} + +// BrandRequest Brand Serializer +type BrandRequest struct { + // Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + Domain string `json:"domain"` + Default *bool `json:"default,omitempty"` + BrandingTitle *string `json:"branding_title,omitempty"` + BrandingLogo *string `json:"branding_logo,omitempty"` + BrandingFavicon *string `json:"branding_favicon,omitempty"` + BrandingCustomCss *string `json:"branding_custom_css,omitempty"` + BrandingDefaultFlowBackground *string `json:"branding_default_flow_background,omitempty"` + FlowAuthentication NullableString `json:"flow_authentication,omitempty"` + FlowInvalidation NullableString `json:"flow_invalidation,omitempty"` + FlowRecovery NullableString `json:"flow_recovery,omitempty"` + FlowUnenrollment NullableString `json:"flow_unenrollment,omitempty"` + FlowUserSettings NullableString `json:"flow_user_settings,omitempty"` + FlowDeviceCode NullableString `json:"flow_device_code,omitempty"` + // When set, external users will be redirected to this application after authenticating. + DefaultApplication NullableString `json:"default_application,omitempty"` + // Web Certificate used by the authentik Core webserver. + WebCertificate NullableString `json:"web_certificate,omitempty"` + // Certificates used for client authentication. + ClientCertificates []string `json:"client_certificates,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _BrandRequest BrandRequest + +// NewBrandRequest instantiates a new BrandRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBrandRequest(domain string) *BrandRequest { + this := BrandRequest{} + this.Domain = domain + return &this +} + +// NewBrandRequestWithDefaults instantiates a new BrandRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBrandRequestWithDefaults() *BrandRequest { + this := BrandRequest{} + return &this +} + +// GetDomain returns the Domain field value +func (o *BrandRequest) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +func (o *BrandRequest) SetDomain(v string) { + o.Domain = v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *BrandRequest) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *BrandRequest) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *BrandRequest) SetDefault(v bool) { + o.Default = &v +} + +// GetBrandingTitle returns the BrandingTitle field value if set, zero value otherwise. +func (o *BrandRequest) GetBrandingTitle() string { + if o == nil || IsNil(o.BrandingTitle) { + var ret string + return ret + } + return *o.BrandingTitle +} + +// GetBrandingTitleOk returns a tuple with the BrandingTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetBrandingTitleOk() (*string, bool) { + if o == nil || IsNil(o.BrandingTitle) { + return nil, false + } + return o.BrandingTitle, true +} + +// HasBrandingTitle returns a boolean if a field has been set. +func (o *BrandRequest) HasBrandingTitle() bool { + if o != nil && !IsNil(o.BrandingTitle) { + return true + } + + return false +} + +// SetBrandingTitle gets a reference to the given string and assigns it to the BrandingTitle field. +func (o *BrandRequest) SetBrandingTitle(v string) { + o.BrandingTitle = &v +} + +// GetBrandingLogo returns the BrandingLogo field value if set, zero value otherwise. +func (o *BrandRequest) GetBrandingLogo() string { + if o == nil || IsNil(o.BrandingLogo) { + var ret string + return ret + } + return *o.BrandingLogo +} + +// GetBrandingLogoOk returns a tuple with the BrandingLogo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetBrandingLogoOk() (*string, bool) { + if o == nil || IsNil(o.BrandingLogo) { + return nil, false + } + return o.BrandingLogo, true +} + +// HasBrandingLogo returns a boolean if a field has been set. +func (o *BrandRequest) HasBrandingLogo() bool { + if o != nil && !IsNil(o.BrandingLogo) { + return true + } + + return false +} + +// SetBrandingLogo gets a reference to the given string and assigns it to the BrandingLogo field. +func (o *BrandRequest) SetBrandingLogo(v string) { + o.BrandingLogo = &v +} + +// GetBrandingFavicon returns the BrandingFavicon field value if set, zero value otherwise. +func (o *BrandRequest) GetBrandingFavicon() string { + if o == nil || IsNil(o.BrandingFavicon) { + var ret string + return ret + } + return *o.BrandingFavicon +} + +// GetBrandingFaviconOk returns a tuple with the BrandingFavicon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetBrandingFaviconOk() (*string, bool) { + if o == nil || IsNil(o.BrandingFavicon) { + return nil, false + } + return o.BrandingFavicon, true +} + +// HasBrandingFavicon returns a boolean if a field has been set. +func (o *BrandRequest) HasBrandingFavicon() bool { + if o != nil && !IsNil(o.BrandingFavicon) { + return true + } + + return false +} + +// SetBrandingFavicon gets a reference to the given string and assigns it to the BrandingFavicon field. +func (o *BrandRequest) SetBrandingFavicon(v string) { + o.BrandingFavicon = &v +} + +// GetBrandingCustomCss returns the BrandingCustomCss field value if set, zero value otherwise. +func (o *BrandRequest) GetBrandingCustomCss() string { + if o == nil || IsNil(o.BrandingCustomCss) { + var ret string + return ret + } + return *o.BrandingCustomCss +} + +// GetBrandingCustomCssOk returns a tuple with the BrandingCustomCss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetBrandingCustomCssOk() (*string, bool) { + if o == nil || IsNil(o.BrandingCustomCss) { + return nil, false + } + return o.BrandingCustomCss, true +} + +// HasBrandingCustomCss returns a boolean if a field has been set. +func (o *BrandRequest) HasBrandingCustomCss() bool { + if o != nil && !IsNil(o.BrandingCustomCss) { + return true + } + + return false +} + +// SetBrandingCustomCss gets a reference to the given string and assigns it to the BrandingCustomCss field. +func (o *BrandRequest) SetBrandingCustomCss(v string) { + o.BrandingCustomCss = &v +} + +// GetBrandingDefaultFlowBackground returns the BrandingDefaultFlowBackground field value if set, zero value otherwise. +func (o *BrandRequest) GetBrandingDefaultFlowBackground() string { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + var ret string + return ret + } + return *o.BrandingDefaultFlowBackground +} + +// GetBrandingDefaultFlowBackgroundOk returns a tuple with the BrandingDefaultFlowBackground field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetBrandingDefaultFlowBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + return nil, false + } + return o.BrandingDefaultFlowBackground, true +} + +// HasBrandingDefaultFlowBackground returns a boolean if a field has been set. +func (o *BrandRequest) HasBrandingDefaultFlowBackground() bool { + if o != nil && !IsNil(o.BrandingDefaultFlowBackground) { + return true + } + + return false +} + +// SetBrandingDefaultFlowBackground gets a reference to the given string and assigns it to the BrandingDefaultFlowBackground field. +func (o *BrandRequest) SetBrandingDefaultFlowBackground(v string) { + o.BrandingDefaultFlowBackground = &v +} + +// GetFlowAuthentication returns the FlowAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowAuthentication() string { + if o == nil || IsNil(o.FlowAuthentication.Get()) { + var ret string + return ret + } + return *o.FlowAuthentication.Get() +} + +// GetFlowAuthenticationOk returns a tuple with the FlowAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowAuthentication.Get(), o.FlowAuthentication.IsSet() +} + +// HasFlowAuthentication returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowAuthentication() bool { + if o != nil && o.FlowAuthentication.IsSet() { + return true + } + + return false +} + +// SetFlowAuthentication gets a reference to the given NullableString and assigns it to the FlowAuthentication field. +func (o *BrandRequest) SetFlowAuthentication(v string) { + o.FlowAuthentication.Set(&v) +} + +// SetFlowAuthenticationNil sets the value for FlowAuthentication to be an explicit nil +func (o *BrandRequest) SetFlowAuthenticationNil() { + o.FlowAuthentication.Set(nil) +} + +// UnsetFlowAuthentication ensures that no value is present for FlowAuthentication, not even an explicit nil +func (o *BrandRequest) UnsetFlowAuthentication() { + o.FlowAuthentication.Unset() +} + +// GetFlowInvalidation returns the FlowInvalidation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowInvalidation() string { + if o == nil || IsNil(o.FlowInvalidation.Get()) { + var ret string + return ret + } + return *o.FlowInvalidation.Get() +} + +// GetFlowInvalidationOk returns a tuple with the FlowInvalidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowInvalidationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowInvalidation.Get(), o.FlowInvalidation.IsSet() +} + +// HasFlowInvalidation returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowInvalidation() bool { + if o != nil && o.FlowInvalidation.IsSet() { + return true + } + + return false +} + +// SetFlowInvalidation gets a reference to the given NullableString and assigns it to the FlowInvalidation field. +func (o *BrandRequest) SetFlowInvalidation(v string) { + o.FlowInvalidation.Set(&v) +} + +// SetFlowInvalidationNil sets the value for FlowInvalidation to be an explicit nil +func (o *BrandRequest) SetFlowInvalidationNil() { + o.FlowInvalidation.Set(nil) +} + +// UnsetFlowInvalidation ensures that no value is present for FlowInvalidation, not even an explicit nil +func (o *BrandRequest) UnsetFlowInvalidation() { + o.FlowInvalidation.Unset() +} + +// GetFlowRecovery returns the FlowRecovery field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowRecovery() string { + if o == nil || IsNil(o.FlowRecovery.Get()) { + var ret string + return ret + } + return *o.FlowRecovery.Get() +} + +// GetFlowRecoveryOk returns a tuple with the FlowRecovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowRecoveryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowRecovery.Get(), o.FlowRecovery.IsSet() +} + +// HasFlowRecovery returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowRecovery() bool { + if o != nil && o.FlowRecovery.IsSet() { + return true + } + + return false +} + +// SetFlowRecovery gets a reference to the given NullableString and assigns it to the FlowRecovery field. +func (o *BrandRequest) SetFlowRecovery(v string) { + o.FlowRecovery.Set(&v) +} + +// SetFlowRecoveryNil sets the value for FlowRecovery to be an explicit nil +func (o *BrandRequest) SetFlowRecoveryNil() { + o.FlowRecovery.Set(nil) +} + +// UnsetFlowRecovery ensures that no value is present for FlowRecovery, not even an explicit nil +func (o *BrandRequest) UnsetFlowRecovery() { + o.FlowRecovery.Unset() +} + +// GetFlowUnenrollment returns the FlowUnenrollment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowUnenrollment() string { + if o == nil || IsNil(o.FlowUnenrollment.Get()) { + var ret string + return ret + } + return *o.FlowUnenrollment.Get() +} + +// GetFlowUnenrollmentOk returns a tuple with the FlowUnenrollment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowUnenrollmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUnenrollment.Get(), o.FlowUnenrollment.IsSet() +} + +// HasFlowUnenrollment returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowUnenrollment() bool { + if o != nil && o.FlowUnenrollment.IsSet() { + return true + } + + return false +} + +// SetFlowUnenrollment gets a reference to the given NullableString and assigns it to the FlowUnenrollment field. +func (o *BrandRequest) SetFlowUnenrollment(v string) { + o.FlowUnenrollment.Set(&v) +} + +// SetFlowUnenrollmentNil sets the value for FlowUnenrollment to be an explicit nil +func (o *BrandRequest) SetFlowUnenrollmentNil() { + o.FlowUnenrollment.Set(nil) +} + +// UnsetFlowUnenrollment ensures that no value is present for FlowUnenrollment, not even an explicit nil +func (o *BrandRequest) UnsetFlowUnenrollment() { + o.FlowUnenrollment.Unset() +} + +// GetFlowUserSettings returns the FlowUserSettings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowUserSettings() string { + if o == nil || IsNil(o.FlowUserSettings.Get()) { + var ret string + return ret + } + return *o.FlowUserSettings.Get() +} + +// GetFlowUserSettingsOk returns a tuple with the FlowUserSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowUserSettingsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUserSettings.Get(), o.FlowUserSettings.IsSet() +} + +// HasFlowUserSettings returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowUserSettings() bool { + if o != nil && o.FlowUserSettings.IsSet() { + return true + } + + return false +} + +// SetFlowUserSettings gets a reference to the given NullableString and assigns it to the FlowUserSettings field. +func (o *BrandRequest) SetFlowUserSettings(v string) { + o.FlowUserSettings.Set(&v) +} + +// SetFlowUserSettingsNil sets the value for FlowUserSettings to be an explicit nil +func (o *BrandRequest) SetFlowUserSettingsNil() { + o.FlowUserSettings.Set(nil) +} + +// UnsetFlowUserSettings ensures that no value is present for FlowUserSettings, not even an explicit nil +func (o *BrandRequest) UnsetFlowUserSettings() { + o.FlowUserSettings.Unset() +} + +// GetFlowDeviceCode returns the FlowDeviceCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetFlowDeviceCode() string { + if o == nil || IsNil(o.FlowDeviceCode.Get()) { + var ret string + return ret + } + return *o.FlowDeviceCode.Get() +} + +// GetFlowDeviceCodeOk returns a tuple with the FlowDeviceCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetFlowDeviceCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowDeviceCode.Get(), o.FlowDeviceCode.IsSet() +} + +// HasFlowDeviceCode returns a boolean if a field has been set. +func (o *BrandRequest) HasFlowDeviceCode() bool { + if o != nil && o.FlowDeviceCode.IsSet() { + return true + } + + return false +} + +// SetFlowDeviceCode gets a reference to the given NullableString and assigns it to the FlowDeviceCode field. +func (o *BrandRequest) SetFlowDeviceCode(v string) { + o.FlowDeviceCode.Set(&v) +} + +// SetFlowDeviceCodeNil sets the value for FlowDeviceCode to be an explicit nil +func (o *BrandRequest) SetFlowDeviceCodeNil() { + o.FlowDeviceCode.Set(nil) +} + +// UnsetFlowDeviceCode ensures that no value is present for FlowDeviceCode, not even an explicit nil +func (o *BrandRequest) UnsetFlowDeviceCode() { + o.FlowDeviceCode.Unset() +} + +// GetDefaultApplication returns the DefaultApplication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetDefaultApplication() string { + if o == nil || IsNil(o.DefaultApplication.Get()) { + var ret string + return ret + } + return *o.DefaultApplication.Get() +} + +// GetDefaultApplicationOk returns a tuple with the DefaultApplication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetDefaultApplicationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultApplication.Get(), o.DefaultApplication.IsSet() +} + +// HasDefaultApplication returns a boolean if a field has been set. +func (o *BrandRequest) HasDefaultApplication() bool { + if o != nil && o.DefaultApplication.IsSet() { + return true + } + + return false +} + +// SetDefaultApplication gets a reference to the given NullableString and assigns it to the DefaultApplication field. +func (o *BrandRequest) SetDefaultApplication(v string) { + o.DefaultApplication.Set(&v) +} + +// SetDefaultApplicationNil sets the value for DefaultApplication to be an explicit nil +func (o *BrandRequest) SetDefaultApplicationNil() { + o.DefaultApplication.Set(nil) +} + +// UnsetDefaultApplication ensures that no value is present for DefaultApplication, not even an explicit nil +func (o *BrandRequest) UnsetDefaultApplication() { + o.DefaultApplication.Unset() +} + +// GetWebCertificate returns the WebCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *BrandRequest) GetWebCertificate() string { + if o == nil || IsNil(o.WebCertificate.Get()) { + var ret string + return ret + } + return *o.WebCertificate.Get() +} + +// GetWebCertificateOk returns a tuple with the WebCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *BrandRequest) GetWebCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebCertificate.Get(), o.WebCertificate.IsSet() +} + +// HasWebCertificate returns a boolean if a field has been set. +func (o *BrandRequest) HasWebCertificate() bool { + if o != nil && o.WebCertificate.IsSet() { + return true + } + + return false +} + +// SetWebCertificate gets a reference to the given NullableString and assigns it to the WebCertificate field. +func (o *BrandRequest) SetWebCertificate(v string) { + o.WebCertificate.Set(&v) +} + +// SetWebCertificateNil sets the value for WebCertificate to be an explicit nil +func (o *BrandRequest) SetWebCertificateNil() { + o.WebCertificate.Set(nil) +} + +// UnsetWebCertificate ensures that no value is present for WebCertificate, not even an explicit nil +func (o *BrandRequest) UnsetWebCertificate() { + o.WebCertificate.Unset() +} + +// GetClientCertificates returns the ClientCertificates field value if set, zero value otherwise. +func (o *BrandRequest) GetClientCertificates() []string { + if o == nil || IsNil(o.ClientCertificates) { + var ret []string + return ret + } + return o.ClientCertificates +} + +// GetClientCertificatesOk returns a tuple with the ClientCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetClientCertificatesOk() ([]string, bool) { + if o == nil || IsNil(o.ClientCertificates) { + return nil, false + } + return o.ClientCertificates, true +} + +// HasClientCertificates returns a boolean if a field has been set. +func (o *BrandRequest) HasClientCertificates() bool { + if o != nil && !IsNil(o.ClientCertificates) { + return true + } + + return false +} + +// SetClientCertificates gets a reference to the given []string and assigns it to the ClientCertificates field. +func (o *BrandRequest) SetClientCertificates(v []string) { + o.ClientCertificates = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *BrandRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BrandRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *BrandRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *BrandRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o BrandRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BrandRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["domain"] = o.Domain + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.BrandingTitle) { + toSerialize["branding_title"] = o.BrandingTitle + } + if !IsNil(o.BrandingLogo) { + toSerialize["branding_logo"] = o.BrandingLogo + } + if !IsNil(o.BrandingFavicon) { + toSerialize["branding_favicon"] = o.BrandingFavicon + } + if !IsNil(o.BrandingCustomCss) { + toSerialize["branding_custom_css"] = o.BrandingCustomCss + } + if !IsNil(o.BrandingDefaultFlowBackground) { + toSerialize["branding_default_flow_background"] = o.BrandingDefaultFlowBackground + } + if o.FlowAuthentication.IsSet() { + toSerialize["flow_authentication"] = o.FlowAuthentication.Get() + } + if o.FlowInvalidation.IsSet() { + toSerialize["flow_invalidation"] = o.FlowInvalidation.Get() + } + if o.FlowRecovery.IsSet() { + toSerialize["flow_recovery"] = o.FlowRecovery.Get() + } + if o.FlowUnenrollment.IsSet() { + toSerialize["flow_unenrollment"] = o.FlowUnenrollment.Get() + } + if o.FlowUserSettings.IsSet() { + toSerialize["flow_user_settings"] = o.FlowUserSettings.Get() + } + if o.FlowDeviceCode.IsSet() { + toSerialize["flow_device_code"] = o.FlowDeviceCode.Get() + } + if o.DefaultApplication.IsSet() { + toSerialize["default_application"] = o.DefaultApplication.Get() + } + if o.WebCertificate.IsSet() { + toSerialize["web_certificate"] = o.WebCertificate.Get() + } + if !IsNil(o.ClientCertificates) { + toSerialize["client_certificates"] = o.ClientCertificates + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BrandRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBrandRequest := _BrandRequest{} + + err = json.Unmarshal(data, &varBrandRequest) + + if err != nil { + return err + } + + *o = BrandRequest(varBrandRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "domain") + delete(additionalProperties, "default") + delete(additionalProperties, "branding_title") + delete(additionalProperties, "branding_logo") + delete(additionalProperties, "branding_favicon") + delete(additionalProperties, "branding_custom_css") + delete(additionalProperties, "branding_default_flow_background") + delete(additionalProperties, "flow_authentication") + delete(additionalProperties, "flow_invalidation") + delete(additionalProperties, "flow_recovery") + delete(additionalProperties, "flow_unenrollment") + delete(additionalProperties, "flow_user_settings") + delete(additionalProperties, "flow_device_code") + delete(additionalProperties, "default_application") + delete(additionalProperties, "web_certificate") + delete(additionalProperties, "client_certificates") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBrandRequest struct { + value *BrandRequest + isSet bool +} + +func (v NullableBrandRequest) Get() *BrandRequest { + return v.value +} + +func (v *NullableBrandRequest) Set(val *BrandRequest) { + v.value = val + v.isSet = true +} + +func (v NullableBrandRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableBrandRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBrandRequest(val *BrandRequest) *NullableBrandRequest { + return &NullableBrandRequest{value: val, isSet: true} +} + +func (v NullableBrandRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBrandRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_bulk_delete_session_response.go b/packages/client-go/model_bulk_delete_session_response.go new file mode 100644 index 0000000000..632796bbe7 --- /dev/null +++ b/packages/client-go/model_bulk_delete_session_response.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the BulkDeleteSessionResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BulkDeleteSessionResponse{} + +// BulkDeleteSessionResponse struct for BulkDeleteSessionResponse +type BulkDeleteSessionResponse struct { + Deleted int32 `json:"deleted"` + AdditionalProperties map[string]interface{} +} + +type _BulkDeleteSessionResponse BulkDeleteSessionResponse + +// NewBulkDeleteSessionResponse instantiates a new BulkDeleteSessionResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBulkDeleteSessionResponse(deleted int32) *BulkDeleteSessionResponse { + this := BulkDeleteSessionResponse{} + this.Deleted = deleted + return &this +} + +// NewBulkDeleteSessionResponseWithDefaults instantiates a new BulkDeleteSessionResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBulkDeleteSessionResponseWithDefaults() *BulkDeleteSessionResponse { + this := BulkDeleteSessionResponse{} + return &this +} + +// GetDeleted returns the Deleted field value +func (o *BulkDeleteSessionResponse) GetDeleted() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Deleted +} + +// GetDeletedOk returns a tuple with the Deleted field value +// and a boolean to check if the value has been set. +func (o *BulkDeleteSessionResponse) GetDeletedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Deleted, true +} + +// SetDeleted sets field value +func (o *BulkDeleteSessionResponse) SetDeleted(v int32) { + o.Deleted = v +} + +func (o BulkDeleteSessionResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BulkDeleteSessionResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["deleted"] = o.Deleted + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *BulkDeleteSessionResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "deleted", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBulkDeleteSessionResponse := _BulkDeleteSessionResponse{} + + err = json.Unmarshal(data, &varBulkDeleteSessionResponse) + + if err != nil { + return err + } + + *o = BulkDeleteSessionResponse(varBulkDeleteSessionResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "deleted") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableBulkDeleteSessionResponse struct { + value *BulkDeleteSessionResponse + isSet bool +} + +func (v NullableBulkDeleteSessionResponse) Get() *BulkDeleteSessionResponse { + return v.value +} + +func (v *NullableBulkDeleteSessionResponse) Set(val *BulkDeleteSessionResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBulkDeleteSessionResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBulkDeleteSessionResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBulkDeleteSessionResponse(val *BulkDeleteSessionResponse) *NullableBulkDeleteSessionResponse { + return &NullableBulkDeleteSessionResponse{value: val, isSet: true} +} + +func (v NullableBulkDeleteSessionResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBulkDeleteSessionResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_cache.go b/packages/client-go/model_cache.go new file mode 100644 index 0000000000..0e44cfb6bd --- /dev/null +++ b/packages/client-go/model_cache.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Cache type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Cache{} + +// Cache Generic cache stats for an object +type Cache struct { + Count int32 `json:"count"` + AdditionalProperties map[string]interface{} +} + +type _Cache Cache + +// NewCache instantiates a new Cache object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCache(count int32) *Cache { + this := Cache{} + this.Count = count + return &this +} + +// NewCacheWithDefaults instantiates a new Cache object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCacheWithDefaults() *Cache { + this := Cache{} + return &this +} + +// GetCount returns the Count field value +func (o *Cache) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *Cache) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *Cache) SetCount(v int32) { + o.Count = v +} + +func (o Cache) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Cache) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["count"] = o.Count + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Cache) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCache := _Cache{} + + err = json.Unmarshal(data, &varCache) + + if err != nil { + return err + } + + *o = Cache(varCache) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCache struct { + value *Cache + isSet bool +} + +func (v NullableCache) Get() *Cache { + return v.value +} + +func (v *NullableCache) Set(val *Cache) { + v.value = val + v.isSet = true +} + +func (v NullableCache) IsSet() bool { + return v.isSet +} + +func (v *NullableCache) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCache(val *Cache) *NullableCache { + return &NullableCache{value: val, isSet: true} +} + +func (v NullableCache) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCache) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_capabilities_enum.go b/packages/client-go/model_capabilities_enum.go new file mode 100644 index 0000000000..2ce434b39a --- /dev/null +++ b/packages/client-go/model_capabilities_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// CapabilitiesEnum the model 'CapabilitiesEnum' +type CapabilitiesEnum string + +// List of CapabilitiesEnum +const ( + CAPABILITIESENUM_CAN_SAVE_MEDIA CapabilitiesEnum = "can_save_media" + CAPABILITIESENUM_CAN_SAVE_REPORTS CapabilitiesEnum = "can_save_reports" + CAPABILITIESENUM_CAN_GEO_IP CapabilitiesEnum = "can_geo_ip" + CAPABILITIESENUM_CAN_ASN CapabilitiesEnum = "can_asn" + CAPABILITIESENUM_CAN_IMPERSONATE CapabilitiesEnum = "can_impersonate" + CAPABILITIESENUM_CAN_DEBUG CapabilitiesEnum = "can_debug" + CAPABILITIESENUM_IS_ENTERPRISE CapabilitiesEnum = "is_enterprise" +) + +// All allowed values of CapabilitiesEnum enum +var AllowedCapabilitiesEnumEnumValues = []CapabilitiesEnum{ + "can_save_media", + "can_save_reports", + "can_geo_ip", + "can_asn", + "can_impersonate", + "can_debug", + "is_enterprise", +} + +func (v *CapabilitiesEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CapabilitiesEnum(value) + for _, existing := range AllowedCapabilitiesEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CapabilitiesEnum", value) +} + +// NewCapabilitiesEnumFromValue returns a pointer to a valid CapabilitiesEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCapabilitiesEnumFromValue(v string) (*CapabilitiesEnum, error) { + ev := CapabilitiesEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CapabilitiesEnum: valid values are %v", v, AllowedCapabilitiesEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CapabilitiesEnum) IsValid() bool { + for _, existing := range AllowedCapabilitiesEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CapabilitiesEnum value +func (v CapabilitiesEnum) Ptr() *CapabilitiesEnum { + return &v +} + +type NullableCapabilitiesEnum struct { + value *CapabilitiesEnum + isSet bool +} + +func (v NullableCapabilitiesEnum) Get() *CapabilitiesEnum { + return v.value +} + +func (v *NullableCapabilitiesEnum) Set(val *CapabilitiesEnum) { + v.value = val + v.isSet = true +} + +func (v NullableCapabilitiesEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableCapabilitiesEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCapabilitiesEnum(val *CapabilitiesEnum) *NullableCapabilitiesEnum { + return &NullableCapabilitiesEnum{value: val, isSet: true} +} + +func (v NullableCapabilitiesEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCapabilitiesEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_captcha_challenge.go b/packages/client-go/model_captcha_challenge.go new file mode 100644 index 0000000000..8ff3dc6c0f --- /dev/null +++ b/packages/client-go/model_captcha_challenge.go @@ -0,0 +1,398 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CaptchaChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CaptchaChallenge{} + +// CaptchaChallenge Site public key +type CaptchaChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + SiteKey string `json:"site_key"` + JsUrl string `json:"js_url"` + Interactive bool `json:"interactive"` + AdditionalProperties map[string]interface{} +} + +type _CaptchaChallenge CaptchaChallenge + +// NewCaptchaChallenge instantiates a new CaptchaChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptchaChallenge(pendingUser string, pendingUserAvatar string, siteKey string, jsUrl string, interactive bool) *CaptchaChallenge { + this := CaptchaChallenge{} + var component string = "ak-stage-captcha" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.SiteKey = siteKey + this.JsUrl = jsUrl + this.Interactive = interactive + return &this +} + +// NewCaptchaChallengeWithDefaults instantiates a new CaptchaChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptchaChallengeWithDefaults() *CaptchaChallenge { + this := CaptchaChallenge{} + var component string = "ak-stage-captcha" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *CaptchaChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *CaptchaChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *CaptchaChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *CaptchaChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *CaptchaChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *CaptchaChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *CaptchaChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *CaptchaChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *CaptchaChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *CaptchaChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *CaptchaChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *CaptchaChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *CaptchaChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetSiteKey returns the SiteKey field value +func (o *CaptchaChallenge) GetSiteKey() string { + if o == nil { + var ret string + return ret + } + + return o.SiteKey +} + +// GetSiteKeyOk returns a tuple with the SiteKey field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetSiteKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SiteKey, true +} + +// SetSiteKey sets field value +func (o *CaptchaChallenge) SetSiteKey(v string) { + o.SiteKey = v +} + +// GetJsUrl returns the JsUrl field value +func (o *CaptchaChallenge) GetJsUrl() string { + if o == nil { + var ret string + return ret + } + + return o.JsUrl +} + +// GetJsUrlOk returns a tuple with the JsUrl field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetJsUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JsUrl, true +} + +// SetJsUrl sets field value +func (o *CaptchaChallenge) SetJsUrl(v string) { + o.JsUrl = v +} + +// GetInteractive returns the Interactive field value +func (o *CaptchaChallenge) GetInteractive() bool { + if o == nil { + var ret bool + return ret + } + + return o.Interactive +} + +// GetInteractiveOk returns a tuple with the Interactive field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallenge) GetInteractiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Interactive, true +} + +// SetInteractive sets field value +func (o *CaptchaChallenge) SetInteractive(v bool) { + o.Interactive = v +} + +func (o CaptchaChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptchaChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + toSerialize["site_key"] = o.SiteKey + toSerialize["js_url"] = o.JsUrl + toSerialize["interactive"] = o.Interactive + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CaptchaChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "site_key", + "js_url", + "interactive", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCaptchaChallenge := _CaptchaChallenge{} + + err = json.Unmarshal(data, &varCaptchaChallenge) + + if err != nil { + return err + } + + *o = CaptchaChallenge(varCaptchaChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "site_key") + delete(additionalProperties, "js_url") + delete(additionalProperties, "interactive") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCaptchaChallenge struct { + value *CaptchaChallenge + isSet bool +} + +func (v NullableCaptchaChallenge) Get() *CaptchaChallenge { + return v.value +} + +func (v *NullableCaptchaChallenge) Set(val *CaptchaChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableCaptchaChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptchaChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptchaChallenge(val *CaptchaChallenge) *NullableCaptchaChallenge { + return &NullableCaptchaChallenge{value: val, isSet: true} +} + +func (v NullableCaptchaChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptchaChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_captcha_challenge_response_request.go b/packages/client-go/model_captcha_challenge_response_request.go new file mode 100644 index 0000000000..0c34c518c4 --- /dev/null +++ b/packages/client-go/model_captcha_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CaptchaChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CaptchaChallengeResponseRequest{} + +// CaptchaChallengeResponseRequest Validate captcha token +type CaptchaChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Token string `json:"token"` + AdditionalProperties map[string]interface{} +} + +type _CaptchaChallengeResponseRequest CaptchaChallengeResponseRequest + +// NewCaptchaChallengeResponseRequest instantiates a new CaptchaChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptchaChallengeResponseRequest(token string) *CaptchaChallengeResponseRequest { + this := CaptchaChallengeResponseRequest{} + var component string = "ak-stage-captcha" + this.Component = &component + this.Token = token + return &this +} + +// NewCaptchaChallengeResponseRequestWithDefaults instantiates a new CaptchaChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptchaChallengeResponseRequestWithDefaults() *CaptchaChallengeResponseRequest { + this := CaptchaChallengeResponseRequest{} + var component string = "ak-stage-captcha" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *CaptchaChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *CaptchaChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *CaptchaChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetToken returns the Token field value +func (o *CaptchaChallengeResponseRequest) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *CaptchaChallengeResponseRequest) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *CaptchaChallengeResponseRequest) SetToken(v string) { + o.Token = v +} + +func (o CaptchaChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptchaChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["token"] = o.Token + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CaptchaChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCaptchaChallengeResponseRequest := _CaptchaChallengeResponseRequest{} + + err = json.Unmarshal(data, &varCaptchaChallengeResponseRequest) + + if err != nil { + return err + } + + *o = CaptchaChallengeResponseRequest(varCaptchaChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCaptchaChallengeResponseRequest struct { + value *CaptchaChallengeResponseRequest + isSet bool +} + +func (v NullableCaptchaChallengeResponseRequest) Get() *CaptchaChallengeResponseRequest { + return v.value +} + +func (v *NullableCaptchaChallengeResponseRequest) Set(val *CaptchaChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCaptchaChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptchaChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptchaChallengeResponseRequest(val *CaptchaChallengeResponseRequest) *NullableCaptchaChallengeResponseRequest { + return &NullableCaptchaChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableCaptchaChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptchaChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_captcha_stage.go b/packages/client-go/model_captcha_stage.go new file mode 100644 index 0000000000..30d2e5bc32 --- /dev/null +++ b/packages/client-go/model_captcha_stage.go @@ -0,0 +1,598 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CaptchaStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CaptchaStage{} + +// CaptchaStage CaptchaStage Serializer +type CaptchaStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Public key, acquired your captcha Provider. + PublicKey string `json:"public_key"` + JsUrl *string `json:"js_url,omitempty"` + ApiUrl *string `json:"api_url,omitempty"` + Interactive *bool `json:"interactive,omitempty"` + ScoreMinThreshold *float64 `json:"score_min_threshold,omitempty"` + ScoreMaxThreshold *float64 `json:"score_max_threshold,omitempty"` + // When enabled and the received captcha score is outside of the given threshold, the stage will show an error message. When not enabled, the flow will continue, but the data from the captcha will be available in the context for policy decisions + ErrorOnInvalidScore *bool `json:"error_on_invalid_score,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CaptchaStage CaptchaStage + +// NewCaptchaStage instantiates a new CaptchaStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptchaStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, publicKey string) *CaptchaStage { + this := CaptchaStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.PublicKey = publicKey + return &this +} + +// NewCaptchaStageWithDefaults instantiates a new CaptchaStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptchaStageWithDefaults() *CaptchaStage { + this := CaptchaStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *CaptchaStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *CaptchaStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *CaptchaStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CaptchaStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *CaptchaStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *CaptchaStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *CaptchaStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *CaptchaStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *CaptchaStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *CaptchaStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *CaptchaStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *CaptchaStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *CaptchaStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *CaptchaStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetPublicKey returns the PublicKey field value +func (o *CaptchaStage) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CaptchaStage) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetJsUrl returns the JsUrl field value if set, zero value otherwise. +func (o *CaptchaStage) GetJsUrl() string { + if o == nil || IsNil(o.JsUrl) { + var ret string + return ret + } + return *o.JsUrl +} + +// GetJsUrlOk returns a tuple with the JsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetJsUrlOk() (*string, bool) { + if o == nil || IsNil(o.JsUrl) { + return nil, false + } + return o.JsUrl, true +} + +// HasJsUrl returns a boolean if a field has been set. +func (o *CaptchaStage) HasJsUrl() bool { + if o != nil && !IsNil(o.JsUrl) { + return true + } + + return false +} + +// SetJsUrl gets a reference to the given string and assigns it to the JsUrl field. +func (o *CaptchaStage) SetJsUrl(v string) { + o.JsUrl = &v +} + +// GetApiUrl returns the ApiUrl field value if set, zero value otherwise. +func (o *CaptchaStage) GetApiUrl() string { + if o == nil || IsNil(o.ApiUrl) { + var ret string + return ret + } + return *o.ApiUrl +} + +// GetApiUrlOk returns a tuple with the ApiUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetApiUrlOk() (*string, bool) { + if o == nil || IsNil(o.ApiUrl) { + return nil, false + } + return o.ApiUrl, true +} + +// HasApiUrl returns a boolean if a field has been set. +func (o *CaptchaStage) HasApiUrl() bool { + if o != nil && !IsNil(o.ApiUrl) { + return true + } + + return false +} + +// SetApiUrl gets a reference to the given string and assigns it to the ApiUrl field. +func (o *CaptchaStage) SetApiUrl(v string) { + o.ApiUrl = &v +} + +// GetInteractive returns the Interactive field value if set, zero value otherwise. +func (o *CaptchaStage) GetInteractive() bool { + if o == nil || IsNil(o.Interactive) { + var ret bool + return ret + } + return *o.Interactive +} + +// GetInteractiveOk returns a tuple with the Interactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetInteractiveOk() (*bool, bool) { + if o == nil || IsNil(o.Interactive) { + return nil, false + } + return o.Interactive, true +} + +// HasInteractive returns a boolean if a field has been set. +func (o *CaptchaStage) HasInteractive() bool { + if o != nil && !IsNil(o.Interactive) { + return true + } + + return false +} + +// SetInteractive gets a reference to the given bool and assigns it to the Interactive field. +func (o *CaptchaStage) SetInteractive(v bool) { + o.Interactive = &v +} + +// GetScoreMinThreshold returns the ScoreMinThreshold field value if set, zero value otherwise. +func (o *CaptchaStage) GetScoreMinThreshold() float64 { + if o == nil || IsNil(o.ScoreMinThreshold) { + var ret float64 + return ret + } + return *o.ScoreMinThreshold +} + +// GetScoreMinThresholdOk returns a tuple with the ScoreMinThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetScoreMinThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMinThreshold) { + return nil, false + } + return o.ScoreMinThreshold, true +} + +// HasScoreMinThreshold returns a boolean if a field has been set. +func (o *CaptchaStage) HasScoreMinThreshold() bool { + if o != nil && !IsNil(o.ScoreMinThreshold) { + return true + } + + return false +} + +// SetScoreMinThreshold gets a reference to the given float64 and assigns it to the ScoreMinThreshold field. +func (o *CaptchaStage) SetScoreMinThreshold(v float64) { + o.ScoreMinThreshold = &v +} + +// GetScoreMaxThreshold returns the ScoreMaxThreshold field value if set, zero value otherwise. +func (o *CaptchaStage) GetScoreMaxThreshold() float64 { + if o == nil || IsNil(o.ScoreMaxThreshold) { + var ret float64 + return ret + } + return *o.ScoreMaxThreshold +} + +// GetScoreMaxThresholdOk returns a tuple with the ScoreMaxThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetScoreMaxThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMaxThreshold) { + return nil, false + } + return o.ScoreMaxThreshold, true +} + +// HasScoreMaxThreshold returns a boolean if a field has been set. +func (o *CaptchaStage) HasScoreMaxThreshold() bool { + if o != nil && !IsNil(o.ScoreMaxThreshold) { + return true + } + + return false +} + +// SetScoreMaxThreshold gets a reference to the given float64 and assigns it to the ScoreMaxThreshold field. +func (o *CaptchaStage) SetScoreMaxThreshold(v float64) { + o.ScoreMaxThreshold = &v +} + +// GetErrorOnInvalidScore returns the ErrorOnInvalidScore field value if set, zero value otherwise. +func (o *CaptchaStage) GetErrorOnInvalidScore() bool { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + var ret bool + return ret + } + return *o.ErrorOnInvalidScore +} + +// GetErrorOnInvalidScoreOk returns a tuple with the ErrorOnInvalidScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStage) GetErrorOnInvalidScoreOk() (*bool, bool) { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + return nil, false + } + return o.ErrorOnInvalidScore, true +} + +// HasErrorOnInvalidScore returns a boolean if a field has been set. +func (o *CaptchaStage) HasErrorOnInvalidScore() bool { + if o != nil && !IsNil(o.ErrorOnInvalidScore) { + return true + } + + return false +} + +// SetErrorOnInvalidScore gets a reference to the given bool and assigns it to the ErrorOnInvalidScore field. +func (o *CaptchaStage) SetErrorOnInvalidScore(v bool) { + o.ErrorOnInvalidScore = &v +} + +func (o CaptchaStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptchaStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["public_key"] = o.PublicKey + if !IsNil(o.JsUrl) { + toSerialize["js_url"] = o.JsUrl + } + if !IsNil(o.ApiUrl) { + toSerialize["api_url"] = o.ApiUrl + } + if !IsNil(o.Interactive) { + toSerialize["interactive"] = o.Interactive + } + if !IsNil(o.ScoreMinThreshold) { + toSerialize["score_min_threshold"] = o.ScoreMinThreshold + } + if !IsNil(o.ScoreMaxThreshold) { + toSerialize["score_max_threshold"] = o.ScoreMaxThreshold + } + if !IsNil(o.ErrorOnInvalidScore) { + toSerialize["error_on_invalid_score"] = o.ErrorOnInvalidScore + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CaptchaStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "public_key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCaptchaStage := _CaptchaStage{} + + err = json.Unmarshal(data, &varCaptchaStage) + + if err != nil { + return err + } + + *o = CaptchaStage(varCaptchaStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "public_key") + delete(additionalProperties, "js_url") + delete(additionalProperties, "api_url") + delete(additionalProperties, "interactive") + delete(additionalProperties, "score_min_threshold") + delete(additionalProperties, "score_max_threshold") + delete(additionalProperties, "error_on_invalid_score") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCaptchaStage struct { + value *CaptchaStage + isSet bool +} + +func (v NullableCaptchaStage) Get() *CaptchaStage { + return v.value +} + +func (v *NullableCaptchaStage) Set(val *CaptchaStage) { + v.value = val + v.isSet = true +} + +func (v NullableCaptchaStage) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptchaStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptchaStage(val *CaptchaStage) *NullableCaptchaStage { + return &NullableCaptchaStage{value: val, isSet: true} +} + +func (v NullableCaptchaStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptchaStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_captcha_stage_request.go b/packages/client-go/model_captcha_stage_request.go new file mode 100644 index 0000000000..bc3b68aeda --- /dev/null +++ b/packages/client-go/model_captcha_stage_request.go @@ -0,0 +1,450 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CaptchaStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CaptchaStageRequest{} + +// CaptchaStageRequest CaptchaStage Serializer +type CaptchaStageRequest struct { + Name string `json:"name"` + // Public key, acquired your captcha Provider. + PublicKey string `json:"public_key"` + // Private key, acquired your captcha Provider. + PrivateKey string `json:"private_key"` + JsUrl *string `json:"js_url,omitempty"` + ApiUrl *string `json:"api_url,omitempty"` + Interactive *bool `json:"interactive,omitempty"` + ScoreMinThreshold *float64 `json:"score_min_threshold,omitempty"` + ScoreMaxThreshold *float64 `json:"score_max_threshold,omitempty"` + // When enabled and the received captcha score is outside of the given threshold, the stage will show an error message. When not enabled, the flow will continue, but the data from the captcha will be available in the context for policy decisions + ErrorOnInvalidScore *bool `json:"error_on_invalid_score,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CaptchaStageRequest CaptchaStageRequest + +// NewCaptchaStageRequest instantiates a new CaptchaStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCaptchaStageRequest(name string, publicKey string, privateKey string) *CaptchaStageRequest { + this := CaptchaStageRequest{} + this.Name = name + this.PublicKey = publicKey + this.PrivateKey = privateKey + return &this +} + +// NewCaptchaStageRequestWithDefaults instantiates a new CaptchaStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCaptchaStageRequestWithDefaults() *CaptchaStageRequest { + this := CaptchaStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *CaptchaStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CaptchaStageRequest) SetName(v string) { + o.Name = v +} + +// GetPublicKey returns the PublicKey field value +func (o *CaptchaStageRequest) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CaptchaStageRequest) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetPrivateKey returns the PrivateKey field value +func (o *CaptchaStageRequest) GetPrivateKey() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetPrivateKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKey, true +} + +// SetPrivateKey sets field value +func (o *CaptchaStageRequest) SetPrivateKey(v string) { + o.PrivateKey = v +} + +// GetJsUrl returns the JsUrl field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetJsUrl() string { + if o == nil || IsNil(o.JsUrl) { + var ret string + return ret + } + return *o.JsUrl +} + +// GetJsUrlOk returns a tuple with the JsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetJsUrlOk() (*string, bool) { + if o == nil || IsNil(o.JsUrl) { + return nil, false + } + return o.JsUrl, true +} + +// HasJsUrl returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasJsUrl() bool { + if o != nil && !IsNil(o.JsUrl) { + return true + } + + return false +} + +// SetJsUrl gets a reference to the given string and assigns it to the JsUrl field. +func (o *CaptchaStageRequest) SetJsUrl(v string) { + o.JsUrl = &v +} + +// GetApiUrl returns the ApiUrl field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetApiUrl() string { + if o == nil || IsNil(o.ApiUrl) { + var ret string + return ret + } + return *o.ApiUrl +} + +// GetApiUrlOk returns a tuple with the ApiUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetApiUrlOk() (*string, bool) { + if o == nil || IsNil(o.ApiUrl) { + return nil, false + } + return o.ApiUrl, true +} + +// HasApiUrl returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasApiUrl() bool { + if o != nil && !IsNil(o.ApiUrl) { + return true + } + + return false +} + +// SetApiUrl gets a reference to the given string and assigns it to the ApiUrl field. +func (o *CaptchaStageRequest) SetApiUrl(v string) { + o.ApiUrl = &v +} + +// GetInteractive returns the Interactive field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetInteractive() bool { + if o == nil || IsNil(o.Interactive) { + var ret bool + return ret + } + return *o.Interactive +} + +// GetInteractiveOk returns a tuple with the Interactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetInteractiveOk() (*bool, bool) { + if o == nil || IsNil(o.Interactive) { + return nil, false + } + return o.Interactive, true +} + +// HasInteractive returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasInteractive() bool { + if o != nil && !IsNil(o.Interactive) { + return true + } + + return false +} + +// SetInteractive gets a reference to the given bool and assigns it to the Interactive field. +func (o *CaptchaStageRequest) SetInteractive(v bool) { + o.Interactive = &v +} + +// GetScoreMinThreshold returns the ScoreMinThreshold field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetScoreMinThreshold() float64 { + if o == nil || IsNil(o.ScoreMinThreshold) { + var ret float64 + return ret + } + return *o.ScoreMinThreshold +} + +// GetScoreMinThresholdOk returns a tuple with the ScoreMinThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetScoreMinThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMinThreshold) { + return nil, false + } + return o.ScoreMinThreshold, true +} + +// HasScoreMinThreshold returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasScoreMinThreshold() bool { + if o != nil && !IsNil(o.ScoreMinThreshold) { + return true + } + + return false +} + +// SetScoreMinThreshold gets a reference to the given float64 and assigns it to the ScoreMinThreshold field. +func (o *CaptchaStageRequest) SetScoreMinThreshold(v float64) { + o.ScoreMinThreshold = &v +} + +// GetScoreMaxThreshold returns the ScoreMaxThreshold field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetScoreMaxThreshold() float64 { + if o == nil || IsNil(o.ScoreMaxThreshold) { + var ret float64 + return ret + } + return *o.ScoreMaxThreshold +} + +// GetScoreMaxThresholdOk returns a tuple with the ScoreMaxThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetScoreMaxThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMaxThreshold) { + return nil, false + } + return o.ScoreMaxThreshold, true +} + +// HasScoreMaxThreshold returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasScoreMaxThreshold() bool { + if o != nil && !IsNil(o.ScoreMaxThreshold) { + return true + } + + return false +} + +// SetScoreMaxThreshold gets a reference to the given float64 and assigns it to the ScoreMaxThreshold field. +func (o *CaptchaStageRequest) SetScoreMaxThreshold(v float64) { + o.ScoreMaxThreshold = &v +} + +// GetErrorOnInvalidScore returns the ErrorOnInvalidScore field value if set, zero value otherwise. +func (o *CaptchaStageRequest) GetErrorOnInvalidScore() bool { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + var ret bool + return ret + } + return *o.ErrorOnInvalidScore +} + +// GetErrorOnInvalidScoreOk returns a tuple with the ErrorOnInvalidScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaptchaStageRequest) GetErrorOnInvalidScoreOk() (*bool, bool) { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + return nil, false + } + return o.ErrorOnInvalidScore, true +} + +// HasErrorOnInvalidScore returns a boolean if a field has been set. +func (o *CaptchaStageRequest) HasErrorOnInvalidScore() bool { + if o != nil && !IsNil(o.ErrorOnInvalidScore) { + return true + } + + return false +} + +// SetErrorOnInvalidScore gets a reference to the given bool and assigns it to the ErrorOnInvalidScore field. +func (o *CaptchaStageRequest) SetErrorOnInvalidScore(v bool) { + o.ErrorOnInvalidScore = &v +} + +func (o CaptchaStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CaptchaStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["public_key"] = o.PublicKey + toSerialize["private_key"] = o.PrivateKey + if !IsNil(o.JsUrl) { + toSerialize["js_url"] = o.JsUrl + } + if !IsNil(o.ApiUrl) { + toSerialize["api_url"] = o.ApiUrl + } + if !IsNil(o.Interactive) { + toSerialize["interactive"] = o.Interactive + } + if !IsNil(o.ScoreMinThreshold) { + toSerialize["score_min_threshold"] = o.ScoreMinThreshold + } + if !IsNil(o.ScoreMaxThreshold) { + toSerialize["score_max_threshold"] = o.ScoreMaxThreshold + } + if !IsNil(o.ErrorOnInvalidScore) { + toSerialize["error_on_invalid_score"] = o.ErrorOnInvalidScore + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CaptchaStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "public_key", + "private_key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCaptchaStageRequest := _CaptchaStageRequest{} + + err = json.Unmarshal(data, &varCaptchaStageRequest) + + if err != nil { + return err + } + + *o = CaptchaStageRequest(varCaptchaStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "public_key") + delete(additionalProperties, "private_key") + delete(additionalProperties, "js_url") + delete(additionalProperties, "api_url") + delete(additionalProperties, "interactive") + delete(additionalProperties, "score_min_threshold") + delete(additionalProperties, "score_max_threshold") + delete(additionalProperties, "error_on_invalid_score") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCaptchaStageRequest struct { + value *CaptchaStageRequest + isSet bool +} + +func (v NullableCaptchaStageRequest) Get() *CaptchaStageRequest { + return v.value +} + +func (v *NullableCaptchaStageRequest) Set(val *CaptchaStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCaptchaStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCaptchaStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCaptchaStageRequest(val *CaptchaStageRequest) *NullableCaptchaStageRequest { + return &NullableCaptchaStageRequest{value: val, isSet: true} +} + +func (v NullableCaptchaStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCaptchaStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_cert_attribute_enum.go b/packages/client-go/model_cert_attribute_enum.go new file mode 100644 index 0000000000..4c6fb6de55 --- /dev/null +++ b/packages/client-go/model_cert_attribute_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// CertAttributeEnum the model 'CertAttributeEnum' +type CertAttributeEnum string + +// List of CertAttributeEnum +const ( + CERTATTRIBUTEENUM_SUBJECT CertAttributeEnum = "subject" + CERTATTRIBUTEENUM_COMMON_NAME CertAttributeEnum = "common_name" + CERTATTRIBUTEENUM_EMAIL CertAttributeEnum = "email" +) + +// All allowed values of CertAttributeEnum enum +var AllowedCertAttributeEnumEnumValues = []CertAttributeEnum{ + "subject", + "common_name", + "email", +} + +func (v *CertAttributeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CertAttributeEnum(value) + for _, existing := range AllowedCertAttributeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CertAttributeEnum", value) +} + +// NewCertAttributeEnumFromValue returns a pointer to a valid CertAttributeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCertAttributeEnumFromValue(v string) (*CertAttributeEnum, error) { + ev := CertAttributeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CertAttributeEnum: valid values are %v", v, AllowedCertAttributeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CertAttributeEnum) IsValid() bool { + for _, existing := range AllowedCertAttributeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CertAttributeEnum value +func (v CertAttributeEnum) Ptr() *CertAttributeEnum { + return &v +} + +type NullableCertAttributeEnum struct { + value *CertAttributeEnum + isSet bool +} + +func (v NullableCertAttributeEnum) Get() *CertAttributeEnum { + return v.value +} + +func (v *NullableCertAttributeEnum) Set(val *CertAttributeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableCertAttributeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableCertAttributeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertAttributeEnum(val *CertAttributeEnum) *NullableCertAttributeEnum { + return &NullableCertAttributeEnum{value: val, isSet: true} +} + +func (v NullableCertAttributeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertAttributeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_certificate_data.go b/packages/client-go/model_certificate_data.go new file mode 100644 index 0000000000..0045e45cc2 --- /dev/null +++ b/packages/client-go/model_certificate_data.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CertificateData type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateData{} + +// CertificateData Get CertificateKeyPair's data +type CertificateData struct { + Data string `json:"data"` + AdditionalProperties map[string]interface{} +} + +type _CertificateData CertificateData + +// NewCertificateData instantiates a new CertificateData object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCertificateData(data string) *CertificateData { + this := CertificateData{} + this.Data = data + return &this +} + +// NewCertificateDataWithDefaults instantiates a new CertificateData object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCertificateDataWithDefaults() *CertificateData { + this := CertificateData{} + return &this +} + +// GetData returns the Data field value +func (o *CertificateData) GetData() string { + if o == nil { + var ret string + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CertificateData) GetDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *CertificateData) SetData(v string) { + o.Data = v +} + +func (o CertificateData) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CertificateData) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CertificateData) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCertificateData := _CertificateData{} + + err = json.Unmarshal(data, &varCertificateData) + + if err != nil { + return err + } + + *o = CertificateData(varCertificateData) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCertificateData struct { + value *CertificateData + isSet bool +} + +func (v NullableCertificateData) Get() *CertificateData { + return v.value +} + +func (v *NullableCertificateData) Set(val *CertificateData) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateData) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateData) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateData(val *CertificateData) *NullableCertificateData { + return &NullableCertificateData{value: val, isSet: true} +} + +func (v NullableCertificateData) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateData) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_certificate_generation_request.go b/packages/client-go/model_certificate_generation_request.go new file mode 100644 index 0000000000..69d188cf29 --- /dev/null +++ b/packages/client-go/model_certificate_generation_request.go @@ -0,0 +1,274 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CertificateGenerationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateGenerationRequest{} + +// CertificateGenerationRequest Certificate generation parameters +type CertificateGenerationRequest struct { + CommonName string `json:"common_name"` + SubjectAltName *string `json:"subject_alt_name,omitempty"` + ValidityDays int32 `json:"validity_days"` + Alg *AlgEnum `json:"alg,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CertificateGenerationRequest CertificateGenerationRequest + +// NewCertificateGenerationRequest instantiates a new CertificateGenerationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCertificateGenerationRequest(commonName string, validityDays int32) *CertificateGenerationRequest { + this := CertificateGenerationRequest{} + this.CommonName = commonName + this.ValidityDays = validityDays + var alg AlgEnum = ALGENUM_RSA + this.Alg = &alg + return &this +} + +// NewCertificateGenerationRequestWithDefaults instantiates a new CertificateGenerationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCertificateGenerationRequestWithDefaults() *CertificateGenerationRequest { + this := CertificateGenerationRequest{} + var alg AlgEnum = ALGENUM_RSA + this.Alg = &alg + return &this +} + +// GetCommonName returns the CommonName field value +func (o *CertificateGenerationRequest) GetCommonName() string { + if o == nil { + var ret string + return ret + } + + return o.CommonName +} + +// GetCommonNameOk returns a tuple with the CommonName field value +// and a boolean to check if the value has been set. +func (o *CertificateGenerationRequest) GetCommonNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CommonName, true +} + +// SetCommonName sets field value +func (o *CertificateGenerationRequest) SetCommonName(v string) { + o.CommonName = v +} + +// GetSubjectAltName returns the SubjectAltName field value if set, zero value otherwise. +func (o *CertificateGenerationRequest) GetSubjectAltName() string { + if o == nil || IsNil(o.SubjectAltName) { + var ret string + return ret + } + return *o.SubjectAltName +} + +// GetSubjectAltNameOk returns a tuple with the SubjectAltName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertificateGenerationRequest) GetSubjectAltNameOk() (*string, bool) { + if o == nil || IsNil(o.SubjectAltName) { + return nil, false + } + return o.SubjectAltName, true +} + +// HasSubjectAltName returns a boolean if a field has been set. +func (o *CertificateGenerationRequest) HasSubjectAltName() bool { + if o != nil && !IsNil(o.SubjectAltName) { + return true + } + + return false +} + +// SetSubjectAltName gets a reference to the given string and assigns it to the SubjectAltName field. +func (o *CertificateGenerationRequest) SetSubjectAltName(v string) { + o.SubjectAltName = &v +} + +// GetValidityDays returns the ValidityDays field value +func (o *CertificateGenerationRequest) GetValidityDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ValidityDays +} + +// GetValidityDaysOk returns a tuple with the ValidityDays field value +// and a boolean to check if the value has been set. +func (o *CertificateGenerationRequest) GetValidityDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ValidityDays, true +} + +// SetValidityDays sets field value +func (o *CertificateGenerationRequest) SetValidityDays(v int32) { + o.ValidityDays = v +} + +// GetAlg returns the Alg field value if set, zero value otherwise. +func (o *CertificateGenerationRequest) GetAlg() AlgEnum { + if o == nil || IsNil(o.Alg) { + var ret AlgEnum + return ret + } + return *o.Alg +} + +// GetAlgOk returns a tuple with the Alg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertificateGenerationRequest) GetAlgOk() (*AlgEnum, bool) { + if o == nil || IsNil(o.Alg) { + return nil, false + } + return o.Alg, true +} + +// HasAlg returns a boolean if a field has been set. +func (o *CertificateGenerationRequest) HasAlg() bool { + if o != nil && !IsNil(o.Alg) { + return true + } + + return false +} + +// SetAlg gets a reference to the given AlgEnum and assigns it to the Alg field. +func (o *CertificateGenerationRequest) SetAlg(v AlgEnum) { + o.Alg = &v +} + +func (o CertificateGenerationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CertificateGenerationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["common_name"] = o.CommonName + if !IsNil(o.SubjectAltName) { + toSerialize["subject_alt_name"] = o.SubjectAltName + } + toSerialize["validity_days"] = o.ValidityDays + if !IsNil(o.Alg) { + toSerialize["alg"] = o.Alg + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CertificateGenerationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "common_name", + "validity_days", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCertificateGenerationRequest := _CertificateGenerationRequest{} + + err = json.Unmarshal(data, &varCertificateGenerationRequest) + + if err != nil { + return err + } + + *o = CertificateGenerationRequest(varCertificateGenerationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "common_name") + delete(additionalProperties, "subject_alt_name") + delete(additionalProperties, "validity_days") + delete(additionalProperties, "alg") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCertificateGenerationRequest struct { + value *CertificateGenerationRequest + isSet bool +} + +func (v NullableCertificateGenerationRequest) Get() *CertificateGenerationRequest { + return v.value +} + +func (v *NullableCertificateGenerationRequest) Set(val *CertificateGenerationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateGenerationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateGenerationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateGenerationRequest(val *CertificateGenerationRequest) *NullableCertificateGenerationRequest { + return &NullableCertificateGenerationRequest{value: val, isSet: true} +} + +func (v NullableCertificateGenerationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateGenerationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_certificate_key_pair.go b/packages/client-go/model_certificate_key_pair.go new file mode 100644 index 0000000000..af98b4fe78 --- /dev/null +++ b/packages/client-go/model_certificate_key_pair.go @@ -0,0 +1,479 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the CertificateKeyPair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateKeyPair{} + +// CertificateKeyPair CertificateKeyPair Serializer +type CertificateKeyPair struct { + Pk string `json:"pk"` + Name string `json:"name"` + // SHA256 fingerprint of the certificate + FingerprintSha256 NullableString `json:"fingerprint_sha256"` + // SHA1 fingerprint of the certificate + FingerprintSha1 NullableString `json:"fingerprint_sha1"` + // Certificate expiry date + CertExpiry NullableTime `json:"cert_expiry"` + // Certificate subject as RFC4514 string + CertSubject NullableString `json:"cert_subject"` + // Show if this keypair has a private key configured or not + PrivateKeyAvailable bool `json:"private_key_available"` + // Key algorithm type detected from the certificate's public key + KeyType NullableKeyTypeEnum `json:"key_type"` + // Get URL to download certificate + CertificateDownloadUrl string `json:"certificate_download_url"` + // Get URL to download private key + PrivateKeyDownloadUrl string `json:"private_key_download_url"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + AdditionalProperties map[string]interface{} +} + +type _CertificateKeyPair CertificateKeyPair + +// NewCertificateKeyPair instantiates a new CertificateKeyPair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCertificateKeyPair(pk string, name string, fingerprintSha256 NullableString, fingerprintSha1 NullableString, certExpiry NullableTime, certSubject NullableString, privateKeyAvailable bool, keyType NullableKeyTypeEnum, certificateDownloadUrl string, privateKeyDownloadUrl string, managed NullableString) *CertificateKeyPair { + this := CertificateKeyPair{} + this.Pk = pk + this.Name = name + this.FingerprintSha256 = fingerprintSha256 + this.FingerprintSha1 = fingerprintSha1 + this.CertExpiry = certExpiry + this.CertSubject = certSubject + this.PrivateKeyAvailable = privateKeyAvailable + this.KeyType = keyType + this.CertificateDownloadUrl = certificateDownloadUrl + this.PrivateKeyDownloadUrl = privateKeyDownloadUrl + this.Managed = managed + return &this +} + +// NewCertificateKeyPairWithDefaults instantiates a new CertificateKeyPair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCertificateKeyPairWithDefaults() *CertificateKeyPair { + this := CertificateKeyPair{} + return &this +} + +// GetPk returns the Pk field value +func (o *CertificateKeyPair) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPair) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *CertificateKeyPair) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *CertificateKeyPair) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPair) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CertificateKeyPair) SetName(v string) { + o.Name = v +} + +// GetFingerprintSha256 returns the FingerprintSha256 field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CertificateKeyPair) GetFingerprintSha256() string { + if o == nil || o.FingerprintSha256.Get() == nil { + var ret string + return ret + } + + return *o.FingerprintSha256.Get() +} + +// GetFingerprintSha256Ok returns a tuple with the FingerprintSha256 field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetFingerprintSha256Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.FingerprintSha256.Get(), o.FingerprintSha256.IsSet() +} + +// SetFingerprintSha256 sets field value +func (o *CertificateKeyPair) SetFingerprintSha256(v string) { + o.FingerprintSha256.Set(&v) +} + +// GetFingerprintSha1 returns the FingerprintSha1 field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CertificateKeyPair) GetFingerprintSha1() string { + if o == nil || o.FingerprintSha1.Get() == nil { + var ret string + return ret + } + + return *o.FingerprintSha1.Get() +} + +// GetFingerprintSha1Ok returns a tuple with the FingerprintSha1 field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetFingerprintSha1Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.FingerprintSha1.Get(), o.FingerprintSha1.IsSet() +} + +// SetFingerprintSha1 sets field value +func (o *CertificateKeyPair) SetFingerprintSha1(v string) { + o.FingerprintSha1.Set(&v) +} + +// GetCertExpiry returns the CertExpiry field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *CertificateKeyPair) GetCertExpiry() time.Time { + if o == nil || o.CertExpiry.Get() == nil { + var ret time.Time + return ret + } + + return *o.CertExpiry.Get() +} + +// GetCertExpiryOk returns a tuple with the CertExpiry field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetCertExpiryOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.CertExpiry.Get(), o.CertExpiry.IsSet() +} + +// SetCertExpiry sets field value +func (o *CertificateKeyPair) SetCertExpiry(v time.Time) { + o.CertExpiry.Set(&v) +} + +// GetCertSubject returns the CertSubject field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CertificateKeyPair) GetCertSubject() string { + if o == nil || o.CertSubject.Get() == nil { + var ret string + return ret + } + + return *o.CertSubject.Get() +} + +// GetCertSubjectOk returns a tuple with the CertSubject field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetCertSubjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CertSubject.Get(), o.CertSubject.IsSet() +} + +// SetCertSubject sets field value +func (o *CertificateKeyPair) SetCertSubject(v string) { + o.CertSubject.Set(&v) +} + +// GetPrivateKeyAvailable returns the PrivateKeyAvailable field value +func (o *CertificateKeyPair) GetPrivateKeyAvailable() bool { + if o == nil { + var ret bool + return ret + } + + return o.PrivateKeyAvailable +} + +// GetPrivateKeyAvailableOk returns a tuple with the PrivateKeyAvailable field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPair) GetPrivateKeyAvailableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKeyAvailable, true +} + +// SetPrivateKeyAvailable sets field value +func (o *CertificateKeyPair) SetPrivateKeyAvailable(v bool) { + o.PrivateKeyAvailable = v +} + +// GetKeyType returns the KeyType field value +// If the value is explicit nil, the zero value for KeyTypeEnum will be returned +func (o *CertificateKeyPair) GetKeyType() KeyTypeEnum { + if o == nil || o.KeyType.Get() == nil { + var ret KeyTypeEnum + return ret + } + + return *o.KeyType.Get() +} + +// GetKeyTypeOk returns a tuple with the KeyType field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetKeyTypeOk() (*KeyTypeEnum, bool) { + if o == nil { + return nil, false + } + return o.KeyType.Get(), o.KeyType.IsSet() +} + +// SetKeyType sets field value +func (o *CertificateKeyPair) SetKeyType(v KeyTypeEnum) { + o.KeyType.Set(&v) +} + +// GetCertificateDownloadUrl returns the CertificateDownloadUrl field value +func (o *CertificateKeyPair) GetCertificateDownloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.CertificateDownloadUrl +} + +// GetCertificateDownloadUrlOk returns a tuple with the CertificateDownloadUrl field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPair) GetCertificateDownloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CertificateDownloadUrl, true +} + +// SetCertificateDownloadUrl sets field value +func (o *CertificateKeyPair) SetCertificateDownloadUrl(v string) { + o.CertificateDownloadUrl = v +} + +// GetPrivateKeyDownloadUrl returns the PrivateKeyDownloadUrl field value +func (o *CertificateKeyPair) GetPrivateKeyDownloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.PrivateKeyDownloadUrl +} + +// GetPrivateKeyDownloadUrlOk returns a tuple with the PrivateKeyDownloadUrl field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPair) GetPrivateKeyDownloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrivateKeyDownloadUrl, true +} + +// SetPrivateKeyDownloadUrl sets field value +func (o *CertificateKeyPair) SetPrivateKeyDownloadUrl(v string) { + o.PrivateKeyDownloadUrl = v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *CertificateKeyPair) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CertificateKeyPair) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *CertificateKeyPair) SetManaged(v string) { + o.Managed.Set(&v) +} + +func (o CertificateKeyPair) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CertificateKeyPair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["fingerprint_sha256"] = o.FingerprintSha256.Get() + toSerialize["fingerprint_sha1"] = o.FingerprintSha1.Get() + toSerialize["cert_expiry"] = o.CertExpiry.Get() + toSerialize["cert_subject"] = o.CertSubject.Get() + toSerialize["private_key_available"] = o.PrivateKeyAvailable + toSerialize["key_type"] = o.KeyType.Get() + toSerialize["certificate_download_url"] = o.CertificateDownloadUrl + toSerialize["private_key_download_url"] = o.PrivateKeyDownloadUrl + toSerialize["managed"] = o.Managed.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CertificateKeyPair) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "fingerprint_sha256", + "fingerprint_sha1", + "cert_expiry", + "cert_subject", + "private_key_available", + "key_type", + "certificate_download_url", + "private_key_download_url", + "managed", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCertificateKeyPair := _CertificateKeyPair{} + + err = json.Unmarshal(data, &varCertificateKeyPair) + + if err != nil { + return err + } + + *o = CertificateKeyPair(varCertificateKeyPair) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "fingerprint_sha256") + delete(additionalProperties, "fingerprint_sha1") + delete(additionalProperties, "cert_expiry") + delete(additionalProperties, "cert_subject") + delete(additionalProperties, "private_key_available") + delete(additionalProperties, "key_type") + delete(additionalProperties, "certificate_download_url") + delete(additionalProperties, "private_key_download_url") + delete(additionalProperties, "managed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCertificateKeyPair struct { + value *CertificateKeyPair + isSet bool +} + +func (v NullableCertificateKeyPair) Get() *CertificateKeyPair { + return v.value +} + +func (v *NullableCertificateKeyPair) Set(val *CertificateKeyPair) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateKeyPair) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateKeyPair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateKeyPair(val *CertificateKeyPair) *NullableCertificateKeyPair { + return &NullableCertificateKeyPair{value: val, isSet: true} +} + +func (v NullableCertificateKeyPair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateKeyPair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_certificate_key_pair_request.go b/packages/client-go/model_certificate_key_pair_request.go new file mode 100644 index 0000000000..6ca8eb8d13 --- /dev/null +++ b/packages/client-go/model_certificate_key_pair_request.go @@ -0,0 +1,235 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CertificateKeyPairRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CertificateKeyPairRequest{} + +// CertificateKeyPairRequest CertificateKeyPair Serializer +type CertificateKeyPairRequest struct { + Name string `json:"name"` + // PEM-encoded Certificate data + CertificateData string `json:"certificate_data"` + // Optional Private Key. If this is set, you can use this keypair for encryption. + KeyData *string `json:"key_data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CertificateKeyPairRequest CertificateKeyPairRequest + +// NewCertificateKeyPairRequest instantiates a new CertificateKeyPairRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCertificateKeyPairRequest(name string, certificateData string) *CertificateKeyPairRequest { + this := CertificateKeyPairRequest{} + this.Name = name + this.CertificateData = certificateData + return &this +} + +// NewCertificateKeyPairRequestWithDefaults instantiates a new CertificateKeyPairRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCertificateKeyPairRequestWithDefaults() *CertificateKeyPairRequest { + this := CertificateKeyPairRequest{} + return &this +} + +// GetName returns the Name field value +func (o *CertificateKeyPairRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPairRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CertificateKeyPairRequest) SetName(v string) { + o.Name = v +} + +// GetCertificateData returns the CertificateData field value +func (o *CertificateKeyPairRequest) GetCertificateData() string { + if o == nil { + var ret string + return ret + } + + return o.CertificateData +} + +// GetCertificateDataOk returns a tuple with the CertificateData field value +// and a boolean to check if the value has been set. +func (o *CertificateKeyPairRequest) GetCertificateDataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CertificateData, true +} + +// SetCertificateData sets field value +func (o *CertificateKeyPairRequest) SetCertificateData(v string) { + o.CertificateData = v +} + +// GetKeyData returns the KeyData field value if set, zero value otherwise. +func (o *CertificateKeyPairRequest) GetKeyData() string { + if o == nil || IsNil(o.KeyData) { + var ret string + return ret + } + return *o.KeyData +} + +// GetKeyDataOk returns a tuple with the KeyData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CertificateKeyPairRequest) GetKeyDataOk() (*string, bool) { + if o == nil || IsNil(o.KeyData) { + return nil, false + } + return o.KeyData, true +} + +// HasKeyData returns a boolean if a field has been set. +func (o *CertificateKeyPairRequest) HasKeyData() bool { + if o != nil && !IsNil(o.KeyData) { + return true + } + + return false +} + +// SetKeyData gets a reference to the given string and assigns it to the KeyData field. +func (o *CertificateKeyPairRequest) SetKeyData(v string) { + o.KeyData = &v +} + +func (o CertificateKeyPairRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CertificateKeyPairRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["certificate_data"] = o.CertificateData + if !IsNil(o.KeyData) { + toSerialize["key_data"] = o.KeyData + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CertificateKeyPairRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "certificate_data", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCertificateKeyPairRequest := _CertificateKeyPairRequest{} + + err = json.Unmarshal(data, &varCertificateKeyPairRequest) + + if err != nil { + return err + } + + *o = CertificateKeyPairRequest(varCertificateKeyPairRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "certificate_data") + delete(additionalProperties, "key_data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCertificateKeyPairRequest struct { + value *CertificateKeyPairRequest + isSet bool +} + +func (v NullableCertificateKeyPairRequest) Get() *CertificateKeyPairRequest { + return v.value +} + +func (v *NullableCertificateKeyPairRequest) Set(val *CertificateKeyPairRequest) { + v.value = val + v.isSet = true +} + +func (v NullableCertificateKeyPairRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableCertificateKeyPairRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCertificateKeyPairRequest(val *CertificateKeyPairRequest) *NullableCertificateKeyPairRequest { + return &NullableCertificateKeyPairRequest{value: val, isSet: true} +} + +func (v NullableCertificateKeyPairRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCertificateKeyPairRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_challenge_types.go b/packages/client-go/model_challenge_types.go new file mode 100644 index 0000000000..e4e0845348 --- /dev/null +++ b/packages/client-go/model_challenge_types.go @@ -0,0 +1,1050 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ChallengeTypes - struct for ChallengeTypes +type ChallengeTypes struct { + AccessDeniedChallenge *AccessDeniedChallenge + AppleLoginChallenge *AppleLoginChallenge + AuthenticatorDuoChallenge *AuthenticatorDuoChallenge + AuthenticatorEmailChallenge *AuthenticatorEmailChallenge + AuthenticatorSMSChallenge *AuthenticatorSMSChallenge + AuthenticatorStaticChallenge *AuthenticatorStaticChallenge + AuthenticatorTOTPChallenge *AuthenticatorTOTPChallenge + AuthenticatorValidationChallenge *AuthenticatorValidationChallenge + AuthenticatorWebAuthnChallenge *AuthenticatorWebAuthnChallenge + AutosubmitChallenge *AutosubmitChallenge + CaptchaChallenge *CaptchaChallenge + ConsentChallenge *ConsentChallenge + DummyChallenge *DummyChallenge + EmailChallenge *EmailChallenge + EndpointAgentChallenge *EndpointAgentChallenge + FlowErrorChallenge *FlowErrorChallenge + FrameChallenge *FrameChallenge + IdentificationChallenge *IdentificationChallenge + IframeLogoutChallenge *IframeLogoutChallenge + NativeLogoutChallenge *NativeLogoutChallenge + OAuthDeviceCodeChallenge *OAuthDeviceCodeChallenge + OAuthDeviceCodeFinishChallenge *OAuthDeviceCodeFinishChallenge + PasswordChallenge *PasswordChallenge + PlexAuthenticationChallenge *PlexAuthenticationChallenge + PromptChallenge *PromptChallenge + RedirectChallenge *RedirectChallenge + SessionEndChallenge *SessionEndChallenge + ShellChallenge *ShellChallenge + TelegramLoginChallenge *TelegramLoginChallenge + UserLoginChallenge *UserLoginChallenge +} + +// AccessDeniedChallengeAsChallengeTypes is a convenience function that returns AccessDeniedChallenge wrapped in ChallengeTypes +func AccessDeniedChallengeAsChallengeTypes(v *AccessDeniedChallenge) ChallengeTypes { + return ChallengeTypes{ + AccessDeniedChallenge: v, + } +} + +// AppleLoginChallengeAsChallengeTypes is a convenience function that returns AppleLoginChallenge wrapped in ChallengeTypes +func AppleLoginChallengeAsChallengeTypes(v *AppleLoginChallenge) ChallengeTypes { + return ChallengeTypes{ + AppleLoginChallenge: v, + } +} + +// AuthenticatorDuoChallengeAsChallengeTypes is a convenience function that returns AuthenticatorDuoChallenge wrapped in ChallengeTypes +func AuthenticatorDuoChallengeAsChallengeTypes(v *AuthenticatorDuoChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorDuoChallenge: v, + } +} + +// AuthenticatorEmailChallengeAsChallengeTypes is a convenience function that returns AuthenticatorEmailChallenge wrapped in ChallengeTypes +func AuthenticatorEmailChallengeAsChallengeTypes(v *AuthenticatorEmailChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorEmailChallenge: v, + } +} + +// AuthenticatorSMSChallengeAsChallengeTypes is a convenience function that returns AuthenticatorSMSChallenge wrapped in ChallengeTypes +func AuthenticatorSMSChallengeAsChallengeTypes(v *AuthenticatorSMSChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorSMSChallenge: v, + } +} + +// AuthenticatorStaticChallengeAsChallengeTypes is a convenience function that returns AuthenticatorStaticChallenge wrapped in ChallengeTypes +func AuthenticatorStaticChallengeAsChallengeTypes(v *AuthenticatorStaticChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorStaticChallenge: v, + } +} + +// AuthenticatorTOTPChallengeAsChallengeTypes is a convenience function that returns AuthenticatorTOTPChallenge wrapped in ChallengeTypes +func AuthenticatorTOTPChallengeAsChallengeTypes(v *AuthenticatorTOTPChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorTOTPChallenge: v, + } +} + +// AuthenticatorValidationChallengeAsChallengeTypes is a convenience function that returns AuthenticatorValidationChallenge wrapped in ChallengeTypes +func AuthenticatorValidationChallengeAsChallengeTypes(v *AuthenticatorValidationChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorValidationChallenge: v, + } +} + +// AuthenticatorWebAuthnChallengeAsChallengeTypes is a convenience function that returns AuthenticatorWebAuthnChallenge wrapped in ChallengeTypes +func AuthenticatorWebAuthnChallengeAsChallengeTypes(v *AuthenticatorWebAuthnChallenge) ChallengeTypes { + return ChallengeTypes{ + AuthenticatorWebAuthnChallenge: v, + } +} + +// AutosubmitChallengeAsChallengeTypes is a convenience function that returns AutosubmitChallenge wrapped in ChallengeTypes +func AutosubmitChallengeAsChallengeTypes(v *AutosubmitChallenge) ChallengeTypes { + return ChallengeTypes{ + AutosubmitChallenge: v, + } +} + +// CaptchaChallengeAsChallengeTypes is a convenience function that returns CaptchaChallenge wrapped in ChallengeTypes +func CaptchaChallengeAsChallengeTypes(v *CaptchaChallenge) ChallengeTypes { + return ChallengeTypes{ + CaptchaChallenge: v, + } +} + +// ConsentChallengeAsChallengeTypes is a convenience function that returns ConsentChallenge wrapped in ChallengeTypes +func ConsentChallengeAsChallengeTypes(v *ConsentChallenge) ChallengeTypes { + return ChallengeTypes{ + ConsentChallenge: v, + } +} + +// DummyChallengeAsChallengeTypes is a convenience function that returns DummyChallenge wrapped in ChallengeTypes +func DummyChallengeAsChallengeTypes(v *DummyChallenge) ChallengeTypes { + return ChallengeTypes{ + DummyChallenge: v, + } +} + +// EmailChallengeAsChallengeTypes is a convenience function that returns EmailChallenge wrapped in ChallengeTypes +func EmailChallengeAsChallengeTypes(v *EmailChallenge) ChallengeTypes { + return ChallengeTypes{ + EmailChallenge: v, + } +} + +// EndpointAgentChallengeAsChallengeTypes is a convenience function that returns EndpointAgentChallenge wrapped in ChallengeTypes +func EndpointAgentChallengeAsChallengeTypes(v *EndpointAgentChallenge) ChallengeTypes { + return ChallengeTypes{ + EndpointAgentChallenge: v, + } +} + +// FlowErrorChallengeAsChallengeTypes is a convenience function that returns FlowErrorChallenge wrapped in ChallengeTypes +func FlowErrorChallengeAsChallengeTypes(v *FlowErrorChallenge) ChallengeTypes { + return ChallengeTypes{ + FlowErrorChallenge: v, + } +} + +// FrameChallengeAsChallengeTypes is a convenience function that returns FrameChallenge wrapped in ChallengeTypes +func FrameChallengeAsChallengeTypes(v *FrameChallenge) ChallengeTypes { + return ChallengeTypes{ + FrameChallenge: v, + } +} + +// IdentificationChallengeAsChallengeTypes is a convenience function that returns IdentificationChallenge wrapped in ChallengeTypes +func IdentificationChallengeAsChallengeTypes(v *IdentificationChallenge) ChallengeTypes { + return ChallengeTypes{ + IdentificationChallenge: v, + } +} + +// IframeLogoutChallengeAsChallengeTypes is a convenience function that returns IframeLogoutChallenge wrapped in ChallengeTypes +func IframeLogoutChallengeAsChallengeTypes(v *IframeLogoutChallenge) ChallengeTypes { + return ChallengeTypes{ + IframeLogoutChallenge: v, + } +} + +// NativeLogoutChallengeAsChallengeTypes is a convenience function that returns NativeLogoutChallenge wrapped in ChallengeTypes +func NativeLogoutChallengeAsChallengeTypes(v *NativeLogoutChallenge) ChallengeTypes { + return ChallengeTypes{ + NativeLogoutChallenge: v, + } +} + +// OAuthDeviceCodeChallengeAsChallengeTypes is a convenience function that returns OAuthDeviceCodeChallenge wrapped in ChallengeTypes +func OAuthDeviceCodeChallengeAsChallengeTypes(v *OAuthDeviceCodeChallenge) ChallengeTypes { + return ChallengeTypes{ + OAuthDeviceCodeChallenge: v, + } +} + +// OAuthDeviceCodeFinishChallengeAsChallengeTypes is a convenience function that returns OAuthDeviceCodeFinishChallenge wrapped in ChallengeTypes +func OAuthDeviceCodeFinishChallengeAsChallengeTypes(v *OAuthDeviceCodeFinishChallenge) ChallengeTypes { + return ChallengeTypes{ + OAuthDeviceCodeFinishChallenge: v, + } +} + +// PasswordChallengeAsChallengeTypes is a convenience function that returns PasswordChallenge wrapped in ChallengeTypes +func PasswordChallengeAsChallengeTypes(v *PasswordChallenge) ChallengeTypes { + return ChallengeTypes{ + PasswordChallenge: v, + } +} + +// PlexAuthenticationChallengeAsChallengeTypes is a convenience function that returns PlexAuthenticationChallenge wrapped in ChallengeTypes +func PlexAuthenticationChallengeAsChallengeTypes(v *PlexAuthenticationChallenge) ChallengeTypes { + return ChallengeTypes{ + PlexAuthenticationChallenge: v, + } +} + +// PromptChallengeAsChallengeTypes is a convenience function that returns PromptChallenge wrapped in ChallengeTypes +func PromptChallengeAsChallengeTypes(v *PromptChallenge) ChallengeTypes { + return ChallengeTypes{ + PromptChallenge: v, + } +} + +// RedirectChallengeAsChallengeTypes is a convenience function that returns RedirectChallenge wrapped in ChallengeTypes +func RedirectChallengeAsChallengeTypes(v *RedirectChallenge) ChallengeTypes { + return ChallengeTypes{ + RedirectChallenge: v, + } +} + +// SessionEndChallengeAsChallengeTypes is a convenience function that returns SessionEndChallenge wrapped in ChallengeTypes +func SessionEndChallengeAsChallengeTypes(v *SessionEndChallenge) ChallengeTypes { + return ChallengeTypes{ + SessionEndChallenge: v, + } +} + +// ShellChallengeAsChallengeTypes is a convenience function that returns ShellChallenge wrapped in ChallengeTypes +func ShellChallengeAsChallengeTypes(v *ShellChallenge) ChallengeTypes { + return ChallengeTypes{ + ShellChallenge: v, + } +} + +// TelegramLoginChallengeAsChallengeTypes is a convenience function that returns TelegramLoginChallenge wrapped in ChallengeTypes +func TelegramLoginChallengeAsChallengeTypes(v *TelegramLoginChallenge) ChallengeTypes { + return ChallengeTypes{ + TelegramLoginChallenge: v, + } +} + +// UserLoginChallengeAsChallengeTypes is a convenience function that returns UserLoginChallenge wrapped in ChallengeTypes +func UserLoginChallengeAsChallengeTypes(v *UserLoginChallenge) ChallengeTypes { + return ChallengeTypes{ + UserLoginChallenge: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ChallengeTypes) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'ak-provider-iframe-logout' + if jsonDict["component"] == "ak-provider-iframe-logout" { + // try to unmarshal JSON data into IframeLogoutChallenge + err = json.Unmarshal(data, &dst.IframeLogoutChallenge) + if err == nil { + return nil // data stored in dst.IframeLogoutChallenge, return on the first match + } else { + dst.IframeLogoutChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as IframeLogoutChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-oauth2-device-code' + if jsonDict["component"] == "ak-provider-oauth2-device-code" { + // try to unmarshal JSON data into OAuthDeviceCodeChallenge + err = json.Unmarshal(data, &dst.OAuthDeviceCodeChallenge) + if err == nil { + return nil // data stored in dst.OAuthDeviceCodeChallenge, return on the first match + } else { + dst.OAuthDeviceCodeChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as OAuthDeviceCodeChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-oauth2-device-code-finish' + if jsonDict["component"] == "ak-provider-oauth2-device-code-finish" { + // try to unmarshal JSON data into OAuthDeviceCodeFinishChallenge + err = json.Unmarshal(data, &dst.OAuthDeviceCodeFinishChallenge) + if err == nil { + return nil // data stored in dst.OAuthDeviceCodeFinishChallenge, return on the first match + } else { + dst.OAuthDeviceCodeFinishChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as OAuthDeviceCodeFinishChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-saml-native-logout' + if jsonDict["component"] == "ak-provider-saml-native-logout" { + // try to unmarshal JSON data into NativeLogoutChallenge + err = json.Unmarshal(data, &dst.NativeLogoutChallenge) + if err == nil { + return nil // data stored in dst.NativeLogoutChallenge, return on the first match + } else { + dst.NativeLogoutChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as NativeLogoutChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-oauth-apple' + if jsonDict["component"] == "ak-source-oauth-apple" { + // try to unmarshal JSON data into AppleLoginChallenge + err = json.Unmarshal(data, &dst.AppleLoginChallenge) + if err == nil { + return nil // data stored in dst.AppleLoginChallenge, return on the first match + } else { + dst.AppleLoginChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AppleLoginChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-plex' + if jsonDict["component"] == "ak-source-plex" { + // try to unmarshal JSON data into PlexAuthenticationChallenge + err = json.Unmarshal(data, &dst.PlexAuthenticationChallenge) + if err == nil { + return nil // data stored in dst.PlexAuthenticationChallenge, return on the first match + } else { + dst.PlexAuthenticationChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as PlexAuthenticationChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-telegram' + if jsonDict["component"] == "ak-source-telegram" { + // try to unmarshal JSON data into TelegramLoginChallenge + err = json.Unmarshal(data, &dst.TelegramLoginChallenge) + if err == nil { + return nil // data stored in dst.TelegramLoginChallenge, return on the first match + } else { + dst.TelegramLoginChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as TelegramLoginChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-access-denied' + if jsonDict["component"] == "ak-stage-access-denied" { + // try to unmarshal JSON data into AccessDeniedChallenge + err = json.Unmarshal(data, &dst.AccessDeniedChallenge) + if err == nil { + return nil // data stored in dst.AccessDeniedChallenge, return on the first match + } else { + dst.AccessDeniedChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AccessDeniedChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-duo' + if jsonDict["component"] == "ak-stage-authenticator-duo" { + // try to unmarshal JSON data into AuthenticatorDuoChallenge + err = json.Unmarshal(data, &dst.AuthenticatorDuoChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorDuoChallenge, return on the first match + } else { + dst.AuthenticatorDuoChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorDuoChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-email' + if jsonDict["component"] == "ak-stage-authenticator-email" { + // try to unmarshal JSON data into AuthenticatorEmailChallenge + err = json.Unmarshal(data, &dst.AuthenticatorEmailChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorEmailChallenge, return on the first match + } else { + dst.AuthenticatorEmailChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorEmailChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-sms' + if jsonDict["component"] == "ak-stage-authenticator-sms" { + // try to unmarshal JSON data into AuthenticatorSMSChallenge + err = json.Unmarshal(data, &dst.AuthenticatorSMSChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorSMSChallenge, return on the first match + } else { + dst.AuthenticatorSMSChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorSMSChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-static' + if jsonDict["component"] == "ak-stage-authenticator-static" { + // try to unmarshal JSON data into AuthenticatorStaticChallenge + err = json.Unmarshal(data, &dst.AuthenticatorStaticChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorStaticChallenge, return on the first match + } else { + dst.AuthenticatorStaticChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorStaticChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-totp' + if jsonDict["component"] == "ak-stage-authenticator-totp" { + // try to unmarshal JSON data into AuthenticatorTOTPChallenge + err = json.Unmarshal(data, &dst.AuthenticatorTOTPChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorTOTPChallenge, return on the first match + } else { + dst.AuthenticatorTOTPChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorTOTPChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-validate' + if jsonDict["component"] == "ak-stage-authenticator-validate" { + // try to unmarshal JSON data into AuthenticatorValidationChallenge + err = json.Unmarshal(data, &dst.AuthenticatorValidationChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorValidationChallenge, return on the first match + } else { + dst.AuthenticatorValidationChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorValidationChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-webauthn' + if jsonDict["component"] == "ak-stage-authenticator-webauthn" { + // try to unmarshal JSON data into AuthenticatorWebAuthnChallenge + err = json.Unmarshal(data, &dst.AuthenticatorWebAuthnChallenge) + if err == nil { + return nil // data stored in dst.AuthenticatorWebAuthnChallenge, return on the first match + } else { + dst.AuthenticatorWebAuthnChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AuthenticatorWebAuthnChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-autosubmit' + if jsonDict["component"] == "ak-stage-autosubmit" { + // try to unmarshal JSON data into AutosubmitChallenge + err = json.Unmarshal(data, &dst.AutosubmitChallenge) + if err == nil { + return nil // data stored in dst.AutosubmitChallenge, return on the first match + } else { + dst.AutosubmitChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as AutosubmitChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-captcha' + if jsonDict["component"] == "ak-stage-captcha" { + // try to unmarshal JSON data into CaptchaChallenge + err = json.Unmarshal(data, &dst.CaptchaChallenge) + if err == nil { + return nil // data stored in dst.CaptchaChallenge, return on the first match + } else { + dst.CaptchaChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as CaptchaChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-consent' + if jsonDict["component"] == "ak-stage-consent" { + // try to unmarshal JSON data into ConsentChallenge + err = json.Unmarshal(data, &dst.ConsentChallenge) + if err == nil { + return nil // data stored in dst.ConsentChallenge, return on the first match + } else { + dst.ConsentChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as ConsentChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-dummy' + if jsonDict["component"] == "ak-stage-dummy" { + // try to unmarshal JSON data into DummyChallenge + err = json.Unmarshal(data, &dst.DummyChallenge) + if err == nil { + return nil // data stored in dst.DummyChallenge, return on the first match + } else { + dst.DummyChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as DummyChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-email' + if jsonDict["component"] == "ak-stage-email" { + // try to unmarshal JSON data into EmailChallenge + err = json.Unmarshal(data, &dst.EmailChallenge) + if err == nil { + return nil // data stored in dst.EmailChallenge, return on the first match + } else { + dst.EmailChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as EmailChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-endpoint-agent' + if jsonDict["component"] == "ak-stage-endpoint-agent" { + // try to unmarshal JSON data into EndpointAgentChallenge + err = json.Unmarshal(data, &dst.EndpointAgentChallenge) + if err == nil { + return nil // data stored in dst.EndpointAgentChallenge, return on the first match + } else { + dst.EndpointAgentChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as EndpointAgentChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-flow-error' + if jsonDict["component"] == "ak-stage-flow-error" { + // try to unmarshal JSON data into FlowErrorChallenge + err = json.Unmarshal(data, &dst.FlowErrorChallenge) + if err == nil { + return nil // data stored in dst.FlowErrorChallenge, return on the first match + } else { + dst.FlowErrorChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as FlowErrorChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-identification' + if jsonDict["component"] == "ak-stage-identification" { + // try to unmarshal JSON data into IdentificationChallenge + err = json.Unmarshal(data, &dst.IdentificationChallenge) + if err == nil { + return nil // data stored in dst.IdentificationChallenge, return on the first match + } else { + dst.IdentificationChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as IdentificationChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-password' + if jsonDict["component"] == "ak-stage-password" { + // try to unmarshal JSON data into PasswordChallenge + err = json.Unmarshal(data, &dst.PasswordChallenge) + if err == nil { + return nil // data stored in dst.PasswordChallenge, return on the first match + } else { + dst.PasswordChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as PasswordChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-prompt' + if jsonDict["component"] == "ak-stage-prompt" { + // try to unmarshal JSON data into PromptChallenge + err = json.Unmarshal(data, &dst.PromptChallenge) + if err == nil { + return nil // data stored in dst.PromptChallenge, return on the first match + } else { + dst.PromptChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as PromptChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-session-end' + if jsonDict["component"] == "ak-stage-session-end" { + // try to unmarshal JSON data into SessionEndChallenge + err = json.Unmarshal(data, &dst.SessionEndChallenge) + if err == nil { + return nil // data stored in dst.SessionEndChallenge, return on the first match + } else { + dst.SessionEndChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as SessionEndChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-user-login' + if jsonDict["component"] == "ak-stage-user-login" { + // try to unmarshal JSON data into UserLoginChallenge + err = json.Unmarshal(data, &dst.UserLoginChallenge) + if err == nil { + return nil // data stored in dst.UserLoginChallenge, return on the first match + } else { + dst.UserLoginChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as UserLoginChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-frame' + if jsonDict["component"] == "xak-flow-frame" { + // try to unmarshal JSON data into FrameChallenge + err = json.Unmarshal(data, &dst.FrameChallenge) + if err == nil { + return nil // data stored in dst.FrameChallenge, return on the first match + } else { + dst.FrameChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as FrameChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-redirect' + if jsonDict["component"] == "xak-flow-redirect" { + // try to unmarshal JSON data into RedirectChallenge + err = json.Unmarshal(data, &dst.RedirectChallenge) + if err == nil { + return nil // data stored in dst.RedirectChallenge, return on the first match + } else { + dst.RedirectChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as RedirectChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-shell' + if jsonDict["component"] == "xak-flow-shell" { + // try to unmarshal JSON data into ShellChallenge + err = json.Unmarshal(data, &dst.ShellChallenge) + if err == nil { + return nil // data stored in dst.ShellChallenge, return on the first match + } else { + dst.ShellChallenge = nil + return fmt.Errorf("failed to unmarshal ChallengeTypes as ShellChallenge: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ChallengeTypes) MarshalJSON() ([]byte, error) { + if src.AccessDeniedChallenge != nil { + return json.Marshal(&src.AccessDeniedChallenge) + } + + if src.AppleLoginChallenge != nil { + return json.Marshal(&src.AppleLoginChallenge) + } + + if src.AuthenticatorDuoChallenge != nil { + return json.Marshal(&src.AuthenticatorDuoChallenge) + } + + if src.AuthenticatorEmailChallenge != nil { + return json.Marshal(&src.AuthenticatorEmailChallenge) + } + + if src.AuthenticatorSMSChallenge != nil { + return json.Marshal(&src.AuthenticatorSMSChallenge) + } + + if src.AuthenticatorStaticChallenge != nil { + return json.Marshal(&src.AuthenticatorStaticChallenge) + } + + if src.AuthenticatorTOTPChallenge != nil { + return json.Marshal(&src.AuthenticatorTOTPChallenge) + } + + if src.AuthenticatorValidationChallenge != nil { + return json.Marshal(&src.AuthenticatorValidationChallenge) + } + + if src.AuthenticatorWebAuthnChallenge != nil { + return json.Marshal(&src.AuthenticatorWebAuthnChallenge) + } + + if src.AutosubmitChallenge != nil { + return json.Marshal(&src.AutosubmitChallenge) + } + + if src.CaptchaChallenge != nil { + return json.Marshal(&src.CaptchaChallenge) + } + + if src.ConsentChallenge != nil { + return json.Marshal(&src.ConsentChallenge) + } + + if src.DummyChallenge != nil { + return json.Marshal(&src.DummyChallenge) + } + + if src.EmailChallenge != nil { + return json.Marshal(&src.EmailChallenge) + } + + if src.EndpointAgentChallenge != nil { + return json.Marshal(&src.EndpointAgentChallenge) + } + + if src.FlowErrorChallenge != nil { + return json.Marshal(&src.FlowErrorChallenge) + } + + if src.FrameChallenge != nil { + return json.Marshal(&src.FrameChallenge) + } + + if src.IdentificationChallenge != nil { + return json.Marshal(&src.IdentificationChallenge) + } + + if src.IframeLogoutChallenge != nil { + return json.Marshal(&src.IframeLogoutChallenge) + } + + if src.NativeLogoutChallenge != nil { + return json.Marshal(&src.NativeLogoutChallenge) + } + + if src.OAuthDeviceCodeChallenge != nil { + return json.Marshal(&src.OAuthDeviceCodeChallenge) + } + + if src.OAuthDeviceCodeFinishChallenge != nil { + return json.Marshal(&src.OAuthDeviceCodeFinishChallenge) + } + + if src.PasswordChallenge != nil { + return json.Marshal(&src.PasswordChallenge) + } + + if src.PlexAuthenticationChallenge != nil { + return json.Marshal(&src.PlexAuthenticationChallenge) + } + + if src.PromptChallenge != nil { + return json.Marshal(&src.PromptChallenge) + } + + if src.RedirectChallenge != nil { + return json.Marshal(&src.RedirectChallenge) + } + + if src.SessionEndChallenge != nil { + return json.Marshal(&src.SessionEndChallenge) + } + + if src.ShellChallenge != nil { + return json.Marshal(&src.ShellChallenge) + } + + if src.TelegramLoginChallenge != nil { + return json.Marshal(&src.TelegramLoginChallenge) + } + + if src.UserLoginChallenge != nil { + return json.Marshal(&src.UserLoginChallenge) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ChallengeTypes) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AccessDeniedChallenge != nil { + return obj.AccessDeniedChallenge + } + + if obj.AppleLoginChallenge != nil { + return obj.AppleLoginChallenge + } + + if obj.AuthenticatorDuoChallenge != nil { + return obj.AuthenticatorDuoChallenge + } + + if obj.AuthenticatorEmailChallenge != nil { + return obj.AuthenticatorEmailChallenge + } + + if obj.AuthenticatorSMSChallenge != nil { + return obj.AuthenticatorSMSChallenge + } + + if obj.AuthenticatorStaticChallenge != nil { + return obj.AuthenticatorStaticChallenge + } + + if obj.AuthenticatorTOTPChallenge != nil { + return obj.AuthenticatorTOTPChallenge + } + + if obj.AuthenticatorValidationChallenge != nil { + return obj.AuthenticatorValidationChallenge + } + + if obj.AuthenticatorWebAuthnChallenge != nil { + return obj.AuthenticatorWebAuthnChallenge + } + + if obj.AutosubmitChallenge != nil { + return obj.AutosubmitChallenge + } + + if obj.CaptchaChallenge != nil { + return obj.CaptchaChallenge + } + + if obj.ConsentChallenge != nil { + return obj.ConsentChallenge + } + + if obj.DummyChallenge != nil { + return obj.DummyChallenge + } + + if obj.EmailChallenge != nil { + return obj.EmailChallenge + } + + if obj.EndpointAgentChallenge != nil { + return obj.EndpointAgentChallenge + } + + if obj.FlowErrorChallenge != nil { + return obj.FlowErrorChallenge + } + + if obj.FrameChallenge != nil { + return obj.FrameChallenge + } + + if obj.IdentificationChallenge != nil { + return obj.IdentificationChallenge + } + + if obj.IframeLogoutChallenge != nil { + return obj.IframeLogoutChallenge + } + + if obj.NativeLogoutChallenge != nil { + return obj.NativeLogoutChallenge + } + + if obj.OAuthDeviceCodeChallenge != nil { + return obj.OAuthDeviceCodeChallenge + } + + if obj.OAuthDeviceCodeFinishChallenge != nil { + return obj.OAuthDeviceCodeFinishChallenge + } + + if obj.PasswordChallenge != nil { + return obj.PasswordChallenge + } + + if obj.PlexAuthenticationChallenge != nil { + return obj.PlexAuthenticationChallenge + } + + if obj.PromptChallenge != nil { + return obj.PromptChallenge + } + + if obj.RedirectChallenge != nil { + return obj.RedirectChallenge + } + + if obj.SessionEndChallenge != nil { + return obj.SessionEndChallenge + } + + if obj.ShellChallenge != nil { + return obj.ShellChallenge + } + + if obj.TelegramLoginChallenge != nil { + return obj.TelegramLoginChallenge + } + + if obj.UserLoginChallenge != nil { + return obj.UserLoginChallenge + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ChallengeTypes) GetActualInstanceValue() interface{} { + if obj.AccessDeniedChallenge != nil { + return *obj.AccessDeniedChallenge + } + + if obj.AppleLoginChallenge != nil { + return *obj.AppleLoginChallenge + } + + if obj.AuthenticatorDuoChallenge != nil { + return *obj.AuthenticatorDuoChallenge + } + + if obj.AuthenticatorEmailChallenge != nil { + return *obj.AuthenticatorEmailChallenge + } + + if obj.AuthenticatorSMSChallenge != nil { + return *obj.AuthenticatorSMSChallenge + } + + if obj.AuthenticatorStaticChallenge != nil { + return *obj.AuthenticatorStaticChallenge + } + + if obj.AuthenticatorTOTPChallenge != nil { + return *obj.AuthenticatorTOTPChallenge + } + + if obj.AuthenticatorValidationChallenge != nil { + return *obj.AuthenticatorValidationChallenge + } + + if obj.AuthenticatorWebAuthnChallenge != nil { + return *obj.AuthenticatorWebAuthnChallenge + } + + if obj.AutosubmitChallenge != nil { + return *obj.AutosubmitChallenge + } + + if obj.CaptchaChallenge != nil { + return *obj.CaptchaChallenge + } + + if obj.ConsentChallenge != nil { + return *obj.ConsentChallenge + } + + if obj.DummyChallenge != nil { + return *obj.DummyChallenge + } + + if obj.EmailChallenge != nil { + return *obj.EmailChallenge + } + + if obj.EndpointAgentChallenge != nil { + return *obj.EndpointAgentChallenge + } + + if obj.FlowErrorChallenge != nil { + return *obj.FlowErrorChallenge + } + + if obj.FrameChallenge != nil { + return *obj.FrameChallenge + } + + if obj.IdentificationChallenge != nil { + return *obj.IdentificationChallenge + } + + if obj.IframeLogoutChallenge != nil { + return *obj.IframeLogoutChallenge + } + + if obj.NativeLogoutChallenge != nil { + return *obj.NativeLogoutChallenge + } + + if obj.OAuthDeviceCodeChallenge != nil { + return *obj.OAuthDeviceCodeChallenge + } + + if obj.OAuthDeviceCodeFinishChallenge != nil { + return *obj.OAuthDeviceCodeFinishChallenge + } + + if obj.PasswordChallenge != nil { + return *obj.PasswordChallenge + } + + if obj.PlexAuthenticationChallenge != nil { + return *obj.PlexAuthenticationChallenge + } + + if obj.PromptChallenge != nil { + return *obj.PromptChallenge + } + + if obj.RedirectChallenge != nil { + return *obj.RedirectChallenge + } + + if obj.SessionEndChallenge != nil { + return *obj.SessionEndChallenge + } + + if obj.ShellChallenge != nil { + return *obj.ShellChallenge + } + + if obj.TelegramLoginChallenge != nil { + return *obj.TelegramLoginChallenge + } + + if obj.UserLoginChallenge != nil { + return *obj.UserLoginChallenge + } + + // all schemas are nil + return nil +} + +type NullableChallengeTypes struct { + value *ChallengeTypes + isSet bool +} + +func (v NullableChallengeTypes) Get() *ChallengeTypes { + return v.value +} + +func (v *NullableChallengeTypes) Set(val *ChallengeTypes) { + v.value = val + v.isSet = true +} + +func (v NullableChallengeTypes) IsSet() bool { + return v.isSet +} + +func (v *NullableChallengeTypes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableChallengeTypes(val *ChallengeTypes) *NullableChallengeTypes { + return &NullableChallengeTypes{value: val, isSet: true} +} + +func (v NullableChallengeTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableChallengeTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_client_type_enum.go b/packages/client-go/model_client_type_enum.go new file mode 100644 index 0000000000..f5351944a9 --- /dev/null +++ b/packages/client-go/model_client_type_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ClientTypeEnum the model 'ClientTypeEnum' +type ClientTypeEnum string + +// List of ClientTypeEnum +const ( + CLIENTTYPEENUM_CONFIDENTIAL ClientTypeEnum = "confidential" + CLIENTTYPEENUM_PUBLIC ClientTypeEnum = "public" +) + +// All allowed values of ClientTypeEnum enum +var AllowedClientTypeEnumEnumValues = []ClientTypeEnum{ + "confidential", + "public", +} + +func (v *ClientTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ClientTypeEnum(value) + for _, existing := range AllowedClientTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ClientTypeEnum", value) +} + +// NewClientTypeEnumFromValue returns a pointer to a valid ClientTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewClientTypeEnumFromValue(v string) (*ClientTypeEnum, error) { + ev := ClientTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ClientTypeEnum: valid values are %v", v, AllowedClientTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ClientTypeEnum) IsValid() bool { + for _, existing := range AllowedClientTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ClientTypeEnum value +func (v ClientTypeEnum) Ptr() *ClientTypeEnum { + return &v +} + +type NullableClientTypeEnum struct { + value *ClientTypeEnum + isSet bool +} + +func (v NullableClientTypeEnum) Get() *ClientTypeEnum { + return v.value +} + +func (v *NullableClientTypeEnum) Set(val *ClientTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableClientTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableClientTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableClientTypeEnum(val *ClientTypeEnum) *NullableClientTypeEnum { + return &NullableClientTypeEnum{value: val, isSet: true} +} + +func (v NullableClientTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableClientTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_compatibility_mode_enum.go b/packages/client-go/model_compatibility_mode_enum.go new file mode 100644 index 0000000000..2ed0f22976 --- /dev/null +++ b/packages/client-go/model_compatibility_mode_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// CompatibilityModeEnum the model 'CompatibilityModeEnum' +type CompatibilityModeEnum string + +// List of CompatibilityModeEnum +const ( + COMPATIBILITYMODEENUM_DEFAULT CompatibilityModeEnum = "default" + COMPATIBILITYMODEENUM_AWS CompatibilityModeEnum = "aws" + COMPATIBILITYMODEENUM_SLACK CompatibilityModeEnum = "slack" + COMPATIBILITYMODEENUM_SFDC CompatibilityModeEnum = "sfdc" +) + +// All allowed values of CompatibilityModeEnum enum +var AllowedCompatibilityModeEnumEnumValues = []CompatibilityModeEnum{ + "default", + "aws", + "slack", + "sfdc", +} + +func (v *CompatibilityModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CompatibilityModeEnum(value) + for _, existing := range AllowedCompatibilityModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CompatibilityModeEnum", value) +} + +// NewCompatibilityModeEnumFromValue returns a pointer to a valid CompatibilityModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCompatibilityModeEnumFromValue(v string) (*CompatibilityModeEnum, error) { + ev := CompatibilityModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CompatibilityModeEnum: valid values are %v", v, AllowedCompatibilityModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CompatibilityModeEnum) IsValid() bool { + for _, existing := range AllowedCompatibilityModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CompatibilityModeEnum value +func (v CompatibilityModeEnum) Ptr() *CompatibilityModeEnum { + return &v +} + +type NullableCompatibilityModeEnum struct { + value *CompatibilityModeEnum + isSet bool +} + +func (v NullableCompatibilityModeEnum) Get() *CompatibilityModeEnum { + return v.value +} + +func (v *NullableCompatibilityModeEnum) Set(val *CompatibilityModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableCompatibilityModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableCompatibilityModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCompatibilityModeEnum(val *CompatibilityModeEnum) *NullableCompatibilityModeEnum { + return &NullableCompatibilityModeEnum{value: val, isSet: true} +} + +func (v NullableCompatibilityModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCompatibilityModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_config.go b/packages/client-go/model_config.go new file mode 100644 index 0000000000..ee0e6e680b --- /dev/null +++ b/packages/client-go/model_config.go @@ -0,0 +1,283 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Config type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Config{} + +// Config Serialize authentik Config into DRF Object +type Config struct { + ErrorReporting ErrorReportingConfig `json:"error_reporting"` + Capabilities []CapabilitiesEnum `json:"capabilities"` + CacheTimeout int32 `json:"cache_timeout"` + CacheTimeoutFlows int32 `json:"cache_timeout_flows"` + CacheTimeoutPolicies int32 `json:"cache_timeout_policies"` + AdditionalProperties map[string]interface{} +} + +type _Config Config + +// NewConfig instantiates a new Config object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConfig(errorReporting ErrorReportingConfig, capabilities []CapabilitiesEnum, cacheTimeout int32, cacheTimeoutFlows int32, cacheTimeoutPolicies int32) *Config { + this := Config{} + this.ErrorReporting = errorReporting + this.Capabilities = capabilities + this.CacheTimeout = cacheTimeout + this.CacheTimeoutFlows = cacheTimeoutFlows + this.CacheTimeoutPolicies = cacheTimeoutPolicies + return &this +} + +// NewConfigWithDefaults instantiates a new Config object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConfigWithDefaults() *Config { + this := Config{} + return &this +} + +// GetErrorReporting returns the ErrorReporting field value +func (o *Config) GetErrorReporting() ErrorReportingConfig { + if o == nil { + var ret ErrorReportingConfig + return ret + } + + return o.ErrorReporting +} + +// GetErrorReportingOk returns a tuple with the ErrorReporting field value +// and a boolean to check if the value has been set. +func (o *Config) GetErrorReportingOk() (*ErrorReportingConfig, bool) { + if o == nil { + return nil, false + } + return &o.ErrorReporting, true +} + +// SetErrorReporting sets field value +func (o *Config) SetErrorReporting(v ErrorReportingConfig) { + o.ErrorReporting = v +} + +// GetCapabilities returns the Capabilities field value +func (o *Config) GetCapabilities() []CapabilitiesEnum { + if o == nil { + var ret []CapabilitiesEnum + return ret + } + + return o.Capabilities +} + +// GetCapabilitiesOk returns a tuple with the Capabilities field value +// and a boolean to check if the value has been set. +func (o *Config) GetCapabilitiesOk() ([]CapabilitiesEnum, bool) { + if o == nil { + return nil, false + } + return o.Capabilities, true +} + +// SetCapabilities sets field value +func (o *Config) SetCapabilities(v []CapabilitiesEnum) { + o.Capabilities = v +} + +// GetCacheTimeout returns the CacheTimeout field value +func (o *Config) GetCacheTimeout() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CacheTimeout +} + +// GetCacheTimeoutOk returns a tuple with the CacheTimeout field value +// and a boolean to check if the value has been set. +func (o *Config) GetCacheTimeoutOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CacheTimeout, true +} + +// SetCacheTimeout sets field value +func (o *Config) SetCacheTimeout(v int32) { + o.CacheTimeout = v +} + +// GetCacheTimeoutFlows returns the CacheTimeoutFlows field value +func (o *Config) GetCacheTimeoutFlows() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CacheTimeoutFlows +} + +// GetCacheTimeoutFlowsOk returns a tuple with the CacheTimeoutFlows field value +// and a boolean to check if the value has been set. +func (o *Config) GetCacheTimeoutFlowsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CacheTimeoutFlows, true +} + +// SetCacheTimeoutFlows sets field value +func (o *Config) SetCacheTimeoutFlows(v int32) { + o.CacheTimeoutFlows = v +} + +// GetCacheTimeoutPolicies returns the CacheTimeoutPolicies field value +func (o *Config) GetCacheTimeoutPolicies() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CacheTimeoutPolicies +} + +// GetCacheTimeoutPoliciesOk returns a tuple with the CacheTimeoutPolicies field value +// and a boolean to check if the value has been set. +func (o *Config) GetCacheTimeoutPoliciesOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CacheTimeoutPolicies, true +} + +// SetCacheTimeoutPolicies sets field value +func (o *Config) SetCacheTimeoutPolicies(v int32) { + o.CacheTimeoutPolicies = v +} + +func (o Config) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Config) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["error_reporting"] = o.ErrorReporting + toSerialize["capabilities"] = o.Capabilities + toSerialize["cache_timeout"] = o.CacheTimeout + toSerialize["cache_timeout_flows"] = o.CacheTimeoutFlows + toSerialize["cache_timeout_policies"] = o.CacheTimeoutPolicies + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Config) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "error_reporting", + "capabilities", + "cache_timeout", + "cache_timeout_flows", + "cache_timeout_policies", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConfig := _Config{} + + err = json.Unmarshal(data, &varConfig) + + if err != nil { + return err + } + + *o = Config(varConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "error_reporting") + delete(additionalProperties, "capabilities") + delete(additionalProperties, "cache_timeout") + delete(additionalProperties, "cache_timeout_flows") + delete(additionalProperties, "cache_timeout_policies") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConfig struct { + value *Config + isSet bool +} + +func (v NullableConfig) Get() *Config { + return v.value +} + +func (v *NullableConfig) Set(val *Config) { + v.value = val + v.isSet = true +} + +func (v NullableConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConfig(val *Config) *NullableConfig { + return &NullableConfig{value: val, isSet: true} +} + +func (v NullableConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_connection_token.go b/packages/client-go/model_connection_token.go new file mode 100644 index 0000000000..e7c1bfc78c --- /dev/null +++ b/packages/client-go/model_connection_token.go @@ -0,0 +1,320 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConnectionToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionToken{} + +// ConnectionToken ConnectionToken Serializer +type ConnectionToken struct { + Pk *string `json:"pk,omitempty"` + Provider int32 `json:"provider"` + ProviderObj RACProvider `json:"provider_obj"` + Endpoint string `json:"endpoint"` + EndpointObj Endpoint `json:"endpoint_obj"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _ConnectionToken ConnectionToken + +// NewConnectionToken instantiates a new ConnectionToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionToken(provider int32, providerObj RACProvider, endpoint string, endpointObj Endpoint, user PartialUser) *ConnectionToken { + this := ConnectionToken{} + this.Provider = provider + this.ProviderObj = providerObj + this.Endpoint = endpoint + this.EndpointObj = endpointObj + this.User = user + return &this +} + +// NewConnectionTokenWithDefaults instantiates a new ConnectionToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionTokenWithDefaults() *ConnectionToken { + this := ConnectionToken{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *ConnectionToken) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *ConnectionToken) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *ConnectionToken) SetPk(v string) { + o.Pk = &v +} + +// GetProvider returns the Provider field value +func (o *ConnectionToken) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ConnectionToken) SetProvider(v int32) { + o.Provider = v +} + +// GetProviderObj returns the ProviderObj field value +func (o *ConnectionToken) GetProviderObj() RACProvider { + if o == nil { + var ret RACProvider + return ret + } + + return o.ProviderObj +} + +// GetProviderObjOk returns a tuple with the ProviderObj field value +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetProviderObjOk() (*RACProvider, bool) { + if o == nil { + return nil, false + } + return &o.ProviderObj, true +} + +// SetProviderObj sets field value +func (o *ConnectionToken) SetProviderObj(v RACProvider) { + o.ProviderObj = v +} + +// GetEndpoint returns the Endpoint field value +func (o *ConnectionToken) GetEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.Endpoint +} + +// GetEndpointOk returns a tuple with the Endpoint field value +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Endpoint, true +} + +// SetEndpoint sets field value +func (o *ConnectionToken) SetEndpoint(v string) { + o.Endpoint = v +} + +// GetEndpointObj returns the EndpointObj field value +func (o *ConnectionToken) GetEndpointObj() Endpoint { + if o == nil { + var ret Endpoint + return ret + } + + return o.EndpointObj +} + +// GetEndpointObjOk returns a tuple with the EndpointObj field value +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetEndpointObjOk() (*Endpoint, bool) { + if o == nil { + return nil, false + } + return &o.EndpointObj, true +} + +// SetEndpointObj sets field value +func (o *ConnectionToken) SetEndpointObj(v Endpoint) { + o.EndpointObj = v +} + +// GetUser returns the User field value +func (o *ConnectionToken) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *ConnectionToken) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *ConnectionToken) SetUser(v PartialUser) { + o.User = v +} + +func (o ConnectionToken) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + toSerialize["provider"] = o.Provider + toSerialize["provider_obj"] = o.ProviderObj + toSerialize["endpoint"] = o.Endpoint + toSerialize["endpoint_obj"] = o.EndpointObj + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConnectionToken) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "provider_obj", + "endpoint", + "endpoint_obj", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConnectionToken := _ConnectionToken{} + + err = json.Unmarshal(data, &varConnectionToken) + + if err != nil { + return err + } + + *o = ConnectionToken(varConnectionToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_obj") + delete(additionalProperties, "endpoint") + delete(additionalProperties, "endpoint_obj") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnectionToken struct { + value *ConnectionToken + isSet bool +} + +func (v NullableConnectionToken) Get() *ConnectionToken { + return v.value +} + +func (v *NullableConnectionToken) Set(val *ConnectionToken) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionToken) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionToken(val *ConnectionToken) *NullableConnectionToken { + return &NullableConnectionToken{value: val, isSet: true} +} + +func (v NullableConnectionToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_connection_token_request.go b/packages/client-go/model_connection_token_request.go new file mode 100644 index 0000000000..121eb9d89c --- /dev/null +++ b/packages/client-go/model_connection_token_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConnectionTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConnectionTokenRequest{} + +// ConnectionTokenRequest ConnectionToken Serializer +type ConnectionTokenRequest struct { + Pk *string `json:"pk,omitempty"` + Provider int32 `json:"provider"` + Endpoint string `json:"endpoint"` + AdditionalProperties map[string]interface{} +} + +type _ConnectionTokenRequest ConnectionTokenRequest + +// NewConnectionTokenRequest instantiates a new ConnectionTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnectionTokenRequest(provider int32, endpoint string) *ConnectionTokenRequest { + this := ConnectionTokenRequest{} + this.Provider = provider + this.Endpoint = endpoint + return &this +} + +// NewConnectionTokenRequestWithDefaults instantiates a new ConnectionTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectionTokenRequestWithDefaults() *ConnectionTokenRequest { + this := ConnectionTokenRequest{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *ConnectionTokenRequest) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConnectionTokenRequest) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *ConnectionTokenRequest) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *ConnectionTokenRequest) SetPk(v string) { + o.Pk = &v +} + +// GetProvider returns the Provider field value +func (o *ConnectionTokenRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ConnectionTokenRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ConnectionTokenRequest) SetProvider(v int32) { + o.Provider = v +} + +// GetEndpoint returns the Endpoint field value +func (o *ConnectionTokenRequest) GetEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.Endpoint +} + +// GetEndpointOk returns a tuple with the Endpoint field value +// and a boolean to check if the value has been set. +func (o *ConnectionTokenRequest) GetEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Endpoint, true +} + +// SetEndpoint sets field value +func (o *ConnectionTokenRequest) SetEndpoint(v string) { + o.Endpoint = v +} + +func (o ConnectionTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConnectionTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + toSerialize["provider"] = o.Provider + toSerialize["endpoint"] = o.Endpoint + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConnectionTokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "provider", + "endpoint", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConnectionTokenRequest := _ConnectionTokenRequest{} + + err = json.Unmarshal(data, &varConnectionTokenRequest) + + if err != nil { + return err + } + + *o = ConnectionTokenRequest(varConnectionTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "endpoint") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnectionTokenRequest struct { + value *ConnectionTokenRequest + isSet bool +} + +func (v NullableConnectionTokenRequest) Get() *ConnectionTokenRequest { + return v.value +} + +func (v *NullableConnectionTokenRequest) Set(val *ConnectionTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConnectionTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConnectionTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnectionTokenRequest(val *ConnectionTokenRequest) *NullableConnectionTokenRequest { + return &NullableConnectionTokenRequest{value: val, isSet: true} +} + +func (v NullableConnectionTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnectionTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_connector.go b/packages/client-go/model_connector.go new file mode 100644 index 0000000000..1715c3c951 --- /dev/null +++ b/packages/client-go/model_connector.go @@ -0,0 +1,361 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Connector type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Connector{} + +// Connector struct for Connector +type Connector struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _Connector Connector + +// NewConnector instantiates a new Connector object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConnector(name string, component string, verboseName string, verboseNamePlural string, metaModelName string) *Connector { + this := Connector{} + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewConnectorWithDefaults instantiates a new Connector object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConnectorWithDefaults() *Connector { + this := Connector{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *Connector) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connector) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *Connector) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *Connector) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *Connector) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Connector) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Connector) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *Connector) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Connector) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *Connector) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *Connector) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetComponent returns the Component field value +func (o *Connector) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *Connector) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *Connector) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *Connector) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Connector) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Connector) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Connector) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Connector) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Connector) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Connector) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Connector) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Connector) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o Connector) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Connector) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Connector) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConnector := _Connector{} + + err = json.Unmarshal(data, &varConnector) + + if err != nil { + return err + } + + *o = Connector(varConnector) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConnector struct { + value *Connector + isSet bool +} + +func (v NullableConnector) Get() *Connector { + return v.value +} + +func (v *NullableConnector) Set(val *Connector) { + v.value = val + v.isSet = true +} + +func (v NullableConnector) IsSet() bool { + return v.isSet +} + +func (v *NullableConnector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConnector(val *Connector) *NullableConnector { + return &NullableConnector{value: val, isSet: true} +} + +func (v NullableConnector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConnector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_challenge.go b/packages/client-go/model_consent_challenge.go new file mode 100644 index 0000000000..8902d489d3 --- /dev/null +++ b/packages/client-go/model_consent_challenge.go @@ -0,0 +1,435 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsentChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsentChallenge{} + +// ConsentChallenge Challenge info for consent screens +type ConsentChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + HeaderText *string `json:"header_text,omitempty"` + Permissions []ConsentPermission `json:"permissions"` + AdditionalPermissions []ConsentPermission `json:"additional_permissions"` + Token string `json:"token"` + AdditionalProperties map[string]interface{} +} + +type _ConsentChallenge ConsentChallenge + +// NewConsentChallenge instantiates a new ConsentChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsentChallenge(pendingUser string, pendingUserAvatar string, permissions []ConsentPermission, additionalPermissions []ConsentPermission, token string) *ConsentChallenge { + this := ConsentChallenge{} + var component string = "ak-stage-consent" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.Permissions = permissions + this.AdditionalPermissions = additionalPermissions + this.Token = token + return &this +} + +// NewConsentChallengeWithDefaults instantiates a new ConsentChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsentChallengeWithDefaults() *ConsentChallenge { + this := ConsentChallenge{} + var component string = "ak-stage-consent" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *ConsentChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *ConsentChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *ConsentChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *ConsentChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *ConsentChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *ConsentChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *ConsentChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *ConsentChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *ConsentChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *ConsentChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *ConsentChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *ConsentChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *ConsentChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetHeaderText returns the HeaderText field value if set, zero value otherwise. +func (o *ConsentChallenge) GetHeaderText() string { + if o == nil || IsNil(o.HeaderText) { + var ret string + return ret + } + return *o.HeaderText +} + +// GetHeaderTextOk returns a tuple with the HeaderText field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetHeaderTextOk() (*string, bool) { + if o == nil || IsNil(o.HeaderText) { + return nil, false + } + return o.HeaderText, true +} + +// HasHeaderText returns a boolean if a field has been set. +func (o *ConsentChallenge) HasHeaderText() bool { + if o != nil && !IsNil(o.HeaderText) { + return true + } + + return false +} + +// SetHeaderText gets a reference to the given string and assigns it to the HeaderText field. +func (o *ConsentChallenge) SetHeaderText(v string) { + o.HeaderText = &v +} + +// GetPermissions returns the Permissions field value +func (o *ConsentChallenge) GetPermissions() []ConsentPermission { + if o == nil { + var ret []ConsentPermission + return ret + } + + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetPermissionsOk() ([]ConsentPermission, bool) { + if o == nil { + return nil, false + } + return o.Permissions, true +} + +// SetPermissions sets field value +func (o *ConsentChallenge) SetPermissions(v []ConsentPermission) { + o.Permissions = v +} + +// GetAdditionalPermissions returns the AdditionalPermissions field value +func (o *ConsentChallenge) GetAdditionalPermissions() []ConsentPermission { + if o == nil { + var ret []ConsentPermission + return ret + } + + return o.AdditionalPermissions +} + +// GetAdditionalPermissionsOk returns a tuple with the AdditionalPermissions field value +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetAdditionalPermissionsOk() ([]ConsentPermission, bool) { + if o == nil { + return nil, false + } + return o.AdditionalPermissions, true +} + +// SetAdditionalPermissions sets field value +func (o *ConsentChallenge) SetAdditionalPermissions(v []ConsentPermission) { + o.AdditionalPermissions = v +} + +// GetToken returns the Token field value +func (o *ConsentChallenge) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *ConsentChallenge) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *ConsentChallenge) SetToken(v string) { + o.Token = v +} + +func (o ConsentChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsentChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if !IsNil(o.HeaderText) { + toSerialize["header_text"] = o.HeaderText + } + toSerialize["permissions"] = o.Permissions + toSerialize["additional_permissions"] = o.AdditionalPermissions + toSerialize["token"] = o.Token + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsentChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "permissions", + "additional_permissions", + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsentChallenge := _ConsentChallenge{} + + err = json.Unmarshal(data, &varConsentChallenge) + + if err != nil { + return err + } + + *o = ConsentChallenge(varConsentChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "header_text") + delete(additionalProperties, "permissions") + delete(additionalProperties, "additional_permissions") + delete(additionalProperties, "token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsentChallenge struct { + value *ConsentChallenge + isSet bool +} + +func (v NullableConsentChallenge) Get() *ConsentChallenge { + return v.value +} + +func (v *NullableConsentChallenge) Set(val *ConsentChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableConsentChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentChallenge(val *ConsentChallenge) *NullableConsentChallenge { + return &NullableConsentChallenge{value: val, isSet: true} +} + +func (v NullableConsentChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_challenge_response_request.go b/packages/client-go/model_consent_challenge_response_request.go new file mode 100644 index 0000000000..e2da9e859e --- /dev/null +++ b/packages/client-go/model_consent_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsentChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsentChallengeResponseRequest{} + +// ConsentChallengeResponseRequest Consent challenge response, any valid response request is valid +type ConsentChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Token string `json:"token"` + AdditionalProperties map[string]interface{} +} + +type _ConsentChallengeResponseRequest ConsentChallengeResponseRequest + +// NewConsentChallengeResponseRequest instantiates a new ConsentChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsentChallengeResponseRequest(token string) *ConsentChallengeResponseRequest { + this := ConsentChallengeResponseRequest{} + var component string = "ak-stage-consent" + this.Component = &component + this.Token = token + return &this +} + +// NewConsentChallengeResponseRequestWithDefaults instantiates a new ConsentChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsentChallengeResponseRequestWithDefaults() *ConsentChallengeResponseRequest { + this := ConsentChallengeResponseRequest{} + var component string = "ak-stage-consent" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *ConsentChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *ConsentChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *ConsentChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetToken returns the Token field value +func (o *ConsentChallengeResponseRequest) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *ConsentChallengeResponseRequest) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *ConsentChallengeResponseRequest) SetToken(v string) { + o.Token = v +} + +func (o ConsentChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsentChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["token"] = o.Token + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsentChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsentChallengeResponseRequest := _ConsentChallengeResponseRequest{} + + err = json.Unmarshal(data, &varConsentChallengeResponseRequest) + + if err != nil { + return err + } + + *o = ConsentChallengeResponseRequest(varConsentChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsentChallengeResponseRequest struct { + value *ConsentChallengeResponseRequest + isSet bool +} + +func (v NullableConsentChallengeResponseRequest) Get() *ConsentChallengeResponseRequest { + return v.value +} + +func (v *NullableConsentChallengeResponseRequest) Set(val *ConsentChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsentChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentChallengeResponseRequest(val *ConsentChallengeResponseRequest) *NullableConsentChallengeResponseRequest { + return &NullableConsentChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableConsentChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_permission.go b/packages/client-go/model_consent_permission.go new file mode 100644 index 0000000000..8d43c181c6 --- /dev/null +++ b/packages/client-go/model_consent_permission.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsentPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsentPermission{} + +// ConsentPermission Permission used for consent +type ConsentPermission struct { + Name string `json:"name"` + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _ConsentPermission ConsentPermission + +// NewConsentPermission instantiates a new ConsentPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsentPermission(name string, id string) *ConsentPermission { + this := ConsentPermission{} + this.Name = name + this.Id = id + return &this +} + +// NewConsentPermissionWithDefaults instantiates a new ConsentPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsentPermissionWithDefaults() *ConsentPermission { + this := ConsentPermission{} + return &this +} + +// GetName returns the Name field value +func (o *ConsentPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsentPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsentPermission) SetName(v string) { + o.Name = v +} + +// GetId returns the Id field value +func (o *ConsentPermission) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ConsentPermission) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ConsentPermission) SetId(v string) { + o.Id = v +} + +func (o ConsentPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsentPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsentPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsentPermission := _ConsentPermission{} + + err = json.Unmarshal(data, &varConsentPermission) + + if err != nil { + return err + } + + *o = ConsentPermission(varConsentPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsentPermission struct { + value *ConsentPermission + isSet bool +} + +func (v NullableConsentPermission) Get() *ConsentPermission { + return v.value +} + +func (v *NullableConsentPermission) Set(val *ConsentPermission) { + v.value = val + v.isSet = true +} + +func (v NullableConsentPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentPermission(val *ConsentPermission) *NullableConsentPermission { + return &NullableConsentPermission{value: val, isSet: true} +} + +func (v NullableConsentPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_stage.go b/packages/client-go/model_consent_stage.go new file mode 100644 index 0000000000..2145af3ef5 --- /dev/null +++ b/packages/client-go/model_consent_stage.go @@ -0,0 +1,420 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsentStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsentStage{} + +// ConsentStage ConsentStage Serializer +type ConsentStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + Mode *ConsentStageModeEnum `json:"mode,omitempty"` + // Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + ConsentExpireIn *string `json:"consent_expire_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsentStage ConsentStage + +// NewConsentStage instantiates a new ConsentStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsentStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *ConsentStage { + this := ConsentStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewConsentStageWithDefaults instantiates a new ConsentStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsentStageWithDefaults() *ConsentStage { + this := ConsentStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *ConsentStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ConsentStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ConsentStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsentStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *ConsentStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ConsentStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *ConsentStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ConsentStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ConsentStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ConsentStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ConsentStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ConsentStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *ConsentStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *ConsentStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ConsentStage) GetMode() ConsentStageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret ConsentStageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetModeOk() (*ConsentStageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ConsentStage) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ConsentStageModeEnum and assigns it to the Mode field. +func (o *ConsentStage) SetMode(v ConsentStageModeEnum) { + o.Mode = &v +} + +// GetConsentExpireIn returns the ConsentExpireIn field value if set, zero value otherwise. +func (o *ConsentStage) GetConsentExpireIn() string { + if o == nil || IsNil(o.ConsentExpireIn) { + var ret string + return ret + } + return *o.ConsentExpireIn +} + +// GetConsentExpireInOk returns a tuple with the ConsentExpireIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentStage) GetConsentExpireInOk() (*string, bool) { + if o == nil || IsNil(o.ConsentExpireIn) { + return nil, false + } + return o.ConsentExpireIn, true +} + +// HasConsentExpireIn returns a boolean if a field has been set. +func (o *ConsentStage) HasConsentExpireIn() bool { + if o != nil && !IsNil(o.ConsentExpireIn) { + return true + } + + return false +} + +// SetConsentExpireIn gets a reference to the given string and assigns it to the ConsentExpireIn field. +func (o *ConsentStage) SetConsentExpireIn(v string) { + o.ConsentExpireIn = &v +} + +func (o ConsentStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsentStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ConsentExpireIn) { + toSerialize["consent_expire_in"] = o.ConsentExpireIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsentStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsentStage := _ConsentStage{} + + err = json.Unmarshal(data, &varConsentStage) + + if err != nil { + return err + } + + *o = ConsentStage(varConsentStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "mode") + delete(additionalProperties, "consent_expire_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsentStage struct { + value *ConsentStage + isSet bool +} + +func (v NullableConsentStage) Get() *ConsentStage { + return v.value +} + +func (v *NullableConsentStage) Set(val *ConsentStage) { + v.value = val + v.isSet = true +} + +func (v NullableConsentStage) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentStage(val *ConsentStage) *NullableConsentStage { + return &NullableConsentStage{value: val, isSet: true} +} + +func (v NullableConsentStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_stage_mode_enum.go b/packages/client-go/model_consent_stage_mode_enum.go new file mode 100644 index 0000000000..7ea02200c4 --- /dev/null +++ b/packages/client-go/model_consent_stage_mode_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ConsentStageModeEnum the model 'ConsentStageModeEnum' +type ConsentStageModeEnum string + +// List of ConsentStageModeEnum +const ( + CONSENTSTAGEMODEENUM_ALWAYS_REQUIRE ConsentStageModeEnum = "always_require" + CONSENTSTAGEMODEENUM_PERMANENT ConsentStageModeEnum = "permanent" + CONSENTSTAGEMODEENUM_EXPIRING ConsentStageModeEnum = "expiring" +) + +// All allowed values of ConsentStageModeEnum enum +var AllowedConsentStageModeEnumEnumValues = []ConsentStageModeEnum{ + "always_require", + "permanent", + "expiring", +} + +func (v *ConsentStageModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ConsentStageModeEnum(value) + for _, existing := range AllowedConsentStageModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ConsentStageModeEnum", value) +} + +// NewConsentStageModeEnumFromValue returns a pointer to a valid ConsentStageModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewConsentStageModeEnumFromValue(v string) (*ConsentStageModeEnum, error) { + ev := ConsentStageModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ConsentStageModeEnum: valid values are %v", v, AllowedConsentStageModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ConsentStageModeEnum) IsValid() bool { + for _, existing := range AllowedConsentStageModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ConsentStageModeEnum value +func (v ConsentStageModeEnum) Ptr() *ConsentStageModeEnum { + return &v +} + +type NullableConsentStageModeEnum struct { + value *ConsentStageModeEnum + isSet bool +} + +func (v NullableConsentStageModeEnum) Get() *ConsentStageModeEnum { + return v.value +} + +func (v *NullableConsentStageModeEnum) Set(val *ConsentStageModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableConsentStageModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentStageModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentStageModeEnum(val *ConsentStageModeEnum) *NullableConsentStageModeEnum { + return &NullableConsentStageModeEnum{value: val, isSet: true} +} + +func (v NullableConsentStageModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentStageModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_consent_stage_request.go b/packages/client-go/model_consent_stage_request.go new file mode 100644 index 0000000000..971ca4ab47 --- /dev/null +++ b/packages/client-go/model_consent_stage_request.go @@ -0,0 +1,242 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ConsentStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConsentStageRequest{} + +// ConsentStageRequest ConsentStage Serializer +type ConsentStageRequest struct { + Name string `json:"name"` + Mode *ConsentStageModeEnum `json:"mode,omitempty"` + // Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + ConsentExpireIn *string `json:"consent_expire_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ConsentStageRequest ConsentStageRequest + +// NewConsentStageRequest instantiates a new ConsentStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConsentStageRequest(name string) *ConsentStageRequest { + this := ConsentStageRequest{} + this.Name = name + return &this +} + +// NewConsentStageRequestWithDefaults instantiates a new ConsentStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConsentStageRequestWithDefaults() *ConsentStageRequest { + this := ConsentStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ConsentStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ConsentStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ConsentStageRequest) SetName(v string) { + o.Name = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ConsentStageRequest) GetMode() ConsentStageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret ConsentStageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentStageRequest) GetModeOk() (*ConsentStageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ConsentStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ConsentStageModeEnum and assigns it to the Mode field. +func (o *ConsentStageRequest) SetMode(v ConsentStageModeEnum) { + o.Mode = &v +} + +// GetConsentExpireIn returns the ConsentExpireIn field value if set, zero value otherwise. +func (o *ConsentStageRequest) GetConsentExpireIn() string { + if o == nil || IsNil(o.ConsentExpireIn) { + var ret string + return ret + } + return *o.ConsentExpireIn +} + +// GetConsentExpireInOk returns a tuple with the ConsentExpireIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConsentStageRequest) GetConsentExpireInOk() (*string, bool) { + if o == nil || IsNil(o.ConsentExpireIn) { + return nil, false + } + return o.ConsentExpireIn, true +} + +// HasConsentExpireIn returns a boolean if a field has been set. +func (o *ConsentStageRequest) HasConsentExpireIn() bool { + if o != nil && !IsNil(o.ConsentExpireIn) { + return true + } + + return false +} + +// SetConsentExpireIn gets a reference to the given string and assigns it to the ConsentExpireIn field. +func (o *ConsentStageRequest) SetConsentExpireIn(v string) { + o.ConsentExpireIn = &v +} + +func (o ConsentStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConsentStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ConsentExpireIn) { + toSerialize["consent_expire_in"] = o.ConsentExpireIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ConsentStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varConsentStageRequest := _ConsentStageRequest{} + + err = json.Unmarshal(data, &varConsentStageRequest) + + if err != nil { + return err + } + + *o = ConsentStageRequest(varConsentStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "consent_expire_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableConsentStageRequest struct { + value *ConsentStageRequest + isSet bool +} + +func (v NullableConsentStageRequest) Get() *ConsentStageRequest { + return v.value +} + +func (v *NullableConsentStageRequest) Set(val *ConsentStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableConsentStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableConsentStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConsentStageRequest(val *ConsentStageRequest) *NullableConsentStageRequest { + return &NullableConsentStageRequest{value: val, isSet: true} +} + +func (v NullableConsentStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConsentStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_content_type.go b/packages/client-go/model_content_type.go new file mode 100644 index 0000000000..90cebeae33 --- /dev/null +++ b/packages/client-go/model_content_type.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContentType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContentType{} + +// ContentType struct for ContentType +type ContentType struct { + Id int32 `json:"id"` + AppLabel string `json:"app_label"` + Model string `json:"model"` + VerboseNamePlural string `json:"verbose_name_plural"` + AdditionalProperties map[string]interface{} +} + +type _ContentType ContentType + +// NewContentType instantiates a new ContentType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContentType(id int32, appLabel string, model string, verboseNamePlural string) *ContentType { + this := ContentType{} + this.Id = id + this.AppLabel = appLabel + this.Model = model + this.VerboseNamePlural = verboseNamePlural + return &this +} + +// NewContentTypeWithDefaults instantiates a new ContentType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContentTypeWithDefaults() *ContentType { + this := ContentType{} + return &this +} + +// GetId returns the Id field value +func (o *ContentType) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ContentType) SetId(v int32) { + o.Id = v +} + +// GetAppLabel returns the AppLabel field value +func (o *ContentType) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *ContentType) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetModel returns the Model field value +func (o *ContentType) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *ContentType) SetModel(v string) { + o.Model = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ContentType) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ContentType) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ContentType) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +func (o ContentType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContentType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["app_label"] = o.AppLabel + toSerialize["model"] = o.Model + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContentType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "app_label", + "model", + "verbose_name_plural", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContentType := _ContentType{} + + err = json.Unmarshal(data, &varContentType) + + if err != nil { + return err + } + + *o = ContentType(varContentType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "app_label") + delete(additionalProperties, "model") + delete(additionalProperties, "verbose_name_plural") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContentType struct { + value *ContentType + isSet bool +} + +func (v NullableContentType) Get() *ContentType { + return v.value +} + +func (v *NullableContentType) Set(val *ContentType) { + v.value = val + v.isSet = true +} + +func (v NullableContentType) IsSet() bool { + return v.isSet +} + +func (v *NullableContentType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentType(val *ContentType) *NullableContentType { + return &NullableContentType{value: val, isSet: true} +} + +func (v NullableContentType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_content_type_enum.go b/packages/client-go/model_content_type_enum.go new file mode 100644 index 0000000000..a2d4178770 --- /dev/null +++ b/packages/client-go/model_content_type_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ContentTypeEnum the model 'ContentTypeEnum' +type ContentTypeEnum string + +// List of ContentTypeEnum +const ( + CONTENTTYPEENUM_AUTHENTIK_CORE_APPLICATION ContentTypeEnum = "authentik_core.application" + CONTENTTYPEENUM_AUTHENTIK_CORE_GROUP ContentTypeEnum = "authentik_core.group" + CONTENTTYPEENUM_AUTHENTIK_RBAC_ROLE ContentTypeEnum = "authentik_rbac.role" +) + +// All allowed values of ContentTypeEnum enum +var AllowedContentTypeEnumEnumValues = []ContentTypeEnum{ + "authentik_core.application", + "authentik_core.group", + "authentik_rbac.role", +} + +func (v *ContentTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContentTypeEnum(value) + for _, existing := range AllowedContentTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ContentTypeEnum", value) +} + +// NewContentTypeEnumFromValue returns a pointer to a valid ContentTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContentTypeEnumFromValue(v string) (*ContentTypeEnum, error) { + ev := ContentTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContentTypeEnum: valid values are %v", v, AllowedContentTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContentTypeEnum) IsValid() bool { + for _, existing := range AllowedContentTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContentTypeEnum value +func (v ContentTypeEnum) Ptr() *ContentTypeEnum { + return &v +} + +type NullableContentTypeEnum struct { + value *ContentTypeEnum + isSet bool +} + +func (v NullableContentTypeEnum) Get() *ContentTypeEnum { + return v.value +} + +func (v *NullableContentTypeEnum) Set(val *ContentTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableContentTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableContentTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContentTypeEnum(val *ContentTypeEnum) *NullableContentTypeEnum { + return &NullableContentTypeEnum{value: val, isSet: true} +} + +func (v NullableContentTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContentTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_contextual_flow_info.go b/packages/client-go/model_contextual_flow_info.go new file mode 100644 index 0000000000..afff1c1548 --- /dev/null +++ b/packages/client-go/model_contextual_flow_info.go @@ -0,0 +1,318 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ContextualFlowInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ContextualFlowInfo{} + +// ContextualFlowInfo Contextual flow information for a challenge +type ContextualFlowInfo struct { + Title *string `json:"title,omitempty"` + Background *string `json:"background,omitempty"` + BackgroundThemedUrls NullableThemedUrls `json:"background_themed_urls,omitempty"` + CancelUrl string `json:"cancel_url"` + Layout ContextualFlowInfoLayoutEnum `json:"layout"` + AdditionalProperties map[string]interface{} +} + +type _ContextualFlowInfo ContextualFlowInfo + +// NewContextualFlowInfo instantiates a new ContextualFlowInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewContextualFlowInfo(cancelUrl string, layout ContextualFlowInfoLayoutEnum) *ContextualFlowInfo { + this := ContextualFlowInfo{} + this.CancelUrl = cancelUrl + this.Layout = layout + return &this +} + +// NewContextualFlowInfoWithDefaults instantiates a new ContextualFlowInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewContextualFlowInfoWithDefaults() *ContextualFlowInfo { + this := ContextualFlowInfo{} + return &this +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *ContextualFlowInfo) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContextualFlowInfo) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *ContextualFlowInfo) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *ContextualFlowInfo) SetTitle(v string) { + o.Title = &v +} + +// GetBackground returns the Background field value if set, zero value otherwise. +func (o *ContextualFlowInfo) GetBackground() string { + if o == nil || IsNil(o.Background) { + var ret string + return ret + } + return *o.Background +} + +// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ContextualFlowInfo) GetBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.Background) { + return nil, false + } + return o.Background, true +} + +// HasBackground returns a boolean if a field has been set. +func (o *ContextualFlowInfo) HasBackground() bool { + if o != nil && !IsNil(o.Background) { + return true + } + + return false +} + +// SetBackground gets a reference to the given string and assigns it to the Background field. +func (o *ContextualFlowInfo) SetBackground(v string) { + o.Background = &v +} + +// GetBackgroundThemedUrls returns the BackgroundThemedUrls field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ContextualFlowInfo) GetBackgroundThemedUrls() ThemedUrls { + if o == nil || IsNil(o.BackgroundThemedUrls.Get()) { + var ret ThemedUrls + return ret + } + return *o.BackgroundThemedUrls.Get() +} + +// GetBackgroundThemedUrlsOk returns a tuple with the BackgroundThemedUrls field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ContextualFlowInfo) GetBackgroundThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.BackgroundThemedUrls.Get(), o.BackgroundThemedUrls.IsSet() +} + +// HasBackgroundThemedUrls returns a boolean if a field has been set. +func (o *ContextualFlowInfo) HasBackgroundThemedUrls() bool { + if o != nil && o.BackgroundThemedUrls.IsSet() { + return true + } + + return false +} + +// SetBackgroundThemedUrls gets a reference to the given NullableThemedUrls and assigns it to the BackgroundThemedUrls field. +func (o *ContextualFlowInfo) SetBackgroundThemedUrls(v ThemedUrls) { + o.BackgroundThemedUrls.Set(&v) +} + +// SetBackgroundThemedUrlsNil sets the value for BackgroundThemedUrls to be an explicit nil +func (o *ContextualFlowInfo) SetBackgroundThemedUrlsNil() { + o.BackgroundThemedUrls.Set(nil) +} + +// UnsetBackgroundThemedUrls ensures that no value is present for BackgroundThemedUrls, not even an explicit nil +func (o *ContextualFlowInfo) UnsetBackgroundThemedUrls() { + o.BackgroundThemedUrls.Unset() +} + +// GetCancelUrl returns the CancelUrl field value +func (o *ContextualFlowInfo) GetCancelUrl() string { + if o == nil { + var ret string + return ret + } + + return o.CancelUrl +} + +// GetCancelUrlOk returns a tuple with the CancelUrl field value +// and a boolean to check if the value has been set. +func (o *ContextualFlowInfo) GetCancelUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CancelUrl, true +} + +// SetCancelUrl sets field value +func (o *ContextualFlowInfo) SetCancelUrl(v string) { + o.CancelUrl = v +} + +// GetLayout returns the Layout field value +func (o *ContextualFlowInfo) GetLayout() ContextualFlowInfoLayoutEnum { + if o == nil { + var ret ContextualFlowInfoLayoutEnum + return ret + } + + return o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value +// and a boolean to check if the value has been set. +func (o *ContextualFlowInfo) GetLayoutOk() (*ContextualFlowInfoLayoutEnum, bool) { + if o == nil { + return nil, false + } + return &o.Layout, true +} + +// SetLayout sets field value +func (o *ContextualFlowInfo) SetLayout(v ContextualFlowInfoLayoutEnum) { + o.Layout = v +} + +func (o ContextualFlowInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ContextualFlowInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Background) { + toSerialize["background"] = o.Background + } + if o.BackgroundThemedUrls.IsSet() { + toSerialize["background_themed_urls"] = o.BackgroundThemedUrls.Get() + } + toSerialize["cancel_url"] = o.CancelUrl + toSerialize["layout"] = o.Layout + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ContextualFlowInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cancel_url", + "layout", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContextualFlowInfo := _ContextualFlowInfo{} + + err = json.Unmarshal(data, &varContextualFlowInfo) + + if err != nil { + return err + } + + *o = ContextualFlowInfo(varContextualFlowInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "title") + delete(additionalProperties, "background") + delete(additionalProperties, "background_themed_urls") + delete(additionalProperties, "cancel_url") + delete(additionalProperties, "layout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableContextualFlowInfo struct { + value *ContextualFlowInfo + isSet bool +} + +func (v NullableContextualFlowInfo) Get() *ContextualFlowInfo { + return v.value +} + +func (v *NullableContextualFlowInfo) Set(val *ContextualFlowInfo) { + v.value = val + v.isSet = true +} + +func (v NullableContextualFlowInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableContextualFlowInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContextualFlowInfo(val *ContextualFlowInfo) *NullableContextualFlowInfo { + return &NullableContextualFlowInfo{value: val, isSet: true} +} + +func (v NullableContextualFlowInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContextualFlowInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_contextual_flow_info_layout_enum.go b/packages/client-go/model_contextual_flow_info_layout_enum.go new file mode 100644 index 0000000000..7cf6ed1526 --- /dev/null +++ b/packages/client-go/model_contextual_flow_info_layout_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ContextualFlowInfoLayoutEnum the model 'ContextualFlowInfoLayoutEnum' +type ContextualFlowInfoLayoutEnum string + +// List of ContextualFlowInfoLayoutEnum +const ( + CONTEXTUALFLOWINFOLAYOUTENUM_STACKED ContextualFlowInfoLayoutEnum = "stacked" + CONTEXTUALFLOWINFOLAYOUTENUM_CONTENT_LEFT ContextualFlowInfoLayoutEnum = "content_left" + CONTEXTUALFLOWINFOLAYOUTENUM_CONTENT_RIGHT ContextualFlowInfoLayoutEnum = "content_right" + CONTEXTUALFLOWINFOLAYOUTENUM_SIDEBAR_LEFT ContextualFlowInfoLayoutEnum = "sidebar_left" + CONTEXTUALFLOWINFOLAYOUTENUM_SIDEBAR_RIGHT ContextualFlowInfoLayoutEnum = "sidebar_right" + CONTEXTUALFLOWINFOLAYOUTENUM_SIDEBAR_LEFT_FRAME_BACKGROUND ContextualFlowInfoLayoutEnum = "sidebar_left_frame_background" + CONTEXTUALFLOWINFOLAYOUTENUM_SIDEBAR_RIGHT_FRAME_BACKGROUND ContextualFlowInfoLayoutEnum = "sidebar_right_frame_background" +) + +// All allowed values of ContextualFlowInfoLayoutEnum enum +var AllowedContextualFlowInfoLayoutEnumEnumValues = []ContextualFlowInfoLayoutEnum{ + "stacked", + "content_left", + "content_right", + "sidebar_left", + "sidebar_right", + "sidebar_left_frame_background", + "sidebar_right_frame_background", +} + +func (v *ContextualFlowInfoLayoutEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ContextualFlowInfoLayoutEnum(value) + for _, existing := range AllowedContextualFlowInfoLayoutEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ContextualFlowInfoLayoutEnum", value) +} + +// NewContextualFlowInfoLayoutEnumFromValue returns a pointer to a valid ContextualFlowInfoLayoutEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewContextualFlowInfoLayoutEnumFromValue(v string) (*ContextualFlowInfoLayoutEnum, error) { + ev := ContextualFlowInfoLayoutEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ContextualFlowInfoLayoutEnum: valid values are %v", v, AllowedContextualFlowInfoLayoutEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ContextualFlowInfoLayoutEnum) IsValid() bool { + for _, existing := range AllowedContextualFlowInfoLayoutEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ContextualFlowInfoLayoutEnum value +func (v ContextualFlowInfoLayoutEnum) Ptr() *ContextualFlowInfoLayoutEnum { + return &v +} + +type NullableContextualFlowInfoLayoutEnum struct { + value *ContextualFlowInfoLayoutEnum + isSet bool +} + +func (v NullableContextualFlowInfoLayoutEnum) Get() *ContextualFlowInfoLayoutEnum { + return v.value +} + +func (v *NullableContextualFlowInfoLayoutEnum) Set(val *ContextualFlowInfoLayoutEnum) { + v.value = val + v.isSet = true +} + +func (v NullableContextualFlowInfoLayoutEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableContextualFlowInfoLayoutEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableContextualFlowInfoLayoutEnum(val *ContextualFlowInfoLayoutEnum) *NullableContextualFlowInfoLayoutEnum { + return &NullableContextualFlowInfoLayoutEnum{value: val, isSet: true} +} + +func (v NullableContextualFlowInfoLayoutEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableContextualFlowInfoLayoutEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_country_code_enum.go b/packages/client-go/model_country_code_enum.go new file mode 100644 index 0000000000..0d9e3bfa6f --- /dev/null +++ b/packages/client-go/model_country_code_enum.go @@ -0,0 +1,605 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// CountryCodeEnum the model 'CountryCodeEnum' +type CountryCodeEnum string + +// List of CountryCodeEnum +const ( + COUNTRYCODEENUM_AF CountryCodeEnum = "AF" + COUNTRYCODEENUM_AX CountryCodeEnum = "AX" + COUNTRYCODEENUM_AL CountryCodeEnum = "AL" + COUNTRYCODEENUM_DZ CountryCodeEnum = "DZ" + COUNTRYCODEENUM_AS CountryCodeEnum = "AS" + COUNTRYCODEENUM_AD CountryCodeEnum = "AD" + COUNTRYCODEENUM_AO CountryCodeEnum = "AO" + COUNTRYCODEENUM_AI CountryCodeEnum = "AI" + COUNTRYCODEENUM_AQ CountryCodeEnum = "AQ" + COUNTRYCODEENUM_AG CountryCodeEnum = "AG" + COUNTRYCODEENUM_AR CountryCodeEnum = "AR" + COUNTRYCODEENUM_AM CountryCodeEnum = "AM" + COUNTRYCODEENUM_AW CountryCodeEnum = "AW" + COUNTRYCODEENUM_AU CountryCodeEnum = "AU" + COUNTRYCODEENUM_AT CountryCodeEnum = "AT" + COUNTRYCODEENUM_AZ CountryCodeEnum = "AZ" + COUNTRYCODEENUM_BS CountryCodeEnum = "BS" + COUNTRYCODEENUM_BH CountryCodeEnum = "BH" + COUNTRYCODEENUM_BD CountryCodeEnum = "BD" + COUNTRYCODEENUM_BB CountryCodeEnum = "BB" + COUNTRYCODEENUM_BY CountryCodeEnum = "BY" + COUNTRYCODEENUM_BE CountryCodeEnum = "BE" + COUNTRYCODEENUM_BZ CountryCodeEnum = "BZ" + COUNTRYCODEENUM_BJ CountryCodeEnum = "BJ" + COUNTRYCODEENUM_BM CountryCodeEnum = "BM" + COUNTRYCODEENUM_BT CountryCodeEnum = "BT" + COUNTRYCODEENUM_BO CountryCodeEnum = "BO" + COUNTRYCODEENUM_BQ CountryCodeEnum = "BQ" + COUNTRYCODEENUM_BA CountryCodeEnum = "BA" + COUNTRYCODEENUM_BW CountryCodeEnum = "BW" + COUNTRYCODEENUM_BV CountryCodeEnum = "BV" + COUNTRYCODEENUM_BR CountryCodeEnum = "BR" + COUNTRYCODEENUM_IO CountryCodeEnum = "IO" + COUNTRYCODEENUM_BN CountryCodeEnum = "BN" + COUNTRYCODEENUM_BG CountryCodeEnum = "BG" + COUNTRYCODEENUM_BF CountryCodeEnum = "BF" + COUNTRYCODEENUM_BI CountryCodeEnum = "BI" + COUNTRYCODEENUM_CV CountryCodeEnum = "CV" + COUNTRYCODEENUM_KH CountryCodeEnum = "KH" + COUNTRYCODEENUM_CM CountryCodeEnum = "CM" + COUNTRYCODEENUM_CA CountryCodeEnum = "CA" + COUNTRYCODEENUM_KY CountryCodeEnum = "KY" + COUNTRYCODEENUM_CF CountryCodeEnum = "CF" + COUNTRYCODEENUM_TD CountryCodeEnum = "TD" + COUNTRYCODEENUM_CL CountryCodeEnum = "CL" + COUNTRYCODEENUM_CN CountryCodeEnum = "CN" + COUNTRYCODEENUM_CX CountryCodeEnum = "CX" + COUNTRYCODEENUM_CC CountryCodeEnum = "CC" + COUNTRYCODEENUM_CO CountryCodeEnum = "CO" + COUNTRYCODEENUM_KM CountryCodeEnum = "KM" + COUNTRYCODEENUM_CG CountryCodeEnum = "CG" + COUNTRYCODEENUM_CK CountryCodeEnum = "CK" + COUNTRYCODEENUM_CR CountryCodeEnum = "CR" + COUNTRYCODEENUM_CI CountryCodeEnum = "CI" + COUNTRYCODEENUM_HR CountryCodeEnum = "HR" + COUNTRYCODEENUM_CU CountryCodeEnum = "CU" + COUNTRYCODEENUM_CW CountryCodeEnum = "CW" + COUNTRYCODEENUM_CY CountryCodeEnum = "CY" + COUNTRYCODEENUM_CZ CountryCodeEnum = "CZ" + COUNTRYCODEENUM_CD CountryCodeEnum = "CD" + COUNTRYCODEENUM_DK CountryCodeEnum = "DK" + COUNTRYCODEENUM_DJ CountryCodeEnum = "DJ" + COUNTRYCODEENUM_DM CountryCodeEnum = "DM" + COUNTRYCODEENUM_DO CountryCodeEnum = "DO" + COUNTRYCODEENUM_EC CountryCodeEnum = "EC" + COUNTRYCODEENUM_EG CountryCodeEnum = "EG" + COUNTRYCODEENUM_SV CountryCodeEnum = "SV" + COUNTRYCODEENUM_GQ CountryCodeEnum = "GQ" + COUNTRYCODEENUM_ER CountryCodeEnum = "ER" + COUNTRYCODEENUM_EE CountryCodeEnum = "EE" + COUNTRYCODEENUM_SZ CountryCodeEnum = "SZ" + COUNTRYCODEENUM_ET CountryCodeEnum = "ET" + COUNTRYCODEENUM_FK CountryCodeEnum = "FK" + COUNTRYCODEENUM_FO CountryCodeEnum = "FO" + COUNTRYCODEENUM_FJ CountryCodeEnum = "FJ" + COUNTRYCODEENUM_FI CountryCodeEnum = "FI" + COUNTRYCODEENUM_FR CountryCodeEnum = "FR" + COUNTRYCODEENUM_GF CountryCodeEnum = "GF" + COUNTRYCODEENUM_PF CountryCodeEnum = "PF" + COUNTRYCODEENUM_TF CountryCodeEnum = "TF" + COUNTRYCODEENUM_GA CountryCodeEnum = "GA" + COUNTRYCODEENUM_GM CountryCodeEnum = "GM" + COUNTRYCODEENUM_GE CountryCodeEnum = "GE" + COUNTRYCODEENUM_DE CountryCodeEnum = "DE" + COUNTRYCODEENUM_GH CountryCodeEnum = "GH" + COUNTRYCODEENUM_GI CountryCodeEnum = "GI" + COUNTRYCODEENUM_GR CountryCodeEnum = "GR" + COUNTRYCODEENUM_GL CountryCodeEnum = "GL" + COUNTRYCODEENUM_GD CountryCodeEnum = "GD" + COUNTRYCODEENUM_GP CountryCodeEnum = "GP" + COUNTRYCODEENUM_GU CountryCodeEnum = "GU" + COUNTRYCODEENUM_GT CountryCodeEnum = "GT" + COUNTRYCODEENUM_GG CountryCodeEnum = "GG" + COUNTRYCODEENUM_GN CountryCodeEnum = "GN" + COUNTRYCODEENUM_GW CountryCodeEnum = "GW" + COUNTRYCODEENUM_GY CountryCodeEnum = "GY" + COUNTRYCODEENUM_HT CountryCodeEnum = "HT" + COUNTRYCODEENUM_HM CountryCodeEnum = "HM" + COUNTRYCODEENUM_HN CountryCodeEnum = "HN" + COUNTRYCODEENUM_HK CountryCodeEnum = "HK" + COUNTRYCODEENUM_HU CountryCodeEnum = "HU" + COUNTRYCODEENUM_IS CountryCodeEnum = "IS" + COUNTRYCODEENUM_IN CountryCodeEnum = "IN" + COUNTRYCODEENUM_ID CountryCodeEnum = "ID" + COUNTRYCODEENUM_IR CountryCodeEnum = "IR" + COUNTRYCODEENUM_IQ CountryCodeEnum = "IQ" + COUNTRYCODEENUM_IE CountryCodeEnum = "IE" + COUNTRYCODEENUM_IM CountryCodeEnum = "IM" + COUNTRYCODEENUM_IL CountryCodeEnum = "IL" + COUNTRYCODEENUM_IT CountryCodeEnum = "IT" + COUNTRYCODEENUM_JM CountryCodeEnum = "JM" + COUNTRYCODEENUM_JP CountryCodeEnum = "JP" + COUNTRYCODEENUM_JE CountryCodeEnum = "JE" + COUNTRYCODEENUM_JO CountryCodeEnum = "JO" + COUNTRYCODEENUM_KZ CountryCodeEnum = "KZ" + COUNTRYCODEENUM_KE CountryCodeEnum = "KE" + COUNTRYCODEENUM_KI CountryCodeEnum = "KI" + COUNTRYCODEENUM_KW CountryCodeEnum = "KW" + COUNTRYCODEENUM_KG CountryCodeEnum = "KG" + COUNTRYCODEENUM_LA CountryCodeEnum = "LA" + COUNTRYCODEENUM_LV CountryCodeEnum = "LV" + COUNTRYCODEENUM_LB CountryCodeEnum = "LB" + COUNTRYCODEENUM_LS CountryCodeEnum = "LS" + COUNTRYCODEENUM_LR CountryCodeEnum = "LR" + COUNTRYCODEENUM_LY CountryCodeEnum = "LY" + COUNTRYCODEENUM_LI CountryCodeEnum = "LI" + COUNTRYCODEENUM_LT CountryCodeEnum = "LT" + COUNTRYCODEENUM_LU CountryCodeEnum = "LU" + COUNTRYCODEENUM_MO CountryCodeEnum = "MO" + COUNTRYCODEENUM_MG CountryCodeEnum = "MG" + COUNTRYCODEENUM_MW CountryCodeEnum = "MW" + COUNTRYCODEENUM_MY CountryCodeEnum = "MY" + COUNTRYCODEENUM_MV CountryCodeEnum = "MV" + COUNTRYCODEENUM_ML CountryCodeEnum = "ML" + COUNTRYCODEENUM_MT CountryCodeEnum = "MT" + COUNTRYCODEENUM_MH CountryCodeEnum = "MH" + COUNTRYCODEENUM_MQ CountryCodeEnum = "MQ" + COUNTRYCODEENUM_MR CountryCodeEnum = "MR" + COUNTRYCODEENUM_MU CountryCodeEnum = "MU" + COUNTRYCODEENUM_YT CountryCodeEnum = "YT" + COUNTRYCODEENUM_MX CountryCodeEnum = "MX" + COUNTRYCODEENUM_FM CountryCodeEnum = "FM" + COUNTRYCODEENUM_MD CountryCodeEnum = "MD" + COUNTRYCODEENUM_MC CountryCodeEnum = "MC" + COUNTRYCODEENUM_MN CountryCodeEnum = "MN" + COUNTRYCODEENUM_ME CountryCodeEnum = "ME" + COUNTRYCODEENUM_MS CountryCodeEnum = "MS" + COUNTRYCODEENUM_MA CountryCodeEnum = "MA" + COUNTRYCODEENUM_MZ CountryCodeEnum = "MZ" + COUNTRYCODEENUM_MM CountryCodeEnum = "MM" + COUNTRYCODEENUM_NA CountryCodeEnum = "NA" + COUNTRYCODEENUM_NR CountryCodeEnum = "NR" + COUNTRYCODEENUM_NP CountryCodeEnum = "NP" + COUNTRYCODEENUM_NL CountryCodeEnum = "NL" + COUNTRYCODEENUM_NC CountryCodeEnum = "NC" + COUNTRYCODEENUM_NZ CountryCodeEnum = "NZ" + COUNTRYCODEENUM_NI CountryCodeEnum = "NI" + COUNTRYCODEENUM_NE CountryCodeEnum = "NE" + COUNTRYCODEENUM_NG CountryCodeEnum = "NG" + COUNTRYCODEENUM_NU CountryCodeEnum = "NU" + COUNTRYCODEENUM_NF CountryCodeEnum = "NF" + COUNTRYCODEENUM_KP CountryCodeEnum = "KP" + COUNTRYCODEENUM_MK CountryCodeEnum = "MK" + COUNTRYCODEENUM_MP CountryCodeEnum = "MP" + COUNTRYCODEENUM_NO CountryCodeEnum = "NO" + COUNTRYCODEENUM_OM CountryCodeEnum = "OM" + COUNTRYCODEENUM_PK CountryCodeEnum = "PK" + COUNTRYCODEENUM_PW CountryCodeEnum = "PW" + COUNTRYCODEENUM_PS CountryCodeEnum = "PS" + COUNTRYCODEENUM_PA CountryCodeEnum = "PA" + COUNTRYCODEENUM_PG CountryCodeEnum = "PG" + COUNTRYCODEENUM_PY CountryCodeEnum = "PY" + COUNTRYCODEENUM_PE CountryCodeEnum = "PE" + COUNTRYCODEENUM_PH CountryCodeEnum = "PH" + COUNTRYCODEENUM_PN CountryCodeEnum = "PN" + COUNTRYCODEENUM_PL CountryCodeEnum = "PL" + COUNTRYCODEENUM_PT CountryCodeEnum = "PT" + COUNTRYCODEENUM_PR CountryCodeEnum = "PR" + COUNTRYCODEENUM_QA CountryCodeEnum = "QA" + COUNTRYCODEENUM_RE CountryCodeEnum = "RE" + COUNTRYCODEENUM_RO CountryCodeEnum = "RO" + COUNTRYCODEENUM_RU CountryCodeEnum = "RU" + COUNTRYCODEENUM_RW CountryCodeEnum = "RW" + COUNTRYCODEENUM_BL CountryCodeEnum = "BL" + COUNTRYCODEENUM_SH CountryCodeEnum = "SH" + COUNTRYCODEENUM_KN CountryCodeEnum = "KN" + COUNTRYCODEENUM_LC CountryCodeEnum = "LC" + COUNTRYCODEENUM_MF CountryCodeEnum = "MF" + COUNTRYCODEENUM_PM CountryCodeEnum = "PM" + COUNTRYCODEENUM_VC CountryCodeEnum = "VC" + COUNTRYCODEENUM_WS CountryCodeEnum = "WS" + COUNTRYCODEENUM_SM CountryCodeEnum = "SM" + COUNTRYCODEENUM_ST CountryCodeEnum = "ST" + COUNTRYCODEENUM_SA CountryCodeEnum = "SA" + COUNTRYCODEENUM_SN CountryCodeEnum = "SN" + COUNTRYCODEENUM_RS CountryCodeEnum = "RS" + COUNTRYCODEENUM_SC CountryCodeEnum = "SC" + COUNTRYCODEENUM_SL CountryCodeEnum = "SL" + COUNTRYCODEENUM_SG CountryCodeEnum = "SG" + COUNTRYCODEENUM_SX CountryCodeEnum = "SX" + COUNTRYCODEENUM_SK CountryCodeEnum = "SK" + COUNTRYCODEENUM_SI CountryCodeEnum = "SI" + COUNTRYCODEENUM_SB CountryCodeEnum = "SB" + COUNTRYCODEENUM_SO CountryCodeEnum = "SO" + COUNTRYCODEENUM_ZA CountryCodeEnum = "ZA" + COUNTRYCODEENUM_GS CountryCodeEnum = "GS" + COUNTRYCODEENUM_KR CountryCodeEnum = "KR" + COUNTRYCODEENUM_SS CountryCodeEnum = "SS" + COUNTRYCODEENUM_ES CountryCodeEnum = "ES" + COUNTRYCODEENUM_LK CountryCodeEnum = "LK" + COUNTRYCODEENUM_SD CountryCodeEnum = "SD" + COUNTRYCODEENUM_SR CountryCodeEnum = "SR" + COUNTRYCODEENUM_SJ CountryCodeEnum = "SJ" + COUNTRYCODEENUM_SE CountryCodeEnum = "SE" + COUNTRYCODEENUM_CH CountryCodeEnum = "CH" + COUNTRYCODEENUM_SY CountryCodeEnum = "SY" + COUNTRYCODEENUM_TW CountryCodeEnum = "TW" + COUNTRYCODEENUM_TJ CountryCodeEnum = "TJ" + COUNTRYCODEENUM_TZ CountryCodeEnum = "TZ" + COUNTRYCODEENUM_TH CountryCodeEnum = "TH" + COUNTRYCODEENUM_TL CountryCodeEnum = "TL" + COUNTRYCODEENUM_TG CountryCodeEnum = "TG" + COUNTRYCODEENUM_TK CountryCodeEnum = "TK" + COUNTRYCODEENUM_TO CountryCodeEnum = "TO" + COUNTRYCODEENUM_TT CountryCodeEnum = "TT" + COUNTRYCODEENUM_TN CountryCodeEnum = "TN" + COUNTRYCODEENUM_TR CountryCodeEnum = "TR" + COUNTRYCODEENUM_TM CountryCodeEnum = "TM" + COUNTRYCODEENUM_TC CountryCodeEnum = "TC" + COUNTRYCODEENUM_TV CountryCodeEnum = "TV" + COUNTRYCODEENUM_UG CountryCodeEnum = "UG" + COUNTRYCODEENUM_UA CountryCodeEnum = "UA" + COUNTRYCODEENUM_AE CountryCodeEnum = "AE" + COUNTRYCODEENUM_GB CountryCodeEnum = "GB" + COUNTRYCODEENUM_UM CountryCodeEnum = "UM" + COUNTRYCODEENUM_US CountryCodeEnum = "US" + COUNTRYCODEENUM_UY CountryCodeEnum = "UY" + COUNTRYCODEENUM_UZ CountryCodeEnum = "UZ" + COUNTRYCODEENUM_VU CountryCodeEnum = "VU" + COUNTRYCODEENUM_VA CountryCodeEnum = "VA" + COUNTRYCODEENUM_VE CountryCodeEnum = "VE" + COUNTRYCODEENUM_VN CountryCodeEnum = "VN" + COUNTRYCODEENUM_VG CountryCodeEnum = "VG" + COUNTRYCODEENUM_VI CountryCodeEnum = "VI" + COUNTRYCODEENUM_WF CountryCodeEnum = "WF" + COUNTRYCODEENUM_EH CountryCodeEnum = "EH" + COUNTRYCODEENUM_YE CountryCodeEnum = "YE" + COUNTRYCODEENUM_ZM CountryCodeEnum = "ZM" + COUNTRYCODEENUM_ZW CountryCodeEnum = "ZW" +) + +// All allowed values of CountryCodeEnum enum +var AllowedCountryCodeEnumEnumValues = []CountryCodeEnum{ + "AF", + "AX", + "AL", + "DZ", + "AS", + "AD", + "AO", + "AI", + "AQ", + "AG", + "AR", + "AM", + "AW", + "AU", + "AT", + "AZ", + "BS", + "BH", + "BD", + "BB", + "BY", + "BE", + "BZ", + "BJ", + "BM", + "BT", + "BO", + "BQ", + "BA", + "BW", + "BV", + "BR", + "IO", + "BN", + "BG", + "BF", + "BI", + "CV", + "KH", + "CM", + "CA", + "KY", + "CF", + "TD", + "CL", + "CN", + "CX", + "CC", + "CO", + "KM", + "CG", + "CK", + "CR", + "CI", + "HR", + "CU", + "CW", + "CY", + "CZ", + "CD", + "DK", + "DJ", + "DM", + "DO", + "EC", + "EG", + "SV", + "GQ", + "ER", + "EE", + "SZ", + "ET", + "FK", + "FO", + "FJ", + "FI", + "FR", + "GF", + "PF", + "TF", + "GA", + "GM", + "GE", + "DE", + "GH", + "GI", + "GR", + "GL", + "GD", + "GP", + "GU", + "GT", + "GG", + "GN", + "GW", + "GY", + "HT", + "HM", + "HN", + "HK", + "HU", + "IS", + "IN", + "ID", + "IR", + "IQ", + "IE", + "IM", + "IL", + "IT", + "JM", + "JP", + "JE", + "JO", + "KZ", + "KE", + "KI", + "KW", + "KG", + "LA", + "LV", + "LB", + "LS", + "LR", + "LY", + "LI", + "LT", + "LU", + "MO", + "MG", + "MW", + "MY", + "MV", + "ML", + "MT", + "MH", + "MQ", + "MR", + "MU", + "YT", + "MX", + "FM", + "MD", + "MC", + "MN", + "ME", + "MS", + "MA", + "MZ", + "MM", + "NA", + "NR", + "NP", + "NL", + "NC", + "NZ", + "NI", + "NE", + "NG", + "NU", + "NF", + "KP", + "MK", + "MP", + "NO", + "OM", + "PK", + "PW", + "PS", + "PA", + "PG", + "PY", + "PE", + "PH", + "PN", + "PL", + "PT", + "PR", + "QA", + "RE", + "RO", + "RU", + "RW", + "BL", + "SH", + "KN", + "LC", + "MF", + "PM", + "VC", + "WS", + "SM", + "ST", + "SA", + "SN", + "RS", + "SC", + "SL", + "SG", + "SX", + "SK", + "SI", + "SB", + "SO", + "ZA", + "GS", + "KR", + "SS", + "ES", + "LK", + "SD", + "SR", + "SJ", + "SE", + "CH", + "SY", + "TW", + "TJ", + "TZ", + "TH", + "TL", + "TG", + "TK", + "TO", + "TT", + "TN", + "TR", + "TM", + "TC", + "TV", + "UG", + "UA", + "AE", + "GB", + "UM", + "US", + "UY", + "UZ", + "VU", + "VA", + "VE", + "VN", + "VG", + "VI", + "WF", + "EH", + "YE", + "ZM", + "ZW", +} + +func (v *CountryCodeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := CountryCodeEnum(value) + for _, existing := range AllowedCountryCodeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CountryCodeEnum", value) +} + +// NewCountryCodeEnumFromValue returns a pointer to a valid CountryCodeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewCountryCodeEnumFromValue(v string) (*CountryCodeEnum, error) { + ev := CountryCodeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CountryCodeEnum: valid values are %v", v, AllowedCountryCodeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v CountryCodeEnum) IsValid() bool { + for _, existing := range AllowedCountryCodeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CountryCodeEnum value +func (v CountryCodeEnum) Ptr() *CountryCodeEnum { + return &v +} + +type NullableCountryCodeEnum struct { + value *CountryCodeEnum + isSet bool +} + +func (v NullableCountryCodeEnum) Get() *CountryCodeEnum { + return v.value +} + +func (v *NullableCountryCodeEnum) Set(val *CountryCodeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableCountryCodeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableCountryCodeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCountryCodeEnum(val *CountryCodeEnum) *NullableCountryCodeEnum { + return &NullableCountryCodeEnum{value: val, isSet: true} +} + +func (v NullableCountryCodeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCountryCodeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_current_brand.go b/packages/client-go/model_current_brand.go new file mode 100644 index 0000000000..06f25c1bfe --- /dev/null +++ b/packages/client-go/model_current_brand.go @@ -0,0 +1,683 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CurrentBrand type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CurrentBrand{} + +// CurrentBrand Partial brand information for styling +type CurrentBrand struct { + MatchedDomain string `json:"matched_domain"` + BrandingTitle string `json:"branding_title"` + BrandingLogo string `json:"branding_logo"` + BrandingLogoThemedUrls NullableThemedUrls `json:"branding_logo_themed_urls"` + BrandingFavicon string `json:"branding_favicon"` + BrandingFaviconThemedUrls NullableThemedUrls `json:"branding_favicon_themed_urls"` + BrandingCustomCss string `json:"branding_custom_css"` + UiFooterLinks []FooterLink `json:"ui_footer_links"` + UiTheme UiThemeEnum `json:"ui_theme"` + FlowAuthentication *string `json:"flow_authentication,omitempty"` + FlowInvalidation *string `json:"flow_invalidation,omitempty"` + FlowRecovery *string `json:"flow_recovery,omitempty"` + FlowUnenrollment *string `json:"flow_unenrollment,omitempty"` + FlowUserSettings *string `json:"flow_user_settings,omitempty"` + FlowDeviceCode *string `json:"flow_device_code,omitempty"` + DefaultLocale string `json:"default_locale"` + Flags CurrentBrandFlags `json:"flags"` + AdditionalProperties map[string]interface{} +} + +type _CurrentBrand CurrentBrand + +// NewCurrentBrand instantiates a new CurrentBrand object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCurrentBrand(matchedDomain string, brandingTitle string, brandingLogo string, brandingLogoThemedUrls NullableThemedUrls, brandingFavicon string, brandingFaviconThemedUrls NullableThemedUrls, brandingCustomCss string, uiFooterLinks []FooterLink, uiTheme UiThemeEnum, defaultLocale string, flags CurrentBrandFlags) *CurrentBrand { + this := CurrentBrand{} + this.MatchedDomain = matchedDomain + this.BrandingTitle = brandingTitle + this.BrandingLogo = brandingLogo + this.BrandingLogoThemedUrls = brandingLogoThemedUrls + this.BrandingFavicon = brandingFavicon + this.BrandingFaviconThemedUrls = brandingFaviconThemedUrls + this.BrandingCustomCss = brandingCustomCss + this.UiFooterLinks = uiFooterLinks + this.UiTheme = uiTheme + this.DefaultLocale = defaultLocale + this.Flags = flags + return &this +} + +// NewCurrentBrandWithDefaults instantiates a new CurrentBrand object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCurrentBrandWithDefaults() *CurrentBrand { + this := CurrentBrand{} + return &this +} + +// GetMatchedDomain returns the MatchedDomain field value +func (o *CurrentBrand) GetMatchedDomain() string { + if o == nil { + var ret string + return ret + } + + return o.MatchedDomain +} + +// GetMatchedDomainOk returns a tuple with the MatchedDomain field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetMatchedDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MatchedDomain, true +} + +// SetMatchedDomain sets field value +func (o *CurrentBrand) SetMatchedDomain(v string) { + o.MatchedDomain = v +} + +// GetBrandingTitle returns the BrandingTitle field value +func (o *CurrentBrand) GetBrandingTitle() string { + if o == nil { + var ret string + return ret + } + + return o.BrandingTitle +} + +// GetBrandingTitleOk returns a tuple with the BrandingTitle field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetBrandingTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandingTitle, true +} + +// SetBrandingTitle sets field value +func (o *CurrentBrand) SetBrandingTitle(v string) { + o.BrandingTitle = v +} + +// GetBrandingLogo returns the BrandingLogo field value +func (o *CurrentBrand) GetBrandingLogo() string { + if o == nil { + var ret string + return ret + } + + return o.BrandingLogo +} + +// GetBrandingLogoOk returns a tuple with the BrandingLogo field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetBrandingLogoOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandingLogo, true +} + +// SetBrandingLogo sets field value +func (o *CurrentBrand) SetBrandingLogo(v string) { + o.BrandingLogo = v +} + +// GetBrandingLogoThemedUrls returns the BrandingLogoThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *CurrentBrand) GetBrandingLogoThemedUrls() ThemedUrls { + if o == nil || o.BrandingLogoThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.BrandingLogoThemedUrls.Get() +} + +// GetBrandingLogoThemedUrlsOk returns a tuple with the BrandingLogoThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentBrand) GetBrandingLogoThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.BrandingLogoThemedUrls.Get(), o.BrandingLogoThemedUrls.IsSet() +} + +// SetBrandingLogoThemedUrls sets field value +func (o *CurrentBrand) SetBrandingLogoThemedUrls(v ThemedUrls) { + o.BrandingLogoThemedUrls.Set(&v) +} + +// GetBrandingFavicon returns the BrandingFavicon field value +func (o *CurrentBrand) GetBrandingFavicon() string { + if o == nil { + var ret string + return ret + } + + return o.BrandingFavicon +} + +// GetBrandingFaviconOk returns a tuple with the BrandingFavicon field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetBrandingFaviconOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandingFavicon, true +} + +// SetBrandingFavicon sets field value +func (o *CurrentBrand) SetBrandingFavicon(v string) { + o.BrandingFavicon = v +} + +// GetBrandingFaviconThemedUrls returns the BrandingFaviconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *CurrentBrand) GetBrandingFaviconThemedUrls() ThemedUrls { + if o == nil || o.BrandingFaviconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.BrandingFaviconThemedUrls.Get() +} + +// GetBrandingFaviconThemedUrlsOk returns a tuple with the BrandingFaviconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CurrentBrand) GetBrandingFaviconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.BrandingFaviconThemedUrls.Get(), o.BrandingFaviconThemedUrls.IsSet() +} + +// SetBrandingFaviconThemedUrls sets field value +func (o *CurrentBrand) SetBrandingFaviconThemedUrls(v ThemedUrls) { + o.BrandingFaviconThemedUrls.Set(&v) +} + +// GetBrandingCustomCss returns the BrandingCustomCss field value +func (o *CurrentBrand) GetBrandingCustomCss() string { + if o == nil { + var ret string + return ret + } + + return o.BrandingCustomCss +} + +// GetBrandingCustomCssOk returns a tuple with the BrandingCustomCss field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetBrandingCustomCssOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandingCustomCss, true +} + +// SetBrandingCustomCss sets field value +func (o *CurrentBrand) SetBrandingCustomCss(v string) { + o.BrandingCustomCss = v +} + +// GetUiFooterLinks returns the UiFooterLinks field value +func (o *CurrentBrand) GetUiFooterLinks() []FooterLink { + if o == nil { + var ret []FooterLink + return ret + } + + return o.UiFooterLinks +} + +// GetUiFooterLinksOk returns a tuple with the UiFooterLinks field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetUiFooterLinksOk() ([]FooterLink, bool) { + if o == nil { + return nil, false + } + return o.UiFooterLinks, true +} + +// SetUiFooterLinks sets field value +func (o *CurrentBrand) SetUiFooterLinks(v []FooterLink) { + o.UiFooterLinks = v +} + +// GetUiTheme returns the UiTheme field value +func (o *CurrentBrand) GetUiTheme() UiThemeEnum { + if o == nil { + var ret UiThemeEnum + return ret + } + + return o.UiTheme +} + +// GetUiThemeOk returns a tuple with the UiTheme field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetUiThemeOk() (*UiThemeEnum, bool) { + if o == nil { + return nil, false + } + return &o.UiTheme, true +} + +// SetUiTheme sets field value +func (o *CurrentBrand) SetUiTheme(v UiThemeEnum) { + o.UiTheme = v +} + +// GetFlowAuthentication returns the FlowAuthentication field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowAuthentication() string { + if o == nil || IsNil(o.FlowAuthentication) { + var ret string + return ret + } + return *o.FlowAuthentication +} + +// GetFlowAuthenticationOk returns a tuple with the FlowAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowAuthenticationOk() (*string, bool) { + if o == nil || IsNil(o.FlowAuthentication) { + return nil, false + } + return o.FlowAuthentication, true +} + +// HasFlowAuthentication returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowAuthentication() bool { + if o != nil && !IsNil(o.FlowAuthentication) { + return true + } + + return false +} + +// SetFlowAuthentication gets a reference to the given string and assigns it to the FlowAuthentication field. +func (o *CurrentBrand) SetFlowAuthentication(v string) { + o.FlowAuthentication = &v +} + +// GetFlowInvalidation returns the FlowInvalidation field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowInvalidation() string { + if o == nil || IsNil(o.FlowInvalidation) { + var ret string + return ret + } + return *o.FlowInvalidation +} + +// GetFlowInvalidationOk returns a tuple with the FlowInvalidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowInvalidationOk() (*string, bool) { + if o == nil || IsNil(o.FlowInvalidation) { + return nil, false + } + return o.FlowInvalidation, true +} + +// HasFlowInvalidation returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowInvalidation() bool { + if o != nil && !IsNil(o.FlowInvalidation) { + return true + } + + return false +} + +// SetFlowInvalidation gets a reference to the given string and assigns it to the FlowInvalidation field. +func (o *CurrentBrand) SetFlowInvalidation(v string) { + o.FlowInvalidation = &v +} + +// GetFlowRecovery returns the FlowRecovery field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowRecovery() string { + if o == nil || IsNil(o.FlowRecovery) { + var ret string + return ret + } + return *o.FlowRecovery +} + +// GetFlowRecoveryOk returns a tuple with the FlowRecovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowRecoveryOk() (*string, bool) { + if o == nil || IsNil(o.FlowRecovery) { + return nil, false + } + return o.FlowRecovery, true +} + +// HasFlowRecovery returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowRecovery() bool { + if o != nil && !IsNil(o.FlowRecovery) { + return true + } + + return false +} + +// SetFlowRecovery gets a reference to the given string and assigns it to the FlowRecovery field. +func (o *CurrentBrand) SetFlowRecovery(v string) { + o.FlowRecovery = &v +} + +// GetFlowUnenrollment returns the FlowUnenrollment field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowUnenrollment() string { + if o == nil || IsNil(o.FlowUnenrollment) { + var ret string + return ret + } + return *o.FlowUnenrollment +} + +// GetFlowUnenrollmentOk returns a tuple with the FlowUnenrollment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowUnenrollmentOk() (*string, bool) { + if o == nil || IsNil(o.FlowUnenrollment) { + return nil, false + } + return o.FlowUnenrollment, true +} + +// HasFlowUnenrollment returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowUnenrollment() bool { + if o != nil && !IsNil(o.FlowUnenrollment) { + return true + } + + return false +} + +// SetFlowUnenrollment gets a reference to the given string and assigns it to the FlowUnenrollment field. +func (o *CurrentBrand) SetFlowUnenrollment(v string) { + o.FlowUnenrollment = &v +} + +// GetFlowUserSettings returns the FlowUserSettings field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowUserSettings() string { + if o == nil || IsNil(o.FlowUserSettings) { + var ret string + return ret + } + return *o.FlowUserSettings +} + +// GetFlowUserSettingsOk returns a tuple with the FlowUserSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowUserSettingsOk() (*string, bool) { + if o == nil || IsNil(o.FlowUserSettings) { + return nil, false + } + return o.FlowUserSettings, true +} + +// HasFlowUserSettings returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowUserSettings() bool { + if o != nil && !IsNil(o.FlowUserSettings) { + return true + } + + return false +} + +// SetFlowUserSettings gets a reference to the given string and assigns it to the FlowUserSettings field. +func (o *CurrentBrand) SetFlowUserSettings(v string) { + o.FlowUserSettings = &v +} + +// GetFlowDeviceCode returns the FlowDeviceCode field value if set, zero value otherwise. +func (o *CurrentBrand) GetFlowDeviceCode() string { + if o == nil || IsNil(o.FlowDeviceCode) { + var ret string + return ret + } + return *o.FlowDeviceCode +} + +// GetFlowDeviceCodeOk returns a tuple with the FlowDeviceCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlowDeviceCodeOk() (*string, bool) { + if o == nil || IsNil(o.FlowDeviceCode) { + return nil, false + } + return o.FlowDeviceCode, true +} + +// HasFlowDeviceCode returns a boolean if a field has been set. +func (o *CurrentBrand) HasFlowDeviceCode() bool { + if o != nil && !IsNil(o.FlowDeviceCode) { + return true + } + + return false +} + +// SetFlowDeviceCode gets a reference to the given string and assigns it to the FlowDeviceCode field. +func (o *CurrentBrand) SetFlowDeviceCode(v string) { + o.FlowDeviceCode = &v +} + +// GetDefaultLocale returns the DefaultLocale field value +func (o *CurrentBrand) GetDefaultLocale() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultLocale +} + +// GetDefaultLocaleOk returns a tuple with the DefaultLocale field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetDefaultLocaleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultLocale, true +} + +// SetDefaultLocale sets field value +func (o *CurrentBrand) SetDefaultLocale(v string) { + o.DefaultLocale = v +} + +// GetFlags returns the Flags field value +func (o *CurrentBrand) GetFlags() CurrentBrandFlags { + if o == nil { + var ret CurrentBrandFlags + return ret + } + + return o.Flags +} + +// GetFlagsOk returns a tuple with the Flags field value +// and a boolean to check if the value has been set. +func (o *CurrentBrand) GetFlagsOk() (*CurrentBrandFlags, bool) { + if o == nil { + return nil, false + } + return &o.Flags, true +} + +// SetFlags sets field value +func (o *CurrentBrand) SetFlags(v CurrentBrandFlags) { + o.Flags = v +} + +func (o CurrentBrand) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CurrentBrand) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["matched_domain"] = o.MatchedDomain + toSerialize["branding_title"] = o.BrandingTitle + toSerialize["branding_logo"] = o.BrandingLogo + toSerialize["branding_logo_themed_urls"] = o.BrandingLogoThemedUrls.Get() + toSerialize["branding_favicon"] = o.BrandingFavicon + toSerialize["branding_favicon_themed_urls"] = o.BrandingFaviconThemedUrls.Get() + toSerialize["branding_custom_css"] = o.BrandingCustomCss + toSerialize["ui_footer_links"] = o.UiFooterLinks + toSerialize["ui_theme"] = o.UiTheme + if !IsNil(o.FlowAuthentication) { + toSerialize["flow_authentication"] = o.FlowAuthentication + } + if !IsNil(o.FlowInvalidation) { + toSerialize["flow_invalidation"] = o.FlowInvalidation + } + if !IsNil(o.FlowRecovery) { + toSerialize["flow_recovery"] = o.FlowRecovery + } + if !IsNil(o.FlowUnenrollment) { + toSerialize["flow_unenrollment"] = o.FlowUnenrollment + } + if !IsNil(o.FlowUserSettings) { + toSerialize["flow_user_settings"] = o.FlowUserSettings + } + if !IsNil(o.FlowDeviceCode) { + toSerialize["flow_device_code"] = o.FlowDeviceCode + } + toSerialize["default_locale"] = o.DefaultLocale + toSerialize["flags"] = o.Flags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CurrentBrand) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "matched_domain", + "branding_title", + "branding_logo", + "branding_logo_themed_urls", + "branding_favicon", + "branding_favicon_themed_urls", + "branding_custom_css", + "ui_footer_links", + "ui_theme", + "default_locale", + "flags", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCurrentBrand := _CurrentBrand{} + + err = json.Unmarshal(data, &varCurrentBrand) + + if err != nil { + return err + } + + *o = CurrentBrand(varCurrentBrand) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "matched_domain") + delete(additionalProperties, "branding_title") + delete(additionalProperties, "branding_logo") + delete(additionalProperties, "branding_logo_themed_urls") + delete(additionalProperties, "branding_favicon") + delete(additionalProperties, "branding_favicon_themed_urls") + delete(additionalProperties, "branding_custom_css") + delete(additionalProperties, "ui_footer_links") + delete(additionalProperties, "ui_theme") + delete(additionalProperties, "flow_authentication") + delete(additionalProperties, "flow_invalidation") + delete(additionalProperties, "flow_recovery") + delete(additionalProperties, "flow_unenrollment") + delete(additionalProperties, "flow_user_settings") + delete(additionalProperties, "flow_device_code") + delete(additionalProperties, "default_locale") + delete(additionalProperties, "flags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCurrentBrand struct { + value *CurrentBrand + isSet bool +} + +func (v NullableCurrentBrand) Get() *CurrentBrand { + return v.value +} + +func (v *NullableCurrentBrand) Set(val *CurrentBrand) { + v.value = val + v.isSet = true +} + +func (v NullableCurrentBrand) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrentBrand) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrentBrand(val *CurrentBrand) *NullableCurrentBrand { + return &NullableCurrentBrand{value: val, isSet: true} +} + +func (v NullableCurrentBrand) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrentBrand) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_current_brand_flags.go b/packages/client-go/model_current_brand_flags.go new file mode 100644 index 0000000000..d6304bbe75 --- /dev/null +++ b/packages/client-go/model_current_brand_flags.go @@ -0,0 +1,258 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the CurrentBrandFlags type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CurrentBrandFlags{} + +// CurrentBrandFlags struct for CurrentBrandFlags +type CurrentBrandFlags struct { + // Configure if applications without any policy/group/user bindings should be accessible to any user. + CoreDefaultAppAccess bool `json:"core_default_app_access"` + // Include additional information in audit logs, may incur a performance penalty. + EnterpriseAuditIncludeExpandedDiff bool `json:"enterprise_audit_include_expanded_diff"` + // Upon successful authentication, re-start authentication in other open tabs. + FlowsContinuousLogin bool `json:"flows_continuous_login"` + // Refresh other tabs after successful authentication. + FlowsRefreshOthers bool `json:"flows_refresh_others"` + AdditionalProperties map[string]interface{} +} + +type _CurrentBrandFlags CurrentBrandFlags + +// NewCurrentBrandFlags instantiates a new CurrentBrandFlags object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCurrentBrandFlags(coreDefaultAppAccess bool, enterpriseAuditIncludeExpandedDiff bool, flowsContinuousLogin bool, flowsRefreshOthers bool) *CurrentBrandFlags { + this := CurrentBrandFlags{} + this.CoreDefaultAppAccess = coreDefaultAppAccess + this.EnterpriseAuditIncludeExpandedDiff = enterpriseAuditIncludeExpandedDiff + this.FlowsContinuousLogin = flowsContinuousLogin + this.FlowsRefreshOthers = flowsRefreshOthers + return &this +} + +// NewCurrentBrandFlagsWithDefaults instantiates a new CurrentBrandFlags object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCurrentBrandFlagsWithDefaults() *CurrentBrandFlags { + this := CurrentBrandFlags{} + return &this +} + +// GetCoreDefaultAppAccess returns the CoreDefaultAppAccess field value +func (o *CurrentBrandFlags) GetCoreDefaultAppAccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.CoreDefaultAppAccess +} + +// GetCoreDefaultAppAccessOk returns a tuple with the CoreDefaultAppAccess field value +// and a boolean to check if the value has been set. +func (o *CurrentBrandFlags) GetCoreDefaultAppAccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CoreDefaultAppAccess, true +} + +// SetCoreDefaultAppAccess sets field value +func (o *CurrentBrandFlags) SetCoreDefaultAppAccess(v bool) { + o.CoreDefaultAppAccess = v +} + +// GetEnterpriseAuditIncludeExpandedDiff returns the EnterpriseAuditIncludeExpandedDiff field value +func (o *CurrentBrandFlags) GetEnterpriseAuditIncludeExpandedDiff() bool { + if o == nil { + var ret bool + return ret + } + + return o.EnterpriseAuditIncludeExpandedDiff +} + +// GetEnterpriseAuditIncludeExpandedDiffOk returns a tuple with the EnterpriseAuditIncludeExpandedDiff field value +// and a boolean to check if the value has been set. +func (o *CurrentBrandFlags) GetEnterpriseAuditIncludeExpandedDiffOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.EnterpriseAuditIncludeExpandedDiff, true +} + +// SetEnterpriseAuditIncludeExpandedDiff sets field value +func (o *CurrentBrandFlags) SetEnterpriseAuditIncludeExpandedDiff(v bool) { + o.EnterpriseAuditIncludeExpandedDiff = v +} + +// GetFlowsContinuousLogin returns the FlowsContinuousLogin field value +func (o *CurrentBrandFlags) GetFlowsContinuousLogin() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlowsContinuousLogin +} + +// GetFlowsContinuousLoginOk returns a tuple with the FlowsContinuousLogin field value +// and a boolean to check if the value has been set. +func (o *CurrentBrandFlags) GetFlowsContinuousLoginOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlowsContinuousLogin, true +} + +// SetFlowsContinuousLogin sets field value +func (o *CurrentBrandFlags) SetFlowsContinuousLogin(v bool) { + o.FlowsContinuousLogin = v +} + +// GetFlowsRefreshOthers returns the FlowsRefreshOthers field value +func (o *CurrentBrandFlags) GetFlowsRefreshOthers() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlowsRefreshOthers +} + +// GetFlowsRefreshOthersOk returns a tuple with the FlowsRefreshOthers field value +// and a boolean to check if the value has been set. +func (o *CurrentBrandFlags) GetFlowsRefreshOthersOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlowsRefreshOthers, true +} + +// SetFlowsRefreshOthers sets field value +func (o *CurrentBrandFlags) SetFlowsRefreshOthers(v bool) { + o.FlowsRefreshOthers = v +} + +func (o CurrentBrandFlags) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CurrentBrandFlags) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["core_default_app_access"] = o.CoreDefaultAppAccess + toSerialize["enterprise_audit_include_expanded_diff"] = o.EnterpriseAuditIncludeExpandedDiff + toSerialize["flows_continuous_login"] = o.FlowsContinuousLogin + toSerialize["flows_refresh_others"] = o.FlowsRefreshOthers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CurrentBrandFlags) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "core_default_app_access", + "enterprise_audit_include_expanded_diff", + "flows_continuous_login", + "flows_refresh_others", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCurrentBrandFlags := _CurrentBrandFlags{} + + err = json.Unmarshal(data, &varCurrentBrandFlags) + + if err != nil { + return err + } + + *o = CurrentBrandFlags(varCurrentBrandFlags) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "core_default_app_access") + delete(additionalProperties, "enterprise_audit_include_expanded_diff") + delete(additionalProperties, "flows_continuous_login") + delete(additionalProperties, "flows_refresh_others") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCurrentBrandFlags struct { + value *CurrentBrandFlags + isSet bool +} + +func (v NullableCurrentBrandFlags) Get() *CurrentBrandFlags { + return v.value +} + +func (v *NullableCurrentBrandFlags) Set(val *CurrentBrandFlags) { + v.value = val + v.isSet = true +} + +func (v NullableCurrentBrandFlags) IsSet() bool { + return v.isSet +} + +func (v *NullableCurrentBrandFlags) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCurrentBrandFlags(val *CurrentBrandFlags) *NullableCurrentBrandFlags { + return &NullableCurrentBrandFlags{value: val, isSet: true} +} + +func (v NullableCurrentBrandFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCurrentBrandFlags) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_data_export.go b/packages/client-go/model_data_export.go new file mode 100644 index 0000000000..7cf578895e --- /dev/null +++ b/packages/client-go/model_data_export.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DataExport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataExport{} + +// DataExport Mixin to validate that a valid enterprise license exists before allowing to save the object +type DataExport struct { + Id string `json:"id"` + RequestedBy PartialUser `json:"requested_by"` + RequestedOn time.Time `json:"requested_on"` + ContentType ContentType `json:"content_type"` + QueryParams map[string]interface{} `json:"query_params"` + FileUrl string `json:"file_url"` + Completed bool `json:"completed"` + AdditionalProperties map[string]interface{} +} + +type _DataExport DataExport + +// NewDataExport instantiates a new DataExport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataExport(id string, requestedBy PartialUser, requestedOn time.Time, contentType ContentType, queryParams map[string]interface{}, fileUrl string, completed bool) *DataExport { + this := DataExport{} + this.Id = id + this.RequestedBy = requestedBy + this.RequestedOn = requestedOn + this.ContentType = contentType + this.QueryParams = queryParams + this.FileUrl = fileUrl + this.Completed = completed + return &this +} + +// NewDataExportWithDefaults instantiates a new DataExport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataExportWithDefaults() *DataExport { + this := DataExport{} + return &this +} + +// GetId returns the Id field value +func (o *DataExport) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DataExport) SetId(v string) { + o.Id = v +} + +// GetRequestedBy returns the RequestedBy field value +func (o *DataExport) GetRequestedBy() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.RequestedBy +} + +// GetRequestedByOk returns a tuple with the RequestedBy field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetRequestedByOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.RequestedBy, true +} + +// SetRequestedBy sets field value +func (o *DataExport) SetRequestedBy(v PartialUser) { + o.RequestedBy = v +} + +// GetRequestedOn returns the RequestedOn field value +func (o *DataExport) GetRequestedOn() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.RequestedOn +} + +// GetRequestedOnOk returns a tuple with the RequestedOn field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetRequestedOnOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.RequestedOn, true +} + +// SetRequestedOn sets field value +func (o *DataExport) SetRequestedOn(v time.Time) { + o.RequestedOn = v +} + +// GetContentType returns the ContentType field value +func (o *DataExport) GetContentType() ContentType { + if o == nil { + var ret ContentType + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetContentTypeOk() (*ContentType, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *DataExport) SetContentType(v ContentType) { + o.ContentType = v +} + +// GetQueryParams returns the QueryParams field value +func (o *DataExport) GetQueryParams() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.QueryParams +} + +// GetQueryParamsOk returns a tuple with the QueryParams field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetQueryParamsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.QueryParams, true +} + +// SetQueryParams sets field value +func (o *DataExport) SetQueryParams(v map[string]interface{}) { + o.QueryParams = v +} + +// GetFileUrl returns the FileUrl field value +func (o *DataExport) GetFileUrl() string { + if o == nil { + var ret string + return ret + } + + return o.FileUrl +} + +// GetFileUrlOk returns a tuple with the FileUrl field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetFileUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FileUrl, true +} + +// SetFileUrl sets field value +func (o *DataExport) SetFileUrl(v string) { + o.FileUrl = v +} + +// GetCompleted returns the Completed field value +func (o *DataExport) GetCompleted() bool { + if o == nil { + var ret bool + return ret + } + + return o.Completed +} + +// GetCompletedOk returns a tuple with the Completed field value +// and a boolean to check if the value has been set. +func (o *DataExport) GetCompletedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Completed, true +} + +// SetCompleted sets field value +func (o *DataExport) SetCompleted(v bool) { + o.Completed = v +} + +func (o DataExport) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataExport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["requested_by"] = o.RequestedBy + toSerialize["requested_on"] = o.RequestedOn + toSerialize["content_type"] = o.ContentType + toSerialize["query_params"] = o.QueryParams + toSerialize["file_url"] = o.FileUrl + toSerialize["completed"] = o.Completed + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataExport) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "requested_by", + "requested_on", + "content_type", + "query_params", + "file_url", + "completed", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDataExport := _DataExport{} + + err = json.Unmarshal(data, &varDataExport) + + if err != nil { + return err + } + + *o = DataExport(varDataExport) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "requested_by") + delete(additionalProperties, "requested_on") + delete(additionalProperties, "content_type") + delete(additionalProperties, "query_params") + delete(additionalProperties, "file_url") + delete(additionalProperties, "completed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataExport struct { + value *DataExport + isSet bool +} + +func (v NullableDataExport) Get() *DataExport { + return v.value +} + +func (v *NullableDataExport) Set(val *DataExport) { + v.value = val + v.isSet = true +} + +func (v NullableDataExport) IsSet() bool { + return v.isSet +} + +func (v *NullableDataExport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataExport(val *DataExport) *NullableDataExport { + return &NullableDataExport{value: val, isSet: true} +} + +func (v NullableDataExport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataExport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_delivery_method_enum.go b/packages/client-go/model_delivery_method_enum.go new file mode 100644 index 0000000000..4c073bd435 --- /dev/null +++ b/packages/client-go/model_delivery_method_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DeliveryMethodEnum the model 'DeliveryMethodEnum' +type DeliveryMethodEnum string + +// List of DeliveryMethodEnum +const ( + DELIVERYMETHODENUM_HTTPS___SCHEMAS_OPENID_NET_SECEVENT_RISC_DELIVERY_METHOD_PUSH DeliveryMethodEnum = "https://schemas.openid.net/secevent/risc/delivery-method/push" + DELIVERYMETHODENUM_HTTPS___SCHEMAS_OPENID_NET_SECEVENT_RISC_DELIVERY_METHOD_POLL DeliveryMethodEnum = "https://schemas.openid.net/secevent/risc/delivery-method/poll" +) + +// All allowed values of DeliveryMethodEnum enum +var AllowedDeliveryMethodEnumEnumValues = []DeliveryMethodEnum{ + "https://schemas.openid.net/secevent/risc/delivery-method/push", + "https://schemas.openid.net/secevent/risc/delivery-method/poll", +} + +func (v *DeliveryMethodEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeliveryMethodEnum(value) + for _, existing := range AllowedDeliveryMethodEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeliveryMethodEnum", value) +} + +// NewDeliveryMethodEnumFromValue returns a pointer to a valid DeliveryMethodEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeliveryMethodEnumFromValue(v string) (*DeliveryMethodEnum, error) { + ev := DeliveryMethodEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeliveryMethodEnum: valid values are %v", v, AllowedDeliveryMethodEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeliveryMethodEnum) IsValid() bool { + for _, existing := range AllowedDeliveryMethodEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeliveryMethodEnum value +func (v DeliveryMethodEnum) Ptr() *DeliveryMethodEnum { + return &v +} + +type NullableDeliveryMethodEnum struct { + value *DeliveryMethodEnum + isSet bool +} + +func (v NullableDeliveryMethodEnum) Get() *DeliveryMethodEnum { + return v.value +} + +func (v *NullableDeliveryMethodEnum) Set(val *DeliveryMethodEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDeliveryMethodEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDeliveryMethodEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeliveryMethodEnum(val *DeliveryMethodEnum) *NullableDeliveryMethodEnum { + return &NullableDeliveryMethodEnum{value: val, isSet: true} +} + +func (v NullableDeliveryMethodEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeliveryMethodEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_denied_action_enum.go b/packages/client-go/model_denied_action_enum.go new file mode 100644 index 0000000000..129fe2c09e --- /dev/null +++ b/packages/client-go/model_denied_action_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DeniedActionEnum the model 'DeniedActionEnum' +type DeniedActionEnum string + +// List of DeniedActionEnum +const ( + DENIEDACTIONENUM_MESSAGE_CONTINUE DeniedActionEnum = "message_continue" + DENIEDACTIONENUM_MESSAGE DeniedActionEnum = "message" + DENIEDACTIONENUM_CONTINUE DeniedActionEnum = "continue" +) + +// All allowed values of DeniedActionEnum enum +var AllowedDeniedActionEnumEnumValues = []DeniedActionEnum{ + "message_continue", + "message", + "continue", +} + +func (v *DeniedActionEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeniedActionEnum(value) + for _, existing := range AllowedDeniedActionEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeniedActionEnum", value) +} + +// NewDeniedActionEnumFromValue returns a pointer to a valid DeniedActionEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeniedActionEnumFromValue(v string) (*DeniedActionEnum, error) { + ev := DeniedActionEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeniedActionEnum: valid values are %v", v, AllowedDeniedActionEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeniedActionEnum) IsValid() bool { + for _, existing := range AllowedDeniedActionEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeniedActionEnum value +func (v DeniedActionEnum) Ptr() *DeniedActionEnum { + return &v +} + +type NullableDeniedActionEnum struct { + value *DeniedActionEnum + isSet bool +} + +func (v NullableDeniedActionEnum) Get() *DeniedActionEnum { + return v.value +} + +func (v *NullableDeniedActionEnum) Set(val *DeniedActionEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDeniedActionEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDeniedActionEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeniedActionEnum(val *DeniedActionEnum) *NullableDeniedActionEnum { + return &NullableDeniedActionEnum{value: val, isSet: true} +} + +func (v NullableDeniedActionEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeniedActionEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_deny_stage.go b/packages/client-go/model_deny_stage.go new file mode 100644 index 0000000000..1bed7f6eb2 --- /dev/null +++ b/packages/client-go/model_deny_stage.go @@ -0,0 +1,382 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DenyStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DenyStage{} + +// DenyStage DenyStage Serializer +type DenyStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + DenyMessage *string `json:"deny_message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DenyStage DenyStage + +// NewDenyStage instantiates a new DenyStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDenyStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *DenyStage { + this := DenyStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewDenyStageWithDefaults instantiates a new DenyStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDenyStageWithDefaults() *DenyStage { + this := DenyStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *DenyStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DenyStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *DenyStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DenyStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *DenyStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *DenyStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *DenyStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *DenyStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *DenyStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *DenyStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *DenyStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *DenyStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *DenyStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *DenyStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *DenyStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetDenyMessage returns the DenyMessage field value if set, zero value otherwise. +func (o *DenyStage) GetDenyMessage() string { + if o == nil || IsNil(o.DenyMessage) { + var ret string + return ret + } + return *o.DenyMessage +} + +// GetDenyMessageOk returns a tuple with the DenyMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DenyStage) GetDenyMessageOk() (*string, bool) { + if o == nil || IsNil(o.DenyMessage) { + return nil, false + } + return o.DenyMessage, true +} + +// HasDenyMessage returns a boolean if a field has been set. +func (o *DenyStage) HasDenyMessage() bool { + if o != nil && !IsNil(o.DenyMessage) { + return true + } + + return false +} + +// SetDenyMessage gets a reference to the given string and assigns it to the DenyMessage field. +func (o *DenyStage) SetDenyMessage(v string) { + o.DenyMessage = &v +} + +func (o DenyStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DenyStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.DenyMessage) { + toSerialize["deny_message"] = o.DenyMessage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DenyStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDenyStage := _DenyStage{} + + err = json.Unmarshal(data, &varDenyStage) + + if err != nil { + return err + } + + *o = DenyStage(varDenyStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "deny_message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDenyStage struct { + value *DenyStage + isSet bool +} + +func (v NullableDenyStage) Get() *DenyStage { + return v.value +} + +func (v *NullableDenyStage) Set(val *DenyStage) { + v.value = val + v.isSet = true +} + +func (v NullableDenyStage) IsSet() bool { + return v.isSet +} + +func (v *NullableDenyStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDenyStage(val *DenyStage) *NullableDenyStage { + return &NullableDenyStage{value: val, isSet: true} +} + +func (v NullableDenyStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDenyStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_deny_stage_request.go b/packages/client-go/model_deny_stage_request.go new file mode 100644 index 0000000000..4f78ccca42 --- /dev/null +++ b/packages/client-go/model_deny_stage_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DenyStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DenyStageRequest{} + +// DenyStageRequest DenyStage Serializer +type DenyStageRequest struct { + Name string `json:"name"` + DenyMessage *string `json:"deny_message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DenyStageRequest DenyStageRequest + +// NewDenyStageRequest instantiates a new DenyStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDenyStageRequest(name string) *DenyStageRequest { + this := DenyStageRequest{} + this.Name = name + return &this +} + +// NewDenyStageRequestWithDefaults instantiates a new DenyStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDenyStageRequestWithDefaults() *DenyStageRequest { + this := DenyStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DenyStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DenyStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DenyStageRequest) SetName(v string) { + o.Name = v +} + +// GetDenyMessage returns the DenyMessage field value if set, zero value otherwise. +func (o *DenyStageRequest) GetDenyMessage() string { + if o == nil || IsNil(o.DenyMessage) { + var ret string + return ret + } + return *o.DenyMessage +} + +// GetDenyMessageOk returns a tuple with the DenyMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DenyStageRequest) GetDenyMessageOk() (*string, bool) { + if o == nil || IsNil(o.DenyMessage) { + return nil, false + } + return o.DenyMessage, true +} + +// HasDenyMessage returns a boolean if a field has been set. +func (o *DenyStageRequest) HasDenyMessage() bool { + if o != nil && !IsNil(o.DenyMessage) { + return true + } + + return false +} + +// SetDenyMessage gets a reference to the given string and assigns it to the DenyMessage field. +func (o *DenyStageRequest) SetDenyMessage(v string) { + o.DenyMessage = &v +} + +func (o DenyStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DenyStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.DenyMessage) { + toSerialize["deny_message"] = o.DenyMessage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DenyStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDenyStageRequest := _DenyStageRequest{} + + err = json.Unmarshal(data, &varDenyStageRequest) + + if err != nil { + return err + } + + *o = DenyStageRequest(varDenyStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "deny_message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDenyStageRequest struct { + value *DenyStageRequest + isSet bool +} + +func (v NullableDenyStageRequest) Get() *DenyStageRequest { + return v.value +} + +func (v *NullableDenyStageRequest) Set(val *DenyStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDenyStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDenyStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDenyStageRequest(val *DenyStageRequest) *NullableDenyStageRequest { + return &NullableDenyStageRequest{value: val, isSet: true} +} + +func (v NullableDenyStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDenyStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_detailed_country.go b/packages/client-go/model_detailed_country.go new file mode 100644 index 0000000000..0244ff5b9d --- /dev/null +++ b/packages/client-go/model_detailed_country.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DetailedCountry type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DetailedCountry{} + +// DetailedCountry struct for DetailedCountry +type DetailedCountry struct { + Code CountryCodeEnum `json:"code"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _DetailedCountry DetailedCountry + +// NewDetailedCountry instantiates a new DetailedCountry object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDetailedCountry(code CountryCodeEnum, name string) *DetailedCountry { + this := DetailedCountry{} + this.Code = code + this.Name = name + return &this +} + +// NewDetailedCountryWithDefaults instantiates a new DetailedCountry object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDetailedCountryWithDefaults() *DetailedCountry { + this := DetailedCountry{} + return &this +} + +// GetCode returns the Code field value +func (o *DetailedCountry) GetCode() CountryCodeEnum { + if o == nil { + var ret CountryCodeEnum + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *DetailedCountry) GetCodeOk() (*CountryCodeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *DetailedCountry) SetCode(v CountryCodeEnum) { + o.Code = v +} + +// GetName returns the Name field value +func (o *DetailedCountry) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DetailedCountry) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DetailedCountry) SetName(v string) { + o.Name = v +} + +func (o DetailedCountry) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DetailedCountry) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DetailedCountry) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDetailedCountry := _DetailedCountry{} + + err = json.Unmarshal(data, &varDetailedCountry) + + if err != nil { + return err + } + + *o = DetailedCountry(varDetailedCountry) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDetailedCountry struct { + value *DetailedCountry + isSet bool +} + +func (v NullableDetailedCountry) Get() *DetailedCountry { + return v.value +} + +func (v *NullableDetailedCountry) Set(val *DetailedCountry) { + v.value = val + v.isSet = true +} + +func (v NullableDetailedCountry) IsSet() bool { + return v.isSet +} + +func (v *NullableDetailedCountry) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDetailedCountry(val *DetailedCountry) *NullableDetailedCountry { + return &NullableDetailedCountry{value: val, isSet: true} +} + +func (v NullableDetailedCountry) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDetailedCountry) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device.go b/packages/client-go/model_device.go new file mode 100644 index 0000000000..b44ac106f9 --- /dev/null +++ b/packages/client-go/model_device.go @@ -0,0 +1,499 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Device type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Device{} + +// Device Serializer for authenticator devices +type Device struct { + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + Pk string `json:"pk"` + Name string `json:"name"` + // Get type of device + Type string `json:"type"` + Confirmed bool `json:"confirmed"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + LastUsed NullableTime `json:"last_used"` + // Get extra description + ExtraDescription NullableString `json:"extra_description"` + // Get external Device ID + ExternalId NullableString `json:"external_id"` + AdditionalProperties map[string]interface{} +} + +type _Device Device + +// NewDevice instantiates a new Device object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDevice(verboseName string, verboseNamePlural string, metaModelName string, pk string, name string, type_ string, confirmed bool, created time.Time, lastUpdated time.Time, lastUsed NullableTime, extraDescription NullableString, externalId NullableString) *Device { + this := Device{} + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Pk = pk + this.Name = name + this.Type = type_ + this.Confirmed = confirmed + this.Created = created + this.LastUpdated = lastUpdated + this.LastUsed = lastUsed + this.ExtraDescription = extraDescription + this.ExternalId = externalId + return &this +} + +// NewDeviceWithDefaults instantiates a new Device object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceWithDefaults() *Device { + this := Device{} + return &this +} + +// GetVerboseName returns the VerboseName field value +func (o *Device) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Device) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Device) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Device) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Device) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Device) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Device) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Device) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Device) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPk returns the Pk field value +func (o *Device) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Device) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Device) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Device) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Device) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Device) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *Device) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Device) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Device) SetType(v string) { + o.Type = v +} + +// GetConfirmed returns the Confirmed field value +func (o *Device) GetConfirmed() bool { + if o == nil { + var ret bool + return ret + } + + return o.Confirmed +} + +// GetConfirmedOk returns a tuple with the Confirmed field value +// and a boolean to check if the value has been set. +func (o *Device) GetConfirmedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Confirmed, true +} + +// SetConfirmed sets field value +func (o *Device) SetConfirmed(v bool) { + o.Confirmed = v +} + +// GetCreated returns the Created field value +func (o *Device) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Device) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Device) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *Device) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *Device) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *Device) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +// GetLastUsed returns the LastUsed field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *Device) GetLastUsed() time.Time { + if o == nil || o.LastUsed.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// SetLastUsed sets field value +func (o *Device) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +// GetExtraDescription returns the ExtraDescription field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Device) GetExtraDescription() string { + if o == nil || o.ExtraDescription.Get() == nil { + var ret string + return ret + } + + return *o.ExtraDescription.Get() +} + +// GetExtraDescriptionOk returns a tuple with the ExtraDescription field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetExtraDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExtraDescription.Get(), o.ExtraDescription.IsSet() +} + +// SetExtraDescription sets field value +func (o *Device) SetExtraDescription(v string) { + o.ExtraDescription.Set(&v) +} + +// GetExternalId returns the ExternalId field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Device) GetExternalId() string { + if o == nil || o.ExternalId.Get() == nil { + var ret string + return ret + } + + return *o.ExternalId.Get() +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Device) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExternalId.Get(), o.ExternalId.IsSet() +} + +// SetExternalId sets field value +func (o *Device) SetExternalId(v string) { + o.ExternalId.Set(&v) +} + +func (o Device) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Device) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["confirmed"] = o.Confirmed + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + toSerialize["last_used"] = o.LastUsed.Get() + toSerialize["extra_description"] = o.ExtraDescription.Get() + toSerialize["external_id"] = o.ExternalId.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Device) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "pk", + "name", + "type", + "confirmed", + "created", + "last_updated", + "last_used", + "extra_description", + "external_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDevice := _Device{} + + err = json.Unmarshal(data, &varDevice) + + if err != nil { + return err + } + + *o = Device(varDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "confirmed") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "last_used") + delete(additionalProperties, "extra_description") + delete(additionalProperties, "external_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDevice struct { + value *Device + isSet bool +} + +func (v NullableDevice) Get() *Device { + return v.value +} + +func (v *NullableDevice) Set(val *Device) { + v.value = val + v.isSet = true +} + +func (v NullableDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDevice(val *Device) *NullableDevice { + return &NullableDevice{value: val, isSet: true} +} + +func (v NullableDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_access_group.go b/packages/client-go/model_device_access_group.go new file mode 100644 index 0000000000..0403d2de1d --- /dev/null +++ b/packages/client-go/model_device_access_group.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceAccessGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceAccessGroup{} + +// DeviceAccessGroup struct for DeviceAccessGroup +type DeviceAccessGroup struct { + PbmUuid string `json:"pbm_uuid"` + Name string `json:"name"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceAccessGroup DeviceAccessGroup + +// NewDeviceAccessGroup instantiates a new DeviceAccessGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceAccessGroup(pbmUuid string, name string) *DeviceAccessGroup { + this := DeviceAccessGroup{} + this.PbmUuid = pbmUuid + this.Name = name + return &this +} + +// NewDeviceAccessGroupWithDefaults instantiates a new DeviceAccessGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceAccessGroupWithDefaults() *DeviceAccessGroup { + this := DeviceAccessGroup{} + return &this +} + +// GetPbmUuid returns the PbmUuid field value +func (o *DeviceAccessGroup) GetPbmUuid() string { + if o == nil { + var ret string + return ret + } + + return o.PbmUuid +} + +// GetPbmUuidOk returns a tuple with the PbmUuid field value +// and a boolean to check if the value has been set. +func (o *DeviceAccessGroup) GetPbmUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PbmUuid, true +} + +// SetPbmUuid sets field value +func (o *DeviceAccessGroup) SetPbmUuid(v string) { + o.PbmUuid = v +} + +// GetName returns the Name field value +func (o *DeviceAccessGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceAccessGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceAccessGroup) SetName(v string) { + o.Name = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *DeviceAccessGroup) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceAccessGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *DeviceAccessGroup) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *DeviceAccessGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o DeviceAccessGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceAccessGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pbm_uuid"] = o.PbmUuid + toSerialize["name"] = o.Name + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceAccessGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pbm_uuid", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceAccessGroup := _DeviceAccessGroup{} + + err = json.Unmarshal(data, &varDeviceAccessGroup) + + if err != nil { + return err + } + + *o = DeviceAccessGroup(varDeviceAccessGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pbm_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceAccessGroup struct { + value *DeviceAccessGroup + isSet bool +} + +func (v NullableDeviceAccessGroup) Get() *DeviceAccessGroup { + return v.value +} + +func (v *NullableDeviceAccessGroup) Set(val *DeviceAccessGroup) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceAccessGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceAccessGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceAccessGroup(val *DeviceAccessGroup) *NullableDeviceAccessGroup { + return &NullableDeviceAccessGroup{value: val, isSet: true} +} + +func (v NullableDeviceAccessGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceAccessGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_access_group_request.go b/packages/client-go/model_device_access_group_request.go new file mode 100644 index 0000000000..ed6071c6d1 --- /dev/null +++ b/packages/client-go/model_device_access_group_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceAccessGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceAccessGroupRequest{} + +// DeviceAccessGroupRequest struct for DeviceAccessGroupRequest +type DeviceAccessGroupRequest struct { + Name string `json:"name"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceAccessGroupRequest DeviceAccessGroupRequest + +// NewDeviceAccessGroupRequest instantiates a new DeviceAccessGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceAccessGroupRequest(name string) *DeviceAccessGroupRequest { + this := DeviceAccessGroupRequest{} + this.Name = name + return &this +} + +// NewDeviceAccessGroupRequestWithDefaults instantiates a new DeviceAccessGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceAccessGroupRequestWithDefaults() *DeviceAccessGroupRequest { + this := DeviceAccessGroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DeviceAccessGroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DeviceAccessGroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DeviceAccessGroupRequest) SetName(v string) { + o.Name = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *DeviceAccessGroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceAccessGroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *DeviceAccessGroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *DeviceAccessGroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o DeviceAccessGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceAccessGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceAccessGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceAccessGroupRequest := _DeviceAccessGroupRequest{} + + err = json.Unmarshal(data, &varDeviceAccessGroupRequest) + + if err != nil { + return err + } + + *o = DeviceAccessGroupRequest(varDeviceAccessGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceAccessGroupRequest struct { + value *DeviceAccessGroupRequest + isSet bool +} + +func (v NullableDeviceAccessGroupRequest) Get() *DeviceAccessGroupRequest { + return v.value +} + +func (v *NullableDeviceAccessGroupRequest) Set(val *DeviceAccessGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceAccessGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceAccessGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceAccessGroupRequest(val *DeviceAccessGroupRequest) *NullableDeviceAccessGroupRequest { + return &NullableDeviceAccessGroupRequest{value: val, isSet: true} +} + +func (v NullableDeviceAccessGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceAccessGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_challenge.go b/packages/client-go/model_device_challenge.go new file mode 100644 index 0000000000..eecdbbfad2 --- /dev/null +++ b/packages/client-go/model_device_challenge.go @@ -0,0 +1,257 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceChallenge{} + +// DeviceChallenge Single device challenge +type DeviceChallenge struct { + DeviceClass DeviceClassesEnum `json:"device_class"` + DeviceUid string `json:"device_uid"` + Challenge map[string]interface{} `json:"challenge"` + LastUsed NullableTime `json:"last_used"` + AdditionalProperties map[string]interface{} +} + +type _DeviceChallenge DeviceChallenge + +// NewDeviceChallenge instantiates a new DeviceChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceChallenge(deviceClass DeviceClassesEnum, deviceUid string, challenge map[string]interface{}, lastUsed NullableTime) *DeviceChallenge { + this := DeviceChallenge{} + this.DeviceClass = deviceClass + this.DeviceUid = deviceUid + this.Challenge = challenge + this.LastUsed = lastUsed + return &this +} + +// NewDeviceChallengeWithDefaults instantiates a new DeviceChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceChallengeWithDefaults() *DeviceChallenge { + this := DeviceChallenge{} + return &this +} + +// GetDeviceClass returns the DeviceClass field value +func (o *DeviceChallenge) GetDeviceClass() DeviceClassesEnum { + if o == nil { + var ret DeviceClassesEnum + return ret + } + + return o.DeviceClass +} + +// GetDeviceClassOk returns a tuple with the DeviceClass field value +// and a boolean to check if the value has been set. +func (o *DeviceChallenge) GetDeviceClassOk() (*DeviceClassesEnum, bool) { + if o == nil { + return nil, false + } + return &o.DeviceClass, true +} + +// SetDeviceClass sets field value +func (o *DeviceChallenge) SetDeviceClass(v DeviceClassesEnum) { + o.DeviceClass = v +} + +// GetDeviceUid returns the DeviceUid field value +func (o *DeviceChallenge) GetDeviceUid() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceUid +} + +// GetDeviceUidOk returns a tuple with the DeviceUid field value +// and a boolean to check if the value has been set. +func (o *DeviceChallenge) GetDeviceUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceUid, true +} + +// SetDeviceUid sets field value +func (o *DeviceChallenge) SetDeviceUid(v string) { + o.DeviceUid = v +} + +// GetChallenge returns the Challenge field value +func (o *DeviceChallenge) GetChallenge() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Challenge +} + +// GetChallengeOk returns a tuple with the Challenge field value +// and a boolean to check if the value has been set. +func (o *DeviceChallenge) GetChallengeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Challenge, true +} + +// SetChallenge sets field value +func (o *DeviceChallenge) SetChallenge(v map[string]interface{}) { + o.Challenge = v +} + +// GetLastUsed returns the LastUsed field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceChallenge) GetLastUsed() time.Time { + if o == nil || o.LastUsed.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceChallenge) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// SetLastUsed sets field value +func (o *DeviceChallenge) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +func (o DeviceChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_class"] = o.DeviceClass + toSerialize["device_uid"] = o.DeviceUid + toSerialize["challenge"] = o.Challenge + toSerialize["last_used"] = o.LastUsed.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_class", + "device_uid", + "challenge", + "last_used", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceChallenge := _DeviceChallenge{} + + err = json.Unmarshal(data, &varDeviceChallenge) + + if err != nil { + return err + } + + *o = DeviceChallenge(varDeviceChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_class") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "challenge") + delete(additionalProperties, "last_used") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceChallenge struct { + value *DeviceChallenge + isSet bool +} + +func (v NullableDeviceChallenge) Get() *DeviceChallenge { + return v.value +} + +func (v *NullableDeviceChallenge) Set(val *DeviceChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceChallenge(val *DeviceChallenge) *NullableDeviceChallenge { + return &NullableDeviceChallenge{value: val, isSet: true} +} + +func (v NullableDeviceChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_challenge_request.go b/packages/client-go/model_device_challenge_request.go new file mode 100644 index 0000000000..09125dd71e --- /dev/null +++ b/packages/client-go/model_device_challenge_request.go @@ -0,0 +1,257 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceChallengeRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceChallengeRequest{} + +// DeviceChallengeRequest Single device challenge +type DeviceChallengeRequest struct { + DeviceClass DeviceClassesEnum `json:"device_class"` + DeviceUid string `json:"device_uid"` + Challenge map[string]interface{} `json:"challenge"` + LastUsed NullableTime `json:"last_used"` + AdditionalProperties map[string]interface{} +} + +type _DeviceChallengeRequest DeviceChallengeRequest + +// NewDeviceChallengeRequest instantiates a new DeviceChallengeRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceChallengeRequest(deviceClass DeviceClassesEnum, deviceUid string, challenge map[string]interface{}, lastUsed NullableTime) *DeviceChallengeRequest { + this := DeviceChallengeRequest{} + this.DeviceClass = deviceClass + this.DeviceUid = deviceUid + this.Challenge = challenge + this.LastUsed = lastUsed + return &this +} + +// NewDeviceChallengeRequestWithDefaults instantiates a new DeviceChallengeRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceChallengeRequestWithDefaults() *DeviceChallengeRequest { + this := DeviceChallengeRequest{} + return &this +} + +// GetDeviceClass returns the DeviceClass field value +func (o *DeviceChallengeRequest) GetDeviceClass() DeviceClassesEnum { + if o == nil { + var ret DeviceClassesEnum + return ret + } + + return o.DeviceClass +} + +// GetDeviceClassOk returns a tuple with the DeviceClass field value +// and a boolean to check if the value has been set. +func (o *DeviceChallengeRequest) GetDeviceClassOk() (*DeviceClassesEnum, bool) { + if o == nil { + return nil, false + } + return &o.DeviceClass, true +} + +// SetDeviceClass sets field value +func (o *DeviceChallengeRequest) SetDeviceClass(v DeviceClassesEnum) { + o.DeviceClass = v +} + +// GetDeviceUid returns the DeviceUid field value +func (o *DeviceChallengeRequest) GetDeviceUid() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceUid +} + +// GetDeviceUidOk returns a tuple with the DeviceUid field value +// and a boolean to check if the value has been set. +func (o *DeviceChallengeRequest) GetDeviceUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceUid, true +} + +// SetDeviceUid sets field value +func (o *DeviceChallengeRequest) SetDeviceUid(v string) { + o.DeviceUid = v +} + +// GetChallenge returns the Challenge field value +func (o *DeviceChallengeRequest) GetChallenge() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Challenge +} + +// GetChallengeOk returns a tuple with the Challenge field value +// and a boolean to check if the value has been set. +func (o *DeviceChallengeRequest) GetChallengeOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Challenge, true +} + +// SetChallenge sets field value +func (o *DeviceChallengeRequest) SetChallenge(v map[string]interface{}) { + o.Challenge = v +} + +// GetLastUsed returns the LastUsed field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceChallengeRequest) GetLastUsed() time.Time { + if o == nil || o.LastUsed.Get() == nil { + var ret time.Time + return ret + } + + return *o.LastUsed.Get() +} + +// GetLastUsedOk returns a tuple with the LastUsed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceChallengeRequest) GetLastUsedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastUsed.Get(), o.LastUsed.IsSet() +} + +// SetLastUsed sets field value +func (o *DeviceChallengeRequest) SetLastUsed(v time.Time) { + o.LastUsed.Set(&v) +} + +func (o DeviceChallengeRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceChallengeRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_class"] = o.DeviceClass + toSerialize["device_uid"] = o.DeviceUid + toSerialize["challenge"] = o.Challenge + toSerialize["last_used"] = o.LastUsed.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceChallengeRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_class", + "device_uid", + "challenge", + "last_used", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceChallengeRequest := _DeviceChallengeRequest{} + + err = json.Unmarshal(data, &varDeviceChallengeRequest) + + if err != nil { + return err + } + + *o = DeviceChallengeRequest(varDeviceChallengeRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_class") + delete(additionalProperties, "device_uid") + delete(additionalProperties, "challenge") + delete(additionalProperties, "last_used") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceChallengeRequest struct { + value *DeviceChallengeRequest + isSet bool +} + +func (v NullableDeviceChallengeRequest) Get() *DeviceChallengeRequest { + return v.value +} + +func (v *NullableDeviceChallengeRequest) Set(val *DeviceChallengeRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceChallengeRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceChallengeRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceChallengeRequest(val *DeviceChallengeRequest) *NullableDeviceChallengeRequest { + return &NullableDeviceChallengeRequest{value: val, isSet: true} +} + +func (v NullableDeviceChallengeRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceChallengeRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_classes_enum.go b/packages/client-go/model_device_classes_enum.go new file mode 100644 index 0000000000..689a2b03a5 --- /dev/null +++ b/packages/client-go/model_device_classes_enum.go @@ -0,0 +1,119 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DeviceClassesEnum the model 'DeviceClassesEnum' +type DeviceClassesEnum string + +// List of DeviceClassesEnum +const ( + DEVICECLASSESENUM_STATIC DeviceClassesEnum = "static" + DEVICECLASSESENUM_TOTP DeviceClassesEnum = "totp" + DEVICECLASSESENUM_WEBAUTHN DeviceClassesEnum = "webauthn" + DEVICECLASSESENUM_DUO DeviceClassesEnum = "duo" + DEVICECLASSESENUM_SMS DeviceClassesEnum = "sms" + DEVICECLASSESENUM_EMAIL DeviceClassesEnum = "email" +) + +// All allowed values of DeviceClassesEnum enum +var AllowedDeviceClassesEnumEnumValues = []DeviceClassesEnum{ + "static", + "totp", + "webauthn", + "duo", + "sms", + "email", +} + +func (v *DeviceClassesEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceClassesEnum(value) + for _, existing := range AllowedDeviceClassesEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceClassesEnum", value) +} + +// NewDeviceClassesEnumFromValue returns a pointer to a valid DeviceClassesEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceClassesEnumFromValue(v string) (*DeviceClassesEnum, error) { + ev := DeviceClassesEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceClassesEnum: valid values are %v", v, AllowedDeviceClassesEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceClassesEnum) IsValid() bool { + for _, existing := range AllowedDeviceClassesEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceClassesEnum value +func (v DeviceClassesEnum) Ptr() *DeviceClassesEnum { + return &v +} + +type NullableDeviceClassesEnum struct { + value *DeviceClassesEnum + isSet bool +} + +func (v NullableDeviceClassesEnum) Get() *DeviceClassesEnum { + return v.value +} + +func (v *NullableDeviceClassesEnum) Set(val *DeviceClassesEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceClassesEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceClassesEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceClassesEnum(val *DeviceClassesEnum) *NullableDeviceClassesEnum { + return &NullableDeviceClassesEnum{value: val, isSet: true} +} + +func (v NullableDeviceClassesEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceClassesEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_connection.go b/packages/client-go/model_device_connection.go new file mode 100644 index 0000000000..af6401b073 --- /dev/null +++ b/packages/client-go/model_device_connection.go @@ -0,0 +1,256 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceConnection{} + +// DeviceConnection struct for DeviceConnection +type DeviceConnection struct { + Device string `json:"device"` + Connector string `json:"connector"` + ConnectorObj Connector `json:"connector_obj"` + LatestSnapshot NullableDeviceFactSnapshot `json:"latest_snapshot"` + AdditionalProperties map[string]interface{} +} + +type _DeviceConnection DeviceConnection + +// NewDeviceConnection instantiates a new DeviceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceConnection(device string, connector string, connectorObj Connector, latestSnapshot NullableDeviceFactSnapshot) *DeviceConnection { + this := DeviceConnection{} + this.Device = device + this.Connector = connector + this.ConnectorObj = connectorObj + this.LatestSnapshot = latestSnapshot + return &this +} + +// NewDeviceConnectionWithDefaults instantiates a new DeviceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceConnectionWithDefaults() *DeviceConnection { + this := DeviceConnection{} + return &this +} + +// GetDevice returns the Device field value +func (o *DeviceConnection) GetDevice() string { + if o == nil { + var ret string + return ret + } + + return o.Device +} + +// GetDeviceOk returns a tuple with the Device field value +// and a boolean to check if the value has been set. +func (o *DeviceConnection) GetDeviceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Device, true +} + +// SetDevice sets field value +func (o *DeviceConnection) SetDevice(v string) { + o.Device = v +} + +// GetConnector returns the Connector field value +func (o *DeviceConnection) GetConnector() string { + if o == nil { + var ret string + return ret + } + + return o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +func (o *DeviceConnection) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connector, true +} + +// SetConnector sets field value +func (o *DeviceConnection) SetConnector(v string) { + o.Connector = v +} + +// GetConnectorObj returns the ConnectorObj field value +func (o *DeviceConnection) GetConnectorObj() Connector { + if o == nil { + var ret Connector + return ret + } + + return o.ConnectorObj +} + +// GetConnectorObjOk returns a tuple with the ConnectorObj field value +// and a boolean to check if the value has been set. +func (o *DeviceConnection) GetConnectorObjOk() (*Connector, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorObj, true +} + +// SetConnectorObj sets field value +func (o *DeviceConnection) SetConnectorObj(v Connector) { + o.ConnectorObj = v +} + +// GetLatestSnapshot returns the LatestSnapshot field value +// If the value is explicit nil, the zero value for DeviceFactSnapshot will be returned +func (o *DeviceConnection) GetLatestSnapshot() DeviceFactSnapshot { + if o == nil || o.LatestSnapshot.Get() == nil { + var ret DeviceFactSnapshot + return ret + } + + return *o.LatestSnapshot.Get() +} + +// GetLatestSnapshotOk returns a tuple with the LatestSnapshot field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceConnection) GetLatestSnapshotOk() (*DeviceFactSnapshot, bool) { + if o == nil { + return nil, false + } + return o.LatestSnapshot.Get(), o.LatestSnapshot.IsSet() +} + +// SetLatestSnapshot sets field value +func (o *DeviceConnection) SetLatestSnapshot(v DeviceFactSnapshot) { + o.LatestSnapshot.Set(&v) +} + +func (o DeviceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device"] = o.Device + toSerialize["connector"] = o.Connector + toSerialize["connector_obj"] = o.ConnectorObj + toSerialize["latest_snapshot"] = o.LatestSnapshot.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device", + "connector", + "connector_obj", + "latest_snapshot", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceConnection := _DeviceConnection{} + + err = json.Unmarshal(data, &varDeviceConnection) + + if err != nil { + return err + } + + *o = DeviceConnection(varDeviceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device") + delete(additionalProperties, "connector") + delete(additionalProperties, "connector_obj") + delete(additionalProperties, "latest_snapshot") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceConnection struct { + value *DeviceConnection + isSet bool +} + +func (v NullableDeviceConnection) Get() *DeviceConnection { + return v.value +} + +func (v *NullableDeviceConnection) Set(val *DeviceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceConnection(val *DeviceConnection) *NullableDeviceConnection { + return &NullableDeviceConnection{value: val, isSet: true} +} + +func (v NullableDeviceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_fact_snapshot.go b/packages/client-go/model_device_fact_snapshot.go new file mode 100644 index 0000000000..7c0ec731d1 --- /dev/null +++ b/packages/client-go/model_device_fact_snapshot.go @@ -0,0 +1,286 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the DeviceFactSnapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceFactSnapshot{} + +// DeviceFactSnapshot struct for DeviceFactSnapshot +type DeviceFactSnapshot struct { + Data DeviceFacts `json:"data"` + Connection string `json:"connection"` + Created time.Time `json:"created"` + Expires NullableTime `json:"expires"` + Vendor VendorEnum `json:"vendor"` + AdditionalProperties map[string]interface{} +} + +type _DeviceFactSnapshot DeviceFactSnapshot + +// NewDeviceFactSnapshot instantiates a new DeviceFactSnapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceFactSnapshot(data DeviceFacts, connection string, created time.Time, expires NullableTime, vendor VendorEnum) *DeviceFactSnapshot { + this := DeviceFactSnapshot{} + this.Data = data + this.Connection = connection + this.Created = created + this.Expires = expires + this.Vendor = vendor + return &this +} + +// NewDeviceFactSnapshotWithDefaults instantiates a new DeviceFactSnapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceFactSnapshotWithDefaults() *DeviceFactSnapshot { + this := DeviceFactSnapshot{} + return &this +} + +// GetData returns the Data field value +func (o *DeviceFactSnapshot) GetData() DeviceFacts { + if o == nil { + var ret DeviceFacts + return ret + } + + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *DeviceFactSnapshot) GetDataOk() (*DeviceFacts, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value +func (o *DeviceFactSnapshot) SetData(v DeviceFacts) { + o.Data = v +} + +// GetConnection returns the Connection field value +func (o *DeviceFactSnapshot) GetConnection() string { + if o == nil { + var ret string + return ret + } + + return o.Connection +} + +// GetConnectionOk returns a tuple with the Connection field value +// and a boolean to check if the value has been set. +func (o *DeviceFactSnapshot) GetConnectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connection, true +} + +// SetConnection sets field value +func (o *DeviceFactSnapshot) SetConnection(v string) { + o.Connection = v +} + +// GetCreated returns the Created field value +func (o *DeviceFactSnapshot) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *DeviceFactSnapshot) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *DeviceFactSnapshot) SetCreated(v time.Time) { + o.Created = v +} + +// GetExpires returns the Expires field value +// If the value is explicit nil, the zero value for time.Time will be returned +func (o *DeviceFactSnapshot) GetExpires() time.Time { + if o == nil || o.Expires.Get() == nil { + var ret time.Time + return ret + } + + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactSnapshot) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// SetExpires sets field value +func (o *DeviceFactSnapshot) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// GetVendor returns the Vendor field value +func (o *DeviceFactSnapshot) GetVendor() VendorEnum { + if o == nil { + var ret VendorEnum + return ret + } + + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value +// and a boolean to check if the value has been set. +func (o *DeviceFactSnapshot) GetVendorOk() (*VendorEnum, bool) { + if o == nil { + return nil, false + } + return &o.Vendor, true +} + +// SetVendor sets field value +func (o *DeviceFactSnapshot) SetVendor(v VendorEnum) { + o.Vendor = v +} + +func (o DeviceFactSnapshot) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceFactSnapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["data"] = o.Data + toSerialize["connection"] = o.Connection + toSerialize["created"] = o.Created + toSerialize["expires"] = o.Expires.Get() + toSerialize["vendor"] = o.Vendor + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceFactSnapshot) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "data", + "connection", + "created", + "expires", + "vendor", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceFactSnapshot := _DeviceFactSnapshot{} + + err = json.Unmarshal(data, &varDeviceFactSnapshot) + + if err != nil { + return err + } + + *o = DeviceFactSnapshot(varDeviceFactSnapshot) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "data") + delete(additionalProperties, "connection") + delete(additionalProperties, "created") + delete(additionalProperties, "expires") + delete(additionalProperties, "vendor") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceFactSnapshot struct { + value *DeviceFactSnapshot + isSet bool +} + +func (v NullableDeviceFactSnapshot) Get() *DeviceFactSnapshot { + return v.value +} + +func (v *NullableDeviceFactSnapshot) Set(val *DeviceFactSnapshot) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFactSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFactSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFactSnapshot(val *DeviceFactSnapshot) *NullableDeviceFactSnapshot { + return &NullableDeviceFactSnapshot{value: val, isSet: true} +} + +func (v NullableDeviceFactSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFactSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_facts.go b/packages/client-go/model_device_facts.go new file mode 100644 index 0000000000..cc504dbc9e --- /dev/null +++ b/packages/client-go/model_device_facts.go @@ -0,0 +1,488 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the DeviceFacts type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceFacts{} + +// DeviceFacts struct for DeviceFacts +type DeviceFacts struct { + Os NullableOperatingSystem `json:"os,omitempty"` + Disks []Disk `json:"disks,omitempty"` + Network NullableNetwork `json:"network,omitempty"` + Hardware NullableHardware `json:"hardware,omitempty"` + Software []Software `json:"software,omitempty"` + Processes []Process `json:"processes,omitempty"` + Users []DeviceUser `json:"users,omitempty"` + Groups []DeviceGroup `json:"groups,omitempty"` + Vendor map[string]interface{} `json:"vendor,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceFacts DeviceFacts + +// NewDeviceFacts instantiates a new DeviceFacts object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceFacts() *DeviceFacts { + this := DeviceFacts{} + return &this +} + +// NewDeviceFactsWithDefaults instantiates a new DeviceFacts object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceFactsWithDefaults() *DeviceFacts { + this := DeviceFacts{} + return &this +} + +// GetOs returns the Os field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetOs() OperatingSystem { + if o == nil || IsNil(o.Os.Get()) { + var ret OperatingSystem + return ret + } + return *o.Os.Get() +} + +// GetOsOk returns a tuple with the Os field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetOsOk() (*OperatingSystem, bool) { + if o == nil { + return nil, false + } + return o.Os.Get(), o.Os.IsSet() +} + +// HasOs returns a boolean if a field has been set. +func (o *DeviceFacts) HasOs() bool { + if o != nil && o.Os.IsSet() { + return true + } + + return false +} + +// SetOs gets a reference to the given NullableOperatingSystem and assigns it to the Os field. +func (o *DeviceFacts) SetOs(v OperatingSystem) { + o.Os.Set(&v) +} + +// SetOsNil sets the value for Os to be an explicit nil +func (o *DeviceFacts) SetOsNil() { + o.Os.Set(nil) +} + +// UnsetOs ensures that no value is present for Os, not even an explicit nil +func (o *DeviceFacts) UnsetOs() { + o.Os.Unset() +} + +// GetDisks returns the Disks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetDisks() []Disk { + if o == nil { + var ret []Disk + return ret + } + return o.Disks +} + +// GetDisksOk returns a tuple with the Disks field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetDisksOk() ([]Disk, bool) { + if o == nil || IsNil(o.Disks) { + return nil, false + } + return o.Disks, true +} + +// HasDisks returns a boolean if a field has been set. +func (o *DeviceFacts) HasDisks() bool { + if o != nil && !IsNil(o.Disks) { + return true + } + + return false +} + +// SetDisks gets a reference to the given []Disk and assigns it to the Disks field. +func (o *DeviceFacts) SetDisks(v []Disk) { + o.Disks = v +} + +// GetNetwork returns the Network field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetNetwork() Network { + if o == nil || IsNil(o.Network.Get()) { + var ret Network + return ret + } + return *o.Network.Get() +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetNetworkOk() (*Network, bool) { + if o == nil { + return nil, false + } + return o.Network.Get(), o.Network.IsSet() +} + +// HasNetwork returns a boolean if a field has been set. +func (o *DeviceFacts) HasNetwork() bool { + if o != nil && o.Network.IsSet() { + return true + } + + return false +} + +// SetNetwork gets a reference to the given NullableNetwork and assigns it to the Network field. +func (o *DeviceFacts) SetNetwork(v Network) { + o.Network.Set(&v) +} + +// SetNetworkNil sets the value for Network to be an explicit nil +func (o *DeviceFacts) SetNetworkNil() { + o.Network.Set(nil) +} + +// UnsetNetwork ensures that no value is present for Network, not even an explicit nil +func (o *DeviceFacts) UnsetNetwork() { + o.Network.Unset() +} + +// GetHardware returns the Hardware field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetHardware() Hardware { + if o == nil || IsNil(o.Hardware.Get()) { + var ret Hardware + return ret + } + return *o.Hardware.Get() +} + +// GetHardwareOk returns a tuple with the Hardware field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetHardwareOk() (*Hardware, bool) { + if o == nil { + return nil, false + } + return o.Hardware.Get(), o.Hardware.IsSet() +} + +// HasHardware returns a boolean if a field has been set. +func (o *DeviceFacts) HasHardware() bool { + if o != nil && o.Hardware.IsSet() { + return true + } + + return false +} + +// SetHardware gets a reference to the given NullableHardware and assigns it to the Hardware field. +func (o *DeviceFacts) SetHardware(v Hardware) { + o.Hardware.Set(&v) +} + +// SetHardwareNil sets the value for Hardware to be an explicit nil +func (o *DeviceFacts) SetHardwareNil() { + o.Hardware.Set(nil) +} + +// UnsetHardware ensures that no value is present for Hardware, not even an explicit nil +func (o *DeviceFacts) UnsetHardware() { + o.Hardware.Unset() +} + +// GetSoftware returns the Software field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetSoftware() []Software { + if o == nil { + var ret []Software + return ret + } + return o.Software +} + +// GetSoftwareOk returns a tuple with the Software field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetSoftwareOk() ([]Software, bool) { + if o == nil || IsNil(o.Software) { + return nil, false + } + return o.Software, true +} + +// HasSoftware returns a boolean if a field has been set. +func (o *DeviceFacts) HasSoftware() bool { + if o != nil && !IsNil(o.Software) { + return true + } + + return false +} + +// SetSoftware gets a reference to the given []Software and assigns it to the Software field. +func (o *DeviceFacts) SetSoftware(v []Software) { + o.Software = v +} + +// GetProcesses returns the Processes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetProcesses() []Process { + if o == nil { + var ret []Process + return ret + } + return o.Processes +} + +// GetProcessesOk returns a tuple with the Processes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetProcessesOk() ([]Process, bool) { + if o == nil || IsNil(o.Processes) { + return nil, false + } + return o.Processes, true +} + +// HasProcesses returns a boolean if a field has been set. +func (o *DeviceFacts) HasProcesses() bool { + if o != nil && !IsNil(o.Processes) { + return true + } + + return false +} + +// SetProcesses gets a reference to the given []Process and assigns it to the Processes field. +func (o *DeviceFacts) SetProcesses(v []Process) { + o.Processes = v +} + +// GetUsers returns the Users field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetUsers() []DeviceUser { + if o == nil { + var ret []DeviceUser + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetUsersOk() ([]DeviceUser, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *DeviceFacts) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []DeviceUser and assigns it to the Users field. +func (o *DeviceFacts) SetUsers(v []DeviceUser) { + o.Users = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFacts) GetGroups() []DeviceGroup { + if o == nil { + var ret []DeviceGroup + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFacts) GetGroupsOk() ([]DeviceGroup, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *DeviceFacts) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []DeviceGroup and assigns it to the Groups field. +func (o *DeviceFacts) SetGroups(v []DeviceGroup) { + o.Groups = v +} + +// GetVendor returns the Vendor field value if set, zero value otherwise. +func (o *DeviceFacts) GetVendor() map[string]interface{} { + if o == nil || IsNil(o.Vendor) { + var ret map[string]interface{} + return ret + } + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceFacts) GetVendorOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Vendor) { + return map[string]interface{}{}, false + } + return o.Vendor, true +} + +// HasVendor returns a boolean if a field has been set. +func (o *DeviceFacts) HasVendor() bool { + if o != nil && !IsNil(o.Vendor) { + return true + } + + return false +} + +// SetVendor gets a reference to the given map[string]interface{} and assigns it to the Vendor field. +func (o *DeviceFacts) SetVendor(v map[string]interface{}) { + o.Vendor = v +} + +func (o DeviceFacts) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceFacts) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Os.IsSet() { + toSerialize["os"] = o.Os.Get() + } + if o.Disks != nil { + toSerialize["disks"] = o.Disks + } + if o.Network.IsSet() { + toSerialize["network"] = o.Network.Get() + } + if o.Hardware.IsSet() { + toSerialize["hardware"] = o.Hardware.Get() + } + if o.Software != nil { + toSerialize["software"] = o.Software + } + if o.Processes != nil { + toSerialize["processes"] = o.Processes + } + if o.Users != nil { + toSerialize["users"] = o.Users + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Vendor) { + toSerialize["vendor"] = o.Vendor + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceFacts) UnmarshalJSON(data []byte) (err error) { + varDeviceFacts := _DeviceFacts{} + + err = json.Unmarshal(data, &varDeviceFacts) + + if err != nil { + return err + } + + *o = DeviceFacts(varDeviceFacts) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "os") + delete(additionalProperties, "disks") + delete(additionalProperties, "network") + delete(additionalProperties, "hardware") + delete(additionalProperties, "software") + delete(additionalProperties, "processes") + delete(additionalProperties, "users") + delete(additionalProperties, "groups") + delete(additionalProperties, "vendor") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceFacts struct { + value *DeviceFacts + isSet bool +} + +func (v NullableDeviceFacts) Get() *DeviceFacts { + return v.value +} + +func (v *NullableDeviceFacts) Set(val *DeviceFacts) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFacts) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFacts) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFacts(val *DeviceFacts) *NullableDeviceFacts { + return &NullableDeviceFacts{value: val, isSet: true} +} + +func (v NullableDeviceFacts) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFacts) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_facts_os_family.go b/packages/client-go/model_device_facts_os_family.go new file mode 100644 index 0000000000..e6e4a9875f --- /dev/null +++ b/packages/client-go/model_device_facts_os_family.go @@ -0,0 +1,123 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DeviceFactsOSFamily the model 'DeviceFactsOSFamily' +type DeviceFactsOSFamily string + +// List of DeviceFactsOSFamily +const ( + DEVICEFACTSOSFAMILY_LINUX DeviceFactsOSFamily = "linux" + DEVICEFACTSOSFAMILY_UNIX DeviceFactsOSFamily = "unix" + DEVICEFACTSOSFAMILY_BSD DeviceFactsOSFamily = "bsd" + DEVICEFACTSOSFAMILY_WINDOWS DeviceFactsOSFamily = "windows" + DEVICEFACTSOSFAMILY_MAC_OS DeviceFactsOSFamily = "mac_os" + DEVICEFACTSOSFAMILY_ANDROID DeviceFactsOSFamily = "android" + DEVICEFACTSOSFAMILY_I_OS DeviceFactsOSFamily = "i_os" + DEVICEFACTSOSFAMILY_OTHER DeviceFactsOSFamily = "other" +) + +// All allowed values of DeviceFactsOSFamily enum +var AllowedDeviceFactsOSFamilyEnumValues = []DeviceFactsOSFamily{ + "linux", + "unix", + "bsd", + "windows", + "mac_os", + "android", + "i_os", + "other", +} + +func (v *DeviceFactsOSFamily) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DeviceFactsOSFamily(value) + for _, existing := range AllowedDeviceFactsOSFamilyEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DeviceFactsOSFamily", value) +} + +// NewDeviceFactsOSFamilyFromValue returns a pointer to a valid DeviceFactsOSFamily +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDeviceFactsOSFamilyFromValue(v string) (*DeviceFactsOSFamily, error) { + ev := DeviceFactsOSFamily(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DeviceFactsOSFamily: valid values are %v", v, AllowedDeviceFactsOSFamilyEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DeviceFactsOSFamily) IsValid() bool { + for _, existing := range AllowedDeviceFactsOSFamilyEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DeviceFactsOSFamily value +func (v DeviceFactsOSFamily) Ptr() *DeviceFactsOSFamily { + return &v +} + +type NullableDeviceFactsOSFamily struct { + value *DeviceFactsOSFamily + isSet bool +} + +func (v NullableDeviceFactsOSFamily) Get() *DeviceFactsOSFamily { + return v.value +} + +func (v *NullableDeviceFactsOSFamily) Set(val *DeviceFactsOSFamily) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFactsOSFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFactsOSFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFactsOSFamily(val *DeviceFactsOSFamily) *NullableDeviceFactsOSFamily { + return &NullableDeviceFactsOSFamily{value: val, isSet: true} +} + +func (v NullableDeviceFactsOSFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFactsOSFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_facts_request.go b/packages/client-go/model_device_facts_request.go new file mode 100644 index 0000000000..5adb65ce0e --- /dev/null +++ b/packages/client-go/model_device_facts_request.go @@ -0,0 +1,488 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the DeviceFactsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceFactsRequest{} + +// DeviceFactsRequest struct for DeviceFactsRequest +type DeviceFactsRequest struct { + Os NullableOperatingSystemRequest `json:"os,omitempty"` + Disks []DiskRequest `json:"disks,omitempty"` + Network NullableNetworkRequest `json:"network,omitempty"` + Hardware NullableHardwareRequest `json:"hardware,omitempty"` + Software []SoftwareRequest `json:"software,omitempty"` + Processes []ProcessRequest `json:"processes,omitempty"` + Users []DeviceUserRequest `json:"users,omitempty"` + Groups []DeviceGroupRequest `json:"groups,omitempty"` + Vendor map[string]interface{} `json:"vendor,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceFactsRequest DeviceFactsRequest + +// NewDeviceFactsRequest instantiates a new DeviceFactsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceFactsRequest() *DeviceFactsRequest { + this := DeviceFactsRequest{} + return &this +} + +// NewDeviceFactsRequestWithDefaults instantiates a new DeviceFactsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceFactsRequestWithDefaults() *DeviceFactsRequest { + this := DeviceFactsRequest{} + return &this +} + +// GetOs returns the Os field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetOs() OperatingSystemRequest { + if o == nil || IsNil(o.Os.Get()) { + var ret OperatingSystemRequest + return ret + } + return *o.Os.Get() +} + +// GetOsOk returns a tuple with the Os field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetOsOk() (*OperatingSystemRequest, bool) { + if o == nil { + return nil, false + } + return o.Os.Get(), o.Os.IsSet() +} + +// HasOs returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasOs() bool { + if o != nil && o.Os.IsSet() { + return true + } + + return false +} + +// SetOs gets a reference to the given NullableOperatingSystemRequest and assigns it to the Os field. +func (o *DeviceFactsRequest) SetOs(v OperatingSystemRequest) { + o.Os.Set(&v) +} + +// SetOsNil sets the value for Os to be an explicit nil +func (o *DeviceFactsRequest) SetOsNil() { + o.Os.Set(nil) +} + +// UnsetOs ensures that no value is present for Os, not even an explicit nil +func (o *DeviceFactsRequest) UnsetOs() { + o.Os.Unset() +} + +// GetDisks returns the Disks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetDisks() []DiskRequest { + if o == nil { + var ret []DiskRequest + return ret + } + return o.Disks +} + +// GetDisksOk returns a tuple with the Disks field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetDisksOk() ([]DiskRequest, bool) { + if o == nil || IsNil(o.Disks) { + return nil, false + } + return o.Disks, true +} + +// HasDisks returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasDisks() bool { + if o != nil && !IsNil(o.Disks) { + return true + } + + return false +} + +// SetDisks gets a reference to the given []DiskRequest and assigns it to the Disks field. +func (o *DeviceFactsRequest) SetDisks(v []DiskRequest) { + o.Disks = v +} + +// GetNetwork returns the Network field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetNetwork() NetworkRequest { + if o == nil || IsNil(o.Network.Get()) { + var ret NetworkRequest + return ret + } + return *o.Network.Get() +} + +// GetNetworkOk returns a tuple with the Network field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetNetworkOk() (*NetworkRequest, bool) { + if o == nil { + return nil, false + } + return o.Network.Get(), o.Network.IsSet() +} + +// HasNetwork returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasNetwork() bool { + if o != nil && o.Network.IsSet() { + return true + } + + return false +} + +// SetNetwork gets a reference to the given NullableNetworkRequest and assigns it to the Network field. +func (o *DeviceFactsRequest) SetNetwork(v NetworkRequest) { + o.Network.Set(&v) +} + +// SetNetworkNil sets the value for Network to be an explicit nil +func (o *DeviceFactsRequest) SetNetworkNil() { + o.Network.Set(nil) +} + +// UnsetNetwork ensures that no value is present for Network, not even an explicit nil +func (o *DeviceFactsRequest) UnsetNetwork() { + o.Network.Unset() +} + +// GetHardware returns the Hardware field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetHardware() HardwareRequest { + if o == nil || IsNil(o.Hardware.Get()) { + var ret HardwareRequest + return ret + } + return *o.Hardware.Get() +} + +// GetHardwareOk returns a tuple with the Hardware field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetHardwareOk() (*HardwareRequest, bool) { + if o == nil { + return nil, false + } + return o.Hardware.Get(), o.Hardware.IsSet() +} + +// HasHardware returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasHardware() bool { + if o != nil && o.Hardware.IsSet() { + return true + } + + return false +} + +// SetHardware gets a reference to the given NullableHardwareRequest and assigns it to the Hardware field. +func (o *DeviceFactsRequest) SetHardware(v HardwareRequest) { + o.Hardware.Set(&v) +} + +// SetHardwareNil sets the value for Hardware to be an explicit nil +func (o *DeviceFactsRequest) SetHardwareNil() { + o.Hardware.Set(nil) +} + +// UnsetHardware ensures that no value is present for Hardware, not even an explicit nil +func (o *DeviceFactsRequest) UnsetHardware() { + o.Hardware.Unset() +} + +// GetSoftware returns the Software field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetSoftware() []SoftwareRequest { + if o == nil { + var ret []SoftwareRequest + return ret + } + return o.Software +} + +// GetSoftwareOk returns a tuple with the Software field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetSoftwareOk() ([]SoftwareRequest, bool) { + if o == nil || IsNil(o.Software) { + return nil, false + } + return o.Software, true +} + +// HasSoftware returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasSoftware() bool { + if o != nil && !IsNil(o.Software) { + return true + } + + return false +} + +// SetSoftware gets a reference to the given []SoftwareRequest and assigns it to the Software field. +func (o *DeviceFactsRequest) SetSoftware(v []SoftwareRequest) { + o.Software = v +} + +// GetProcesses returns the Processes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetProcesses() []ProcessRequest { + if o == nil { + var ret []ProcessRequest + return ret + } + return o.Processes +} + +// GetProcessesOk returns a tuple with the Processes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetProcessesOk() ([]ProcessRequest, bool) { + if o == nil || IsNil(o.Processes) { + return nil, false + } + return o.Processes, true +} + +// HasProcesses returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasProcesses() bool { + if o != nil && !IsNil(o.Processes) { + return true + } + + return false +} + +// SetProcesses gets a reference to the given []ProcessRequest and assigns it to the Processes field. +func (o *DeviceFactsRequest) SetProcesses(v []ProcessRequest) { + o.Processes = v +} + +// GetUsers returns the Users field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetUsers() []DeviceUserRequest { + if o == nil { + var ret []DeviceUserRequest + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetUsersOk() ([]DeviceUserRequest, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []DeviceUserRequest and assigns it to the Users field. +func (o *DeviceFactsRequest) SetUsers(v []DeviceUserRequest) { + o.Users = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceFactsRequest) GetGroups() []DeviceGroupRequest { + if o == nil { + var ret []DeviceGroupRequest + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceFactsRequest) GetGroupsOk() ([]DeviceGroupRequest, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []DeviceGroupRequest and assigns it to the Groups field. +func (o *DeviceFactsRequest) SetGroups(v []DeviceGroupRequest) { + o.Groups = v +} + +// GetVendor returns the Vendor field value if set, zero value otherwise. +func (o *DeviceFactsRequest) GetVendor() map[string]interface{} { + if o == nil || IsNil(o.Vendor) { + var ret map[string]interface{} + return ret + } + return o.Vendor +} + +// GetVendorOk returns a tuple with the Vendor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceFactsRequest) GetVendorOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Vendor) { + return map[string]interface{}{}, false + } + return o.Vendor, true +} + +// HasVendor returns a boolean if a field has been set. +func (o *DeviceFactsRequest) HasVendor() bool { + if o != nil && !IsNil(o.Vendor) { + return true + } + + return false +} + +// SetVendor gets a reference to the given map[string]interface{} and assigns it to the Vendor field. +func (o *DeviceFactsRequest) SetVendor(v map[string]interface{}) { + o.Vendor = v +} + +func (o DeviceFactsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceFactsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Os.IsSet() { + toSerialize["os"] = o.Os.Get() + } + if o.Disks != nil { + toSerialize["disks"] = o.Disks + } + if o.Network.IsSet() { + toSerialize["network"] = o.Network.Get() + } + if o.Hardware.IsSet() { + toSerialize["hardware"] = o.Hardware.Get() + } + if o.Software != nil { + toSerialize["software"] = o.Software + } + if o.Processes != nil { + toSerialize["processes"] = o.Processes + } + if o.Users != nil { + toSerialize["users"] = o.Users + } + if o.Groups != nil { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Vendor) { + toSerialize["vendor"] = o.Vendor + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceFactsRequest) UnmarshalJSON(data []byte) (err error) { + varDeviceFactsRequest := _DeviceFactsRequest{} + + err = json.Unmarshal(data, &varDeviceFactsRequest) + + if err != nil { + return err + } + + *o = DeviceFactsRequest(varDeviceFactsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "os") + delete(additionalProperties, "disks") + delete(additionalProperties, "network") + delete(additionalProperties, "hardware") + delete(additionalProperties, "software") + delete(additionalProperties, "processes") + delete(additionalProperties, "users") + delete(additionalProperties, "groups") + delete(additionalProperties, "vendor") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceFactsRequest struct { + value *DeviceFactsRequest + isSet bool +} + +func (v NullableDeviceFactsRequest) Get() *DeviceFactsRequest { + return v.value +} + +func (v *NullableDeviceFactsRequest) Set(val *DeviceFactsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceFactsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceFactsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceFactsRequest(val *DeviceFactsRequest) *NullableDeviceFactsRequest { + return &NullableDeviceFactsRequest{value: val, isSet: true} +} + +func (v NullableDeviceFactsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceFactsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_group.go b/packages/client-go/model_device_group.go new file mode 100644 index 0000000000..aa464553b2 --- /dev/null +++ b/packages/client-go/model_device_group.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceGroup{} + +// DeviceGroup struct for DeviceGroup +type DeviceGroup struct { + Id string `json:"id"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceGroup DeviceGroup + +// NewDeviceGroup instantiates a new DeviceGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceGroup(id string) *DeviceGroup { + this := DeviceGroup{} + this.Id = id + return &this +} + +// NewDeviceGroupWithDefaults instantiates a new DeviceGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceGroupWithDefaults() *DeviceGroup { + this := DeviceGroup{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceGroup) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceGroup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceGroup) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceGroup) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceGroup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceGroup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceGroup) SetName(v string) { + o.Name = &v +} + +func (o DeviceGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceGroup := _DeviceGroup{} + + err = json.Unmarshal(data, &varDeviceGroup) + + if err != nil { + return err + } + + *o = DeviceGroup(varDeviceGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceGroup struct { + value *DeviceGroup + isSet bool +} + +func (v NullableDeviceGroup) Get() *DeviceGroup { + return v.value +} + +func (v *NullableDeviceGroup) Set(val *DeviceGroup) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceGroup(val *DeviceGroup) *NullableDeviceGroup { + return &NullableDeviceGroup{value: val, isSet: true} +} + +func (v NullableDeviceGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_group_request.go b/packages/client-go/model_device_group_request.go new file mode 100644 index 0000000000..d1e189e078 --- /dev/null +++ b/packages/client-go/model_device_group_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceGroupRequest{} + +// DeviceGroupRequest struct for DeviceGroupRequest +type DeviceGroupRequest struct { + Id string `json:"id"` + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceGroupRequest DeviceGroupRequest + +// NewDeviceGroupRequest instantiates a new DeviceGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceGroupRequest(id string) *DeviceGroupRequest { + this := DeviceGroupRequest{} + this.Id = id + return &this +} + +// NewDeviceGroupRequestWithDefaults instantiates a new DeviceGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceGroupRequestWithDefaults() *DeviceGroupRequest { + this := DeviceGroupRequest{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceGroupRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceGroupRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceGroupRequest) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceGroupRequest) SetName(v string) { + o.Name = &v +} + +func (o DeviceGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceGroupRequest := _DeviceGroupRequest{} + + err = json.Unmarshal(data, &varDeviceGroupRequest) + + if err != nil { + return err + } + + *o = DeviceGroupRequest(varDeviceGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceGroupRequest struct { + value *DeviceGroupRequest + isSet bool +} + +func (v NullableDeviceGroupRequest) Get() *DeviceGroupRequest { + return v.value +} + +func (v *NullableDeviceGroupRequest) Set(val *DeviceGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceGroupRequest(val *DeviceGroupRequest) *NullableDeviceGroupRequest { + return &NullableDeviceGroupRequest{value: val, isSet: true} +} + +func (v NullableDeviceGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_summary.go b/packages/client-go/model_device_summary.go new file mode 100644 index 0000000000..bc4ae9e096 --- /dev/null +++ b/packages/client-go/model_device_summary.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceSummary type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceSummary{} + +// DeviceSummary Summary of registered devices +type DeviceSummary struct { + TotalCount int32 `json:"total_count"` + UnreachableCount int32 `json:"unreachable_count"` + OutdatedAgentCount int32 `json:"outdated_agent_count"` + AdditionalProperties map[string]interface{} +} + +type _DeviceSummary DeviceSummary + +// NewDeviceSummary instantiates a new DeviceSummary object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceSummary(totalCount int32, unreachableCount int32, outdatedAgentCount int32) *DeviceSummary { + this := DeviceSummary{} + this.TotalCount = totalCount + this.UnreachableCount = unreachableCount + this.OutdatedAgentCount = outdatedAgentCount + return &this +} + +// NewDeviceSummaryWithDefaults instantiates a new DeviceSummary object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceSummaryWithDefaults() *DeviceSummary { + this := DeviceSummary{} + return &this +} + +// GetTotalCount returns the TotalCount field value +func (o *DeviceSummary) GetTotalCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.TotalCount +} + +// GetTotalCountOk returns a tuple with the TotalCount field value +// and a boolean to check if the value has been set. +func (o *DeviceSummary) GetTotalCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.TotalCount, true +} + +// SetTotalCount sets field value +func (o *DeviceSummary) SetTotalCount(v int32) { + o.TotalCount = v +} + +// GetUnreachableCount returns the UnreachableCount field value +func (o *DeviceSummary) GetUnreachableCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.UnreachableCount +} + +// GetUnreachableCountOk returns a tuple with the UnreachableCount field value +// and a boolean to check if the value has been set. +func (o *DeviceSummary) GetUnreachableCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.UnreachableCount, true +} + +// SetUnreachableCount sets field value +func (o *DeviceSummary) SetUnreachableCount(v int32) { + o.UnreachableCount = v +} + +// GetOutdatedAgentCount returns the OutdatedAgentCount field value +func (o *DeviceSummary) GetOutdatedAgentCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.OutdatedAgentCount +} + +// GetOutdatedAgentCountOk returns a tuple with the OutdatedAgentCount field value +// and a boolean to check if the value has been set. +func (o *DeviceSummary) GetOutdatedAgentCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.OutdatedAgentCount, true +} + +// SetOutdatedAgentCount sets field value +func (o *DeviceSummary) SetOutdatedAgentCount(v int32) { + o.OutdatedAgentCount = v +} + +func (o DeviceSummary) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceSummary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["total_count"] = o.TotalCount + toSerialize["unreachable_count"] = o.UnreachableCount + toSerialize["outdated_agent_count"] = o.OutdatedAgentCount + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceSummary) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "total_count", + "unreachable_count", + "outdated_agent_count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceSummary := _DeviceSummary{} + + err = json.Unmarshal(data, &varDeviceSummary) + + if err != nil { + return err + } + + *o = DeviceSummary(varDeviceSummary) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "total_count") + delete(additionalProperties, "unreachable_count") + delete(additionalProperties, "outdated_agent_count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceSummary struct { + value *DeviceSummary + isSet bool +} + +func (v NullableDeviceSummary) Get() *DeviceSummary { + return v.value +} + +func (v *NullableDeviceSummary) Set(val *DeviceSummary) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceSummary(val *DeviceSummary) *NullableDeviceSummary { + return &NullableDeviceSummary{value: val, isSet: true} +} + +func (v NullableDeviceSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_user.go b/packages/client-go/model_device_user.go new file mode 100644 index 0000000000..6034fa0d67 --- /dev/null +++ b/packages/client-go/model_device_user.go @@ -0,0 +1,278 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUser{} + +// DeviceUser struct for DeviceUser +type DeviceUser struct { + Id string `json:"id"` + Username *string `json:"username,omitempty"` + Name *string `json:"name,omitempty"` + Home *string `json:"home,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUser DeviceUser + +// NewDeviceUser instantiates a new DeviceUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUser(id string) *DeviceUser { + this := DeviceUser{} + this.Id = id + return &this +} + +// NewDeviceUserWithDefaults instantiates a new DeviceUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUserWithDefaults() *DeviceUser { + this := DeviceUser{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceUser) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceUser) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceUser) SetId(v string) { + o.Id = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *DeviceUser) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUser) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *DeviceUser) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *DeviceUser) SetUsername(v string) { + o.Username = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceUser) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUser) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceUser) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceUser) SetName(v string) { + o.Name = &v +} + +// GetHome returns the Home field value if set, zero value otherwise. +func (o *DeviceUser) GetHome() string { + if o == nil || IsNil(o.Home) { + var ret string + return ret + } + return *o.Home +} + +// GetHomeOk returns a tuple with the Home field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUser) GetHomeOk() (*string, bool) { + if o == nil || IsNil(o.Home) { + return nil, false + } + return o.Home, true +} + +// HasHome returns a boolean if a field has been set. +func (o *DeviceUser) HasHome() bool { + if o != nil && !IsNil(o.Home) { + return true + } + + return false +} + +// SetHome gets a reference to the given string and assigns it to the Home field. +func (o *DeviceUser) SetHome(v string) { + o.Home = &v +} + +func (o DeviceUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Home) { + toSerialize["home"] = o.Home + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceUser := _DeviceUser{} + + err = json.Unmarshal(data, &varDeviceUser) + + if err != nil { + return err + } + + *o = DeviceUser(varDeviceUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "home") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUser struct { + value *DeviceUser + isSet bool +} + +func (v NullableDeviceUser) Get() *DeviceUser { + return v.value +} + +func (v *NullableDeviceUser) Set(val *DeviceUser) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUser) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUser(val *DeviceUser) *NullableDeviceUser { + return &NullableDeviceUser{value: val, isSet: true} +} + +func (v NullableDeviceUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_user_binding.go b/packages/client-go/model_device_user_binding.go new file mode 100644 index 0000000000..eb6c0395da --- /dev/null +++ b/packages/client-go/model_device_user_binding.go @@ -0,0 +1,704 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceUserBinding type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUserBinding{} + +// DeviceUserBinding PolicyBinding Serializer +type DeviceUserBinding struct { + Pk string `json:"pk"` + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + PolicyObj Policy `json:"policy_obj"` + GroupObj PartialGroup `json:"group_obj"` + UserObj PartialUser `json:"user_obj"` + Target string `json:"target"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order int32 `json:"order"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + IsPrimary *bool `json:"is_primary,omitempty"` + Connector NullableString `json:"connector"` + ConnectorObj Connector `json:"connector_obj"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUserBinding DeviceUserBinding + +// NewDeviceUserBinding instantiates a new DeviceUserBinding object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUserBinding(pk string, policyObj Policy, groupObj PartialGroup, userObj PartialUser, target string, order int32, connector NullableString, connectorObj Connector) *DeviceUserBinding { + this := DeviceUserBinding{} + this.Pk = pk + this.PolicyObj = policyObj + this.GroupObj = groupObj + this.UserObj = userObj + this.Target = target + this.Order = order + this.Connector = connector + this.ConnectorObj = connectorObj + return &this +} + +// NewDeviceUserBindingWithDefaults instantiates a new DeviceUserBinding object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUserBindingWithDefaults() *DeviceUserBinding { + this := DeviceUserBinding{} + return &this +} + +// GetPk returns the Pk field value +func (o *DeviceUserBinding) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DeviceUserBinding) SetPk(v string) { + o.Pk = v +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBinding) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBinding) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *DeviceUserBinding) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *DeviceUserBinding) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *DeviceUserBinding) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBinding) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBinding) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *DeviceUserBinding) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *DeviceUserBinding) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *DeviceUserBinding) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBinding) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBinding) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *DeviceUserBinding) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *DeviceUserBinding) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *DeviceUserBinding) UnsetUser() { + o.User.Unset() +} + +// GetPolicyObj returns the PolicyObj field value +func (o *DeviceUserBinding) GetPolicyObj() Policy { + if o == nil { + var ret Policy + return ret + } + + return o.PolicyObj +} + +// GetPolicyObjOk returns a tuple with the PolicyObj field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetPolicyObjOk() (*Policy, bool) { + if o == nil { + return nil, false + } + return &o.PolicyObj, true +} + +// SetPolicyObj sets field value +func (o *DeviceUserBinding) SetPolicyObj(v Policy) { + o.PolicyObj = v +} + +// GetGroupObj returns the GroupObj field value +func (o *DeviceUserBinding) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *DeviceUserBinding) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetUserObj returns the UserObj field value +func (o *DeviceUserBinding) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *DeviceUserBinding) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetTarget returns the Target field value +func (o *DeviceUserBinding) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *DeviceUserBinding) SetTarget(v string) { + o.Target = v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *DeviceUserBinding) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *DeviceUserBinding) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *DeviceUserBinding) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *DeviceUserBinding) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value +func (o *DeviceUserBinding) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *DeviceUserBinding) SetOrder(v int32) { + o.Order = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *DeviceUserBinding) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *DeviceUserBinding) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *DeviceUserBinding) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *DeviceUserBinding) SetFailureResult(v bool) { + o.FailureResult = &v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *DeviceUserBinding) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *DeviceUserBinding) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *DeviceUserBinding) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +// GetConnector returns the Connector field value +// If the value is explicit nil, the zero value for string will be returned +func (o *DeviceUserBinding) GetConnector() string { + if o == nil || o.Connector.Get() == nil { + var ret string + return ret + } + + return *o.Connector.Get() +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBinding) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Connector.Get(), o.Connector.IsSet() +} + +// SetConnector sets field value +func (o *DeviceUserBinding) SetConnector(v string) { + o.Connector.Set(&v) +} + +// GetConnectorObj returns the ConnectorObj field value +func (o *DeviceUserBinding) GetConnectorObj() Connector { + if o == nil { + var ret Connector + return ret + } + + return o.ConnectorObj +} + +// GetConnectorObjOk returns a tuple with the ConnectorObj field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBinding) GetConnectorObjOk() (*Connector, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorObj, true +} + +// SetConnectorObj sets field value +func (o *DeviceUserBinding) SetConnectorObj(v Connector) { + o.ConnectorObj = v +} + +func (o DeviceUserBinding) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUserBinding) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + toSerialize["policy_obj"] = o.PolicyObj + toSerialize["group_obj"] = o.GroupObj + toSerialize["user_obj"] = o.UserObj + toSerialize["target"] = o.Target + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["order"] = o.Order + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + toSerialize["connector"] = o.Connector.Get() + toSerialize["connector_obj"] = o.ConnectorObj + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUserBinding) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "policy_obj", + "group_obj", + "user_obj", + "target", + "order", + "connector", + "connector_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceUserBinding := _DeviceUserBinding{} + + err = json.Unmarshal(data, &varDeviceUserBinding) + + if err != nil { + return err + } + + *o = DeviceUserBinding(varDeviceUserBinding) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "policy_obj") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + delete(additionalProperties, "is_primary") + delete(additionalProperties, "connector") + delete(additionalProperties, "connector_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUserBinding struct { + value *DeviceUserBinding + isSet bool +} + +func (v NullableDeviceUserBinding) Get() *DeviceUserBinding { + return v.value +} + +func (v *NullableDeviceUserBinding) Set(val *DeviceUserBinding) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUserBinding) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUserBinding) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUserBinding(val *DeviceUserBinding) *NullableDeviceUserBinding { + return &NullableDeviceUserBinding{value: val, isSet: true} +} + +func (v NullableDeviceUserBinding) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUserBinding) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_user_binding_request.go b/packages/client-go/model_device_user_binding_request.go new file mode 100644 index 0000000000..0ca4e6e86c --- /dev/null +++ b/packages/client-go/model_device_user_binding_request.go @@ -0,0 +1,528 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceUserBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUserBindingRequest{} + +// DeviceUserBindingRequest PolicyBinding Serializer +type DeviceUserBindingRequest struct { + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Target string `json:"target"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order int32 `json:"order"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + IsPrimary *bool `json:"is_primary,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUserBindingRequest DeviceUserBindingRequest + +// NewDeviceUserBindingRequest instantiates a new DeviceUserBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUserBindingRequest(target string, order int32) *DeviceUserBindingRequest { + this := DeviceUserBindingRequest{} + this.Target = target + this.Order = order + return &this +} + +// NewDeviceUserBindingRequestWithDefaults instantiates a new DeviceUserBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUserBindingRequestWithDefaults() *DeviceUserBindingRequest { + this := DeviceUserBindingRequest{} + return &this +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBindingRequest) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBindingRequest) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *DeviceUserBindingRequest) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *DeviceUserBindingRequest) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *DeviceUserBindingRequest) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBindingRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBindingRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *DeviceUserBindingRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *DeviceUserBindingRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *DeviceUserBindingRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DeviceUserBindingRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DeviceUserBindingRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *DeviceUserBindingRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *DeviceUserBindingRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *DeviceUserBindingRequest) UnsetUser() { + o.User.Unset() +} + +// GetTarget returns the Target field value +func (o *DeviceUserBindingRequest) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *DeviceUserBindingRequest) SetTarget(v string) { + o.Target = v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *DeviceUserBindingRequest) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *DeviceUserBindingRequest) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *DeviceUserBindingRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *DeviceUserBindingRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value +func (o *DeviceUserBindingRequest) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *DeviceUserBindingRequest) SetOrder(v int32) { + o.Order = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *DeviceUserBindingRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *DeviceUserBindingRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *DeviceUserBindingRequest) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *DeviceUserBindingRequest) SetFailureResult(v bool) { + o.FailureResult = &v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *DeviceUserBindingRequest) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserBindingRequest) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *DeviceUserBindingRequest) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *DeviceUserBindingRequest) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +func (o DeviceUserBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUserBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + toSerialize["target"] = o.Target + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["order"] = o.Order + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUserBindingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "target", + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceUserBindingRequest := _DeviceUserBindingRequest{} + + err = json.Unmarshal(data, &varDeviceUserBindingRequest) + + if err != nil { + return err + } + + *o = DeviceUserBindingRequest(varDeviceUserBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + delete(additionalProperties, "is_primary") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUserBindingRequest struct { + value *DeviceUserBindingRequest + isSet bool +} + +func (v NullableDeviceUserBindingRequest) Get() *DeviceUserBindingRequest { + return v.value +} + +func (v *NullableDeviceUserBindingRequest) Set(val *DeviceUserBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUserBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUserBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUserBindingRequest(val *DeviceUserBindingRequest) *NullableDeviceUserBindingRequest { + return &NullableDeviceUserBindingRequest{value: val, isSet: true} +} + +func (v NullableDeviceUserBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUserBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_device_user_request.go b/packages/client-go/model_device_user_request.go new file mode 100644 index 0000000000..6f7a118406 --- /dev/null +++ b/packages/client-go/model_device_user_request.go @@ -0,0 +1,278 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DeviceUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DeviceUserRequest{} + +// DeviceUserRequest struct for DeviceUserRequest +type DeviceUserRequest struct { + Id string `json:"id"` + Username *string `json:"username,omitempty"` + Name *string `json:"name,omitempty"` + Home *string `json:"home,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DeviceUserRequest DeviceUserRequest + +// NewDeviceUserRequest instantiates a new DeviceUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDeviceUserRequest(id string) *DeviceUserRequest { + this := DeviceUserRequest{} + this.Id = id + return &this +} + +// NewDeviceUserRequestWithDefaults instantiates a new DeviceUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDeviceUserRequestWithDefaults() *DeviceUserRequest { + this := DeviceUserRequest{} + return &this +} + +// GetId returns the Id field value +func (o *DeviceUserRequest) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *DeviceUserRequest) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *DeviceUserRequest) SetId(v string) { + o.Id = v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *DeviceUserRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *DeviceUserRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *DeviceUserRequest) SetUsername(v string) { + o.Username = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DeviceUserRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DeviceUserRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DeviceUserRequest) SetName(v string) { + o.Name = &v +} + +// GetHome returns the Home field value if set, zero value otherwise. +func (o *DeviceUserRequest) GetHome() string { + if o == nil || IsNil(o.Home) { + var ret string + return ret + } + return *o.Home +} + +// GetHomeOk returns a tuple with the Home field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DeviceUserRequest) GetHomeOk() (*string, bool) { + if o == nil || IsNil(o.Home) { + return nil, false + } + return o.Home, true +} + +// HasHome returns a boolean if a field has been set. +func (o *DeviceUserRequest) HasHome() bool { + if o != nil && !IsNil(o.Home) { + return true + } + + return false +} + +// SetHome gets a reference to the given string and assigns it to the Home field. +func (o *DeviceUserRequest) SetHome(v string) { + o.Home = &v +} + +func (o DeviceUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DeviceUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Home) { + toSerialize["home"] = o.Home + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DeviceUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDeviceUserRequest := _DeviceUserRequest{} + + err = json.Unmarshal(data, &varDeviceUserRequest) + + if err != nil { + return err + } + + *o = DeviceUserRequest(varDeviceUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "home") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDeviceUserRequest struct { + value *DeviceUserRequest + isSet bool +} + +func (v NullableDeviceUserRequest) Get() *DeviceUserRequest { + return v.value +} + +func (v *NullableDeviceUserRequest) Set(val *DeviceUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDeviceUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDeviceUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDeviceUserRequest(val *DeviceUserRequest) *NullableDeviceUserRequest { + return &NullableDeviceUserRequest{value: val, isSet: true} +} + +func (v NullableDeviceUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDeviceUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_digest_algorithm_enum.go b/packages/client-go/model_digest_algorithm_enum.go new file mode 100644 index 0000000000..804ec00807 --- /dev/null +++ b/packages/client-go/model_digest_algorithm_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DigestAlgorithmEnum the model 'DigestAlgorithmEnum' +type DigestAlgorithmEnum string + +// List of DigestAlgorithmEnum +const ( + DIGESTALGORITHMENUM_HTTP___WWW_W3_ORG_2000_09_XMLDSIGSHA1 DigestAlgorithmEnum = "http://www.w3.org/2000/09/xmldsig#sha1" + DIGESTALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLENCSHA256 DigestAlgorithmEnum = "http://www.w3.org/2001/04/xmlenc#sha256" + DIGESTALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MORESHA384 DigestAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#sha384" + DIGESTALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLENCSHA512 DigestAlgorithmEnum = "http://www.w3.org/2001/04/xmlenc#sha512" +) + +// All allowed values of DigestAlgorithmEnum enum +var AllowedDigestAlgorithmEnumEnumValues = []DigestAlgorithmEnum{ + "http://www.w3.org/2000/09/xmldsig#sha1", + "http://www.w3.org/2001/04/xmlenc#sha256", + "http://www.w3.org/2001/04/xmldsig-more#sha384", + "http://www.w3.org/2001/04/xmlenc#sha512", +} + +func (v *DigestAlgorithmEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DigestAlgorithmEnum(value) + for _, existing := range AllowedDigestAlgorithmEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DigestAlgorithmEnum", value) +} + +// NewDigestAlgorithmEnumFromValue returns a pointer to a valid DigestAlgorithmEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDigestAlgorithmEnumFromValue(v string) (*DigestAlgorithmEnum, error) { + ev := DigestAlgorithmEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DigestAlgorithmEnum: valid values are %v", v, AllowedDigestAlgorithmEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DigestAlgorithmEnum) IsValid() bool { + for _, existing := range AllowedDigestAlgorithmEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DigestAlgorithmEnum value +func (v DigestAlgorithmEnum) Ptr() *DigestAlgorithmEnum { + return &v +} + +type NullableDigestAlgorithmEnum struct { + value *DigestAlgorithmEnum + isSet bool +} + +func (v NullableDigestAlgorithmEnum) Get() *DigestAlgorithmEnum { + return v.value +} + +func (v *NullableDigestAlgorithmEnum) Set(val *DigestAlgorithmEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDigestAlgorithmEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDigestAlgorithmEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDigestAlgorithmEnum(val *DigestAlgorithmEnum) *NullableDigestAlgorithmEnum { + return &NullableDigestAlgorithmEnum{value: val, isSet: true} +} + +func (v NullableDigestAlgorithmEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDigestAlgorithmEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_digits_enum.go b/packages/client-go/model_digits_enum.go new file mode 100644 index 0000000000..0fe505cbbf --- /dev/null +++ b/packages/client-go/model_digits_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DigitsEnum the model 'DigitsEnum' +type DigitsEnum string + +// List of DigitsEnum +const ( + DIGITSENUM__6 DigitsEnum = "6" + DIGITSENUM__8 DigitsEnum = "8" +) + +// All allowed values of DigitsEnum enum +var AllowedDigitsEnumEnumValues = []DigitsEnum{ + "6", + "8", +} + +func (v *DigitsEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DigitsEnum(value) + for _, existing := range AllowedDigitsEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DigitsEnum", value) +} + +// NewDigitsEnumFromValue returns a pointer to a valid DigitsEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDigitsEnumFromValue(v string) (*DigitsEnum, error) { + ev := DigitsEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DigitsEnum: valid values are %v", v, AllowedDigitsEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DigitsEnum) IsValid() bool { + for _, existing := range AllowedDigitsEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DigitsEnum value +func (v DigitsEnum) Ptr() *DigitsEnum { + return &v +} + +type NullableDigitsEnum struct { + value *DigitsEnum + isSet bool +} + +func (v NullableDigitsEnum) Get() *DigitsEnum { + return v.value +} + +func (v *NullableDigitsEnum) Set(val *DigitsEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDigitsEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDigitsEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDigitsEnum(val *DigitsEnum) *NullableDigitsEnum { + return &NullableDigitsEnum{value: val, isSet: true} +} + +func (v NullableDigitsEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDigitsEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_disk.go b/packages/client-go/model_disk.go new file mode 100644 index 0000000000..941746bafe --- /dev/null +++ b/packages/client-go/model_disk.go @@ -0,0 +1,348 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Disk type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Disk{} + +// Disk struct for Disk +type Disk struct { + Name string `json:"name"` + Mountpoint string `json:"mountpoint"` + Label *string `json:"label,omitempty"` + CapacityTotalBytes *int64 `json:"capacity_total_bytes,omitempty"` + CapacityUsedBytes *int64 `json:"capacity_used_bytes,omitempty"` + EncryptionEnabled *bool `json:"encryption_enabled,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Disk Disk + +// NewDisk instantiates a new Disk object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDisk(name string, mountpoint string) *Disk { + this := Disk{} + this.Name = name + this.Mountpoint = mountpoint + var encryptionEnabled bool = false + this.EncryptionEnabled = &encryptionEnabled + return &this +} + +// NewDiskWithDefaults instantiates a new Disk object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiskWithDefaults() *Disk { + this := Disk{} + var encryptionEnabled bool = false + this.EncryptionEnabled = &encryptionEnabled + return &this +} + +// GetName returns the Name field value +func (o *Disk) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Disk) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Disk) SetName(v string) { + o.Name = v +} + +// GetMountpoint returns the Mountpoint field value +func (o *Disk) GetMountpoint() string { + if o == nil { + var ret string + return ret + } + + return o.Mountpoint +} + +// GetMountpointOk returns a tuple with the Mountpoint field value +// and a boolean to check if the value has been set. +func (o *Disk) GetMountpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mountpoint, true +} + +// SetMountpoint sets field value +func (o *Disk) SetMountpoint(v string) { + o.Mountpoint = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *Disk) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *Disk) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *Disk) SetLabel(v string) { + o.Label = &v +} + +// GetCapacityTotalBytes returns the CapacityTotalBytes field value if set, zero value otherwise. +func (o *Disk) GetCapacityTotalBytes() int64 { + if o == nil || IsNil(o.CapacityTotalBytes) { + var ret int64 + return ret + } + return *o.CapacityTotalBytes +} + +// GetCapacityTotalBytesOk returns a tuple with the CapacityTotalBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetCapacityTotalBytesOk() (*int64, bool) { + if o == nil || IsNil(o.CapacityTotalBytes) { + return nil, false + } + return o.CapacityTotalBytes, true +} + +// HasCapacityTotalBytes returns a boolean if a field has been set. +func (o *Disk) HasCapacityTotalBytes() bool { + if o != nil && !IsNil(o.CapacityTotalBytes) { + return true + } + + return false +} + +// SetCapacityTotalBytes gets a reference to the given int64 and assigns it to the CapacityTotalBytes field. +func (o *Disk) SetCapacityTotalBytes(v int64) { + o.CapacityTotalBytes = &v +} + +// GetCapacityUsedBytes returns the CapacityUsedBytes field value if set, zero value otherwise. +func (o *Disk) GetCapacityUsedBytes() int64 { + if o == nil || IsNil(o.CapacityUsedBytes) { + var ret int64 + return ret + } + return *o.CapacityUsedBytes +} + +// GetCapacityUsedBytesOk returns a tuple with the CapacityUsedBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetCapacityUsedBytesOk() (*int64, bool) { + if o == nil || IsNil(o.CapacityUsedBytes) { + return nil, false + } + return o.CapacityUsedBytes, true +} + +// HasCapacityUsedBytes returns a boolean if a field has been set. +func (o *Disk) HasCapacityUsedBytes() bool { + if o != nil && !IsNil(o.CapacityUsedBytes) { + return true + } + + return false +} + +// SetCapacityUsedBytes gets a reference to the given int64 and assigns it to the CapacityUsedBytes field. +func (o *Disk) SetCapacityUsedBytes(v int64) { + o.CapacityUsedBytes = &v +} + +// GetEncryptionEnabled returns the EncryptionEnabled field value if set, zero value otherwise. +func (o *Disk) GetEncryptionEnabled() bool { + if o == nil || IsNil(o.EncryptionEnabled) { + var ret bool + return ret + } + return *o.EncryptionEnabled +} + +// GetEncryptionEnabledOk returns a tuple with the EncryptionEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Disk) GetEncryptionEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.EncryptionEnabled) { + return nil, false + } + return o.EncryptionEnabled, true +} + +// HasEncryptionEnabled returns a boolean if a field has been set. +func (o *Disk) HasEncryptionEnabled() bool { + if o != nil && !IsNil(o.EncryptionEnabled) { + return true + } + + return false +} + +// SetEncryptionEnabled gets a reference to the given bool and assigns it to the EncryptionEnabled field. +func (o *Disk) SetEncryptionEnabled(v bool) { + o.EncryptionEnabled = &v +} + +func (o Disk) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Disk) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["mountpoint"] = o.Mountpoint + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.CapacityTotalBytes) { + toSerialize["capacity_total_bytes"] = o.CapacityTotalBytes + } + if !IsNil(o.CapacityUsedBytes) { + toSerialize["capacity_used_bytes"] = o.CapacityUsedBytes + } + if !IsNil(o.EncryptionEnabled) { + toSerialize["encryption_enabled"] = o.EncryptionEnabled + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Disk) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mountpoint", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDisk := _Disk{} + + err = json.Unmarshal(data, &varDisk) + + if err != nil { + return err + } + + *o = Disk(varDisk) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mountpoint") + delete(additionalProperties, "label") + delete(additionalProperties, "capacity_total_bytes") + delete(additionalProperties, "capacity_used_bytes") + delete(additionalProperties, "encryption_enabled") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDisk struct { + value *Disk + isSet bool +} + +func (v NullableDisk) Get() *Disk { + return v.value +} + +func (v *NullableDisk) Set(val *Disk) { + v.value = val + v.isSet = true +} + +func (v NullableDisk) IsSet() bool { + return v.isSet +} + +func (v *NullableDisk) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDisk(val *Disk) *NullableDisk { + return &NullableDisk{value: val, isSet: true} +} + +func (v NullableDisk) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDisk) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_disk_request.go b/packages/client-go/model_disk_request.go new file mode 100644 index 0000000000..d5c02d4511 --- /dev/null +++ b/packages/client-go/model_disk_request.go @@ -0,0 +1,348 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DiskRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DiskRequest{} + +// DiskRequest struct for DiskRequest +type DiskRequest struct { + Name string `json:"name"` + Mountpoint string `json:"mountpoint"` + Label *string `json:"label,omitempty"` + CapacityTotalBytes *int64 `json:"capacity_total_bytes,omitempty"` + CapacityUsedBytes *int64 `json:"capacity_used_bytes,omitempty"` + EncryptionEnabled *bool `json:"encryption_enabled,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DiskRequest DiskRequest + +// NewDiskRequest instantiates a new DiskRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDiskRequest(name string, mountpoint string) *DiskRequest { + this := DiskRequest{} + this.Name = name + this.Mountpoint = mountpoint + var encryptionEnabled bool = false + this.EncryptionEnabled = &encryptionEnabled + return &this +} + +// NewDiskRequestWithDefaults instantiates a new DiskRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDiskRequestWithDefaults() *DiskRequest { + this := DiskRequest{} + var encryptionEnabled bool = false + this.EncryptionEnabled = &encryptionEnabled + return &this +} + +// GetName returns the Name field value +func (o *DiskRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DiskRequest) SetName(v string) { + o.Name = v +} + +// GetMountpoint returns the Mountpoint field value +func (o *DiskRequest) GetMountpoint() string { + if o == nil { + var ret string + return ret + } + + return o.Mountpoint +} + +// GetMountpointOk returns a tuple with the Mountpoint field value +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetMountpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mountpoint, true +} + +// SetMountpoint sets field value +func (o *DiskRequest) SetMountpoint(v string) { + o.Mountpoint = v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *DiskRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *DiskRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *DiskRequest) SetLabel(v string) { + o.Label = &v +} + +// GetCapacityTotalBytes returns the CapacityTotalBytes field value if set, zero value otherwise. +func (o *DiskRequest) GetCapacityTotalBytes() int64 { + if o == nil || IsNil(o.CapacityTotalBytes) { + var ret int64 + return ret + } + return *o.CapacityTotalBytes +} + +// GetCapacityTotalBytesOk returns a tuple with the CapacityTotalBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetCapacityTotalBytesOk() (*int64, bool) { + if o == nil || IsNil(o.CapacityTotalBytes) { + return nil, false + } + return o.CapacityTotalBytes, true +} + +// HasCapacityTotalBytes returns a boolean if a field has been set. +func (o *DiskRequest) HasCapacityTotalBytes() bool { + if o != nil && !IsNil(o.CapacityTotalBytes) { + return true + } + + return false +} + +// SetCapacityTotalBytes gets a reference to the given int64 and assigns it to the CapacityTotalBytes field. +func (o *DiskRequest) SetCapacityTotalBytes(v int64) { + o.CapacityTotalBytes = &v +} + +// GetCapacityUsedBytes returns the CapacityUsedBytes field value if set, zero value otherwise. +func (o *DiskRequest) GetCapacityUsedBytes() int64 { + if o == nil || IsNil(o.CapacityUsedBytes) { + var ret int64 + return ret + } + return *o.CapacityUsedBytes +} + +// GetCapacityUsedBytesOk returns a tuple with the CapacityUsedBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetCapacityUsedBytesOk() (*int64, bool) { + if o == nil || IsNil(o.CapacityUsedBytes) { + return nil, false + } + return o.CapacityUsedBytes, true +} + +// HasCapacityUsedBytes returns a boolean if a field has been set. +func (o *DiskRequest) HasCapacityUsedBytes() bool { + if o != nil && !IsNil(o.CapacityUsedBytes) { + return true + } + + return false +} + +// SetCapacityUsedBytes gets a reference to the given int64 and assigns it to the CapacityUsedBytes field. +func (o *DiskRequest) SetCapacityUsedBytes(v int64) { + o.CapacityUsedBytes = &v +} + +// GetEncryptionEnabled returns the EncryptionEnabled field value if set, zero value otherwise. +func (o *DiskRequest) GetEncryptionEnabled() bool { + if o == nil || IsNil(o.EncryptionEnabled) { + var ret bool + return ret + } + return *o.EncryptionEnabled +} + +// GetEncryptionEnabledOk returns a tuple with the EncryptionEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DiskRequest) GetEncryptionEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.EncryptionEnabled) { + return nil, false + } + return o.EncryptionEnabled, true +} + +// HasEncryptionEnabled returns a boolean if a field has been set. +func (o *DiskRequest) HasEncryptionEnabled() bool { + if o != nil && !IsNil(o.EncryptionEnabled) { + return true + } + + return false +} + +// SetEncryptionEnabled gets a reference to the given bool and assigns it to the EncryptionEnabled field. +func (o *DiskRequest) SetEncryptionEnabled(v bool) { + o.EncryptionEnabled = &v +} + +func (o DiskRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DiskRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["mountpoint"] = o.Mountpoint + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.CapacityTotalBytes) { + toSerialize["capacity_total_bytes"] = o.CapacityTotalBytes + } + if !IsNil(o.CapacityUsedBytes) { + toSerialize["capacity_used_bytes"] = o.CapacityUsedBytes + } + if !IsNil(o.EncryptionEnabled) { + toSerialize["encryption_enabled"] = o.EncryptionEnabled + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DiskRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mountpoint", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDiskRequest := _DiskRequest{} + + err = json.Unmarshal(data, &varDiskRequest) + + if err != nil { + return err + } + + *o = DiskRequest(varDiskRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mountpoint") + delete(additionalProperties, "label") + delete(additionalProperties, "capacity_total_bytes") + delete(additionalProperties, "capacity_used_bytes") + delete(additionalProperties, "encryption_enabled") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDiskRequest struct { + value *DiskRequest + isSet bool +} + +func (v NullableDiskRequest) Get() *DiskRequest { + return v.value +} + +func (v *NullableDiskRequest) Set(val *DiskRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDiskRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDiskRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDiskRequest(val *DiskRequest) *NullableDiskRequest { + return &NullableDiskRequest{value: val, isSet: true} +} + +func (v NullableDiskRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDiskRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_docker_service_connection.go b/packages/client-go/model_docker_service_connection.go new file mode 100644 index 0000000000..f04c65ef21 --- /dev/null +++ b/packages/client-go/model_docker_service_connection.go @@ -0,0 +1,481 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DockerServiceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DockerServiceConnection{} + +// DockerServiceConnection DockerServiceConnection Serializer +type DockerServiceConnection struct { + Pk string `json:"pk"` + Name string `json:"name"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + Url string `json:"url"` + // CA which the endpoint's Certificate is verified against. Can be left empty for no validation. + TlsVerification NullableString `json:"tls_verification,omitempty"` + // Certificate/Key used for authentication. Can be left empty for no authentication. + TlsAuthentication NullableString `json:"tls_authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DockerServiceConnection DockerServiceConnection + +// NewDockerServiceConnection instantiates a new DockerServiceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDockerServiceConnection(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, url string) *DockerServiceConnection { + this := DockerServiceConnection{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Url = url + return &this +} + +// NewDockerServiceConnectionWithDefaults instantiates a new DockerServiceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDockerServiceConnectionWithDefaults() *DockerServiceConnection { + this := DockerServiceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *DockerServiceConnection) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DockerServiceConnection) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *DockerServiceConnection) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DockerServiceConnection) SetName(v string) { + o.Name = v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *DockerServiceConnection) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *DockerServiceConnection) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *DockerServiceConnection) SetLocal(v bool) { + o.Local = &v +} + +// GetComponent returns the Component field value +func (o *DockerServiceConnection) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *DockerServiceConnection) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *DockerServiceConnection) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *DockerServiceConnection) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *DockerServiceConnection) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *DockerServiceConnection) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *DockerServiceConnection) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *DockerServiceConnection) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetUrl returns the Url field value +func (o *DockerServiceConnection) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnection) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DockerServiceConnection) SetUrl(v string) { + o.Url = v +} + +// GetTlsVerification returns the TlsVerification field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DockerServiceConnection) GetTlsVerification() string { + if o == nil || IsNil(o.TlsVerification.Get()) { + var ret string + return ret + } + return *o.TlsVerification.Get() +} + +// GetTlsVerificationOk returns a tuple with the TlsVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DockerServiceConnection) GetTlsVerificationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsVerification.Get(), o.TlsVerification.IsSet() +} + +// HasTlsVerification returns a boolean if a field has been set. +func (o *DockerServiceConnection) HasTlsVerification() bool { + if o != nil && o.TlsVerification.IsSet() { + return true + } + + return false +} + +// SetTlsVerification gets a reference to the given NullableString and assigns it to the TlsVerification field. +func (o *DockerServiceConnection) SetTlsVerification(v string) { + o.TlsVerification.Set(&v) +} + +// SetTlsVerificationNil sets the value for TlsVerification to be an explicit nil +func (o *DockerServiceConnection) SetTlsVerificationNil() { + o.TlsVerification.Set(nil) +} + +// UnsetTlsVerification ensures that no value is present for TlsVerification, not even an explicit nil +func (o *DockerServiceConnection) UnsetTlsVerification() { + o.TlsVerification.Unset() +} + +// GetTlsAuthentication returns the TlsAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DockerServiceConnection) GetTlsAuthentication() string { + if o == nil || IsNil(o.TlsAuthentication.Get()) { + var ret string + return ret + } + return *o.TlsAuthentication.Get() +} + +// GetTlsAuthenticationOk returns a tuple with the TlsAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DockerServiceConnection) GetTlsAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsAuthentication.Get(), o.TlsAuthentication.IsSet() +} + +// HasTlsAuthentication returns a boolean if a field has been set. +func (o *DockerServiceConnection) HasTlsAuthentication() bool { + if o != nil && o.TlsAuthentication.IsSet() { + return true + } + + return false +} + +// SetTlsAuthentication gets a reference to the given NullableString and assigns it to the TlsAuthentication field. +func (o *DockerServiceConnection) SetTlsAuthentication(v string) { + o.TlsAuthentication.Set(&v) +} + +// SetTlsAuthenticationNil sets the value for TlsAuthentication to be an explicit nil +func (o *DockerServiceConnection) SetTlsAuthenticationNil() { + o.TlsAuthentication.Set(nil) +} + +// UnsetTlsAuthentication ensures that no value is present for TlsAuthentication, not even an explicit nil +func (o *DockerServiceConnection) UnsetTlsAuthentication() { + o.TlsAuthentication.Unset() +} + +func (o DockerServiceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DockerServiceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["url"] = o.Url + if o.TlsVerification.IsSet() { + toSerialize["tls_verification"] = o.TlsVerification.Get() + } + if o.TlsAuthentication.IsSet() { + toSerialize["tls_authentication"] = o.TlsAuthentication.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DockerServiceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDockerServiceConnection := _DockerServiceConnection{} + + err = json.Unmarshal(data, &varDockerServiceConnection) + + if err != nil { + return err + } + + *o = DockerServiceConnection(varDockerServiceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "url") + delete(additionalProperties, "tls_verification") + delete(additionalProperties, "tls_authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDockerServiceConnection struct { + value *DockerServiceConnection + isSet bool +} + +func (v NullableDockerServiceConnection) Get() *DockerServiceConnection { + return v.value +} + +func (v *NullableDockerServiceConnection) Set(val *DockerServiceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableDockerServiceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableDockerServiceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDockerServiceConnection(val *DockerServiceConnection) *NullableDockerServiceConnection { + return &NullableDockerServiceConnection{value: val, isSet: true} +} + +func (v NullableDockerServiceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDockerServiceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_docker_service_connection_request.go b/packages/client-go/model_docker_service_connection_request.go new file mode 100644 index 0000000000..cb6fd33640 --- /dev/null +++ b/packages/client-go/model_docker_service_connection_request.go @@ -0,0 +1,333 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DockerServiceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DockerServiceConnectionRequest{} + +// DockerServiceConnectionRequest DockerServiceConnection Serializer +type DockerServiceConnectionRequest struct { + Name string `json:"name"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + // Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + Url string `json:"url"` + // CA which the endpoint's Certificate is verified against. Can be left empty for no validation. + TlsVerification NullableString `json:"tls_verification,omitempty"` + // Certificate/Key used for authentication. Can be left empty for no authentication. + TlsAuthentication NullableString `json:"tls_authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DockerServiceConnectionRequest DockerServiceConnectionRequest + +// NewDockerServiceConnectionRequest instantiates a new DockerServiceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDockerServiceConnectionRequest(name string, url string) *DockerServiceConnectionRequest { + this := DockerServiceConnectionRequest{} + this.Name = name + this.Url = url + return &this +} + +// NewDockerServiceConnectionRequestWithDefaults instantiates a new DockerServiceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDockerServiceConnectionRequestWithDefaults() *DockerServiceConnectionRequest { + this := DockerServiceConnectionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DockerServiceConnectionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnectionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DockerServiceConnectionRequest) SetName(v string) { + o.Name = v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *DockerServiceConnectionRequest) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DockerServiceConnectionRequest) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *DockerServiceConnectionRequest) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *DockerServiceConnectionRequest) SetLocal(v bool) { + o.Local = &v +} + +// GetUrl returns the Url field value +func (o *DockerServiceConnectionRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *DockerServiceConnectionRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *DockerServiceConnectionRequest) SetUrl(v string) { + o.Url = v +} + +// GetTlsVerification returns the TlsVerification field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DockerServiceConnectionRequest) GetTlsVerification() string { + if o == nil || IsNil(o.TlsVerification.Get()) { + var ret string + return ret + } + return *o.TlsVerification.Get() +} + +// GetTlsVerificationOk returns a tuple with the TlsVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DockerServiceConnectionRequest) GetTlsVerificationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsVerification.Get(), o.TlsVerification.IsSet() +} + +// HasTlsVerification returns a boolean if a field has been set. +func (o *DockerServiceConnectionRequest) HasTlsVerification() bool { + if o != nil && o.TlsVerification.IsSet() { + return true + } + + return false +} + +// SetTlsVerification gets a reference to the given NullableString and assigns it to the TlsVerification field. +func (o *DockerServiceConnectionRequest) SetTlsVerification(v string) { + o.TlsVerification.Set(&v) +} + +// SetTlsVerificationNil sets the value for TlsVerification to be an explicit nil +func (o *DockerServiceConnectionRequest) SetTlsVerificationNil() { + o.TlsVerification.Set(nil) +} + +// UnsetTlsVerification ensures that no value is present for TlsVerification, not even an explicit nil +func (o *DockerServiceConnectionRequest) UnsetTlsVerification() { + o.TlsVerification.Unset() +} + +// GetTlsAuthentication returns the TlsAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *DockerServiceConnectionRequest) GetTlsAuthentication() string { + if o == nil || IsNil(o.TlsAuthentication.Get()) { + var ret string + return ret + } + return *o.TlsAuthentication.Get() +} + +// GetTlsAuthenticationOk returns a tuple with the TlsAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *DockerServiceConnectionRequest) GetTlsAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsAuthentication.Get(), o.TlsAuthentication.IsSet() +} + +// HasTlsAuthentication returns a boolean if a field has been set. +func (o *DockerServiceConnectionRequest) HasTlsAuthentication() bool { + if o != nil && o.TlsAuthentication.IsSet() { + return true + } + + return false +} + +// SetTlsAuthentication gets a reference to the given NullableString and assigns it to the TlsAuthentication field. +func (o *DockerServiceConnectionRequest) SetTlsAuthentication(v string) { + o.TlsAuthentication.Set(&v) +} + +// SetTlsAuthenticationNil sets the value for TlsAuthentication to be an explicit nil +func (o *DockerServiceConnectionRequest) SetTlsAuthenticationNil() { + o.TlsAuthentication.Set(nil) +} + +// UnsetTlsAuthentication ensures that no value is present for TlsAuthentication, not even an explicit nil +func (o *DockerServiceConnectionRequest) UnsetTlsAuthentication() { + o.TlsAuthentication.Unset() +} + +func (o DockerServiceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DockerServiceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + toSerialize["url"] = o.Url + if o.TlsVerification.IsSet() { + toSerialize["tls_verification"] = o.TlsVerification.Get() + } + if o.TlsAuthentication.IsSet() { + toSerialize["tls_authentication"] = o.TlsAuthentication.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DockerServiceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDockerServiceConnectionRequest := _DockerServiceConnectionRequest{} + + err = json.Unmarshal(data, &varDockerServiceConnectionRequest) + + if err != nil { + return err + } + + *o = DockerServiceConnectionRequest(varDockerServiceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "url") + delete(additionalProperties, "tls_verification") + delete(additionalProperties, "tls_authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDockerServiceConnectionRequest struct { + value *DockerServiceConnectionRequest + isSet bool +} + +func (v NullableDockerServiceConnectionRequest) Get() *DockerServiceConnectionRequest { + return v.value +} + +func (v *NullableDockerServiceConnectionRequest) Set(val *DockerServiceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDockerServiceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDockerServiceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDockerServiceConnectionRequest(val *DockerServiceConnectionRequest) *NullableDockerServiceConnectionRequest { + return &NullableDockerServiceConnectionRequest{value: val, isSet: true} +} + +func (v NullableDockerServiceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDockerServiceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_domain.go b/packages/client-go/model_domain.go new file mode 100644 index 0000000000..25f5fc5414 --- /dev/null +++ b/packages/client-go/model_domain.go @@ -0,0 +1,262 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Domain type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Domain{} + +// Domain Domain Serializer +type Domain struct { + Id int32 `json:"id"` + Domain string `json:"domain"` + IsPrimary *bool `json:"is_primary,omitempty"` + Tenant string `json:"tenant"` + AdditionalProperties map[string]interface{} +} + +type _Domain Domain + +// NewDomain instantiates a new Domain object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDomain(id int32, domain string, tenant string) *Domain { + this := Domain{} + this.Id = id + this.Domain = domain + this.Tenant = tenant + return &this +} + +// NewDomainWithDefaults instantiates a new Domain object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDomainWithDefaults() *Domain { + this := Domain{} + return &this +} + +// GetId returns the Id field value +func (o *Domain) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Domain) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Domain) SetId(v int32) { + o.Id = v +} + +// GetDomain returns the Domain field value +func (o *Domain) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *Domain) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +func (o *Domain) SetDomain(v string) { + o.Domain = v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *Domain) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Domain) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *Domain) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *Domain) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +// GetTenant returns the Tenant field value +func (o *Domain) GetTenant() string { + if o == nil { + var ret string + return ret + } + + return o.Tenant +} + +// GetTenantOk returns a tuple with the Tenant field value +// and a boolean to check if the value has been set. +func (o *Domain) GetTenantOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Tenant, true +} + +// SetTenant sets field value +func (o *Domain) SetTenant(v string) { + o.Tenant = v +} + +func (o Domain) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Domain) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["domain"] = o.Domain + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + toSerialize["tenant"] = o.Tenant + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Domain) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "domain", + "tenant", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDomain := _Domain{} + + err = json.Unmarshal(data, &varDomain) + + if err != nil { + return err + } + + *o = Domain(varDomain) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "domain") + delete(additionalProperties, "is_primary") + delete(additionalProperties, "tenant") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDomain struct { + value *Domain + isSet bool +} + +func (v NullableDomain) Get() *Domain { + return v.value +} + +func (v *NullableDomain) Set(val *Domain) { + v.value = val + v.isSet = true +} + +func (v NullableDomain) IsSet() bool { + return v.isSet +} + +func (v *NullableDomain) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomain(val *Domain) *NullableDomain { + return &NullableDomain{value: val, isSet: true} +} + +func (v NullableDomain) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomain) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_domain_request.go b/packages/client-go/model_domain_request.go new file mode 100644 index 0000000000..793f9930d7 --- /dev/null +++ b/packages/client-go/model_domain_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DomainRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DomainRequest{} + +// DomainRequest Domain Serializer +type DomainRequest struct { + Domain string `json:"domain"` + IsPrimary *bool `json:"is_primary,omitempty"` + Tenant string `json:"tenant"` + AdditionalProperties map[string]interface{} +} + +type _DomainRequest DomainRequest + +// NewDomainRequest instantiates a new DomainRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDomainRequest(domain string, tenant string) *DomainRequest { + this := DomainRequest{} + this.Domain = domain + this.Tenant = tenant + return &this +} + +// NewDomainRequestWithDefaults instantiates a new DomainRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDomainRequestWithDefaults() *DomainRequest { + this := DomainRequest{} + return &this +} + +// GetDomain returns the Domain field value +func (o *DomainRequest) GetDomain() string { + if o == nil { + var ret string + return ret + } + + return o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value +// and a boolean to check if the value has been set. +func (o *DomainRequest) GetDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Domain, true +} + +// SetDomain sets field value +func (o *DomainRequest) SetDomain(v string) { + o.Domain = v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *DomainRequest) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DomainRequest) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *DomainRequest) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *DomainRequest) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +// GetTenant returns the Tenant field value +func (o *DomainRequest) GetTenant() string { + if o == nil { + var ret string + return ret + } + + return o.Tenant +} + +// GetTenantOk returns a tuple with the Tenant field value +// and a boolean to check if the value has been set. +func (o *DomainRequest) GetTenantOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Tenant, true +} + +// SetTenant sets field value +func (o *DomainRequest) SetTenant(v string) { + o.Tenant = v +} + +func (o DomainRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DomainRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["domain"] = o.Domain + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + toSerialize["tenant"] = o.Tenant + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DomainRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "domain", + "tenant", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDomainRequest := _DomainRequest{} + + err = json.Unmarshal(data, &varDomainRequest) + + if err != nil { + return err + } + + *o = DomainRequest(varDomainRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "domain") + delete(additionalProperties, "is_primary") + delete(additionalProperties, "tenant") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDomainRequest struct { + value *DomainRequest + isSet bool +} + +func (v NullableDomainRequest) Get() *DomainRequest { + return v.value +} + +func (v *NullableDomainRequest) Set(val *DomainRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDomainRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDomainRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDomainRequest(val *DomainRequest) *NullableDomainRequest { + return &NullableDomainRequest{value: val, isSet: true} +} + +func (v NullableDomainRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDomainRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_challenge.go b/packages/client-go/model_dummy_challenge.go new file mode 100644 index 0000000000..a445fe033f --- /dev/null +++ b/packages/client-go/model_dummy_challenge.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DummyChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyChallenge{} + +// DummyChallenge Dummy challenge +type DummyChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _DummyChallenge DummyChallenge + +// NewDummyChallenge instantiates a new DummyChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyChallenge(name string) *DummyChallenge { + this := DummyChallenge{} + var component string = "ak-stage-dummy" + this.Component = &component + this.Name = name + return &this +} + +// NewDummyChallengeWithDefaults instantiates a new DummyChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyChallengeWithDefaults() *DummyChallenge { + this := DummyChallenge{} + var component string = "ak-stage-dummy" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *DummyChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *DummyChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *DummyChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *DummyChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *DummyChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *DummyChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *DummyChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *DummyChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *DummyChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetName returns the Name field value +func (o *DummyChallenge) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DummyChallenge) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DummyChallenge) SetName(v string) { + o.Name = v +} + +func (o DummyChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDummyChallenge := _DummyChallenge{} + + err = json.Unmarshal(data, &varDummyChallenge) + + if err != nil { + return err + } + + *o = DummyChallenge(varDummyChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyChallenge struct { + value *DummyChallenge + isSet bool +} + +func (v NullableDummyChallenge) Get() *DummyChallenge { + return v.value +} + +func (v *NullableDummyChallenge) Set(val *DummyChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableDummyChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyChallenge(val *DummyChallenge) *NullableDummyChallenge { + return &NullableDummyChallenge{value: val, isSet: true} +} + +func (v NullableDummyChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_challenge_response_request.go b/packages/client-go/model_dummy_challenge_response_request.go new file mode 100644 index 0000000000..3902d06347 --- /dev/null +++ b/packages/client-go/model_dummy_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the DummyChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyChallengeResponseRequest{} + +// DummyChallengeResponseRequest Dummy challenge response +type DummyChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DummyChallengeResponseRequest DummyChallengeResponseRequest + +// NewDummyChallengeResponseRequest instantiates a new DummyChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyChallengeResponseRequest() *DummyChallengeResponseRequest { + this := DummyChallengeResponseRequest{} + var component string = "ak-stage-dummy" + this.Component = &component + return &this +} + +// NewDummyChallengeResponseRequestWithDefaults instantiates a new DummyChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyChallengeResponseRequestWithDefaults() *DummyChallengeResponseRequest { + this := DummyChallengeResponseRequest{} + var component string = "ak-stage-dummy" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *DummyChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *DummyChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *DummyChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o DummyChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varDummyChallengeResponseRequest := _DummyChallengeResponseRequest{} + + err = json.Unmarshal(data, &varDummyChallengeResponseRequest) + + if err != nil { + return err + } + + *o = DummyChallengeResponseRequest(varDummyChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyChallengeResponseRequest struct { + value *DummyChallengeResponseRequest + isSet bool +} + +func (v NullableDummyChallengeResponseRequest) Get() *DummyChallengeResponseRequest { + return v.value +} + +func (v *NullableDummyChallengeResponseRequest) Set(val *DummyChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDummyChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyChallengeResponseRequest(val *DummyChallengeResponseRequest) *NullableDummyChallengeResponseRequest { + return &NullableDummyChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableDummyChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_policy.go b/packages/client-go/model_dummy_policy.go new file mode 100644 index 0000000000..de4584ae4d --- /dev/null +++ b/packages/client-go/model_dummy_policy.go @@ -0,0 +1,495 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DummyPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyPolicy{} + +// DummyPolicy Dummy Policy Serializer +type DummyPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + Result *bool `json:"result,omitempty"` + WaitMin *int32 `json:"wait_min,omitempty"` + WaitMax *int32 `json:"wait_max,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DummyPolicy DummyPolicy + +// NewDummyPolicy instantiates a new DummyPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *DummyPolicy { + this := DummyPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewDummyPolicyWithDefaults instantiates a new DummyPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyPolicyWithDefaults() *DummyPolicy { + this := DummyPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *DummyPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DummyPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *DummyPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DummyPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *DummyPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *DummyPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *DummyPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *DummyPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *DummyPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *DummyPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *DummyPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *DummyPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *DummyPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *DummyPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *DummyPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *DummyPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *DummyPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *DummyPolicy) GetResult() bool { + if o == nil || IsNil(o.Result) { + var ret bool + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetResultOk() (*bool, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *DummyPolicy) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given bool and assigns it to the Result field. +func (o *DummyPolicy) SetResult(v bool) { + o.Result = &v +} + +// GetWaitMin returns the WaitMin field value if set, zero value otherwise. +func (o *DummyPolicy) GetWaitMin() int32 { + if o == nil || IsNil(o.WaitMin) { + var ret int32 + return ret + } + return *o.WaitMin +} + +// GetWaitMinOk returns a tuple with the WaitMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetWaitMinOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMin) { + return nil, false + } + return o.WaitMin, true +} + +// HasWaitMin returns a boolean if a field has been set. +func (o *DummyPolicy) HasWaitMin() bool { + if o != nil && !IsNil(o.WaitMin) { + return true + } + + return false +} + +// SetWaitMin gets a reference to the given int32 and assigns it to the WaitMin field. +func (o *DummyPolicy) SetWaitMin(v int32) { + o.WaitMin = &v +} + +// GetWaitMax returns the WaitMax field value if set, zero value otherwise. +func (o *DummyPolicy) GetWaitMax() int32 { + if o == nil || IsNil(o.WaitMax) { + var ret int32 + return ret + } + return *o.WaitMax +} + +// GetWaitMaxOk returns a tuple with the WaitMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicy) GetWaitMaxOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMax) { + return nil, false + } + return o.WaitMax, true +} + +// HasWaitMax returns a boolean if a field has been set. +func (o *DummyPolicy) HasWaitMax() bool { + if o != nil && !IsNil(o.WaitMax) { + return true + } + + return false +} + +// SetWaitMax gets a reference to the given int32 and assigns it to the WaitMax field. +func (o *DummyPolicy) SetWaitMax(v int32) { + o.WaitMax = &v +} + +func (o DummyPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + if !IsNil(o.WaitMin) { + toSerialize["wait_min"] = o.WaitMin + } + if !IsNil(o.WaitMax) { + toSerialize["wait_max"] = o.WaitMax + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDummyPolicy := _DummyPolicy{} + + err = json.Unmarshal(data, &varDummyPolicy) + + if err != nil { + return err + } + + *o = DummyPolicy(varDummyPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "result") + delete(additionalProperties, "wait_min") + delete(additionalProperties, "wait_max") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyPolicy struct { + value *DummyPolicy + isSet bool +} + +func (v NullableDummyPolicy) Get() *DummyPolicy { + return v.value +} + +func (v *NullableDummyPolicy) Set(val *DummyPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableDummyPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyPolicy(val *DummyPolicy) *NullableDummyPolicy { + return &NullableDummyPolicy{value: val, isSet: true} +} + +func (v NullableDummyPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_policy_request.go b/packages/client-go/model_dummy_policy_request.go new file mode 100644 index 0000000000..c42d8efd57 --- /dev/null +++ b/packages/client-go/model_dummy_policy_request.go @@ -0,0 +1,316 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DummyPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyPolicyRequest{} + +// DummyPolicyRequest Dummy Policy Serializer +type DummyPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Result *bool `json:"result,omitempty"` + WaitMin *int32 `json:"wait_min,omitempty"` + WaitMax *int32 `json:"wait_max,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DummyPolicyRequest DummyPolicyRequest + +// NewDummyPolicyRequest instantiates a new DummyPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyPolicyRequest(name string) *DummyPolicyRequest { + this := DummyPolicyRequest{} + this.Name = name + return &this +} + +// NewDummyPolicyRequestWithDefaults instantiates a new DummyPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyPolicyRequestWithDefaults() *DummyPolicyRequest { + this := DummyPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DummyPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DummyPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DummyPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *DummyPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *DummyPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *DummyPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *DummyPolicyRequest) GetResult() bool { + if o == nil || IsNil(o.Result) { + var ret bool + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicyRequest) GetResultOk() (*bool, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *DummyPolicyRequest) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given bool and assigns it to the Result field. +func (o *DummyPolicyRequest) SetResult(v bool) { + o.Result = &v +} + +// GetWaitMin returns the WaitMin field value if set, zero value otherwise. +func (o *DummyPolicyRequest) GetWaitMin() int32 { + if o == nil || IsNil(o.WaitMin) { + var ret int32 + return ret + } + return *o.WaitMin +} + +// GetWaitMinOk returns a tuple with the WaitMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicyRequest) GetWaitMinOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMin) { + return nil, false + } + return o.WaitMin, true +} + +// HasWaitMin returns a boolean if a field has been set. +func (o *DummyPolicyRequest) HasWaitMin() bool { + if o != nil && !IsNil(o.WaitMin) { + return true + } + + return false +} + +// SetWaitMin gets a reference to the given int32 and assigns it to the WaitMin field. +func (o *DummyPolicyRequest) SetWaitMin(v int32) { + o.WaitMin = &v +} + +// GetWaitMax returns the WaitMax field value if set, zero value otherwise. +func (o *DummyPolicyRequest) GetWaitMax() int32 { + if o == nil || IsNil(o.WaitMax) { + var ret int32 + return ret + } + return *o.WaitMax +} + +// GetWaitMaxOk returns a tuple with the WaitMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyPolicyRequest) GetWaitMaxOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMax) { + return nil, false + } + return o.WaitMax, true +} + +// HasWaitMax returns a boolean if a field has been set. +func (o *DummyPolicyRequest) HasWaitMax() bool { + if o != nil && !IsNil(o.WaitMax) { + return true + } + + return false +} + +// SetWaitMax gets a reference to the given int32 and assigns it to the WaitMax field. +func (o *DummyPolicyRequest) SetWaitMax(v int32) { + o.WaitMax = &v +} + +func (o DummyPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + if !IsNil(o.WaitMin) { + toSerialize["wait_min"] = o.WaitMin + } + if !IsNil(o.WaitMax) { + toSerialize["wait_max"] = o.WaitMax + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDummyPolicyRequest := _DummyPolicyRequest{} + + err = json.Unmarshal(data, &varDummyPolicyRequest) + + if err != nil { + return err + } + + *o = DummyPolicyRequest(varDummyPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "result") + delete(additionalProperties, "wait_min") + delete(additionalProperties, "wait_max") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyPolicyRequest struct { + value *DummyPolicyRequest + isSet bool +} + +func (v NullableDummyPolicyRequest) Get() *DummyPolicyRequest { + return v.value +} + +func (v *NullableDummyPolicyRequest) Set(val *DummyPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDummyPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyPolicyRequest(val *DummyPolicyRequest) *NullableDummyPolicyRequest { + return &NullableDummyPolicyRequest{value: val, isSet: true} +} + +func (v NullableDummyPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_stage.go b/packages/client-go/model_dummy_stage.go new file mode 100644 index 0000000000..7c2d2d5604 --- /dev/null +++ b/packages/client-go/model_dummy_stage.go @@ -0,0 +1,382 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DummyStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyStage{} + +// DummyStage DummyStage Serializer +type DummyStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + ThrowError *bool `json:"throw_error,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DummyStage DummyStage + +// NewDummyStage instantiates a new DummyStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *DummyStage { + this := DummyStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewDummyStageWithDefaults instantiates a new DummyStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyStageWithDefaults() *DummyStage { + this := DummyStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *DummyStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DummyStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *DummyStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DummyStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *DummyStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *DummyStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *DummyStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *DummyStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *DummyStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *DummyStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *DummyStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *DummyStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *DummyStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *DummyStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *DummyStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetThrowError returns the ThrowError field value if set, zero value otherwise. +func (o *DummyStage) GetThrowError() bool { + if o == nil || IsNil(o.ThrowError) { + var ret bool + return ret + } + return *o.ThrowError +} + +// GetThrowErrorOk returns a tuple with the ThrowError field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyStage) GetThrowErrorOk() (*bool, bool) { + if o == nil || IsNil(o.ThrowError) { + return nil, false + } + return o.ThrowError, true +} + +// HasThrowError returns a boolean if a field has been set. +func (o *DummyStage) HasThrowError() bool { + if o != nil && !IsNil(o.ThrowError) { + return true + } + + return false +} + +// SetThrowError gets a reference to the given bool and assigns it to the ThrowError field. +func (o *DummyStage) SetThrowError(v bool) { + o.ThrowError = &v +} + +func (o DummyStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.ThrowError) { + toSerialize["throw_error"] = o.ThrowError + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDummyStage := _DummyStage{} + + err = json.Unmarshal(data, &varDummyStage) + + if err != nil { + return err + } + + *o = DummyStage(varDummyStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "throw_error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyStage struct { + value *DummyStage + isSet bool +} + +func (v NullableDummyStage) Get() *DummyStage { + return v.value +} + +func (v *NullableDummyStage) Set(val *DummyStage) { + v.value = val + v.isSet = true +} + +func (v NullableDummyStage) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyStage(val *DummyStage) *NullableDummyStage { + return &NullableDummyStage{value: val, isSet: true} +} + +func (v NullableDummyStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_dummy_stage_request.go b/packages/client-go/model_dummy_stage_request.go new file mode 100644 index 0000000000..760164e469 --- /dev/null +++ b/packages/client-go/model_dummy_stage_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DummyStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DummyStageRequest{} + +// DummyStageRequest DummyStage Serializer +type DummyStageRequest struct { + Name string `json:"name"` + ThrowError *bool `json:"throw_error,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DummyStageRequest DummyStageRequest + +// NewDummyStageRequest instantiates a new DummyStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDummyStageRequest(name string) *DummyStageRequest { + this := DummyStageRequest{} + this.Name = name + return &this +} + +// NewDummyStageRequestWithDefaults instantiates a new DummyStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDummyStageRequestWithDefaults() *DummyStageRequest { + this := DummyStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DummyStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DummyStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DummyStageRequest) SetName(v string) { + o.Name = v +} + +// GetThrowError returns the ThrowError field value if set, zero value otherwise. +func (o *DummyStageRequest) GetThrowError() bool { + if o == nil || IsNil(o.ThrowError) { + var ret bool + return ret + } + return *o.ThrowError +} + +// GetThrowErrorOk returns a tuple with the ThrowError field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DummyStageRequest) GetThrowErrorOk() (*bool, bool) { + if o == nil || IsNil(o.ThrowError) { + return nil, false + } + return o.ThrowError, true +} + +// HasThrowError returns a boolean if a field has been set. +func (o *DummyStageRequest) HasThrowError() bool { + if o != nil && !IsNil(o.ThrowError) { + return true + } + + return false +} + +// SetThrowError gets a reference to the given bool and assigns it to the ThrowError field. +func (o *DummyStageRequest) SetThrowError(v bool) { + o.ThrowError = &v +} + +func (o DummyStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DummyStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ThrowError) { + toSerialize["throw_error"] = o.ThrowError + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DummyStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDummyStageRequest := _DummyStageRequest{} + + err = json.Unmarshal(data, &varDummyStageRequest) + + if err != nil { + return err + } + + *o = DummyStageRequest(varDummyStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "throw_error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDummyStageRequest struct { + value *DummyStageRequest + isSet bool +} + +func (v NullableDummyStageRequest) Get() *DummyStageRequest { + return v.value +} + +func (v *NullableDummyStageRequest) Set(val *DummyStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDummyStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDummyStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDummyStageRequest(val *DummyStageRequest) *NullableDummyStageRequest { + return &NullableDummyStageRequest{value: val, isSet: true} +} + +func (v NullableDummyStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDummyStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_duo_device.go b/packages/client-go/model_duo_device.go new file mode 100644 index 0000000000..f3fc340327 --- /dev/null +++ b/packages/client-go/model_duo_device.go @@ -0,0 +1,226 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DuoDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DuoDevice{} + +// DuoDevice Serializer for Duo authenticator devices +type DuoDevice struct { + Pk int32 `json:"pk"` + // The human-readable name of this device. + Name string `json:"name"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _DuoDevice DuoDevice + +// NewDuoDevice instantiates a new DuoDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDuoDevice(pk int32, name string, user PartialUser) *DuoDevice { + this := DuoDevice{} + this.Pk = pk + this.Name = name + this.User = user + return &this +} + +// NewDuoDeviceWithDefaults instantiates a new DuoDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDuoDeviceWithDefaults() *DuoDevice { + this := DuoDevice{} + return &this +} + +// GetPk returns the Pk field value +func (o *DuoDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *DuoDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *DuoDevice) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *DuoDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DuoDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DuoDevice) SetName(v string) { + o.Name = v +} + +// GetUser returns the User field value +func (o *DuoDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *DuoDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *DuoDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o DuoDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DuoDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DuoDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDuoDevice := _DuoDevice{} + + err = json.Unmarshal(data, &varDuoDevice) + + if err != nil { + return err + } + + *o = DuoDevice(varDuoDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDuoDevice struct { + value *DuoDevice + isSet bool +} + +func (v NullableDuoDevice) Get() *DuoDevice { + return v.value +} + +func (v *NullableDuoDevice) Set(val *DuoDevice) { + v.value = val + v.isSet = true +} + +func (v NullableDuoDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableDuoDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDuoDevice(val *DuoDevice) *NullableDuoDevice { + return &NullableDuoDevice{value: val, isSet: true} +} + +func (v NullableDuoDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDuoDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_duo_device_enrollment_status.go b/packages/client-go/model_duo_device_enrollment_status.go new file mode 100644 index 0000000000..740fe0dde2 --- /dev/null +++ b/packages/client-go/model_duo_device_enrollment_status.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DuoDeviceEnrollmentStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DuoDeviceEnrollmentStatus{} + +// DuoDeviceEnrollmentStatus struct for DuoDeviceEnrollmentStatus +type DuoDeviceEnrollmentStatus struct { + DuoResponse DuoResponseEnum `json:"duo_response"` + AdditionalProperties map[string]interface{} +} + +type _DuoDeviceEnrollmentStatus DuoDeviceEnrollmentStatus + +// NewDuoDeviceEnrollmentStatus instantiates a new DuoDeviceEnrollmentStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDuoDeviceEnrollmentStatus(duoResponse DuoResponseEnum) *DuoDeviceEnrollmentStatus { + this := DuoDeviceEnrollmentStatus{} + this.DuoResponse = duoResponse + return &this +} + +// NewDuoDeviceEnrollmentStatusWithDefaults instantiates a new DuoDeviceEnrollmentStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDuoDeviceEnrollmentStatusWithDefaults() *DuoDeviceEnrollmentStatus { + this := DuoDeviceEnrollmentStatus{} + return &this +} + +// GetDuoResponse returns the DuoResponse field value +func (o *DuoDeviceEnrollmentStatus) GetDuoResponse() DuoResponseEnum { + if o == nil { + var ret DuoResponseEnum + return ret + } + + return o.DuoResponse +} + +// GetDuoResponseOk returns a tuple with the DuoResponse field value +// and a boolean to check if the value has been set. +func (o *DuoDeviceEnrollmentStatus) GetDuoResponseOk() (*DuoResponseEnum, bool) { + if o == nil { + return nil, false + } + return &o.DuoResponse, true +} + +// SetDuoResponse sets field value +func (o *DuoDeviceEnrollmentStatus) SetDuoResponse(v DuoResponseEnum) { + o.DuoResponse = v +} + +func (o DuoDeviceEnrollmentStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DuoDeviceEnrollmentStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["duo_response"] = o.DuoResponse + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DuoDeviceEnrollmentStatus) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "duo_response", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDuoDeviceEnrollmentStatus := _DuoDeviceEnrollmentStatus{} + + err = json.Unmarshal(data, &varDuoDeviceEnrollmentStatus) + + if err != nil { + return err + } + + *o = DuoDeviceEnrollmentStatus(varDuoDeviceEnrollmentStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "duo_response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDuoDeviceEnrollmentStatus struct { + value *DuoDeviceEnrollmentStatus + isSet bool +} + +func (v NullableDuoDeviceEnrollmentStatus) Get() *DuoDeviceEnrollmentStatus { + return v.value +} + +func (v *NullableDuoDeviceEnrollmentStatus) Set(val *DuoDeviceEnrollmentStatus) { + v.value = val + v.isSet = true +} + +func (v NullableDuoDeviceEnrollmentStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableDuoDeviceEnrollmentStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDuoDeviceEnrollmentStatus(val *DuoDeviceEnrollmentStatus) *NullableDuoDeviceEnrollmentStatus { + return &NullableDuoDeviceEnrollmentStatus{value: val, isSet: true} +} + +func (v NullableDuoDeviceEnrollmentStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDuoDeviceEnrollmentStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_duo_device_request.go b/packages/client-go/model_duo_device_request.go new file mode 100644 index 0000000000..d85359bf68 --- /dev/null +++ b/packages/client-go/model_duo_device_request.go @@ -0,0 +1,168 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the DuoDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DuoDeviceRequest{} + +// DuoDeviceRequest Serializer for Duo authenticator devices +type DuoDeviceRequest struct { + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _DuoDeviceRequest DuoDeviceRequest + +// NewDuoDeviceRequest instantiates a new DuoDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDuoDeviceRequest(name string) *DuoDeviceRequest { + this := DuoDeviceRequest{} + this.Name = name + return &this +} + +// NewDuoDeviceRequestWithDefaults instantiates a new DuoDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDuoDeviceRequestWithDefaults() *DuoDeviceRequest { + this := DuoDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *DuoDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *DuoDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *DuoDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o DuoDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DuoDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DuoDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDuoDeviceRequest := _DuoDeviceRequest{} + + err = json.Unmarshal(data, &varDuoDeviceRequest) + + if err != nil { + return err + } + + *o = DuoDeviceRequest(varDuoDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDuoDeviceRequest struct { + value *DuoDeviceRequest + isSet bool +} + +func (v NullableDuoDeviceRequest) Get() *DuoDeviceRequest { + return v.value +} + +func (v *NullableDuoDeviceRequest) Set(val *DuoDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDuoDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDuoDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDuoDeviceRequest(val *DuoDeviceRequest) *NullableDuoDeviceRequest { + return &NullableDuoDeviceRequest{value: val, isSet: true} +} + +func (v NullableDuoDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDuoDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_duo_response_enum.go b/packages/client-go/model_duo_response_enum.go new file mode 100644 index 0000000000..98cd4f8c7d --- /dev/null +++ b/packages/client-go/model_duo_response_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// DuoResponseEnum the model 'DuoResponseEnum' +type DuoResponseEnum string + +// List of DuoResponseEnum +const ( + DUORESPONSEENUM_SUCCESS DuoResponseEnum = "success" + DUORESPONSEENUM_WAITING DuoResponseEnum = "waiting" + DUORESPONSEENUM_INVALID DuoResponseEnum = "invalid" +) + +// All allowed values of DuoResponseEnum enum +var AllowedDuoResponseEnumEnumValues = []DuoResponseEnum{ + "success", + "waiting", + "invalid", +} + +func (v *DuoResponseEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := DuoResponseEnum(value) + for _, existing := range AllowedDuoResponseEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid DuoResponseEnum", value) +} + +// NewDuoResponseEnumFromValue returns a pointer to a valid DuoResponseEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewDuoResponseEnumFromValue(v string) (*DuoResponseEnum, error) { + ev := DuoResponseEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for DuoResponseEnum: valid values are %v", v, AllowedDuoResponseEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v DuoResponseEnum) IsValid() bool { + for _, existing := range AllowedDuoResponseEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DuoResponseEnum value +func (v DuoResponseEnum) Ptr() *DuoResponseEnum { + return &v +} + +type NullableDuoResponseEnum struct { + value *DuoResponseEnum + isSet bool +} + +func (v NullableDuoResponseEnum) Get() *DuoResponseEnum { + return v.value +} + +func (v *NullableDuoResponseEnum) Set(val *DuoResponseEnum) { + v.value = val + v.isSet = true +} + +func (v NullableDuoResponseEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableDuoResponseEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDuoResponseEnum(val *DuoResponseEnum) *NullableDuoResponseEnum { + return &NullableDuoResponseEnum{value: val, isSet: true} +} + +func (v NullableDuoResponseEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDuoResponseEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_challenge.go b/packages/client-go/model_email_challenge.go new file mode 100644 index 0000000000..9a66e5c54f --- /dev/null +++ b/packages/client-go/model_email_challenge.go @@ -0,0 +1,232 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the EmailChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailChallenge{} + +// EmailChallenge Email challenge +type EmailChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EmailChallenge EmailChallenge + +// NewEmailChallenge instantiates a new EmailChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailChallenge() *EmailChallenge { + this := EmailChallenge{} + var component string = "ak-stage-email" + this.Component = &component + return &this +} + +// NewEmailChallengeWithDefaults instantiates a new EmailChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailChallengeWithDefaults() *EmailChallenge { + this := EmailChallenge{} + var component string = "ak-stage-email" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *EmailChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *EmailChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *EmailChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *EmailChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *EmailChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *EmailChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *EmailChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *EmailChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *EmailChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +func (o EmailChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailChallenge) UnmarshalJSON(data []byte) (err error) { + varEmailChallenge := _EmailChallenge{} + + err = json.Unmarshal(data, &varEmailChallenge) + + if err != nil { + return err + } + + *o = EmailChallenge(varEmailChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailChallenge struct { + value *EmailChallenge + isSet bool +} + +func (v NullableEmailChallenge) Get() *EmailChallenge { + return v.value +} + +func (v *NullableEmailChallenge) Set(val *EmailChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableEmailChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailChallenge(val *EmailChallenge) *NullableEmailChallenge { + return &NullableEmailChallenge{value: val, isSet: true} +} + +func (v NullableEmailChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_challenge_response_request.go b/packages/client-go/model_email_challenge_response_request.go new file mode 100644 index 0000000000..5a6760cdca --- /dev/null +++ b/packages/client-go/model_email_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the EmailChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailChallengeResponseRequest{} + +// EmailChallengeResponseRequest Email challenge resposen. No fields. This challenge is always declared invalid to give the user a chance to retry +type EmailChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EmailChallengeResponseRequest EmailChallengeResponseRequest + +// NewEmailChallengeResponseRequest instantiates a new EmailChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailChallengeResponseRequest() *EmailChallengeResponseRequest { + this := EmailChallengeResponseRequest{} + var component string = "ak-stage-email" + this.Component = &component + return &this +} + +// NewEmailChallengeResponseRequestWithDefaults instantiates a new EmailChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailChallengeResponseRequestWithDefaults() *EmailChallengeResponseRequest { + this := EmailChallengeResponseRequest{} + var component string = "ak-stage-email" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *EmailChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *EmailChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *EmailChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o EmailChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varEmailChallengeResponseRequest := _EmailChallengeResponseRequest{} + + err = json.Unmarshal(data, &varEmailChallengeResponseRequest) + + if err != nil { + return err + } + + *o = EmailChallengeResponseRequest(varEmailChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailChallengeResponseRequest struct { + value *EmailChallengeResponseRequest + isSet bool +} + +func (v NullableEmailChallengeResponseRequest) Get() *EmailChallengeResponseRequest { + return v.value +} + +func (v *NullableEmailChallengeResponseRequest) Set(val *EmailChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEmailChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailChallengeResponseRequest(val *EmailChallengeResponseRequest) *NullableEmailChallengeResponseRequest { + return &NullableEmailChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableEmailChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_device.go b/packages/client-go/model_email_device.go new file mode 100644 index 0000000000..c53760a439 --- /dev/null +++ b/packages/client-go/model_email_device.go @@ -0,0 +1,255 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EmailDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailDevice{} + +// EmailDevice Serializer for email authenticator devices +type EmailDevice struct { + // The human-readable name of this device. + Name string `json:"name"` + Pk int32 `json:"pk"` + Email string `json:"email"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _EmailDevice EmailDevice + +// NewEmailDevice instantiates a new EmailDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailDevice(name string, pk int32, email string, user PartialUser) *EmailDevice { + this := EmailDevice{} + this.Name = name + this.Pk = pk + this.Email = email + this.User = user + return &this +} + +// NewEmailDeviceWithDefaults instantiates a new EmailDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailDeviceWithDefaults() *EmailDevice { + this := EmailDevice{} + return &this +} + +// GetName returns the Name field value +func (o *EmailDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EmailDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EmailDevice) SetName(v string) { + o.Name = v +} + +// GetPk returns the Pk field value +func (o *EmailDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *EmailDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *EmailDevice) SetPk(v int32) { + o.Pk = v +} + +// GetEmail returns the Email field value +func (o *EmailDevice) GetEmail() string { + if o == nil { + var ret string + return ret + } + + return o.Email +} + +// GetEmailOk returns a tuple with the Email field value +// and a boolean to check if the value has been set. +func (o *EmailDevice) GetEmailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Email, true +} + +// SetEmail sets field value +func (o *EmailDevice) SetEmail(v string) { + o.Email = v +} + +// GetUser returns the User field value +func (o *EmailDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *EmailDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *EmailDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o EmailDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["pk"] = o.Pk + toSerialize["email"] = o.Email + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "pk", + "email", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEmailDevice := _EmailDevice{} + + err = json.Unmarshal(data, &varEmailDevice) + + if err != nil { + return err + } + + *o = EmailDevice(varEmailDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "pk") + delete(additionalProperties, "email") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailDevice struct { + value *EmailDevice + isSet bool +} + +func (v NullableEmailDevice) Get() *EmailDevice { + return v.value +} + +func (v *NullableEmailDevice) Set(val *EmailDevice) { + v.value = val + v.isSet = true +} + +func (v NullableEmailDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailDevice(val *EmailDevice) *NullableEmailDevice { + return &NullableEmailDevice{value: val, isSet: true} +} + +func (v NullableEmailDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_device_request.go b/packages/client-go/model_email_device_request.go new file mode 100644 index 0000000000..136f481b84 --- /dev/null +++ b/packages/client-go/model_email_device_request.go @@ -0,0 +1,168 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EmailDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailDeviceRequest{} + +// EmailDeviceRequest Serializer for email authenticator devices +type EmailDeviceRequest struct { + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _EmailDeviceRequest EmailDeviceRequest + +// NewEmailDeviceRequest instantiates a new EmailDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailDeviceRequest(name string) *EmailDeviceRequest { + this := EmailDeviceRequest{} + this.Name = name + return &this +} + +// NewEmailDeviceRequestWithDefaults instantiates a new EmailDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailDeviceRequestWithDefaults() *EmailDeviceRequest { + this := EmailDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EmailDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EmailDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EmailDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o EmailDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEmailDeviceRequest := _EmailDeviceRequest{} + + err = json.Unmarshal(data, &varEmailDeviceRequest) + + if err != nil { + return err + } + + *o = EmailDeviceRequest(varEmailDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailDeviceRequest struct { + value *EmailDeviceRequest + isSet bool +} + +func (v NullableEmailDeviceRequest) Get() *EmailDeviceRequest { + return v.value +} + +func (v *NullableEmailDeviceRequest) Set(val *EmailDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEmailDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailDeviceRequest(val *EmailDeviceRequest) *NullableEmailDeviceRequest { + return &NullableEmailDeviceRequest{value: val, isSet: true} +} + +func (v NullableEmailDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_stage.go b/packages/client-go/model_email_stage.go new file mode 100644 index 0000000000..061040ed3d --- /dev/null +++ b/packages/client-go/model_email_stage.go @@ -0,0 +1,867 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EmailStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailStage{} + +// EmailStage EmailStage Serializer +type EmailStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Subject *string `json:"subject,omitempty"` + Template *string `json:"template,omitempty"` + // Activate users upon completion of stage. + ActivateUserOnSuccess *bool `json:"activate_user_on_success,omitempty"` + RecoveryMaxAttempts *int32 `json:"recovery_max_attempts,omitempty"` + // The time window used to count recent account recovery attempts. If the number of attempts exceed recovery_max_attempts within this period, further attempts will be rate-limited. (Format: hours=1;minutes=2;seconds=3). + RecoveryCacheTimeout *string `json:"recovery_cache_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EmailStage EmailStage + +// NewEmailStage instantiates a new EmailStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *EmailStage { + this := EmailStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewEmailStageWithDefaults instantiates a new EmailStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailStageWithDefaults() *EmailStage { + this := EmailStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *EmailStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *EmailStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *EmailStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EmailStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *EmailStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *EmailStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *EmailStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *EmailStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *EmailStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *EmailStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *EmailStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *EmailStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *EmailStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *EmailStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *EmailStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *EmailStage) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *EmailStage) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *EmailStage) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *EmailStage) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *EmailStage) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *EmailStage) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *EmailStage) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *EmailStage) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *EmailStage) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *EmailStage) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *EmailStage) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *EmailStage) SetUsername(v string) { + o.Username = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *EmailStage) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *EmailStage) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *EmailStage) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *EmailStage) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *EmailStage) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *EmailStage) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *EmailStage) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *EmailStage) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *EmailStage) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *EmailStage) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *EmailStage) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *EmailStage) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *EmailStage) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *EmailStage) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *EmailStage) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *EmailStage) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *EmailStage) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *EmailStage) SetSubject(v string) { + o.Subject = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *EmailStage) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *EmailStage) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *EmailStage) SetTemplate(v string) { + o.Template = &v +} + +// GetActivateUserOnSuccess returns the ActivateUserOnSuccess field value if set, zero value otherwise. +func (o *EmailStage) GetActivateUserOnSuccess() bool { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + var ret bool + return ret + } + return *o.ActivateUserOnSuccess +} + +// GetActivateUserOnSuccessOk returns a tuple with the ActivateUserOnSuccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetActivateUserOnSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + return nil, false + } + return o.ActivateUserOnSuccess, true +} + +// HasActivateUserOnSuccess returns a boolean if a field has been set. +func (o *EmailStage) HasActivateUserOnSuccess() bool { + if o != nil && !IsNil(o.ActivateUserOnSuccess) { + return true + } + + return false +} + +// SetActivateUserOnSuccess gets a reference to the given bool and assigns it to the ActivateUserOnSuccess field. +func (o *EmailStage) SetActivateUserOnSuccess(v bool) { + o.ActivateUserOnSuccess = &v +} + +// GetRecoveryMaxAttempts returns the RecoveryMaxAttempts field value if set, zero value otherwise. +func (o *EmailStage) GetRecoveryMaxAttempts() int32 { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + var ret int32 + return ret + } + return *o.RecoveryMaxAttempts +} + +// GetRecoveryMaxAttemptsOk returns a tuple with the RecoveryMaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetRecoveryMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + return nil, false + } + return o.RecoveryMaxAttempts, true +} + +// HasRecoveryMaxAttempts returns a boolean if a field has been set. +func (o *EmailStage) HasRecoveryMaxAttempts() bool { + if o != nil && !IsNil(o.RecoveryMaxAttempts) { + return true + } + + return false +} + +// SetRecoveryMaxAttempts gets a reference to the given int32 and assigns it to the RecoveryMaxAttempts field. +func (o *EmailStage) SetRecoveryMaxAttempts(v int32) { + o.RecoveryMaxAttempts = &v +} + +// GetRecoveryCacheTimeout returns the RecoveryCacheTimeout field value if set, zero value otherwise. +func (o *EmailStage) GetRecoveryCacheTimeout() string { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + var ret string + return ret + } + return *o.RecoveryCacheTimeout +} + +// GetRecoveryCacheTimeoutOk returns a tuple with the RecoveryCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStage) GetRecoveryCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + return nil, false + } + return o.RecoveryCacheTimeout, true +} + +// HasRecoveryCacheTimeout returns a boolean if a field has been set. +func (o *EmailStage) HasRecoveryCacheTimeout() bool { + if o != nil && !IsNil(o.RecoveryCacheTimeout) { + return true + } + + return false +} + +// SetRecoveryCacheTimeout gets a reference to the given string and assigns it to the RecoveryCacheTimeout field. +func (o *EmailStage) SetRecoveryCacheTimeout(v string) { + o.RecoveryCacheTimeout = &v +} + +func (o EmailStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + if !IsNil(o.ActivateUserOnSuccess) { + toSerialize["activate_user_on_success"] = o.ActivateUserOnSuccess + } + if !IsNil(o.RecoveryMaxAttempts) { + toSerialize["recovery_max_attempts"] = o.RecoveryMaxAttempts + } + if !IsNil(o.RecoveryCacheTimeout) { + toSerialize["recovery_cache_timeout"] = o.RecoveryCacheTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEmailStage := _EmailStage{} + + err = json.Unmarshal(data, &varEmailStage) + + if err != nil { + return err + } + + *o = EmailStage(varEmailStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "subject") + delete(additionalProperties, "template") + delete(additionalProperties, "activate_user_on_success") + delete(additionalProperties, "recovery_max_attempts") + delete(additionalProperties, "recovery_cache_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailStage struct { + value *EmailStage + isSet bool +} + +func (v NullableEmailStage) Get() *EmailStage { + return v.value +} + +func (v *NullableEmailStage) Set(val *EmailStage) { + v.value = val + v.isSet = true +} + +func (v NullableEmailStage) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailStage(val *EmailStage) *NullableEmailStage { + return &NullableEmailStage{value: val, isSet: true} +} + +func (v NullableEmailStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_email_stage_request.go b/packages/client-go/model_email_stage_request.go new file mode 100644 index 0000000000..7b832abadc --- /dev/null +++ b/packages/client-go/model_email_stage_request.go @@ -0,0 +1,726 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EmailStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EmailStageRequest{} + +// EmailStageRequest EmailStage Serializer +type EmailStageRequest struct { + Name string `json:"name"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Subject *string `json:"subject,omitempty"` + Template *string `json:"template,omitempty"` + // Activate users upon completion of stage. + ActivateUserOnSuccess *bool `json:"activate_user_on_success,omitempty"` + RecoveryMaxAttempts *int32 `json:"recovery_max_attempts,omitempty"` + // The time window used to count recent account recovery attempts. If the number of attempts exceed recovery_max_attempts within this period, further attempts will be rate-limited. (Format: hours=1;minutes=2;seconds=3). + RecoveryCacheTimeout *string `json:"recovery_cache_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EmailStageRequest EmailStageRequest + +// NewEmailStageRequest instantiates a new EmailStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEmailStageRequest(name string) *EmailStageRequest { + this := EmailStageRequest{} + this.Name = name + return &this +} + +// NewEmailStageRequestWithDefaults instantiates a new EmailStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEmailStageRequestWithDefaults() *EmailStageRequest { + this := EmailStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EmailStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EmailStageRequest) SetName(v string) { + o.Name = v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *EmailStageRequest) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *EmailStageRequest) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *EmailStageRequest) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *EmailStageRequest) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *EmailStageRequest) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *EmailStageRequest) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *EmailStageRequest) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *EmailStageRequest) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *EmailStageRequest) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *EmailStageRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *EmailStageRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *EmailStageRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *EmailStageRequest) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *EmailStageRequest) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *EmailStageRequest) SetPassword(v string) { + o.Password = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *EmailStageRequest) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *EmailStageRequest) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *EmailStageRequest) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *EmailStageRequest) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *EmailStageRequest) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *EmailStageRequest) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *EmailStageRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *EmailStageRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *EmailStageRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *EmailStageRequest) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *EmailStageRequest) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *EmailStageRequest) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *EmailStageRequest) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *EmailStageRequest) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *EmailStageRequest) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *EmailStageRequest) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *EmailStageRequest) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *EmailStageRequest) SetSubject(v string) { + o.Subject = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *EmailStageRequest) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *EmailStageRequest) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *EmailStageRequest) SetTemplate(v string) { + o.Template = &v +} + +// GetActivateUserOnSuccess returns the ActivateUserOnSuccess field value if set, zero value otherwise. +func (o *EmailStageRequest) GetActivateUserOnSuccess() bool { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + var ret bool + return ret + } + return *o.ActivateUserOnSuccess +} + +// GetActivateUserOnSuccessOk returns a tuple with the ActivateUserOnSuccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetActivateUserOnSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + return nil, false + } + return o.ActivateUserOnSuccess, true +} + +// HasActivateUserOnSuccess returns a boolean if a field has been set. +func (o *EmailStageRequest) HasActivateUserOnSuccess() bool { + if o != nil && !IsNil(o.ActivateUserOnSuccess) { + return true + } + + return false +} + +// SetActivateUserOnSuccess gets a reference to the given bool and assigns it to the ActivateUserOnSuccess field. +func (o *EmailStageRequest) SetActivateUserOnSuccess(v bool) { + o.ActivateUserOnSuccess = &v +} + +// GetRecoveryMaxAttempts returns the RecoveryMaxAttempts field value if set, zero value otherwise. +func (o *EmailStageRequest) GetRecoveryMaxAttempts() int32 { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + var ret int32 + return ret + } + return *o.RecoveryMaxAttempts +} + +// GetRecoveryMaxAttemptsOk returns a tuple with the RecoveryMaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetRecoveryMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + return nil, false + } + return o.RecoveryMaxAttempts, true +} + +// HasRecoveryMaxAttempts returns a boolean if a field has been set. +func (o *EmailStageRequest) HasRecoveryMaxAttempts() bool { + if o != nil && !IsNil(o.RecoveryMaxAttempts) { + return true + } + + return false +} + +// SetRecoveryMaxAttempts gets a reference to the given int32 and assigns it to the RecoveryMaxAttempts field. +func (o *EmailStageRequest) SetRecoveryMaxAttempts(v int32) { + o.RecoveryMaxAttempts = &v +} + +// GetRecoveryCacheTimeout returns the RecoveryCacheTimeout field value if set, zero value otherwise. +func (o *EmailStageRequest) GetRecoveryCacheTimeout() string { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + var ret string + return ret + } + return *o.RecoveryCacheTimeout +} + +// GetRecoveryCacheTimeoutOk returns a tuple with the RecoveryCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EmailStageRequest) GetRecoveryCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + return nil, false + } + return o.RecoveryCacheTimeout, true +} + +// HasRecoveryCacheTimeout returns a boolean if a field has been set. +func (o *EmailStageRequest) HasRecoveryCacheTimeout() bool { + if o != nil && !IsNil(o.RecoveryCacheTimeout) { + return true + } + + return false +} + +// SetRecoveryCacheTimeout gets a reference to the given string and assigns it to the RecoveryCacheTimeout field. +func (o *EmailStageRequest) SetRecoveryCacheTimeout(v string) { + o.RecoveryCacheTimeout = &v +} + +func (o EmailStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EmailStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + if !IsNil(o.ActivateUserOnSuccess) { + toSerialize["activate_user_on_success"] = o.ActivateUserOnSuccess + } + if !IsNil(o.RecoveryMaxAttempts) { + toSerialize["recovery_max_attempts"] = o.RecoveryMaxAttempts + } + if !IsNil(o.RecoveryCacheTimeout) { + toSerialize["recovery_cache_timeout"] = o.RecoveryCacheTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EmailStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEmailStageRequest := _EmailStageRequest{} + + err = json.Unmarshal(data, &varEmailStageRequest) + + if err != nil { + return err + } + + *o = EmailStageRequest(varEmailStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "subject") + delete(additionalProperties, "template") + delete(additionalProperties, "activate_user_on_success") + delete(additionalProperties, "recovery_max_attempts") + delete(additionalProperties, "recovery_cache_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEmailStageRequest struct { + value *EmailStageRequest + isSet bool +} + +func (v NullableEmailStageRequest) Get() *EmailStageRequest { + return v.value +} + +func (v *NullableEmailStageRequest) Set(val *EmailStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEmailStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEmailStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEmailStageRequest(val *EmailStageRequest) *NullableEmailStageRequest { + return &NullableEmailStageRequest{value: val, isSet: true} +} + +func (v NullableEmailStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEmailStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint.go b/packages/client-go/model_endpoint.go new file mode 100644 index 0000000000..7c8f3c6a95 --- /dev/null +++ b/packages/client-go/model_endpoint.go @@ -0,0 +1,484 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Endpoint type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Endpoint{} + +// Endpoint Endpoint Serializer +type Endpoint struct { + Pk string `json:"pk"` + Name string `json:"name"` + Provider int32 `json:"provider"` + ProviderObj RACProvider `json:"provider_obj"` + Protocol ProtocolEnum `json:"protocol"` + Host string `json:"host"` + Settings map[string]interface{} `json:"settings,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + AuthMode EndpointAuthModeEnum `json:"auth_mode"` + // Build actual launch URL (the provider itself does not have one, just individual endpoints) + LaunchUrl NullableString `json:"launch_url"` + MaximumConnections *int32 `json:"maximum_connections,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Endpoint Endpoint + +// NewEndpoint instantiates a new Endpoint object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpoint(pk string, name string, provider int32, providerObj RACProvider, protocol ProtocolEnum, host string, authMode EndpointAuthModeEnum, launchUrl NullableString) *Endpoint { + this := Endpoint{} + this.Pk = pk + this.Name = name + this.Provider = provider + this.ProviderObj = providerObj + this.Protocol = protocol + this.Host = host + this.AuthMode = authMode + this.LaunchUrl = launchUrl + return &this +} + +// NewEndpointWithDefaults instantiates a new Endpoint object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointWithDefaults() *Endpoint { + this := Endpoint{} + return &this +} + +// GetPk returns the Pk field value +func (o *Endpoint) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Endpoint) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Endpoint) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Endpoint) SetName(v string) { + o.Name = v +} + +// GetProvider returns the Provider field value +func (o *Endpoint) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *Endpoint) SetProvider(v int32) { + o.Provider = v +} + +// GetProviderObj returns the ProviderObj field value +func (o *Endpoint) GetProviderObj() RACProvider { + if o == nil { + var ret RACProvider + return ret + } + + return o.ProviderObj +} + +// GetProviderObjOk returns a tuple with the ProviderObj field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetProviderObjOk() (*RACProvider, bool) { + if o == nil { + return nil, false + } + return &o.ProviderObj, true +} + +// SetProviderObj sets field value +func (o *Endpoint) SetProviderObj(v RACProvider) { + o.ProviderObj = v +} + +// GetProtocol returns the Protocol field value +func (o *Endpoint) GetProtocol() ProtocolEnum { + if o == nil { + var ret ProtocolEnum + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetProtocolOk() (*ProtocolEnum, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *Endpoint) SetProtocol(v ProtocolEnum) { + o.Protocol = v +} + +// GetHost returns the Host field value +func (o *Endpoint) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *Endpoint) SetHost(v string) { + o.Host = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *Endpoint) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Endpoint) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *Endpoint) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *Endpoint) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *Endpoint) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Endpoint) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *Endpoint) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *Endpoint) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetAuthMode returns the AuthMode field value +func (o *Endpoint) GetAuthMode() EndpointAuthModeEnum { + if o == nil { + var ret EndpointAuthModeEnum + return ret + } + + return o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value +// and a boolean to check if the value has been set. +func (o *Endpoint) GetAuthModeOk() (*EndpointAuthModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.AuthMode, true +} + +// SetAuthMode sets field value +func (o *Endpoint) SetAuthMode(v EndpointAuthModeEnum) { + o.AuthMode = v +} + +// GetLaunchUrl returns the LaunchUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Endpoint) GetLaunchUrl() string { + if o == nil || o.LaunchUrl.Get() == nil { + var ret string + return ret + } + + return *o.LaunchUrl.Get() +} + +// GetLaunchUrlOk returns a tuple with the LaunchUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Endpoint) GetLaunchUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.LaunchUrl.Get(), o.LaunchUrl.IsSet() +} + +// SetLaunchUrl sets field value +func (o *Endpoint) SetLaunchUrl(v string) { + o.LaunchUrl.Set(&v) +} + +// GetMaximumConnections returns the MaximumConnections field value if set, zero value otherwise. +func (o *Endpoint) GetMaximumConnections() int32 { + if o == nil || IsNil(o.MaximumConnections) { + var ret int32 + return ret + } + return *o.MaximumConnections +} + +// GetMaximumConnectionsOk returns a tuple with the MaximumConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Endpoint) GetMaximumConnectionsOk() (*int32, bool) { + if o == nil || IsNil(o.MaximumConnections) { + return nil, false + } + return o.MaximumConnections, true +} + +// HasMaximumConnections returns a boolean if a field has been set. +func (o *Endpoint) HasMaximumConnections() bool { + if o != nil && !IsNil(o.MaximumConnections) { + return true + } + + return false +} + +// SetMaximumConnections gets a reference to the given int32 and assigns it to the MaximumConnections field. +func (o *Endpoint) SetMaximumConnections(v int32) { + o.MaximumConnections = &v +} + +func (o Endpoint) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Endpoint) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["provider"] = o.Provider + toSerialize["provider_obj"] = o.ProviderObj + toSerialize["protocol"] = o.Protocol + toSerialize["host"] = o.Host + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["auth_mode"] = o.AuthMode + toSerialize["launch_url"] = o.LaunchUrl.Get() + if !IsNil(o.MaximumConnections) { + toSerialize["maximum_connections"] = o.MaximumConnections + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Endpoint) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "provider", + "provider_obj", + "protocol", + "host", + "auth_mode", + "launch_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpoint := _Endpoint{} + + err = json.Unmarshal(data, &varEndpoint) + + if err != nil { + return err + } + + *o = Endpoint(varEndpoint) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_obj") + delete(additionalProperties, "protocol") + delete(additionalProperties, "host") + delete(additionalProperties, "settings") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "launch_url") + delete(additionalProperties, "maximum_connections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpoint struct { + value *Endpoint + isSet bool +} + +func (v NullableEndpoint) Get() *Endpoint { + return v.value +} + +func (v *NullableEndpoint) Set(val *Endpoint) { + v.value = val + v.isSet = true +} + +func (v NullableEndpoint) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpoint) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpoint(val *Endpoint) *NullableEndpoint { + return &NullableEndpoint{value: val, isSet: true} +} + +func (v NullableEndpoint) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpoint) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_agent_challenge.go b/packages/client-go/model_endpoint_agent_challenge.go new file mode 100644 index 0000000000..37f6ae52c1 --- /dev/null +++ b/packages/client-go/model_endpoint_agent_challenge.go @@ -0,0 +1,311 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EndpointAgentChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointAgentChallenge{} + +// EndpointAgentChallenge Signed challenge for authentik agent to respond to +type EndpointAgentChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Challenge string `json:"challenge"` + ChallengeIdleTimeout int32 `json:"challenge_idle_timeout"` + AdditionalProperties map[string]interface{} +} + +type _EndpointAgentChallenge EndpointAgentChallenge + +// NewEndpointAgentChallenge instantiates a new EndpointAgentChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointAgentChallenge(challenge string, challengeIdleTimeout int32) *EndpointAgentChallenge { + this := EndpointAgentChallenge{} + var component string = "ak-stage-endpoint-agent" + this.Component = &component + this.Challenge = challenge + this.ChallengeIdleTimeout = challengeIdleTimeout + return &this +} + +// NewEndpointAgentChallengeWithDefaults instantiates a new EndpointAgentChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointAgentChallengeWithDefaults() *EndpointAgentChallenge { + this := EndpointAgentChallenge{} + var component string = "ak-stage-endpoint-agent" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *EndpointAgentChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *EndpointAgentChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *EndpointAgentChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *EndpointAgentChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *EndpointAgentChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *EndpointAgentChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *EndpointAgentChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *EndpointAgentChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *EndpointAgentChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetChallenge returns the Challenge field value +func (o *EndpointAgentChallenge) GetChallenge() string { + if o == nil { + var ret string + return ret + } + + return o.Challenge +} + +// GetChallengeOk returns a tuple with the Challenge field value +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallenge) GetChallengeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Challenge, true +} + +// SetChallenge sets field value +func (o *EndpointAgentChallenge) SetChallenge(v string) { + o.Challenge = v +} + +// GetChallengeIdleTimeout returns the ChallengeIdleTimeout field value +func (o *EndpointAgentChallenge) GetChallengeIdleTimeout() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ChallengeIdleTimeout +} + +// GetChallengeIdleTimeoutOk returns a tuple with the ChallengeIdleTimeout field value +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallenge) GetChallengeIdleTimeoutOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ChallengeIdleTimeout, true +} + +// SetChallengeIdleTimeout sets field value +func (o *EndpointAgentChallenge) SetChallengeIdleTimeout(v int32) { + o.ChallengeIdleTimeout = v +} + +func (o EndpointAgentChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointAgentChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["challenge"] = o.Challenge + toSerialize["challenge_idle_timeout"] = o.ChallengeIdleTimeout + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointAgentChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "challenge", + "challenge_idle_timeout", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointAgentChallenge := _EndpointAgentChallenge{} + + err = json.Unmarshal(data, &varEndpointAgentChallenge) + + if err != nil { + return err + } + + *o = EndpointAgentChallenge(varEndpointAgentChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "challenge") + delete(additionalProperties, "challenge_idle_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointAgentChallenge struct { + value *EndpointAgentChallenge + isSet bool +} + +func (v NullableEndpointAgentChallenge) Get() *EndpointAgentChallenge { + return v.value +} + +func (v *NullableEndpointAgentChallenge) Set(val *EndpointAgentChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointAgentChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointAgentChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointAgentChallenge(val *EndpointAgentChallenge) *NullableEndpointAgentChallenge { + return &NullableEndpointAgentChallenge{value: val, isSet: true} +} + +func (v NullableEndpointAgentChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointAgentChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_agent_challenge_response_request.go b/packages/client-go/model_endpoint_agent_challenge_response_request.go new file mode 100644 index 0000000000..ae165049ba --- /dev/null +++ b/packages/client-go/model_endpoint_agent_challenge_response_request.go @@ -0,0 +1,206 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the EndpointAgentChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointAgentChallengeResponseRequest{} + +// EndpointAgentChallengeResponseRequest Response to signed challenge +type EndpointAgentChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Response NullableString `json:"response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointAgentChallengeResponseRequest EndpointAgentChallengeResponseRequest + +// NewEndpointAgentChallengeResponseRequest instantiates a new EndpointAgentChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointAgentChallengeResponseRequest() *EndpointAgentChallengeResponseRequest { + this := EndpointAgentChallengeResponseRequest{} + var component string = "ak-stage-endpoint-agent" + this.Component = &component + return &this +} + +// NewEndpointAgentChallengeResponseRequestWithDefaults instantiates a new EndpointAgentChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointAgentChallengeResponseRequestWithDefaults() *EndpointAgentChallengeResponseRequest { + this := EndpointAgentChallengeResponseRequest{} + var component string = "ak-stage-endpoint-agent" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *EndpointAgentChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointAgentChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *EndpointAgentChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *EndpointAgentChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetResponse returns the Response field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointAgentChallengeResponseRequest) GetResponse() string { + if o == nil || IsNil(o.Response.Get()) { + var ret string + return ret + } + return *o.Response.Get() +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointAgentChallengeResponseRequest) GetResponseOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Response.Get(), o.Response.IsSet() +} + +// HasResponse returns a boolean if a field has been set. +func (o *EndpointAgentChallengeResponseRequest) HasResponse() bool { + if o != nil && o.Response.IsSet() { + return true + } + + return false +} + +// SetResponse gets a reference to the given NullableString and assigns it to the Response field. +func (o *EndpointAgentChallengeResponseRequest) SetResponse(v string) { + o.Response.Set(&v) +} + +// SetResponseNil sets the value for Response to be an explicit nil +func (o *EndpointAgentChallengeResponseRequest) SetResponseNil() { + o.Response.Set(nil) +} + +// UnsetResponse ensures that no value is present for Response, not even an explicit nil +func (o *EndpointAgentChallengeResponseRequest) UnsetResponse() { + o.Response.Unset() +} + +func (o EndpointAgentChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointAgentChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if o.Response.IsSet() { + toSerialize["response"] = o.Response.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointAgentChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varEndpointAgentChallengeResponseRequest := _EndpointAgentChallengeResponseRequest{} + + err = json.Unmarshal(data, &varEndpointAgentChallengeResponseRequest) + + if err != nil { + return err + } + + *o = EndpointAgentChallengeResponseRequest(varEndpointAgentChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointAgentChallengeResponseRequest struct { + value *EndpointAgentChallengeResponseRequest + isSet bool +} + +func (v NullableEndpointAgentChallengeResponseRequest) Get() *EndpointAgentChallengeResponseRequest { + return v.value +} + +func (v *NullableEndpointAgentChallengeResponseRequest) Set(val *EndpointAgentChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointAgentChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointAgentChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointAgentChallengeResponseRequest(val *EndpointAgentChallengeResponseRequest) *NullableEndpointAgentChallengeResponseRequest { + return &NullableEndpointAgentChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableEndpointAgentChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointAgentChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_auth_mode_enum.go b/packages/client-go/model_endpoint_auth_mode_enum.go new file mode 100644 index 0000000000..d68763d630 --- /dev/null +++ b/packages/client-go/model_endpoint_auth_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// EndpointAuthModeEnum the model 'EndpointAuthModeEnum' +type EndpointAuthModeEnum string + +// List of EndpointAuthModeEnum +const ( + ENDPOINTAUTHMODEENUM_STATIC EndpointAuthModeEnum = "static" + ENDPOINTAUTHMODEENUM_PROMPT EndpointAuthModeEnum = "prompt" +) + +// All allowed values of EndpointAuthModeEnum enum +var AllowedEndpointAuthModeEnumEnumValues = []EndpointAuthModeEnum{ + "static", + "prompt", +} + +func (v *EndpointAuthModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EndpointAuthModeEnum(value) + for _, existing := range AllowedEndpointAuthModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EndpointAuthModeEnum", value) +} + +// NewEndpointAuthModeEnumFromValue returns a pointer to a valid EndpointAuthModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEndpointAuthModeEnumFromValue(v string) (*EndpointAuthModeEnum, error) { + ev := EndpointAuthModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EndpointAuthModeEnum: valid values are %v", v, AllowedEndpointAuthModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EndpointAuthModeEnum) IsValid() bool { + for _, existing := range AllowedEndpointAuthModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EndpointAuthModeEnum value +func (v EndpointAuthModeEnum) Ptr() *EndpointAuthModeEnum { + return &v +} + +type NullableEndpointAuthModeEnum struct { + value *EndpointAuthModeEnum + isSet bool +} + +func (v NullableEndpointAuthModeEnum) Get() *EndpointAuthModeEnum { + return v.value +} + +func (v *NullableEndpointAuthModeEnum) Set(val *EndpointAuthModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointAuthModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointAuthModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointAuthModeEnum(val *EndpointAuthModeEnum) *NullableEndpointAuthModeEnum { + return &NullableEndpointAuthModeEnum{value: val, isSet: true} +} + +func (v NullableEndpointAuthModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointAuthModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_device.go b/packages/client-go/model_endpoint_device.go new file mode 100644 index 0000000000..26d492ede8 --- /dev/null +++ b/packages/client-go/model_endpoint_device.go @@ -0,0 +1,470 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EndpointDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDevice{} + +// EndpointDevice struct for EndpointDevice +type EndpointDevice struct { + DeviceUuid *string `json:"device_uuid,omitempty"` + PbmUuid string `json:"pbm_uuid"` + Name string `json:"name"` + AccessGroup NullableString `json:"access_group,omitempty"` + AccessGroupObj *DeviceAccessGroup `json:"access_group_obj,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Facts DeviceFactSnapshot `json:"facts"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointDevice EndpointDevice + +// NewEndpointDevice instantiates a new EndpointDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointDevice(pbmUuid string, name string, facts DeviceFactSnapshot) *EndpointDevice { + this := EndpointDevice{} + this.PbmUuid = pbmUuid + this.Name = name + this.Facts = facts + return &this +} + +// NewEndpointDeviceWithDefaults instantiates a new EndpointDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointDeviceWithDefaults() *EndpointDevice { + this := EndpointDevice{} + return &this +} + +// GetDeviceUuid returns the DeviceUuid field value if set, zero value otherwise. +func (o *EndpointDevice) GetDeviceUuid() string { + if o == nil || IsNil(o.DeviceUuid) { + var ret string + return ret + } + return *o.DeviceUuid +} + +// GetDeviceUuidOk returns a tuple with the DeviceUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetDeviceUuidOk() (*string, bool) { + if o == nil || IsNil(o.DeviceUuid) { + return nil, false + } + return o.DeviceUuid, true +} + +// HasDeviceUuid returns a boolean if a field has been set. +func (o *EndpointDevice) HasDeviceUuid() bool { + if o != nil && !IsNil(o.DeviceUuid) { + return true + } + + return false +} + +// SetDeviceUuid gets a reference to the given string and assigns it to the DeviceUuid field. +func (o *EndpointDevice) SetDeviceUuid(v string) { + o.DeviceUuid = &v +} + +// GetPbmUuid returns the PbmUuid field value +func (o *EndpointDevice) GetPbmUuid() string { + if o == nil { + var ret string + return ret + } + + return o.PbmUuid +} + +// GetPbmUuidOk returns a tuple with the PbmUuid field value +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetPbmUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PbmUuid, true +} + +// SetPbmUuid sets field value +func (o *EndpointDevice) SetPbmUuid(v string) { + o.PbmUuid = v +} + +// GetName returns the Name field value +func (o *EndpointDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointDevice) SetName(v string) { + o.Name = v +} + +// GetAccessGroup returns the AccessGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDevice) GetAccessGroup() string { + if o == nil || IsNil(o.AccessGroup.Get()) { + var ret string + return ret + } + return *o.AccessGroup.Get() +} + +// GetAccessGroupOk returns a tuple with the AccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDevice) GetAccessGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessGroup.Get(), o.AccessGroup.IsSet() +} + +// HasAccessGroup returns a boolean if a field has been set. +func (o *EndpointDevice) HasAccessGroup() bool { + if o != nil && o.AccessGroup.IsSet() { + return true + } + + return false +} + +// SetAccessGroup gets a reference to the given NullableString and assigns it to the AccessGroup field. +func (o *EndpointDevice) SetAccessGroup(v string) { + o.AccessGroup.Set(&v) +} + +// SetAccessGroupNil sets the value for AccessGroup to be an explicit nil +func (o *EndpointDevice) SetAccessGroupNil() { + o.AccessGroup.Set(nil) +} + +// UnsetAccessGroup ensures that no value is present for AccessGroup, not even an explicit nil +func (o *EndpointDevice) UnsetAccessGroup() { + o.AccessGroup.Unset() +} + +// GetAccessGroupObj returns the AccessGroupObj field value if set, zero value otherwise. +func (o *EndpointDevice) GetAccessGroupObj() DeviceAccessGroup { + if o == nil || IsNil(o.AccessGroupObj) { + var ret DeviceAccessGroup + return ret + } + return *o.AccessGroupObj +} + +// GetAccessGroupObjOk returns a tuple with the AccessGroupObj field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetAccessGroupObjOk() (*DeviceAccessGroup, bool) { + if o == nil || IsNil(o.AccessGroupObj) { + return nil, false + } + return o.AccessGroupObj, true +} + +// HasAccessGroupObj returns a boolean if a field has been set. +func (o *EndpointDevice) HasAccessGroupObj() bool { + if o != nil && !IsNil(o.AccessGroupObj) { + return true + } + + return false +} + +// SetAccessGroupObj gets a reference to the given DeviceAccessGroup and assigns it to the AccessGroupObj field. +func (o *EndpointDevice) SetAccessGroupObj(v DeviceAccessGroup) { + o.AccessGroupObj = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *EndpointDevice) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *EndpointDevice) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *EndpointDevice) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDevice) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDevice) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *EndpointDevice) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *EndpointDevice) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *EndpointDevice) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *EndpointDevice) UnsetExpires() { + o.Expires.Unset() +} + +// GetFacts returns the Facts field value +func (o *EndpointDevice) GetFacts() DeviceFactSnapshot { + if o == nil { + var ret DeviceFactSnapshot + return ret + } + + return o.Facts +} + +// GetFactsOk returns a tuple with the Facts field value +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetFactsOk() (*DeviceFactSnapshot, bool) { + if o == nil { + return nil, false + } + return &o.Facts, true +} + +// SetFacts sets field value +func (o *EndpointDevice) SetFacts(v DeviceFactSnapshot) { + o.Facts = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *EndpointDevice) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDevice) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *EndpointDevice) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *EndpointDevice) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o EndpointDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceUuid) { + toSerialize["device_uuid"] = o.DeviceUuid + } + toSerialize["pbm_uuid"] = o.PbmUuid + toSerialize["name"] = o.Name + if o.AccessGroup.IsSet() { + toSerialize["access_group"] = o.AccessGroup.Get() + } + if !IsNil(o.AccessGroupObj) { + toSerialize["access_group_obj"] = o.AccessGroupObj + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + toSerialize["facts"] = o.Facts + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pbm_uuid", + "name", + "facts", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointDevice := _EndpointDevice{} + + err = json.Unmarshal(data, &varEndpointDevice) + + if err != nil { + return err + } + + *o = EndpointDevice(varEndpointDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_uuid") + delete(additionalProperties, "pbm_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "access_group") + delete(additionalProperties, "access_group_obj") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + delete(additionalProperties, "facts") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointDevice struct { + value *EndpointDevice + isSet bool +} + +func (v NullableEndpointDevice) Get() *EndpointDevice { + return v.value +} + +func (v *NullableEndpointDevice) Set(val *EndpointDevice) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointDevice(val *EndpointDevice) *NullableEndpointDevice { + return &NullableEndpointDevice{value: val, isSet: true} +} + +func (v NullableEndpointDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_device_details.go b/packages/client-go/model_endpoint_device_details.go new file mode 100644 index 0000000000..987b24f71e --- /dev/null +++ b/packages/client-go/model_endpoint_device_details.go @@ -0,0 +1,557 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EndpointDeviceDetails type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDeviceDetails{} + +// EndpointDeviceDetails struct for EndpointDeviceDetails +type EndpointDeviceDetails struct { + DeviceUuid *string `json:"device_uuid,omitempty"` + PbmUuid string `json:"pbm_uuid"` + Name string `json:"name"` + AccessGroup NullableString `json:"access_group,omitempty"` + AccessGroupObj *DeviceAccessGroup `json:"access_group_obj,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Facts DeviceFactSnapshot `json:"facts"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + ConnectionsObj []DeviceConnection `json:"connections_obj"` + Policies []string `json:"policies"` + Connections []string `json:"connections"` + AdditionalProperties map[string]interface{} +} + +type _EndpointDeviceDetails EndpointDeviceDetails + +// NewEndpointDeviceDetails instantiates a new EndpointDeviceDetails object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointDeviceDetails(pbmUuid string, name string, facts DeviceFactSnapshot, connectionsObj []DeviceConnection, policies []string, connections []string) *EndpointDeviceDetails { + this := EndpointDeviceDetails{} + this.PbmUuid = pbmUuid + this.Name = name + this.Facts = facts + this.ConnectionsObj = connectionsObj + this.Policies = policies + this.Connections = connections + return &this +} + +// NewEndpointDeviceDetailsWithDefaults instantiates a new EndpointDeviceDetails object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointDeviceDetailsWithDefaults() *EndpointDeviceDetails { + this := EndpointDeviceDetails{} + return &this +} + +// GetDeviceUuid returns the DeviceUuid field value if set, zero value otherwise. +func (o *EndpointDeviceDetails) GetDeviceUuid() string { + if o == nil || IsNil(o.DeviceUuid) { + var ret string + return ret + } + return *o.DeviceUuid +} + +// GetDeviceUuidOk returns a tuple with the DeviceUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetDeviceUuidOk() (*string, bool) { + if o == nil || IsNil(o.DeviceUuid) { + return nil, false + } + return o.DeviceUuid, true +} + +// HasDeviceUuid returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasDeviceUuid() bool { + if o != nil && !IsNil(o.DeviceUuid) { + return true + } + + return false +} + +// SetDeviceUuid gets a reference to the given string and assigns it to the DeviceUuid field. +func (o *EndpointDeviceDetails) SetDeviceUuid(v string) { + o.DeviceUuid = &v +} + +// GetPbmUuid returns the PbmUuid field value +func (o *EndpointDeviceDetails) GetPbmUuid() string { + if o == nil { + var ret string + return ret + } + + return o.PbmUuid +} + +// GetPbmUuidOk returns a tuple with the PbmUuid field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetPbmUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PbmUuid, true +} + +// SetPbmUuid sets field value +func (o *EndpointDeviceDetails) SetPbmUuid(v string) { + o.PbmUuid = v +} + +// GetName returns the Name field value +func (o *EndpointDeviceDetails) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointDeviceDetails) SetName(v string) { + o.Name = v +} + +// GetAccessGroup returns the AccessGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDeviceDetails) GetAccessGroup() string { + if o == nil || IsNil(o.AccessGroup.Get()) { + var ret string + return ret + } + return *o.AccessGroup.Get() +} + +// GetAccessGroupOk returns a tuple with the AccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDeviceDetails) GetAccessGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessGroup.Get(), o.AccessGroup.IsSet() +} + +// HasAccessGroup returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasAccessGroup() bool { + if o != nil && o.AccessGroup.IsSet() { + return true + } + + return false +} + +// SetAccessGroup gets a reference to the given NullableString and assigns it to the AccessGroup field. +func (o *EndpointDeviceDetails) SetAccessGroup(v string) { + o.AccessGroup.Set(&v) +} + +// SetAccessGroupNil sets the value for AccessGroup to be an explicit nil +func (o *EndpointDeviceDetails) SetAccessGroupNil() { + o.AccessGroup.Set(nil) +} + +// UnsetAccessGroup ensures that no value is present for AccessGroup, not even an explicit nil +func (o *EndpointDeviceDetails) UnsetAccessGroup() { + o.AccessGroup.Unset() +} + +// GetAccessGroupObj returns the AccessGroupObj field value if set, zero value otherwise. +func (o *EndpointDeviceDetails) GetAccessGroupObj() DeviceAccessGroup { + if o == nil || IsNil(o.AccessGroupObj) { + var ret DeviceAccessGroup + return ret + } + return *o.AccessGroupObj +} + +// GetAccessGroupObjOk returns a tuple with the AccessGroupObj field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetAccessGroupObjOk() (*DeviceAccessGroup, bool) { + if o == nil || IsNil(o.AccessGroupObj) { + return nil, false + } + return o.AccessGroupObj, true +} + +// HasAccessGroupObj returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasAccessGroupObj() bool { + if o != nil && !IsNil(o.AccessGroupObj) { + return true + } + + return false +} + +// SetAccessGroupObj gets a reference to the given DeviceAccessGroup and assigns it to the AccessGroupObj field. +func (o *EndpointDeviceDetails) SetAccessGroupObj(v DeviceAccessGroup) { + o.AccessGroupObj = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *EndpointDeviceDetails) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *EndpointDeviceDetails) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDeviceDetails) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDeviceDetails) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *EndpointDeviceDetails) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *EndpointDeviceDetails) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *EndpointDeviceDetails) UnsetExpires() { + o.Expires.Unset() +} + +// GetFacts returns the Facts field value +func (o *EndpointDeviceDetails) GetFacts() DeviceFactSnapshot { + if o == nil { + var ret DeviceFactSnapshot + return ret + } + + return o.Facts +} + +// GetFactsOk returns a tuple with the Facts field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetFactsOk() (*DeviceFactSnapshot, bool) { + if o == nil { + return nil, false + } + return &o.Facts, true +} + +// SetFacts sets field value +func (o *EndpointDeviceDetails) SetFacts(v DeviceFactSnapshot) { + o.Facts = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *EndpointDeviceDetails) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *EndpointDeviceDetails) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *EndpointDeviceDetails) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetConnectionsObj returns the ConnectionsObj field value +func (o *EndpointDeviceDetails) GetConnectionsObj() []DeviceConnection { + if o == nil { + var ret []DeviceConnection + return ret + } + + return o.ConnectionsObj +} + +// GetConnectionsObjOk returns a tuple with the ConnectionsObj field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetConnectionsObjOk() ([]DeviceConnection, bool) { + if o == nil { + return nil, false + } + return o.ConnectionsObj, true +} + +// SetConnectionsObj sets field value +func (o *EndpointDeviceDetails) SetConnectionsObj(v []DeviceConnection) { + o.ConnectionsObj = v +} + +// GetPolicies returns the Policies field value +func (o *EndpointDeviceDetails) GetPolicies() []string { + if o == nil { + var ret []string + return ret + } + + return o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetPoliciesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Policies, true +} + +// SetPolicies sets field value +func (o *EndpointDeviceDetails) SetPolicies(v []string) { + o.Policies = v +} + +// GetConnections returns the Connections field value +func (o *EndpointDeviceDetails) GetConnections() []string { + if o == nil { + var ret []string + return ret + } + + return o.Connections +} + +// GetConnectionsOk returns a tuple with the Connections field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceDetails) GetConnectionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Connections, true +} + +// SetConnections sets field value +func (o *EndpointDeviceDetails) SetConnections(v []string) { + o.Connections = v +} + +func (o EndpointDeviceDetails) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointDeviceDetails) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceUuid) { + toSerialize["device_uuid"] = o.DeviceUuid + } + toSerialize["pbm_uuid"] = o.PbmUuid + toSerialize["name"] = o.Name + if o.AccessGroup.IsSet() { + toSerialize["access_group"] = o.AccessGroup.Get() + } + if !IsNil(o.AccessGroupObj) { + toSerialize["access_group_obj"] = o.AccessGroupObj + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + toSerialize["facts"] = o.Facts + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + toSerialize["connections_obj"] = o.ConnectionsObj + toSerialize["policies"] = o.Policies + toSerialize["connections"] = o.Connections + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointDeviceDetails) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pbm_uuid", + "name", + "facts", + "connections_obj", + "policies", + "connections", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointDeviceDetails := _EndpointDeviceDetails{} + + err = json.Unmarshal(data, &varEndpointDeviceDetails) + + if err != nil { + return err + } + + *o = EndpointDeviceDetails(varEndpointDeviceDetails) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_uuid") + delete(additionalProperties, "pbm_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "access_group") + delete(additionalProperties, "access_group_obj") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + delete(additionalProperties, "facts") + delete(additionalProperties, "attributes") + delete(additionalProperties, "connections_obj") + delete(additionalProperties, "policies") + delete(additionalProperties, "connections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointDeviceDetails struct { + value *EndpointDeviceDetails + isSet bool +} + +func (v NullableEndpointDeviceDetails) Get() *EndpointDeviceDetails { + return v.value +} + +func (v *NullableEndpointDeviceDetails) Set(val *EndpointDeviceDetails) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointDeviceDetails) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointDeviceDetails) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointDeviceDetails(val *EndpointDeviceDetails) *NullableEndpointDeviceDetails { + return &NullableEndpointDeviceDetails{value: val, isSet: true} +} + +func (v NullableEndpointDeviceDetails) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointDeviceDetails) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_device_request.go b/packages/client-go/model_endpoint_device_request.go new file mode 100644 index 0000000000..2a843283f3 --- /dev/null +++ b/packages/client-go/model_endpoint_device_request.go @@ -0,0 +1,412 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EndpointDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointDeviceRequest{} + +// EndpointDeviceRequest struct for EndpointDeviceRequest +type EndpointDeviceRequest struct { + DeviceUuid *string `json:"device_uuid,omitempty"` + Name string `json:"name"` + AccessGroup NullableString `json:"access_group,omitempty"` + AccessGroupObj *DeviceAccessGroupRequest `json:"access_group_obj,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointDeviceRequest EndpointDeviceRequest + +// NewEndpointDeviceRequest instantiates a new EndpointDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointDeviceRequest(name string) *EndpointDeviceRequest { + this := EndpointDeviceRequest{} + this.Name = name + return &this +} + +// NewEndpointDeviceRequestWithDefaults instantiates a new EndpointDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointDeviceRequestWithDefaults() *EndpointDeviceRequest { + this := EndpointDeviceRequest{} + return &this +} + +// GetDeviceUuid returns the DeviceUuid field value if set, zero value otherwise. +func (o *EndpointDeviceRequest) GetDeviceUuid() string { + if o == nil || IsNil(o.DeviceUuid) { + var ret string + return ret + } + return *o.DeviceUuid +} + +// GetDeviceUuidOk returns a tuple with the DeviceUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceRequest) GetDeviceUuidOk() (*string, bool) { + if o == nil || IsNil(o.DeviceUuid) { + return nil, false + } + return o.DeviceUuid, true +} + +// HasDeviceUuid returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasDeviceUuid() bool { + if o != nil && !IsNil(o.DeviceUuid) { + return true + } + + return false +} + +// SetDeviceUuid gets a reference to the given string and assigns it to the DeviceUuid field. +func (o *EndpointDeviceRequest) SetDeviceUuid(v string) { + o.DeviceUuid = &v +} + +// GetName returns the Name field value +func (o *EndpointDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointDeviceRequest) SetName(v string) { + o.Name = v +} + +// GetAccessGroup returns the AccessGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDeviceRequest) GetAccessGroup() string { + if o == nil || IsNil(o.AccessGroup.Get()) { + var ret string + return ret + } + return *o.AccessGroup.Get() +} + +// GetAccessGroupOk returns a tuple with the AccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDeviceRequest) GetAccessGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessGroup.Get(), o.AccessGroup.IsSet() +} + +// HasAccessGroup returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasAccessGroup() bool { + if o != nil && o.AccessGroup.IsSet() { + return true + } + + return false +} + +// SetAccessGroup gets a reference to the given NullableString and assigns it to the AccessGroup field. +func (o *EndpointDeviceRequest) SetAccessGroup(v string) { + o.AccessGroup.Set(&v) +} + +// SetAccessGroupNil sets the value for AccessGroup to be an explicit nil +func (o *EndpointDeviceRequest) SetAccessGroupNil() { + o.AccessGroup.Set(nil) +} + +// UnsetAccessGroup ensures that no value is present for AccessGroup, not even an explicit nil +func (o *EndpointDeviceRequest) UnsetAccessGroup() { + o.AccessGroup.Unset() +} + +// GetAccessGroupObj returns the AccessGroupObj field value if set, zero value otherwise. +func (o *EndpointDeviceRequest) GetAccessGroupObj() DeviceAccessGroupRequest { + if o == nil || IsNil(o.AccessGroupObj) { + var ret DeviceAccessGroupRequest + return ret + } + return *o.AccessGroupObj +} + +// GetAccessGroupObjOk returns a tuple with the AccessGroupObj field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceRequest) GetAccessGroupObjOk() (*DeviceAccessGroupRequest, bool) { + if o == nil || IsNil(o.AccessGroupObj) { + return nil, false + } + return o.AccessGroupObj, true +} + +// HasAccessGroupObj returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasAccessGroupObj() bool { + if o != nil && !IsNil(o.AccessGroupObj) { + return true + } + + return false +} + +// SetAccessGroupObj gets a reference to the given DeviceAccessGroupRequest and assigns it to the AccessGroupObj field. +func (o *EndpointDeviceRequest) SetAccessGroupObj(v DeviceAccessGroupRequest) { + o.AccessGroupObj = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *EndpointDeviceRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *EndpointDeviceRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EndpointDeviceRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EndpointDeviceRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *EndpointDeviceRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *EndpointDeviceRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *EndpointDeviceRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *EndpointDeviceRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointDeviceRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *EndpointDeviceRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *EndpointDeviceRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o EndpointDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceUuid) { + toSerialize["device_uuid"] = o.DeviceUuid + } + toSerialize["name"] = o.Name + if o.AccessGroup.IsSet() { + toSerialize["access_group"] = o.AccessGroup.Get() + } + if !IsNil(o.AccessGroupObj) { + toSerialize["access_group_obj"] = o.AccessGroupObj + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointDeviceRequest := _EndpointDeviceRequest{} + + err = json.Unmarshal(data, &varEndpointDeviceRequest) + + if err != nil { + return err + } + + *o = EndpointDeviceRequest(varEndpointDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "access_group") + delete(additionalProperties, "access_group_obj") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointDeviceRequest struct { + value *EndpointDeviceRequest + isSet bool +} + +func (v NullableEndpointDeviceRequest) Get() *EndpointDeviceRequest { + return v.value +} + +func (v *NullableEndpointDeviceRequest) Set(val *EndpointDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointDeviceRequest(val *EndpointDeviceRequest) *NullableEndpointDeviceRequest { + return &NullableEndpointDeviceRequest{value: val, isSet: true} +} + +func (v NullableEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_request.go b/packages/client-go/model_endpoint_request.go new file mode 100644 index 0000000000..54dac10d2c --- /dev/null +++ b/packages/client-go/model_endpoint_request.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EndpointRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointRequest{} + +// EndpointRequest Endpoint Serializer +type EndpointRequest struct { + Name string `json:"name"` + Provider int32 `json:"provider"` + Protocol ProtocolEnum `json:"protocol"` + Host string `json:"host"` + Settings map[string]interface{} `json:"settings,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + AuthMode EndpointAuthModeEnum `json:"auth_mode"` + MaximumConnections *int32 `json:"maximum_connections,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointRequest EndpointRequest + +// NewEndpointRequest instantiates a new EndpointRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointRequest(name string, provider int32, protocol ProtocolEnum, host string, authMode EndpointAuthModeEnum) *EndpointRequest { + this := EndpointRequest{} + this.Name = name + this.Provider = provider + this.Protocol = protocol + this.Host = host + this.AuthMode = authMode + return &this +} + +// NewEndpointRequestWithDefaults instantiates a new EndpointRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointRequestWithDefaults() *EndpointRequest { + this := EndpointRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EndpointRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointRequest) SetName(v string) { + o.Name = v +} + +// GetProvider returns the Provider field value +func (o *EndpointRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *EndpointRequest) SetProvider(v int32) { + o.Provider = v +} + +// GetProtocol returns the Protocol field value +func (o *EndpointRequest) GetProtocol() ProtocolEnum { + if o == nil { + var ret ProtocolEnum + return ret + } + + return o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetProtocolOk() (*ProtocolEnum, bool) { + if o == nil { + return nil, false + } + return &o.Protocol, true +} + +// SetProtocol sets field value +func (o *EndpointRequest) SetProtocol(v ProtocolEnum) { + o.Protocol = v +} + +// GetHost returns the Host field value +func (o *EndpointRequest) GetHost() string { + if o == nil { + var ret string + return ret + } + + return o.Host +} + +// GetHostOk returns a tuple with the Host field value +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Host, true +} + +// SetHost sets field value +func (o *EndpointRequest) SetHost(v string) { + o.Host = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *EndpointRequest) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *EndpointRequest) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *EndpointRequest) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *EndpointRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *EndpointRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *EndpointRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetAuthMode returns the AuthMode field value +func (o *EndpointRequest) GetAuthMode() EndpointAuthModeEnum { + if o == nil { + var ret EndpointAuthModeEnum + return ret + } + + return o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetAuthModeOk() (*EndpointAuthModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.AuthMode, true +} + +// SetAuthMode sets field value +func (o *EndpointRequest) SetAuthMode(v EndpointAuthModeEnum) { + o.AuthMode = v +} + +// GetMaximumConnections returns the MaximumConnections field value if set, zero value otherwise. +func (o *EndpointRequest) GetMaximumConnections() int32 { + if o == nil || IsNil(o.MaximumConnections) { + var ret int32 + return ret + } + return *o.MaximumConnections +} + +// GetMaximumConnectionsOk returns a tuple with the MaximumConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointRequest) GetMaximumConnectionsOk() (*int32, bool) { + if o == nil || IsNil(o.MaximumConnections) { + return nil, false + } + return o.MaximumConnections, true +} + +// HasMaximumConnections returns a boolean if a field has been set. +func (o *EndpointRequest) HasMaximumConnections() bool { + if o != nil && !IsNil(o.MaximumConnections) { + return true + } + + return false +} + +// SetMaximumConnections gets a reference to the given int32 and assigns it to the MaximumConnections field. +func (o *EndpointRequest) SetMaximumConnections(v int32) { + o.MaximumConnections = &v +} + +func (o EndpointRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["provider"] = o.Provider + toSerialize["protocol"] = o.Protocol + toSerialize["host"] = o.Host + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["auth_mode"] = o.AuthMode + if !IsNil(o.MaximumConnections) { + toSerialize["maximum_connections"] = o.MaximumConnections + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "provider", + "protocol", + "host", + "auth_mode", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointRequest := _EndpointRequest{} + + err = json.Unmarshal(data, &varEndpointRequest) + + if err != nil { + return err + } + + *o = EndpointRequest(varEndpointRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "provider") + delete(additionalProperties, "protocol") + delete(additionalProperties, "host") + delete(additionalProperties, "settings") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "maximum_connections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointRequest struct { + value *EndpointRequest + isSet bool +} + +func (v NullableEndpointRequest) Get() *EndpointRequest { + return v.value +} + +func (v *NullableEndpointRequest) Set(val *EndpointRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointRequest(val *EndpointRequest) *NullableEndpointRequest { + return &NullableEndpointRequest{value: val, isSet: true} +} + +func (v NullableEndpointRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_stage.go b/packages/client-go/model_endpoint_stage.go new file mode 100644 index 0000000000..4ce7d66872 --- /dev/null +++ b/packages/client-go/model_endpoint_stage.go @@ -0,0 +1,440 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EndpointStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointStage{} + +// EndpointStage EndpointStage Serializer +type EndpointStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + Connector string `json:"connector"` + ConnectorObj Connector `json:"connector_obj"` + Mode *StageModeEnum `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointStage EndpointStage + +// NewEndpointStage instantiates a new EndpointStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, connector string, connectorObj Connector) *EndpointStage { + this := EndpointStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Connector = connector + this.ConnectorObj = connectorObj + return &this +} + +// NewEndpointStageWithDefaults instantiates a new EndpointStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointStageWithDefaults() *EndpointStage { + this := EndpointStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *EndpointStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *EndpointStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *EndpointStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *EndpointStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *EndpointStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *EndpointStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *EndpointStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *EndpointStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *EndpointStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *EndpointStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *EndpointStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *EndpointStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *EndpointStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetConnector returns the Connector field value +func (o *EndpointStage) GetConnector() string { + if o == nil { + var ret string + return ret + } + + return o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connector, true +} + +// SetConnector sets field value +func (o *EndpointStage) SetConnector(v string) { + o.Connector = v +} + +// GetConnectorObj returns the ConnectorObj field value +func (o *EndpointStage) GetConnectorObj() Connector { + if o == nil { + var ret Connector + return ret + } + + return o.ConnectorObj +} + +// GetConnectorObjOk returns a tuple with the ConnectorObj field value +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetConnectorObjOk() (*Connector, bool) { + if o == nil { + return nil, false + } + return &o.ConnectorObj, true +} + +// SetConnectorObj sets field value +func (o *EndpointStage) SetConnectorObj(v Connector) { + o.ConnectorObj = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *EndpointStage) GetMode() StageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret StageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointStage) GetModeOk() (*StageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *EndpointStage) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given StageModeEnum and assigns it to the Mode field. +func (o *EndpointStage) SetMode(v StageModeEnum) { + o.Mode = &v +} + +func (o EndpointStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["connector"] = o.Connector + toSerialize["connector_obj"] = o.ConnectorObj + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "connector", + "connector_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointStage := _EndpointStage{} + + err = json.Unmarshal(data, &varEndpointStage) + + if err != nil { + return err + } + + *o = EndpointStage(varEndpointStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "connector") + delete(additionalProperties, "connector_obj") + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointStage struct { + value *EndpointStage + isSet bool +} + +func (v NullableEndpointStage) Get() *EndpointStage { + return v.value +} + +func (v *NullableEndpointStage) Set(val *EndpointStage) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointStage) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointStage(val *EndpointStage) *NullableEndpointStage { + return &NullableEndpointStage{value: val, isSet: true} +} + +func (v NullableEndpointStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_endpoint_stage_request.go b/packages/client-go/model_endpoint_stage_request.go new file mode 100644 index 0000000000..c524a154c0 --- /dev/null +++ b/packages/client-go/model_endpoint_stage_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EndpointStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EndpointStageRequest{} + +// EndpointStageRequest EndpointStage Serializer +type EndpointStageRequest struct { + Name string `json:"name"` + Connector string `json:"connector"` + Mode *StageModeEnum `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EndpointStageRequest EndpointStageRequest + +// NewEndpointStageRequest instantiates a new EndpointStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEndpointStageRequest(name string, connector string) *EndpointStageRequest { + this := EndpointStageRequest{} + this.Name = name + this.Connector = connector + return &this +} + +// NewEndpointStageRequestWithDefaults instantiates a new EndpointStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEndpointStageRequestWithDefaults() *EndpointStageRequest { + this := EndpointStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EndpointStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EndpointStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EndpointStageRequest) SetName(v string) { + o.Name = v +} + +// GetConnector returns the Connector field value +func (o *EndpointStageRequest) GetConnector() string { + if o == nil { + var ret string + return ret + } + + return o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +func (o *EndpointStageRequest) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connector, true +} + +// SetConnector sets field value +func (o *EndpointStageRequest) SetConnector(v string) { + o.Connector = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *EndpointStageRequest) GetMode() StageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret StageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EndpointStageRequest) GetModeOk() (*StageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *EndpointStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given StageModeEnum and assigns it to the Mode field. +func (o *EndpointStageRequest) SetMode(v StageModeEnum) { + o.Mode = &v +} + +func (o EndpointStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EndpointStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["connector"] = o.Connector + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EndpointStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "connector", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEndpointStageRequest := _EndpointStageRequest{} + + err = json.Unmarshal(data, &varEndpointStageRequest) + + if err != nil { + return err + } + + *o = EndpointStageRequest(varEndpointStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "connector") + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEndpointStageRequest struct { + value *EndpointStageRequest + isSet bool +} + +func (v NullableEndpointStageRequest) Get() *EndpointStageRequest { + return v.value +} + +func (v *NullableEndpointStageRequest) Set(val *EndpointStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEndpointStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEndpointStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEndpointStageRequest(val *EndpointStageRequest) *NullableEndpointStageRequest { + return &NullableEndpointStageRequest{value: val, isSet: true} +} + +func (v NullableEndpointStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEndpointStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_enroll_request.go b/packages/client-go/model_enroll_request.go new file mode 100644 index 0000000000..5b3cab4696 --- /dev/null +++ b/packages/client-go/model_enroll_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EnrollRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnrollRequest{} + +// EnrollRequest Base serializer class which doesn't implement create/update methods +type EnrollRequest struct { + DeviceSerial string `json:"device_serial"` + DeviceName string `json:"device_name"` + AdditionalProperties map[string]interface{} +} + +type _EnrollRequest EnrollRequest + +// NewEnrollRequest instantiates a new EnrollRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnrollRequest(deviceSerial string, deviceName string) *EnrollRequest { + this := EnrollRequest{} + this.DeviceSerial = deviceSerial + this.DeviceName = deviceName + return &this +} + +// NewEnrollRequestWithDefaults instantiates a new EnrollRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnrollRequestWithDefaults() *EnrollRequest { + this := EnrollRequest{} + return &this +} + +// GetDeviceSerial returns the DeviceSerial field value +func (o *EnrollRequest) GetDeviceSerial() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceSerial +} + +// GetDeviceSerialOk returns a tuple with the DeviceSerial field value +// and a boolean to check if the value has been set. +func (o *EnrollRequest) GetDeviceSerialOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceSerial, true +} + +// SetDeviceSerial sets field value +func (o *EnrollRequest) SetDeviceSerial(v string) { + o.DeviceSerial = v +} + +// GetDeviceName returns the DeviceName field value +func (o *EnrollRequest) GetDeviceName() string { + if o == nil { + var ret string + return ret + } + + return o.DeviceName +} + +// GetDeviceNameOk returns a tuple with the DeviceName field value +// and a boolean to check if the value has been set. +func (o *EnrollRequest) GetDeviceNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DeviceName, true +} + +// SetDeviceName sets field value +func (o *EnrollRequest) SetDeviceName(v string) { + o.DeviceName = v +} + +func (o EnrollRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnrollRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["device_serial"] = o.DeviceSerial + toSerialize["device_name"] = o.DeviceName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnrollRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "device_serial", + "device_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnrollRequest := _EnrollRequest{} + + err = json.Unmarshal(data, &varEnrollRequest) + + if err != nil { + return err + } + + *o = EnrollRequest(varEnrollRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_serial") + delete(additionalProperties, "device_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnrollRequest struct { + value *EnrollRequest + isSet bool +} + +func (v NullableEnrollRequest) Get() *EnrollRequest { + return v.value +} + +func (v *NullableEnrollRequest) Set(val *EnrollRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEnrollRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEnrollRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnrollRequest(val *EnrollRequest) *NullableEnrollRequest { + return &NullableEnrollRequest{value: val, isSet: true} +} + +func (v NullableEnrollRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnrollRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_enrollment_token.go b/packages/client-go/model_enrollment_token.go new file mode 100644 index 0000000000..7b5fcc4c75 --- /dev/null +++ b/packages/client-go/model_enrollment_token.go @@ -0,0 +1,388 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EnrollmentToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnrollmentToken{} + +// EnrollmentToken struct for EnrollmentToken +type EnrollmentToken struct { + TokenUuid string `json:"token_uuid"` + DeviceGroup NullableString `json:"device_group,omitempty"` + DeviceGroupObj DeviceAccessGroup `json:"device_group_obj"` + Connector string `json:"connector"` + Name string `json:"name"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnrollmentToken EnrollmentToken + +// NewEnrollmentToken instantiates a new EnrollmentToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnrollmentToken(tokenUuid string, deviceGroupObj DeviceAccessGroup, connector string, name string) *EnrollmentToken { + this := EnrollmentToken{} + this.TokenUuid = tokenUuid + this.DeviceGroupObj = deviceGroupObj + this.Connector = connector + this.Name = name + return &this +} + +// NewEnrollmentTokenWithDefaults instantiates a new EnrollmentToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnrollmentTokenWithDefaults() *EnrollmentToken { + this := EnrollmentToken{} + return &this +} + +// GetTokenUuid returns the TokenUuid field value +func (o *EnrollmentToken) GetTokenUuid() string { + if o == nil { + var ret string + return ret + } + + return o.TokenUuid +} + +// GetTokenUuidOk returns a tuple with the TokenUuid field value +// and a boolean to check if the value has been set. +func (o *EnrollmentToken) GetTokenUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenUuid, true +} + +// SetTokenUuid sets field value +func (o *EnrollmentToken) SetTokenUuid(v string) { + o.TokenUuid = v +} + +// GetDeviceGroup returns the DeviceGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnrollmentToken) GetDeviceGroup() string { + if o == nil || IsNil(o.DeviceGroup.Get()) { + var ret string + return ret + } + return *o.DeviceGroup.Get() +} + +// GetDeviceGroupOk returns a tuple with the DeviceGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnrollmentToken) GetDeviceGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeviceGroup.Get(), o.DeviceGroup.IsSet() +} + +// HasDeviceGroup returns a boolean if a field has been set. +func (o *EnrollmentToken) HasDeviceGroup() bool { + if o != nil && o.DeviceGroup.IsSet() { + return true + } + + return false +} + +// SetDeviceGroup gets a reference to the given NullableString and assigns it to the DeviceGroup field. +func (o *EnrollmentToken) SetDeviceGroup(v string) { + o.DeviceGroup.Set(&v) +} + +// SetDeviceGroupNil sets the value for DeviceGroup to be an explicit nil +func (o *EnrollmentToken) SetDeviceGroupNil() { + o.DeviceGroup.Set(nil) +} + +// UnsetDeviceGroup ensures that no value is present for DeviceGroup, not even an explicit nil +func (o *EnrollmentToken) UnsetDeviceGroup() { + o.DeviceGroup.Unset() +} + +// GetDeviceGroupObj returns the DeviceGroupObj field value +func (o *EnrollmentToken) GetDeviceGroupObj() DeviceAccessGroup { + if o == nil { + var ret DeviceAccessGroup + return ret + } + + return o.DeviceGroupObj +} + +// GetDeviceGroupObjOk returns a tuple with the DeviceGroupObj field value +// and a boolean to check if the value has been set. +func (o *EnrollmentToken) GetDeviceGroupObjOk() (*DeviceAccessGroup, bool) { + if o == nil { + return nil, false + } + return &o.DeviceGroupObj, true +} + +// SetDeviceGroupObj sets field value +func (o *EnrollmentToken) SetDeviceGroupObj(v DeviceAccessGroup) { + o.DeviceGroupObj = v +} + +// GetConnector returns the Connector field value +func (o *EnrollmentToken) GetConnector() string { + if o == nil { + var ret string + return ret + } + + return o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +func (o *EnrollmentToken) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connector, true +} + +// SetConnector sets field value +func (o *EnrollmentToken) SetConnector(v string) { + o.Connector = v +} + +// GetName returns the Name field value +func (o *EnrollmentToken) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EnrollmentToken) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EnrollmentToken) SetName(v string) { + o.Name = v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *EnrollmentToken) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnrollmentToken) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *EnrollmentToken) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *EnrollmentToken) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnrollmentToken) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnrollmentToken) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *EnrollmentToken) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *EnrollmentToken) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *EnrollmentToken) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *EnrollmentToken) UnsetExpires() { + o.Expires.Unset() +} + +func (o EnrollmentToken) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnrollmentToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token_uuid"] = o.TokenUuid + if o.DeviceGroup.IsSet() { + toSerialize["device_group"] = o.DeviceGroup.Get() + } + toSerialize["device_group_obj"] = o.DeviceGroupObj + toSerialize["connector"] = o.Connector + toSerialize["name"] = o.Name + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnrollmentToken) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token_uuid", + "device_group_obj", + "connector", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnrollmentToken := _EnrollmentToken{} + + err = json.Unmarshal(data, &varEnrollmentToken) + + if err != nil { + return err + } + + *o = EnrollmentToken(varEnrollmentToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token_uuid") + delete(additionalProperties, "device_group") + delete(additionalProperties, "device_group_obj") + delete(additionalProperties, "connector") + delete(additionalProperties, "name") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnrollmentToken struct { + value *EnrollmentToken + isSet bool +} + +func (v NullableEnrollmentToken) Get() *EnrollmentToken { + return v.value +} + +func (v *NullableEnrollmentToken) Set(val *EnrollmentToken) { + v.value = val + v.isSet = true +} + +func (v NullableEnrollmentToken) IsSet() bool { + return v.isSet +} + +func (v *NullableEnrollmentToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnrollmentToken(val *EnrollmentToken) *NullableEnrollmentToken { + return &NullableEnrollmentToken{value: val, isSet: true} +} + +func (v NullableEnrollmentToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnrollmentToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_enrollment_token_request.go b/packages/client-go/model_enrollment_token_request.go new file mode 100644 index 0000000000..bcb46d4f8b --- /dev/null +++ b/packages/client-go/model_enrollment_token_request.go @@ -0,0 +1,330 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EnrollmentTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnrollmentTokenRequest{} + +// EnrollmentTokenRequest struct for EnrollmentTokenRequest +type EnrollmentTokenRequest struct { + DeviceGroup NullableString `json:"device_group,omitempty"` + Connector string `json:"connector"` + Name string `json:"name"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EnrollmentTokenRequest EnrollmentTokenRequest + +// NewEnrollmentTokenRequest instantiates a new EnrollmentTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEnrollmentTokenRequest(connector string, name string) *EnrollmentTokenRequest { + this := EnrollmentTokenRequest{} + this.Connector = connector + this.Name = name + return &this +} + +// NewEnrollmentTokenRequestWithDefaults instantiates a new EnrollmentTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEnrollmentTokenRequestWithDefaults() *EnrollmentTokenRequest { + this := EnrollmentTokenRequest{} + return &this +} + +// GetDeviceGroup returns the DeviceGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnrollmentTokenRequest) GetDeviceGroup() string { + if o == nil || IsNil(o.DeviceGroup.Get()) { + var ret string + return ret + } + return *o.DeviceGroup.Get() +} + +// GetDeviceGroupOk returns a tuple with the DeviceGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnrollmentTokenRequest) GetDeviceGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeviceGroup.Get(), o.DeviceGroup.IsSet() +} + +// HasDeviceGroup returns a boolean if a field has been set. +func (o *EnrollmentTokenRequest) HasDeviceGroup() bool { + if o != nil && o.DeviceGroup.IsSet() { + return true + } + + return false +} + +// SetDeviceGroup gets a reference to the given NullableString and assigns it to the DeviceGroup field. +func (o *EnrollmentTokenRequest) SetDeviceGroup(v string) { + o.DeviceGroup.Set(&v) +} + +// SetDeviceGroupNil sets the value for DeviceGroup to be an explicit nil +func (o *EnrollmentTokenRequest) SetDeviceGroupNil() { + o.DeviceGroup.Set(nil) +} + +// UnsetDeviceGroup ensures that no value is present for DeviceGroup, not even an explicit nil +func (o *EnrollmentTokenRequest) UnsetDeviceGroup() { + o.DeviceGroup.Unset() +} + +// GetConnector returns the Connector field value +func (o *EnrollmentTokenRequest) GetConnector() string { + if o == nil { + var ret string + return ret + } + + return o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value +// and a boolean to check if the value has been set. +func (o *EnrollmentTokenRequest) GetConnectorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Connector, true +} + +// SetConnector sets field value +func (o *EnrollmentTokenRequest) SetConnector(v string) { + o.Connector = v +} + +// GetName returns the Name field value +func (o *EnrollmentTokenRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EnrollmentTokenRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EnrollmentTokenRequest) SetName(v string) { + o.Name = v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *EnrollmentTokenRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnrollmentTokenRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *EnrollmentTokenRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *EnrollmentTokenRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EnrollmentTokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EnrollmentTokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *EnrollmentTokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *EnrollmentTokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *EnrollmentTokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *EnrollmentTokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +func (o EnrollmentTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnrollmentTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceGroup.IsSet() { + toSerialize["device_group"] = o.DeviceGroup.Get() + } + toSerialize["connector"] = o.Connector + toSerialize["name"] = o.Name + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EnrollmentTokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "connector", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEnrollmentTokenRequest := _EnrollmentTokenRequest{} + + err = json.Unmarshal(data, &varEnrollmentTokenRequest) + + if err != nil { + return err + } + + *o = EnrollmentTokenRequest(varEnrollmentTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_group") + delete(additionalProperties, "connector") + delete(additionalProperties, "name") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEnrollmentTokenRequest struct { + value *EnrollmentTokenRequest + isSet bool +} + +func (v NullableEnrollmentTokenRequest) Get() *EnrollmentTokenRequest { + return v.value +} + +func (v *NullableEnrollmentTokenRequest) Set(val *EnrollmentTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEnrollmentTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEnrollmentTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnrollmentTokenRequest(val *EnrollmentTokenRequest) *NullableEnrollmentTokenRequest { + return &NullableEnrollmentTokenRequest{value: val, isSet: true} +} + +func (v NullableEnrollmentTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnrollmentTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_error_detail.go b/packages/client-go/model_error_detail.go new file mode 100644 index 0000000000..ba76914233 --- /dev/null +++ b/packages/client-go/model_error_detail.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ErrorDetail type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorDetail{} + +// ErrorDetail Serializer for rest_framework's error messages +type ErrorDetail struct { + String string `json:"string"` + Code string `json:"code"` + AdditionalProperties map[string]interface{} +} + +type _ErrorDetail ErrorDetail + +// NewErrorDetail instantiates a new ErrorDetail object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorDetail(string_ string, code string) *ErrorDetail { + this := ErrorDetail{} + this.String = string_ + this.Code = code + return &this +} + +// NewErrorDetailWithDefaults instantiates a new ErrorDetail object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorDetailWithDefaults() *ErrorDetail { + this := ErrorDetail{} + return &this +} + +// GetString returns the String field value +func (o *ErrorDetail) GetString() string { + if o == nil { + var ret string + return ret + } + + return o.String +} + +// GetStringOk returns a tuple with the String field value +// and a boolean to check if the value has been set. +func (o *ErrorDetail) GetStringOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.String, true +} + +// SetString sets field value +func (o *ErrorDetail) SetString(v string) { + o.String = v +} + +// GetCode returns the Code field value +func (o *ErrorDetail) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *ErrorDetail) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ErrorDetail) SetCode(v string) { + o.Code = v +} + +func (o ErrorDetail) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorDetail) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["string"] = o.String + toSerialize["code"] = o.Code + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ErrorDetail) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "string", + "code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorDetail := _ErrorDetail{} + + err = json.Unmarshal(data, &varErrorDetail) + + if err != nil { + return err + } + + *o = ErrorDetail(varErrorDetail) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "string") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableErrorDetail struct { + value *ErrorDetail + isSet bool +} + +func (v NullableErrorDetail) Get() *ErrorDetail { + return v.value +} + +func (v *NullableErrorDetail) Set(val *ErrorDetail) { + v.value = val + v.isSet = true +} + +func (v NullableErrorDetail) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorDetail) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorDetail(val *ErrorDetail) *NullableErrorDetail { + return &NullableErrorDetail{value: val, isSet: true} +} + +func (v NullableErrorDetail) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorDetail) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_error_reporting_config.go b/packages/client-go/model_error_reporting_config.go new file mode 100644 index 0000000000..afb927fc4c --- /dev/null +++ b/packages/client-go/model_error_reporting_config.go @@ -0,0 +1,283 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ErrorReportingConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorReportingConfig{} + +// ErrorReportingConfig Config for error reporting +type ErrorReportingConfig struct { + Enabled bool `json:"enabled"` + SentryDsn string `json:"sentry_dsn"` + Environment string `json:"environment"` + SendPii bool `json:"send_pii"` + TracesSampleRate float64 `json:"traces_sample_rate"` + AdditionalProperties map[string]interface{} +} + +type _ErrorReportingConfig ErrorReportingConfig + +// NewErrorReportingConfig instantiates a new ErrorReportingConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewErrorReportingConfig(enabled bool, sentryDsn string, environment string, sendPii bool, tracesSampleRate float64) *ErrorReportingConfig { + this := ErrorReportingConfig{} + this.Enabled = enabled + this.SentryDsn = sentryDsn + this.Environment = environment + this.SendPii = sendPii + this.TracesSampleRate = tracesSampleRate + return &this +} + +// NewErrorReportingConfigWithDefaults instantiates a new ErrorReportingConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorReportingConfigWithDefaults() *ErrorReportingConfig { + this := ErrorReportingConfig{} + return &this +} + +// GetEnabled returns the Enabled field value +func (o *ErrorReportingConfig) GetEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *ErrorReportingConfig) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Enabled, true +} + +// SetEnabled sets field value +func (o *ErrorReportingConfig) SetEnabled(v bool) { + o.Enabled = v +} + +// GetSentryDsn returns the SentryDsn field value +func (o *ErrorReportingConfig) GetSentryDsn() string { + if o == nil { + var ret string + return ret + } + + return o.SentryDsn +} + +// GetSentryDsnOk returns a tuple with the SentryDsn field value +// and a boolean to check if the value has been set. +func (o *ErrorReportingConfig) GetSentryDsnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SentryDsn, true +} + +// SetSentryDsn sets field value +func (o *ErrorReportingConfig) SetSentryDsn(v string) { + o.SentryDsn = v +} + +// GetEnvironment returns the Environment field value +func (o *ErrorReportingConfig) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *ErrorReportingConfig) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *ErrorReportingConfig) SetEnvironment(v string) { + o.Environment = v +} + +// GetSendPii returns the SendPii field value +func (o *ErrorReportingConfig) GetSendPii() bool { + if o == nil { + var ret bool + return ret + } + + return o.SendPii +} + +// GetSendPiiOk returns a tuple with the SendPii field value +// and a boolean to check if the value has been set. +func (o *ErrorReportingConfig) GetSendPiiOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.SendPii, true +} + +// SetSendPii sets field value +func (o *ErrorReportingConfig) SetSendPii(v bool) { + o.SendPii = v +} + +// GetTracesSampleRate returns the TracesSampleRate field value +func (o *ErrorReportingConfig) GetTracesSampleRate() float64 { + if o == nil { + var ret float64 + return ret + } + + return o.TracesSampleRate +} + +// GetTracesSampleRateOk returns a tuple with the TracesSampleRate field value +// and a boolean to check if the value has been set. +func (o *ErrorReportingConfig) GetTracesSampleRateOk() (*float64, bool) { + if o == nil { + return nil, false + } + return &o.TracesSampleRate, true +} + +// SetTracesSampleRate sets field value +func (o *ErrorReportingConfig) SetTracesSampleRate(v float64) { + o.TracesSampleRate = v +} + +func (o ErrorReportingConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorReportingConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["enabled"] = o.Enabled + toSerialize["sentry_dsn"] = o.SentryDsn + toSerialize["environment"] = o.Environment + toSerialize["send_pii"] = o.SendPii + toSerialize["traces_sample_rate"] = o.TracesSampleRate + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ErrorReportingConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "sentry_dsn", + "environment", + "send_pii", + "traces_sample_rate", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorReportingConfig := _ErrorReportingConfig{} + + err = json.Unmarshal(data, &varErrorReportingConfig) + + if err != nil { + return err + } + + *o = ErrorReportingConfig(varErrorReportingConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "enabled") + delete(additionalProperties, "sentry_dsn") + delete(additionalProperties, "environment") + delete(additionalProperties, "send_pii") + delete(additionalProperties, "traces_sample_rate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableErrorReportingConfig struct { + value *ErrorReportingConfig + isSet bool +} + +func (v NullableErrorReportingConfig) Get() *ErrorReportingConfig { + return v.value +} + +func (v *NullableErrorReportingConfig) Set(val *ErrorReportingConfig) { + v.value = val + v.isSet = true +} + +func (v NullableErrorReportingConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorReportingConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorReportingConfig(val *ErrorReportingConfig) *NullableErrorReportingConfig { + return &NullableErrorReportingConfig{value: val, isSet: true} +} + +func (v NullableErrorReportingConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorReportingConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event.go b/packages/client-go/model_event.go new file mode 100644 index 0000000000..618ee731ba --- /dev/null +++ b/packages/client-go/model_event.go @@ -0,0 +1,451 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Event type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Event{} + +// Event Event Serializer +type Event struct { + Pk string `json:"pk"` + User map[string]interface{} `json:"user,omitempty"` + Action EventActions `json:"action"` + App string `json:"app"` + Context map[string]interface{} `json:"context,omitempty"` + ClientIp NullableString `json:"client_ip,omitempty"` + Created time.Time `json:"created"` + Expires *time.Time `json:"expires,omitempty"` + Brand map[string]interface{} `json:"brand,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Event Event + +// NewEvent instantiates a new Event object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEvent(pk string, action EventActions, app string, created time.Time) *Event { + this := Event{} + this.Pk = pk + this.Action = action + this.App = app + this.Created = created + return &this +} + +// NewEventWithDefaults instantiates a new Event object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventWithDefaults() *Event { + this := Event{} + return &this +} + +// GetPk returns the Pk field value +func (o *Event) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Event) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Event) SetPk(v string) { + o.Pk = v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *Event) GetUser() map[string]interface{} { + if o == nil || IsNil(o.User) { + var ret map[string]interface{} + return ret + } + return o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetUserOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.User) { + return map[string]interface{}{}, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *Event) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given map[string]interface{} and assigns it to the User field. +func (o *Event) SetUser(v map[string]interface{}) { + o.User = v +} + +// GetAction returns the Action field value +func (o *Event) GetAction() EventActions { + if o == nil { + var ret EventActions + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *Event) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *Event) SetAction(v EventActions) { + o.Action = v +} + +// GetApp returns the App field value +func (o *Event) GetApp() string { + if o == nil { + var ret string + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *Event) GetAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *Event) SetApp(v string) { + o.App = v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *Event) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *Event) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *Event) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Event) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Event) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *Event) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *Event) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *Event) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *Event) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetCreated returns the Created field value +func (o *Event) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Event) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Event) SetCreated(v time.Time) { + o.Created = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *Event) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *Event) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *Event) SetExpires(v time.Time) { + o.Expires = &v +} + +// GetBrand returns the Brand field value if set, zero value otherwise. +func (o *Event) GetBrand() map[string]interface{} { + if o == nil || IsNil(o.Brand) { + var ret map[string]interface{} + return ret + } + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Event) GetBrandOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Brand) { + return map[string]interface{}{}, false + } + return o.Brand, true +} + +// HasBrand returns a boolean if a field has been set. +func (o *Event) HasBrand() bool { + if o != nil && !IsNil(o.Brand) { + return true + } + + return false +} + +// SetBrand gets a reference to the given map[string]interface{} and assigns it to the Brand field. +func (o *Event) SetBrand(v map[string]interface{}) { + o.Brand = v +} + +func (o Event) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Event) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + toSerialize["action"] = o.Action + toSerialize["app"] = o.App + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + toSerialize["created"] = o.Created + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + if !IsNil(o.Brand) { + toSerialize["brand"] = o.Brand + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Event) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "action", + "app", + "created", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEvent := _Event{} + + err = json.Unmarshal(data, &varEvent) + + if err != nil { + return err + } + + *o = Event(varEvent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "action") + delete(additionalProperties, "app") + delete(additionalProperties, "context") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "created") + delete(additionalProperties, "expires") + delete(additionalProperties, "brand") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEvent struct { + value *Event + isSet bool +} + +func (v NullableEvent) Get() *Event { + return v.value +} + +func (v *NullableEvent) Set(val *Event) { + v.value = val + v.isSet = true +} + +func (v NullableEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEvent(val *Event) *NullableEvent { + return &NullableEvent{value: val, isSet: true} +} + +func (v NullableEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_actions.go b/packages/client-go/model_event_actions.go new file mode 100644 index 0000000000..48360f8fa0 --- /dev/null +++ b/packages/client-go/model_event_actions.go @@ -0,0 +1,173 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// EventActions the model 'EventActions' +type EventActions string + +// List of EventActions +const ( + EVENTACTIONS_LOGIN EventActions = "login" + EVENTACTIONS_LOGIN_FAILED EventActions = "login_failed" + EVENTACTIONS_LOGOUT EventActions = "logout" + EVENTACTIONS_USER_WRITE EventActions = "user_write" + EVENTACTIONS_SUSPICIOUS_REQUEST EventActions = "suspicious_request" + EVENTACTIONS_PASSWORD_SET EventActions = "password_set" + EVENTACTIONS_SECRET_VIEW EventActions = "secret_view" + EVENTACTIONS_SECRET_ROTATE EventActions = "secret_rotate" + EVENTACTIONS_INVITATION_USED EventActions = "invitation_used" + EVENTACTIONS_AUTHORIZE_APPLICATION EventActions = "authorize_application" + EVENTACTIONS_SOURCE_LINKED EventActions = "source_linked" + EVENTACTIONS_IMPERSONATION_STARTED EventActions = "impersonation_started" + EVENTACTIONS_IMPERSONATION_ENDED EventActions = "impersonation_ended" + EVENTACTIONS_FLOW_EXECUTION EventActions = "flow_execution" + EVENTACTIONS_POLICY_EXECUTION EventActions = "policy_execution" + EVENTACTIONS_POLICY_EXCEPTION EventActions = "policy_exception" + EVENTACTIONS_PROPERTY_MAPPING_EXCEPTION EventActions = "property_mapping_exception" + EVENTACTIONS_SYSTEM_TASK_EXECUTION EventActions = "system_task_execution" + EVENTACTIONS_SYSTEM_TASK_EXCEPTION EventActions = "system_task_exception" + EVENTACTIONS_SYSTEM_EXCEPTION EventActions = "system_exception" + EVENTACTIONS_CONFIGURATION_ERROR EventActions = "configuration_error" + EVENTACTIONS_CONFIGURATION_WARNING EventActions = "configuration_warning" + EVENTACTIONS_MODEL_CREATED EventActions = "model_created" + EVENTACTIONS_MODEL_UPDATED EventActions = "model_updated" + EVENTACTIONS_MODEL_DELETED EventActions = "model_deleted" + EVENTACTIONS_EMAIL_SENT EventActions = "email_sent" + EVENTACTIONS_UPDATE_AVAILABLE EventActions = "update_available" + EVENTACTIONS_EXPORT_READY EventActions = "export_ready" + EVENTACTIONS_REVIEW_INITIATED EventActions = "review_initiated" + EVENTACTIONS_REVIEW_OVERDUE EventActions = "review_overdue" + EVENTACTIONS_REVIEW_ATTESTED EventActions = "review_attested" + EVENTACTIONS_REVIEW_COMPLETED EventActions = "review_completed" + EVENTACTIONS_CUSTOM EventActions = "custom_" +) + +// All allowed values of EventActions enum +var AllowedEventActionsEnumValues = []EventActions{ + "login", + "login_failed", + "logout", + "user_write", + "suspicious_request", + "password_set", + "secret_view", + "secret_rotate", + "invitation_used", + "authorize_application", + "source_linked", + "impersonation_started", + "impersonation_ended", + "flow_execution", + "policy_execution", + "policy_exception", + "property_mapping_exception", + "system_task_execution", + "system_task_exception", + "system_exception", + "configuration_error", + "configuration_warning", + "model_created", + "model_updated", + "model_deleted", + "email_sent", + "update_available", + "export_ready", + "review_initiated", + "review_overdue", + "review_attested", + "review_completed", + "custom_", +} + +func (v *EventActions) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EventActions(value) + for _, existing := range AllowedEventActionsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EventActions", value) +} + +// NewEventActionsFromValue returns a pointer to a valid EventActions +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEventActionsFromValue(v string) (*EventActions, error) { + ev := EventActions(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EventActions: valid values are %v", v, AllowedEventActionsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EventActions) IsValid() bool { + for _, existing := range AllowedEventActionsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EventActions value +func (v EventActions) Ptr() *EventActions { + return &v +} + +type NullableEventActions struct { + value *EventActions + isSet bool +} + +func (v NullableEventActions) Get() *EventActions { + return v.value +} + +func (v *NullableEventActions) Set(val *EventActions) { + v.value = val + v.isSet = true +} + +func (v NullableEventActions) IsSet() bool { + return v.isSet +} + +func (v *NullableEventActions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventActions(val *EventActions) *NullableEventActions { + return &NullableEventActions{value: val, isSet: true} +} + +func (v NullableEventActions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventActions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_matcher_policy.go b/packages/client-go/model_event_matcher_policy.go new file mode 100644 index 0000000000..857eeda98e --- /dev/null +++ b/packages/client-go/model_event_matcher_policy.go @@ -0,0 +1,580 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EventMatcherPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventMatcherPolicy{} + +// EventMatcherPolicy Event Matcher Policy Serializer +type EventMatcherPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + // Match created events with this action type. When left empty, all action types will be matched. + Action NullableEventActions `json:"action,omitempty"` + // Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + ClientIp NullableString `json:"client_ip,omitempty"` + // Match events created by selected application. When left empty, all applications are matched. + App NullableAppEnum `json:"app,omitempty"` + // Match events created by selected model. When left empty, all models are matched. When an app is selected, all the application's models are matched. + Model NullableModelEnum `json:"model,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventMatcherPolicy EventMatcherPolicy + +// NewEventMatcherPolicy instantiates a new EventMatcherPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventMatcherPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *EventMatcherPolicy { + this := EventMatcherPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewEventMatcherPolicyWithDefaults instantiates a new EventMatcherPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventMatcherPolicyWithDefaults() *EventMatcherPolicy { + this := EventMatcherPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *EventMatcherPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *EventMatcherPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *EventMatcherPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EventMatcherPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *EventMatcherPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *EventMatcherPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *EventMatcherPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *EventMatcherPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *EventMatcherPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *EventMatcherPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *EventMatcherPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *EventMatcherPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *EventMatcherPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *EventMatcherPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *EventMatcherPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *EventMatcherPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *EventMatcherPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetAction returns the Action field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicy) GetAction() EventActions { + if o == nil || IsNil(o.Action.Get()) { + var ret EventActions + return ret + } + return *o.Action.Get() +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicy) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return o.Action.Get(), o.Action.IsSet() +} + +// HasAction returns a boolean if a field has been set. +func (o *EventMatcherPolicy) HasAction() bool { + if o != nil && o.Action.IsSet() { + return true + } + + return false +} + +// SetAction gets a reference to the given NullableEventActions and assigns it to the Action field. +func (o *EventMatcherPolicy) SetAction(v EventActions) { + o.Action.Set(&v) +} + +// SetActionNil sets the value for Action to be an explicit nil +func (o *EventMatcherPolicy) SetActionNil() { + o.Action.Set(nil) +} + +// UnsetAction ensures that no value is present for Action, not even an explicit nil +func (o *EventMatcherPolicy) UnsetAction() { + o.Action.Unset() +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicy) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicy) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *EventMatcherPolicy) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *EventMatcherPolicy) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *EventMatcherPolicy) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *EventMatcherPolicy) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetApp returns the App field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicy) GetApp() AppEnum { + if o == nil || IsNil(o.App.Get()) { + var ret AppEnum + return ret + } + return *o.App.Get() +} + +// GetAppOk returns a tuple with the App field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicy) GetAppOk() (*AppEnum, bool) { + if o == nil { + return nil, false + } + return o.App.Get(), o.App.IsSet() +} + +// HasApp returns a boolean if a field has been set. +func (o *EventMatcherPolicy) HasApp() bool { + if o != nil && o.App.IsSet() { + return true + } + + return false +} + +// SetApp gets a reference to the given NullableAppEnum and assigns it to the App field. +func (o *EventMatcherPolicy) SetApp(v AppEnum) { + o.App.Set(&v) +} + +// SetAppNil sets the value for App to be an explicit nil +func (o *EventMatcherPolicy) SetAppNil() { + o.App.Set(nil) +} + +// UnsetApp ensures that no value is present for App, not even an explicit nil +func (o *EventMatcherPolicy) UnsetApp() { + o.App.Unset() +} + +// GetModel returns the Model field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicy) GetModel() ModelEnum { + if o == nil || IsNil(o.Model.Get()) { + var ret ModelEnum + return ret + } + return *o.Model.Get() +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicy) GetModelOk() (*ModelEnum, bool) { + if o == nil { + return nil, false + } + return o.Model.Get(), o.Model.IsSet() +} + +// HasModel returns a boolean if a field has been set. +func (o *EventMatcherPolicy) HasModel() bool { + if o != nil && o.Model.IsSet() { + return true + } + + return false +} + +// SetModel gets a reference to the given NullableModelEnum and assigns it to the Model field. +func (o *EventMatcherPolicy) SetModel(v ModelEnum) { + o.Model.Set(&v) +} + +// SetModelNil sets the value for Model to be an explicit nil +func (o *EventMatcherPolicy) SetModelNil() { + o.Model.Set(nil) +} + +// UnsetModel ensures that no value is present for Model, not even an explicit nil +func (o *EventMatcherPolicy) UnsetModel() { + o.Model.Unset() +} + +func (o EventMatcherPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventMatcherPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if o.Action.IsSet() { + toSerialize["action"] = o.Action.Get() + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + if o.App.IsSet() { + toSerialize["app"] = o.App.Get() + } + if o.Model.IsSet() { + toSerialize["model"] = o.Model.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventMatcherPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventMatcherPolicy := _EventMatcherPolicy{} + + err = json.Unmarshal(data, &varEventMatcherPolicy) + + if err != nil { + return err + } + + *o = EventMatcherPolicy(varEventMatcherPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "action") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "app") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventMatcherPolicy struct { + value *EventMatcherPolicy + isSet bool +} + +func (v NullableEventMatcherPolicy) Get() *EventMatcherPolicy { + return v.value +} + +func (v *NullableEventMatcherPolicy) Set(val *EventMatcherPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableEventMatcherPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableEventMatcherPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventMatcherPolicy(val *EventMatcherPolicy) *NullableEventMatcherPolicy { + return &NullableEventMatcherPolicy{value: val, isSet: true} +} + +func (v NullableEventMatcherPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventMatcherPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_matcher_policy_request.go b/packages/client-go/model_event_matcher_policy_request.go new file mode 100644 index 0000000000..c7e078ee9f --- /dev/null +++ b/packages/client-go/model_event_matcher_policy_request.go @@ -0,0 +1,401 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EventMatcherPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventMatcherPolicyRequest{} + +// EventMatcherPolicyRequest Event Matcher Policy Serializer +type EventMatcherPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Match created events with this action type. When left empty, all action types will be matched. + Action NullableEventActions `json:"action,omitempty"` + // Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + ClientIp NullableString `json:"client_ip,omitempty"` + // Match events created by selected application. When left empty, all applications are matched. + App NullableAppEnum `json:"app,omitempty"` + // Match events created by selected model. When left empty, all models are matched. When an app is selected, all the application's models are matched. + Model NullableModelEnum `json:"model,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventMatcherPolicyRequest EventMatcherPolicyRequest + +// NewEventMatcherPolicyRequest instantiates a new EventMatcherPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventMatcherPolicyRequest(name string) *EventMatcherPolicyRequest { + this := EventMatcherPolicyRequest{} + this.Name = name + return &this +} + +// NewEventMatcherPolicyRequestWithDefaults instantiates a new EventMatcherPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventMatcherPolicyRequestWithDefaults() *EventMatcherPolicyRequest { + this := EventMatcherPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *EventMatcherPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *EventMatcherPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *EventMatcherPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventMatcherPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *EventMatcherPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *EventMatcherPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetAction returns the Action field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicyRequest) GetAction() EventActions { + if o == nil || IsNil(o.Action.Get()) { + var ret EventActions + return ret + } + return *o.Action.Get() +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicyRequest) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return o.Action.Get(), o.Action.IsSet() +} + +// HasAction returns a boolean if a field has been set. +func (o *EventMatcherPolicyRequest) HasAction() bool { + if o != nil && o.Action.IsSet() { + return true + } + + return false +} + +// SetAction gets a reference to the given NullableEventActions and assigns it to the Action field. +func (o *EventMatcherPolicyRequest) SetAction(v EventActions) { + o.Action.Set(&v) +} + +// SetActionNil sets the value for Action to be an explicit nil +func (o *EventMatcherPolicyRequest) SetActionNil() { + o.Action.Set(nil) +} + +// UnsetAction ensures that no value is present for Action, not even an explicit nil +func (o *EventMatcherPolicyRequest) UnsetAction() { + o.Action.Unset() +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicyRequest) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicyRequest) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *EventMatcherPolicyRequest) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *EventMatcherPolicyRequest) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *EventMatcherPolicyRequest) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *EventMatcherPolicyRequest) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetApp returns the App field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicyRequest) GetApp() AppEnum { + if o == nil || IsNil(o.App.Get()) { + var ret AppEnum + return ret + } + return *o.App.Get() +} + +// GetAppOk returns a tuple with the App field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicyRequest) GetAppOk() (*AppEnum, bool) { + if o == nil { + return nil, false + } + return o.App.Get(), o.App.IsSet() +} + +// HasApp returns a boolean if a field has been set. +func (o *EventMatcherPolicyRequest) HasApp() bool { + if o != nil && o.App.IsSet() { + return true + } + + return false +} + +// SetApp gets a reference to the given NullableAppEnum and assigns it to the App field. +func (o *EventMatcherPolicyRequest) SetApp(v AppEnum) { + o.App.Set(&v) +} + +// SetAppNil sets the value for App to be an explicit nil +func (o *EventMatcherPolicyRequest) SetAppNil() { + o.App.Set(nil) +} + +// UnsetApp ensures that no value is present for App, not even an explicit nil +func (o *EventMatcherPolicyRequest) UnsetApp() { + o.App.Unset() +} + +// GetModel returns the Model field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventMatcherPolicyRequest) GetModel() ModelEnum { + if o == nil || IsNil(o.Model.Get()) { + var ret ModelEnum + return ret + } + return *o.Model.Get() +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventMatcherPolicyRequest) GetModelOk() (*ModelEnum, bool) { + if o == nil { + return nil, false + } + return o.Model.Get(), o.Model.IsSet() +} + +// HasModel returns a boolean if a field has been set. +func (o *EventMatcherPolicyRequest) HasModel() bool { + if o != nil && o.Model.IsSet() { + return true + } + + return false +} + +// SetModel gets a reference to the given NullableModelEnum and assigns it to the Model field. +func (o *EventMatcherPolicyRequest) SetModel(v ModelEnum) { + o.Model.Set(&v) +} + +// SetModelNil sets the value for Model to be an explicit nil +func (o *EventMatcherPolicyRequest) SetModelNil() { + o.Model.Set(nil) +} + +// UnsetModel ensures that no value is present for Model, not even an explicit nil +func (o *EventMatcherPolicyRequest) UnsetModel() { + o.Model.Unset() +} + +func (o EventMatcherPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventMatcherPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if o.Action.IsSet() { + toSerialize["action"] = o.Action.Get() + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + if o.App.IsSet() { + toSerialize["app"] = o.App.Get() + } + if o.Model.IsSet() { + toSerialize["model"] = o.Model.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventMatcherPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventMatcherPolicyRequest := _EventMatcherPolicyRequest{} + + err = json.Unmarshal(data, &varEventMatcherPolicyRequest) + + if err != nil { + return err + } + + *o = EventMatcherPolicyRequest(varEventMatcherPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "action") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "app") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventMatcherPolicyRequest struct { + value *EventMatcherPolicyRequest + isSet bool +} + +func (v NullableEventMatcherPolicyRequest) Get() *EventMatcherPolicyRequest { + return v.value +} + +func (v *NullableEventMatcherPolicyRequest) Set(val *EventMatcherPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEventMatcherPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEventMatcherPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventMatcherPolicyRequest(val *EventMatcherPolicyRequest) *NullableEventMatcherPolicyRequest { + return &NullableEventMatcherPolicyRequest{value: val, isSet: true} +} + +func (v NullableEventMatcherPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventMatcherPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_request.go b/packages/client-go/model_event_request.go new file mode 100644 index 0000000000..1520fc05c5 --- /dev/null +++ b/packages/client-go/model_event_request.go @@ -0,0 +1,393 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EventRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventRequest{} + +// EventRequest Event Serializer +type EventRequest struct { + User map[string]interface{} `json:"user,omitempty"` + Action EventActions `json:"action"` + App string `json:"app"` + Context map[string]interface{} `json:"context,omitempty"` + ClientIp NullableString `json:"client_ip,omitempty"` + Expires *time.Time `json:"expires,omitempty"` + Brand map[string]interface{} `json:"brand,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _EventRequest EventRequest + +// NewEventRequest instantiates a new EventRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventRequest(action EventActions, app string) *EventRequest { + this := EventRequest{} + this.Action = action + this.App = app + return &this +} + +// NewEventRequestWithDefaults instantiates a new EventRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventRequestWithDefaults() *EventRequest { + this := EventRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *EventRequest) GetUser() map[string]interface{} { + if o == nil || IsNil(o.User) { + var ret map[string]interface{} + return ret + } + return o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRequest) GetUserOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.User) { + return map[string]interface{}{}, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *EventRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given map[string]interface{} and assigns it to the User field. +func (o *EventRequest) SetUser(v map[string]interface{}) { + o.User = v +} + +// GetAction returns the Action field value +func (o *EventRequest) GetAction() EventActions { + if o == nil { + var ret EventActions + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *EventRequest) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *EventRequest) SetAction(v EventActions) { + o.Action = v +} + +// GetApp returns the App field value +func (o *EventRequest) GetApp() string { + if o == nil { + var ret string + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *EventRequest) GetAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *EventRequest) SetApp(v string) { + o.App = v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *EventRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *EventRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *EventRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *EventRequest) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *EventRequest) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *EventRequest) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *EventRequest) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *EventRequest) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *EventRequest) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *EventRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *EventRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *EventRequest) SetExpires(v time.Time) { + o.Expires = &v +} + +// GetBrand returns the Brand field value if set, zero value otherwise. +func (o *EventRequest) GetBrand() map[string]interface{} { + if o == nil || IsNil(o.Brand) { + var ret map[string]interface{} + return ret + } + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EventRequest) GetBrandOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Brand) { + return map[string]interface{}{}, false + } + return o.Brand, true +} + +// HasBrand returns a boolean if a field has been set. +func (o *EventRequest) HasBrand() bool { + if o != nil && !IsNil(o.Brand) { + return true + } + + return false +} + +// SetBrand gets a reference to the given map[string]interface{} and assigns it to the Brand field. +func (o *EventRequest) SetBrand(v map[string]interface{}) { + o.Brand = v +} + +func (o EventRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + toSerialize["action"] = o.Action + toSerialize["app"] = o.App + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + if !IsNil(o.Brand) { + toSerialize["brand"] = o.Brand + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "app", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventRequest := _EventRequest{} + + err = json.Unmarshal(data, &varEventRequest) + + if err != nil { + return err + } + + *o = EventRequest(varEventRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "action") + delete(additionalProperties, "app") + delete(additionalProperties, "context") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "expires") + delete(additionalProperties, "brand") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventRequest struct { + value *EventRequest + isSet bool +} + +func (v NullableEventRequest) Get() *EventRequest { + return v.value +} + +func (v *NullableEventRequest) Set(val *EventRequest) { + v.value = val + v.isSet = true +} + +func (v NullableEventRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableEventRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventRequest(val *EventRequest) *NullableEventRequest { + return &NullableEventRequest{value: val, isSet: true} +} + +func (v NullableEventRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_top_per_user.go b/packages/client-go/model_event_top_per_user.go new file mode 100644 index 0000000000..fe3a54df0e --- /dev/null +++ b/packages/client-go/model_event_top_per_user.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the EventTopPerUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventTopPerUser{} + +// EventTopPerUser Response object of Event's top_per_user +type EventTopPerUser struct { + Application map[string]interface{} `json:"application"` + CountedEvents int32 `json:"counted_events"` + UniqueUsers int32 `json:"unique_users"` + AdditionalProperties map[string]interface{} +} + +type _EventTopPerUser EventTopPerUser + +// NewEventTopPerUser instantiates a new EventTopPerUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventTopPerUser(application map[string]interface{}, countedEvents int32, uniqueUsers int32) *EventTopPerUser { + this := EventTopPerUser{} + this.Application = application + this.CountedEvents = countedEvents + this.UniqueUsers = uniqueUsers + return &this +} + +// NewEventTopPerUserWithDefaults instantiates a new EventTopPerUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventTopPerUserWithDefaults() *EventTopPerUser { + this := EventTopPerUser{} + return &this +} + +// GetApplication returns the Application field value +func (o *EventTopPerUser) GetApplication() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Application +} + +// GetApplicationOk returns a tuple with the Application field value +// and a boolean to check if the value has been set. +func (o *EventTopPerUser) GetApplicationOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Application, true +} + +// SetApplication sets field value +func (o *EventTopPerUser) SetApplication(v map[string]interface{}) { + o.Application = v +} + +// GetCountedEvents returns the CountedEvents field value +func (o *EventTopPerUser) GetCountedEvents() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CountedEvents +} + +// GetCountedEventsOk returns a tuple with the CountedEvents field value +// and a boolean to check if the value has been set. +func (o *EventTopPerUser) GetCountedEventsOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CountedEvents, true +} + +// SetCountedEvents sets field value +func (o *EventTopPerUser) SetCountedEvents(v int32) { + o.CountedEvents = v +} + +// GetUniqueUsers returns the UniqueUsers field value +func (o *EventTopPerUser) GetUniqueUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.UniqueUsers +} + +// GetUniqueUsersOk returns a tuple with the UniqueUsers field value +// and a boolean to check if the value has been set. +func (o *EventTopPerUser) GetUniqueUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.UniqueUsers, true +} + +// SetUniqueUsers sets field value +func (o *EventTopPerUser) SetUniqueUsers(v int32) { + o.UniqueUsers = v +} + +func (o EventTopPerUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventTopPerUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["application"] = o.Application + toSerialize["counted_events"] = o.CountedEvents + toSerialize["unique_users"] = o.UniqueUsers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventTopPerUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "application", + "counted_events", + "unique_users", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventTopPerUser := _EventTopPerUser{} + + err = json.Unmarshal(data, &varEventTopPerUser) + + if err != nil { + return err + } + + *o = EventTopPerUser(varEventTopPerUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "application") + delete(additionalProperties, "counted_events") + delete(additionalProperties, "unique_users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventTopPerUser struct { + value *EventTopPerUser + isSet bool +} + +func (v NullableEventTopPerUser) Get() *EventTopPerUser { + return v.value +} + +func (v *NullableEventTopPerUser) Set(val *EventTopPerUser) { + v.value = val + v.isSet = true +} + +func (v NullableEventTopPerUser) IsSet() bool { + return v.isSet +} + +func (v *NullableEventTopPerUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventTopPerUser(val *EventTopPerUser) *NullableEventTopPerUser { + return &NullableEventTopPerUser{value: val, isSet: true} +} + +func (v NullableEventTopPerUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventTopPerUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_event_volume.go b/packages/client-go/model_event_volume.go new file mode 100644 index 0000000000..38169ea879 --- /dev/null +++ b/packages/client-go/model_event_volume.go @@ -0,0 +1,226 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the EventVolume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EventVolume{} + +// EventVolume Count of events of action created on day +type EventVolume struct { + Action EventActions `json:"action"` + Time time.Time `json:"time"` + Count int32 `json:"count"` + AdditionalProperties map[string]interface{} +} + +type _EventVolume EventVolume + +// NewEventVolume instantiates a new EventVolume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewEventVolume(action EventActions, time time.Time, count int32) *EventVolume { + this := EventVolume{} + this.Action = action + this.Time = time + this.Count = count + return &this +} + +// NewEventVolumeWithDefaults instantiates a new EventVolume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewEventVolumeWithDefaults() *EventVolume { + this := EventVolume{} + return &this +} + +// GetAction returns the Action field value +func (o *EventVolume) GetAction() EventActions { + if o == nil { + var ret EventActions + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *EventVolume) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *EventVolume) SetAction(v EventActions) { + o.Action = v +} + +// GetTime returns the Time field value +func (o *EventVolume) GetTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Time +} + +// GetTimeOk returns a tuple with the Time field value +// and a boolean to check if the value has been set. +func (o *EventVolume) GetTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Time, true +} + +// SetTime sets field value +func (o *EventVolume) SetTime(v time.Time) { + o.Time = v +} + +// GetCount returns the Count field value +func (o *EventVolume) GetCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *EventVolume) GetCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *EventVolume) SetCount(v int32) { + o.Count = v +} + +func (o EventVolume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EventVolume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["action"] = o.Action + toSerialize["time"] = o.Time + toSerialize["count"] = o.Count + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *EventVolume) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "action", + "time", + "count", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varEventVolume := _EventVolume{} + + err = json.Unmarshal(data, &varEventVolume) + + if err != nil { + return err + } + + *o = EventVolume(varEventVolume) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "action") + delete(additionalProperties, "time") + delete(additionalProperties, "count") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableEventVolume struct { + value *EventVolume + isSet bool +} + +func (v NullableEventVolume) Get() *EventVolume { + return v.value +} + +func (v *NullableEventVolume) Set(val *EventVolume) { + v.value = val + v.isSet = true +} + +func (v NullableEventVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableEventVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventVolume(val *EventVolume) *NullableEventVolume { + return &NullableEventVolume{value: val, isSet: true} +} + +func (v NullableEventVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_events_requested_enum.go b/packages/client-go/model_events_requested_enum.go new file mode 100644 index 0000000000..357bf7beb5 --- /dev/null +++ b/packages/client-go/model_events_requested_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// EventsRequestedEnum the model 'EventsRequestedEnum' +type EventsRequestedEnum string + +// List of EventsRequestedEnum +const ( + EVENTSREQUESTEDENUM_HTTPS___SCHEMAS_OPENID_NET_SECEVENT_CAEP_EVENT_TYPE_SESSION_REVOKED EventsRequestedEnum = "https://schemas.openid.net/secevent/caep/event-type/session-revoked" + EVENTSREQUESTEDENUM_HTTPS___SCHEMAS_OPENID_NET_SECEVENT_CAEP_EVENT_TYPE_CREDENTIAL_CHANGE EventsRequestedEnum = "https://schemas.openid.net/secevent/caep/event-type/credential-change" + EVENTSREQUESTEDENUM_HTTPS___SCHEMAS_OPENID_NET_SECEVENT_SSF_EVENT_TYPE_VERIFICATION EventsRequestedEnum = "https://schemas.openid.net/secevent/ssf/event-type/verification" +) + +// All allowed values of EventsRequestedEnum enum +var AllowedEventsRequestedEnumEnumValues = []EventsRequestedEnum{ + "https://schemas.openid.net/secevent/caep/event-type/session-revoked", + "https://schemas.openid.net/secevent/caep/event-type/credential-change", + "https://schemas.openid.net/secevent/ssf/event-type/verification", +} + +func (v *EventsRequestedEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := EventsRequestedEnum(value) + for _, existing := range AllowedEventsRequestedEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid EventsRequestedEnum", value) +} + +// NewEventsRequestedEnumFromValue returns a pointer to a valid EventsRequestedEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewEventsRequestedEnumFromValue(v string) (*EventsRequestedEnum, error) { + ev := EventsRequestedEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for EventsRequestedEnum: valid values are %v", v, AllowedEventsRequestedEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v EventsRequestedEnum) IsValid() bool { + for _, existing := range AllowedEventsRequestedEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to EventsRequestedEnum value +func (v EventsRequestedEnum) Ptr() *EventsRequestedEnum { + return &v +} + +type NullableEventsRequestedEnum struct { + value *EventsRequestedEnum + isSet bool +} + +func (v NullableEventsRequestedEnum) Get() *EventsRequestedEnum { + return v.value +} + +func (v *NullableEventsRequestedEnum) Set(val *EventsRequestedEnum) { + v.value = val + v.isSet = true +} + +func (v NullableEventsRequestedEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableEventsRequestedEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEventsRequestedEnum(val *EventsRequestedEnum) *NullableEventsRequestedEnum { + return &NullableEventsRequestedEnum{value: val, isSet: true} +} + +func (v NullableEventsRequestedEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEventsRequestedEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_expiring_base_grant_model.go b/packages/client-go/model_expiring_base_grant_model.go new file mode 100644 index 0000000000..af21bf4bc5 --- /dev/null +++ b/packages/client-go/model_expiring_base_grant_model.go @@ -0,0 +1,333 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the ExpiringBaseGrantModel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExpiringBaseGrantModel{} + +// ExpiringBaseGrantModel Serializer for BaseGrantModel and ExpiringBaseGrant +type ExpiringBaseGrantModel struct { + Pk int32 `json:"pk"` + Provider OAuth2Provider `json:"provider"` + User User `json:"user"` + // Check if token is expired yet. + IsExpired bool `json:"is_expired"` + Expires NullableTime `json:"expires,omitempty"` + Scope []string `json:"scope"` + AdditionalProperties map[string]interface{} +} + +type _ExpiringBaseGrantModel ExpiringBaseGrantModel + +// NewExpiringBaseGrantModel instantiates a new ExpiringBaseGrantModel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExpiringBaseGrantModel(pk int32, provider OAuth2Provider, user User, isExpired bool, scope []string) *ExpiringBaseGrantModel { + this := ExpiringBaseGrantModel{} + this.Pk = pk + this.Provider = provider + this.User = user + this.IsExpired = isExpired + this.Scope = scope + return &this +} + +// NewExpiringBaseGrantModelWithDefaults instantiates a new ExpiringBaseGrantModel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExpiringBaseGrantModelWithDefaults() *ExpiringBaseGrantModel { + this := ExpiringBaseGrantModel{} + return &this +} + +// GetPk returns the Pk field value +func (o *ExpiringBaseGrantModel) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ExpiringBaseGrantModel) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ExpiringBaseGrantModel) SetPk(v int32) { + o.Pk = v +} + +// GetProvider returns the Provider field value +func (o *ExpiringBaseGrantModel) GetProvider() OAuth2Provider { + if o == nil { + var ret OAuth2Provider + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *ExpiringBaseGrantModel) GetProviderOk() (*OAuth2Provider, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *ExpiringBaseGrantModel) SetProvider(v OAuth2Provider) { + o.Provider = v +} + +// GetUser returns the User field value +func (o *ExpiringBaseGrantModel) GetUser() User { + if o == nil { + var ret User + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *ExpiringBaseGrantModel) GetUserOk() (*User, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *ExpiringBaseGrantModel) SetUser(v User) { + o.User = v +} + +// GetIsExpired returns the IsExpired field value +func (o *ExpiringBaseGrantModel) GetIsExpired() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsExpired +} + +// GetIsExpiredOk returns a tuple with the IsExpired field value +// and a boolean to check if the value has been set. +func (o *ExpiringBaseGrantModel) GetIsExpiredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsExpired, true +} + +// SetIsExpired sets field value +func (o *ExpiringBaseGrantModel) SetIsExpired(v bool) { + o.IsExpired = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ExpiringBaseGrantModel) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExpiringBaseGrantModel) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *ExpiringBaseGrantModel) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *ExpiringBaseGrantModel) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *ExpiringBaseGrantModel) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *ExpiringBaseGrantModel) UnsetExpires() { + o.Expires.Unset() +} + +// GetScope returns the Scope field value +func (o *ExpiringBaseGrantModel) GetScope() []string { + if o == nil { + var ret []string + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *ExpiringBaseGrantModel) GetScopeOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Scope, true +} + +// SetScope sets field value +func (o *ExpiringBaseGrantModel) SetScope(v []string) { + o.Scope = v +} + +func (o ExpiringBaseGrantModel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExpiringBaseGrantModel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["provider"] = o.Provider + toSerialize["user"] = o.User + toSerialize["is_expired"] = o.IsExpired + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + toSerialize["scope"] = o.Scope + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExpiringBaseGrantModel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "provider", + "user", + "is_expired", + "scope", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExpiringBaseGrantModel := _ExpiringBaseGrantModel{} + + err = json.Unmarshal(data, &varExpiringBaseGrantModel) + + if err != nil { + return err + } + + *o = ExpiringBaseGrantModel(varExpiringBaseGrantModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "user") + delete(additionalProperties, "is_expired") + delete(additionalProperties, "expires") + delete(additionalProperties, "scope") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExpiringBaseGrantModel struct { + value *ExpiringBaseGrantModel + isSet bool +} + +func (v NullableExpiringBaseGrantModel) Get() *ExpiringBaseGrantModel { + return v.value +} + +func (v *NullableExpiringBaseGrantModel) Set(val *ExpiringBaseGrantModel) { + v.value = val + v.isSet = true +} + +func (v NullableExpiringBaseGrantModel) IsSet() bool { + return v.isSet +} + +func (v *NullableExpiringBaseGrantModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExpiringBaseGrantModel(val *ExpiringBaseGrantModel) *NullableExpiringBaseGrantModel { + return &NullableExpiringBaseGrantModel{value: val, isSet: true} +} + +func (v NullableExpiringBaseGrantModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExpiringBaseGrantModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_expression_policy.go b/packages/client-go/model_expression_policy.go new file mode 100644 index 0000000000..53b8cc16cb --- /dev/null +++ b/packages/client-go/model_expression_policy.go @@ -0,0 +1,413 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ExpressionPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExpressionPolicy{} + +// ExpressionPolicy Group Membership Policy Serializer +type ExpressionPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _ExpressionPolicy ExpressionPolicy + +// NewExpressionPolicy instantiates a new ExpressionPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExpressionPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32, expression string) *ExpressionPolicy { + this := ExpressionPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + this.Expression = expression + return &this +} + +// NewExpressionPolicyWithDefaults instantiates a new ExpressionPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExpressionPolicyWithDefaults() *ExpressionPolicy { + this := ExpressionPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *ExpressionPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ExpressionPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ExpressionPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExpressionPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *ExpressionPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *ExpressionPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *ExpressionPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *ExpressionPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ExpressionPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *ExpressionPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ExpressionPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ExpressionPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ExpressionPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ExpressionPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ExpressionPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *ExpressionPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *ExpressionPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetExpression returns the Expression field value +func (o *ExpressionPolicy) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicy) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *ExpressionPolicy) SetExpression(v string) { + o.Expression = v +} + +func (o ExpressionPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExpressionPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExpressionPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExpressionPolicy := _ExpressionPolicy{} + + err = json.Unmarshal(data, &varExpressionPolicy) + + if err != nil { + return err + } + + *o = ExpressionPolicy(varExpressionPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExpressionPolicy struct { + value *ExpressionPolicy + isSet bool +} + +func (v NullableExpressionPolicy) Get() *ExpressionPolicy { + return v.value +} + +func (v *NullableExpressionPolicy) Set(val *ExpressionPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableExpressionPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableExpressionPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExpressionPolicy(val *ExpressionPolicy) *NullableExpressionPolicy { + return &NullableExpressionPolicy{value: val, isSet: true} +} + +func (v NullableExpressionPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExpressionPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_expression_policy_request.go b/packages/client-go/model_expression_policy_request.go new file mode 100644 index 0000000000..47a463e052 --- /dev/null +++ b/packages/client-go/model_expression_policy_request.go @@ -0,0 +1,234 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ExpressionPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExpressionPolicyRequest{} + +// ExpressionPolicyRequest Group Membership Policy Serializer +type ExpressionPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _ExpressionPolicyRequest ExpressionPolicyRequest + +// NewExpressionPolicyRequest instantiates a new ExpressionPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExpressionPolicyRequest(name string, expression string) *ExpressionPolicyRequest { + this := ExpressionPolicyRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewExpressionPolicyRequestWithDefaults instantiates a new ExpressionPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExpressionPolicyRequestWithDefaults() *ExpressionPolicyRequest { + this := ExpressionPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ExpressionPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExpressionPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *ExpressionPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExpressionPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *ExpressionPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *ExpressionPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetExpression returns the Expression field value +func (o *ExpressionPolicyRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *ExpressionPolicyRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *ExpressionPolicyRequest) SetExpression(v string) { + o.Expression = v +} + +func (o ExpressionPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExpressionPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExpressionPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExpressionPolicyRequest := _ExpressionPolicyRequest{} + + err = json.Unmarshal(data, &varExpressionPolicyRequest) + + if err != nil { + return err + } + + *o = ExpressionPolicyRequest(varExpressionPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExpressionPolicyRequest struct { + value *ExpressionPolicyRequest + isSet bool +} + +func (v NullableExpressionPolicyRequest) Get() *ExpressionPolicyRequest { + return v.value +} + +func (v *NullableExpressionPolicyRequest) Set(val *ExpressionPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableExpressionPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableExpressionPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExpressionPolicyRequest(val *ExpressionPolicyRequest) *NullableExpressionPolicyRequest { + return &NullableExpressionPolicyRequest{value: val, isSet: true} +} + +func (v NullableExpressionPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExpressionPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_extra_role_object_permission.go b/packages/client-go/model_extra_role_object_permission.go new file mode 100644 index 0000000000..0d323d8ad4 --- /dev/null +++ b/packages/client-go/model_extra_role_object_permission.go @@ -0,0 +1,404 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ExtraRoleObjectPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ExtraRoleObjectPermission{} + +// ExtraRoleObjectPermission Role permission with additional object-related data +type ExtraRoleObjectPermission struct { + Id int32 `json:"id"` + Codename string `json:"codename"` + Model string `json:"model"` + AppLabel string `json:"app_label"` + ObjectPk string `json:"object_pk"` + Name string `json:"name"` + // Get app label from permission's model + AppLabelVerbose string `json:"app_label_verbose"` + // Get model label from permission's model + ModelVerbose string `json:"model_verbose"` + // Get model description from attached model. This operation takes at least one additional query, and the description is only shown if the role has the view_ permission on the object + ObjectDescription NullableString `json:"object_description"` + AdditionalProperties map[string]interface{} +} + +type _ExtraRoleObjectPermission ExtraRoleObjectPermission + +// NewExtraRoleObjectPermission instantiates a new ExtraRoleObjectPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExtraRoleObjectPermission(id int32, codename string, model string, appLabel string, objectPk string, name string, appLabelVerbose string, modelVerbose string, objectDescription NullableString) *ExtraRoleObjectPermission { + this := ExtraRoleObjectPermission{} + this.Id = id + this.Codename = codename + this.Model = model + this.AppLabel = appLabel + this.ObjectPk = objectPk + this.Name = name + this.AppLabelVerbose = appLabelVerbose + this.ModelVerbose = modelVerbose + this.ObjectDescription = objectDescription + return &this +} + +// NewExtraRoleObjectPermissionWithDefaults instantiates a new ExtraRoleObjectPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExtraRoleObjectPermissionWithDefaults() *ExtraRoleObjectPermission { + this := ExtraRoleObjectPermission{} + return &this +} + +// GetId returns the Id field value +func (o *ExtraRoleObjectPermission) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ExtraRoleObjectPermission) SetId(v int32) { + o.Id = v +} + +// GetCodename returns the Codename field value +func (o *ExtraRoleObjectPermission) GetCodename() string { + if o == nil { + var ret string + return ret + } + + return o.Codename +} + +// GetCodenameOk returns a tuple with the Codename field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetCodenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Codename, true +} + +// SetCodename sets field value +func (o *ExtraRoleObjectPermission) SetCodename(v string) { + o.Codename = v +} + +// GetModel returns the Model field value +func (o *ExtraRoleObjectPermission) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *ExtraRoleObjectPermission) SetModel(v string) { + o.Model = v +} + +// GetAppLabel returns the AppLabel field value +func (o *ExtraRoleObjectPermission) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *ExtraRoleObjectPermission) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetObjectPk returns the ObjectPk field value +func (o *ExtraRoleObjectPermission) GetObjectPk() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectPk +} + +// GetObjectPkOk returns a tuple with the ObjectPk field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetObjectPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectPk, true +} + +// SetObjectPk sets field value +func (o *ExtraRoleObjectPermission) SetObjectPk(v string) { + o.ObjectPk = v +} + +// GetName returns the Name field value +func (o *ExtraRoleObjectPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ExtraRoleObjectPermission) SetName(v string) { + o.Name = v +} + +// GetAppLabelVerbose returns the AppLabelVerbose field value +func (o *ExtraRoleObjectPermission) GetAppLabelVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabelVerbose +} + +// GetAppLabelVerboseOk returns a tuple with the AppLabelVerbose field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetAppLabelVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabelVerbose, true +} + +// SetAppLabelVerbose sets field value +func (o *ExtraRoleObjectPermission) SetAppLabelVerbose(v string) { + o.AppLabelVerbose = v +} + +// GetModelVerbose returns the ModelVerbose field value +func (o *ExtraRoleObjectPermission) GetModelVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.ModelVerbose +} + +// GetModelVerboseOk returns a tuple with the ModelVerbose field value +// and a boolean to check if the value has been set. +func (o *ExtraRoleObjectPermission) GetModelVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelVerbose, true +} + +// SetModelVerbose sets field value +func (o *ExtraRoleObjectPermission) SetModelVerbose(v string) { + o.ModelVerbose = v +} + +// GetObjectDescription returns the ObjectDescription field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ExtraRoleObjectPermission) GetObjectDescription() string { + if o == nil || o.ObjectDescription.Get() == nil { + var ret string + return ret + } + + return *o.ObjectDescription.Get() +} + +// GetObjectDescriptionOk returns a tuple with the ObjectDescription field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ExtraRoleObjectPermission) GetObjectDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectDescription.Get(), o.ObjectDescription.IsSet() +} + +// SetObjectDescription sets field value +func (o *ExtraRoleObjectPermission) SetObjectDescription(v string) { + o.ObjectDescription.Set(&v) +} + +func (o ExtraRoleObjectPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ExtraRoleObjectPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["codename"] = o.Codename + toSerialize["model"] = o.Model + toSerialize["app_label"] = o.AppLabel + toSerialize["object_pk"] = o.ObjectPk + toSerialize["name"] = o.Name + toSerialize["app_label_verbose"] = o.AppLabelVerbose + toSerialize["model_verbose"] = o.ModelVerbose + toSerialize["object_description"] = o.ObjectDescription.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ExtraRoleObjectPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "codename", + "model", + "app_label", + "object_pk", + "name", + "app_label_verbose", + "model_verbose", + "object_description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varExtraRoleObjectPermission := _ExtraRoleObjectPermission{} + + err = json.Unmarshal(data, &varExtraRoleObjectPermission) + + if err != nil { + return err + } + + *o = ExtraRoleObjectPermission(varExtraRoleObjectPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "codename") + delete(additionalProperties, "model") + delete(additionalProperties, "app_label") + delete(additionalProperties, "object_pk") + delete(additionalProperties, "name") + delete(additionalProperties, "app_label_verbose") + delete(additionalProperties, "model_verbose") + delete(additionalProperties, "object_description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableExtraRoleObjectPermission struct { + value *ExtraRoleObjectPermission + isSet bool +} + +func (v NullableExtraRoleObjectPermission) Get() *ExtraRoleObjectPermission { + return v.value +} + +func (v *NullableExtraRoleObjectPermission) Set(val *ExtraRoleObjectPermission) { + v.value = val + v.isSet = true +} + +func (v NullableExtraRoleObjectPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableExtraRoleObjectPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExtraRoleObjectPermission(val *ExtraRoleObjectPermission) *NullableExtraRoleObjectPermission { + return &NullableExtraRoleObjectPermission{value: val, isSet: true} +} + +func (v NullableExtraRoleObjectPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExtraRoleObjectPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_file_list.go b/packages/client-go/model_file_list.go new file mode 100644 index 0000000000..b3a17e0310 --- /dev/null +++ b/packages/client-go/model_file_list.go @@ -0,0 +1,273 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FileList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FileList{} + +// FileList Base serializer class which doesn't implement create/update methods +type FileList struct { + Name string `json:"name"` + MimeType string `json:"mime_type"` + Url string `json:"url"` + ThemedUrls NullableThemedUrls `json:"themed_urls,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FileList FileList + +// NewFileList instantiates a new FileList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFileList(name string, mimeType string, url string) *FileList { + this := FileList{} + this.Name = name + this.MimeType = mimeType + this.Url = url + return &this +} + +// NewFileListWithDefaults instantiates a new FileList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFileListWithDefaults() *FileList { + this := FileList{} + return &this +} + +// GetName returns the Name field value +func (o *FileList) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FileList) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FileList) SetName(v string) { + o.Name = v +} + +// GetMimeType returns the MimeType field value +func (o *FileList) GetMimeType() string { + if o == nil { + var ret string + return ret + } + + return o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value +// and a boolean to check if the value has been set. +func (o *FileList) GetMimeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MimeType, true +} + +// SetMimeType sets field value +func (o *FileList) SetMimeType(v string) { + o.MimeType = v +} + +// GetUrl returns the Url field value +func (o *FileList) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FileList) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FileList) SetUrl(v string) { + o.Url = v +} + +// GetThemedUrls returns the ThemedUrls field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FileList) GetThemedUrls() ThemedUrls { + if o == nil || IsNil(o.ThemedUrls.Get()) { + var ret ThemedUrls + return ret + } + return *o.ThemedUrls.Get() +} + +// GetThemedUrlsOk returns a tuple with the ThemedUrls field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FileList) GetThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.ThemedUrls.Get(), o.ThemedUrls.IsSet() +} + +// HasThemedUrls returns a boolean if a field has been set. +func (o *FileList) HasThemedUrls() bool { + if o != nil && o.ThemedUrls.IsSet() { + return true + } + + return false +} + +// SetThemedUrls gets a reference to the given NullableThemedUrls and assigns it to the ThemedUrls field. +func (o *FileList) SetThemedUrls(v ThemedUrls) { + o.ThemedUrls.Set(&v) +} + +// SetThemedUrlsNil sets the value for ThemedUrls to be an explicit nil +func (o *FileList) SetThemedUrlsNil() { + o.ThemedUrls.Set(nil) +} + +// UnsetThemedUrls ensures that no value is present for ThemedUrls, not even an explicit nil +func (o *FileList) UnsetThemedUrls() { + o.ThemedUrls.Unset() +} + +func (o FileList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FileList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["mime_type"] = o.MimeType + toSerialize["url"] = o.Url + if o.ThemedUrls.IsSet() { + toSerialize["themed_urls"] = o.ThemedUrls.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FileList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mime_type", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFileList := _FileList{} + + err = json.Unmarshal(data, &varFileList) + + if err != nil { + return err + } + + *o = FileList(varFileList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "url") + delete(additionalProperties, "themed_urls") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFileList struct { + value *FileList + isSet bool +} + +func (v NullableFileList) Get() *FileList { + return v.value +} + +func (v *NullableFileList) Set(val *FileList) { + v.value = val + v.isSet = true +} + +func (v NullableFileList) IsSet() bool { + return v.isSet +} + +func (v *NullableFileList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFileList(val *FileList) *NullableFileList { + return &NullableFileList{value: val, isSet: true} +} + +func (v NullableFileList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFileList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_fleet_connector.go b/packages/client-go/model_fleet_connector.go new file mode 100644 index 0000000000..77f76bb995 --- /dev/null +++ b/packages/client-go/model_fleet_connector.go @@ -0,0 +1,513 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FleetConnector type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FleetConnector{} + +// FleetConnector FleetConnector Serializer +type FleetConnector struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + Url string `json:"url"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + HeadersMapping NullableString `json:"headers_mapping,omitempty"` + MapUsers *bool `json:"map_users,omitempty"` + MapTeamsAccessGroup *bool `json:"map_teams_access_group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FleetConnector FleetConnector + +// NewFleetConnector instantiates a new FleetConnector object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFleetConnector(name string, component string, verboseName string, verboseNamePlural string, metaModelName string, url string) *FleetConnector { + this := FleetConnector{} + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Url = url + return &this +} + +// NewFleetConnectorWithDefaults instantiates a new FleetConnector object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFleetConnectorWithDefaults() *FleetConnector { + this := FleetConnector{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *FleetConnector) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *FleetConnector) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *FleetConnector) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *FleetConnector) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FleetConnector) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *FleetConnector) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *FleetConnector) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *FleetConnector) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetComponent returns the Component field value +func (o *FleetConnector) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *FleetConnector) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *FleetConnector) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *FleetConnector) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *FleetConnector) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *FleetConnector) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *FleetConnector) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *FleetConnector) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetUrl returns the Url field value +func (o *FleetConnector) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FleetConnector) SetUrl(v string) { + o.Url = v +} + +// GetHeadersMapping returns the HeadersMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FleetConnector) GetHeadersMapping() string { + if o == nil || IsNil(o.HeadersMapping.Get()) { + var ret string + return ret + } + return *o.HeadersMapping.Get() +} + +// GetHeadersMappingOk returns a tuple with the HeadersMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FleetConnector) GetHeadersMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersMapping.Get(), o.HeadersMapping.IsSet() +} + +// HasHeadersMapping returns a boolean if a field has been set. +func (o *FleetConnector) HasHeadersMapping() bool { + if o != nil && o.HeadersMapping.IsSet() { + return true + } + + return false +} + +// SetHeadersMapping gets a reference to the given NullableString and assigns it to the HeadersMapping field. +func (o *FleetConnector) SetHeadersMapping(v string) { + o.HeadersMapping.Set(&v) +} + +// SetHeadersMappingNil sets the value for HeadersMapping to be an explicit nil +func (o *FleetConnector) SetHeadersMappingNil() { + o.HeadersMapping.Set(nil) +} + +// UnsetHeadersMapping ensures that no value is present for HeadersMapping, not even an explicit nil +func (o *FleetConnector) UnsetHeadersMapping() { + o.HeadersMapping.Unset() +} + +// GetMapUsers returns the MapUsers field value if set, zero value otherwise. +func (o *FleetConnector) GetMapUsers() bool { + if o == nil || IsNil(o.MapUsers) { + var ret bool + return ret + } + return *o.MapUsers +} + +// GetMapUsersOk returns a tuple with the MapUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetMapUsersOk() (*bool, bool) { + if o == nil || IsNil(o.MapUsers) { + return nil, false + } + return o.MapUsers, true +} + +// HasMapUsers returns a boolean if a field has been set. +func (o *FleetConnector) HasMapUsers() bool { + if o != nil && !IsNil(o.MapUsers) { + return true + } + + return false +} + +// SetMapUsers gets a reference to the given bool and assigns it to the MapUsers field. +func (o *FleetConnector) SetMapUsers(v bool) { + o.MapUsers = &v +} + +// GetMapTeamsAccessGroup returns the MapTeamsAccessGroup field value if set, zero value otherwise. +func (o *FleetConnector) GetMapTeamsAccessGroup() bool { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + var ret bool + return ret + } + return *o.MapTeamsAccessGroup +} + +// GetMapTeamsAccessGroupOk returns a tuple with the MapTeamsAccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnector) GetMapTeamsAccessGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + return nil, false + } + return o.MapTeamsAccessGroup, true +} + +// HasMapTeamsAccessGroup returns a boolean if a field has been set. +func (o *FleetConnector) HasMapTeamsAccessGroup() bool { + if o != nil && !IsNil(o.MapTeamsAccessGroup) { + return true + } + + return false +} + +// SetMapTeamsAccessGroup gets a reference to the given bool and assigns it to the MapTeamsAccessGroup field. +func (o *FleetConnector) SetMapTeamsAccessGroup(v bool) { + o.MapTeamsAccessGroup = &v +} + +func (o FleetConnector) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FleetConnector) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["url"] = o.Url + if o.HeadersMapping.IsSet() { + toSerialize["headers_mapping"] = o.HeadersMapping.Get() + } + if !IsNil(o.MapUsers) { + toSerialize["map_users"] = o.MapUsers + } + if !IsNil(o.MapTeamsAccessGroup) { + toSerialize["map_teams_access_group"] = o.MapTeamsAccessGroup + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FleetConnector) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFleetConnector := _FleetConnector{} + + err = json.Unmarshal(data, &varFleetConnector) + + if err != nil { + return err + } + + *o = FleetConnector(varFleetConnector) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "url") + delete(additionalProperties, "headers_mapping") + delete(additionalProperties, "map_users") + delete(additionalProperties, "map_teams_access_group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFleetConnector struct { + value *FleetConnector + isSet bool +} + +func (v NullableFleetConnector) Get() *FleetConnector { + return v.value +} + +func (v *NullableFleetConnector) Set(val *FleetConnector) { + v.value = val + v.isSet = true +} + +func (v NullableFleetConnector) IsSet() bool { + return v.isSet +} + +func (v *NullableFleetConnector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFleetConnector(val *FleetConnector) *NullableFleetConnector { + return &NullableFleetConnector{value: val, isSet: true} +} + +func (v NullableFleetConnector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFleetConnector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_fleet_connector_request.go b/packages/client-go/model_fleet_connector_request.go new file mode 100644 index 0000000000..af58c931f7 --- /dev/null +++ b/packages/client-go/model_fleet_connector_request.go @@ -0,0 +1,422 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FleetConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FleetConnectorRequest{} + +// FleetConnectorRequest FleetConnector Serializer +type FleetConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Url string `json:"url"` + Token string `json:"token"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + HeadersMapping NullableString `json:"headers_mapping,omitempty"` + MapUsers *bool `json:"map_users,omitempty"` + MapTeamsAccessGroup *bool `json:"map_teams_access_group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FleetConnectorRequest FleetConnectorRequest + +// NewFleetConnectorRequest instantiates a new FleetConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFleetConnectorRequest(name string, url string, token string) *FleetConnectorRequest { + this := FleetConnectorRequest{} + this.Name = name + this.Url = url + this.Token = token + return &this +} + +// NewFleetConnectorRequestWithDefaults instantiates a new FleetConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFleetConnectorRequestWithDefaults() *FleetConnectorRequest { + this := FleetConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *FleetConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *FleetConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *FleetConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *FleetConnectorRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FleetConnectorRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *FleetConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *FleetConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *FleetConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetUrl returns the Url field value +func (o *FleetConnectorRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FleetConnectorRequest) SetUrl(v string) { + o.Url = v +} + +// GetToken returns the Token field value +func (o *FleetConnectorRequest) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *FleetConnectorRequest) SetToken(v string) { + o.Token = v +} + +// GetHeadersMapping returns the HeadersMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FleetConnectorRequest) GetHeadersMapping() string { + if o == nil || IsNil(o.HeadersMapping.Get()) { + var ret string + return ret + } + return *o.HeadersMapping.Get() +} + +// GetHeadersMappingOk returns a tuple with the HeadersMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FleetConnectorRequest) GetHeadersMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersMapping.Get(), o.HeadersMapping.IsSet() +} + +// HasHeadersMapping returns a boolean if a field has been set. +func (o *FleetConnectorRequest) HasHeadersMapping() bool { + if o != nil && o.HeadersMapping.IsSet() { + return true + } + + return false +} + +// SetHeadersMapping gets a reference to the given NullableString and assigns it to the HeadersMapping field. +func (o *FleetConnectorRequest) SetHeadersMapping(v string) { + o.HeadersMapping.Set(&v) +} + +// SetHeadersMappingNil sets the value for HeadersMapping to be an explicit nil +func (o *FleetConnectorRequest) SetHeadersMappingNil() { + o.HeadersMapping.Set(nil) +} + +// UnsetHeadersMapping ensures that no value is present for HeadersMapping, not even an explicit nil +func (o *FleetConnectorRequest) UnsetHeadersMapping() { + o.HeadersMapping.Unset() +} + +// GetMapUsers returns the MapUsers field value if set, zero value otherwise. +func (o *FleetConnectorRequest) GetMapUsers() bool { + if o == nil || IsNil(o.MapUsers) { + var ret bool + return ret + } + return *o.MapUsers +} + +// GetMapUsersOk returns a tuple with the MapUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetMapUsersOk() (*bool, bool) { + if o == nil || IsNil(o.MapUsers) { + return nil, false + } + return o.MapUsers, true +} + +// HasMapUsers returns a boolean if a field has been set. +func (o *FleetConnectorRequest) HasMapUsers() bool { + if o != nil && !IsNil(o.MapUsers) { + return true + } + + return false +} + +// SetMapUsers gets a reference to the given bool and assigns it to the MapUsers field. +func (o *FleetConnectorRequest) SetMapUsers(v bool) { + o.MapUsers = &v +} + +// GetMapTeamsAccessGroup returns the MapTeamsAccessGroup field value if set, zero value otherwise. +func (o *FleetConnectorRequest) GetMapTeamsAccessGroup() bool { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + var ret bool + return ret + } + return *o.MapTeamsAccessGroup +} + +// GetMapTeamsAccessGroupOk returns a tuple with the MapTeamsAccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FleetConnectorRequest) GetMapTeamsAccessGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + return nil, false + } + return o.MapTeamsAccessGroup, true +} + +// HasMapTeamsAccessGroup returns a boolean if a field has been set. +func (o *FleetConnectorRequest) HasMapTeamsAccessGroup() bool { + if o != nil && !IsNil(o.MapTeamsAccessGroup) { + return true + } + + return false +} + +// SetMapTeamsAccessGroup gets a reference to the given bool and assigns it to the MapTeamsAccessGroup field. +func (o *FleetConnectorRequest) SetMapTeamsAccessGroup(v bool) { + o.MapTeamsAccessGroup = &v +} + +func (o FleetConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FleetConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["url"] = o.Url + toSerialize["token"] = o.Token + if o.HeadersMapping.IsSet() { + toSerialize["headers_mapping"] = o.HeadersMapping.Get() + } + if !IsNil(o.MapUsers) { + toSerialize["map_users"] = o.MapUsers + } + if !IsNil(o.MapTeamsAccessGroup) { + toSerialize["map_teams_access_group"] = o.MapTeamsAccessGroup + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FleetConnectorRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "url", + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFleetConnectorRequest := _FleetConnectorRequest{} + + err = json.Unmarshal(data, &varFleetConnectorRequest) + + if err != nil { + return err + } + + *o = FleetConnectorRequest(varFleetConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "url") + delete(additionalProperties, "token") + delete(additionalProperties, "headers_mapping") + delete(additionalProperties, "map_users") + delete(additionalProperties, "map_teams_access_group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFleetConnectorRequest struct { + value *FleetConnectorRequest + isSet bool +} + +func (v NullableFleetConnectorRequest) Get() *FleetConnectorRequest { + return v.value +} + +func (v *NullableFleetConnectorRequest) Set(val *FleetConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFleetConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFleetConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFleetConnectorRequest(val *FleetConnectorRequest) *NullableFleetConnectorRequest { + return &NullableFleetConnectorRequest{value: val, isSet: true} +} + +func (v NullableFleetConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFleetConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow.go b/packages/client-go/model_flow.go new file mode 100644 index 0000000000..3b30fd169a --- /dev/null +++ b/packages/client-go/model_flow.go @@ -0,0 +1,720 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Flow type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Flow{} + +// Flow Flow Serializer +type Flow struct { + Pk string `json:"pk"` + PolicybindingmodelPtrId string `json:"policybindingmodel_ptr_id"` + Name string `json:"name"` + // Visible in the URL. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + // Shown as the Title in Flow pages. + Title string `json:"title"` + // Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik. + Designation FlowDesignationEnum `json:"designation"` + // Background shown during execution + Background *string `json:"background,omitempty"` + // Get the URL to the background image + BackgroundUrl string `json:"background_url"` + BackgroundThemedUrls NullableThemedUrls `json:"background_themed_urls"` + Stages []string `json:"stages"` + Policies []string `json:"policies"` + // Get count of cached flows + CacheCount int32 `json:"cache_count"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Enable compatibility mode, increases compatibility with password managers on mobile devices. + CompatibilityMode *bool `json:"compatibility_mode,omitempty"` + // Get export URL for flow + ExportUrl string `json:"export_url"` + Layout *FlowLayoutEnum `json:"layout,omitempty"` + // Configure what should happen when a flow denies access to a user. + DeniedAction *DeniedActionEnum `json:"denied_action,omitempty"` + // Required level of authentication and authorization to access a flow. + Authentication *AuthenticationEnum `json:"authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Flow Flow + +// NewFlow instantiates a new Flow object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlow(pk string, policybindingmodelPtrId string, name string, slug string, title string, designation FlowDesignationEnum, backgroundUrl string, backgroundThemedUrls NullableThemedUrls, stages []string, policies []string, cacheCount int32, exportUrl string) *Flow { + this := Flow{} + this.Pk = pk + this.PolicybindingmodelPtrId = policybindingmodelPtrId + this.Name = name + this.Slug = slug + this.Title = title + this.Designation = designation + this.BackgroundUrl = backgroundUrl + this.BackgroundThemedUrls = backgroundThemedUrls + this.Stages = stages + this.Policies = policies + this.CacheCount = cacheCount + this.ExportUrl = exportUrl + return &this +} + +// NewFlowWithDefaults instantiates a new Flow object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowWithDefaults() *Flow { + this := Flow{} + return &this +} + +// GetPk returns the Pk field value +func (o *Flow) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Flow) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Flow) SetPk(v string) { + o.Pk = v +} + +// GetPolicybindingmodelPtrId returns the PolicybindingmodelPtrId field value +func (o *Flow) GetPolicybindingmodelPtrId() string { + if o == nil { + var ret string + return ret + } + + return o.PolicybindingmodelPtrId +} + +// GetPolicybindingmodelPtrIdOk returns a tuple with the PolicybindingmodelPtrId field value +// and a boolean to check if the value has been set. +func (o *Flow) GetPolicybindingmodelPtrIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicybindingmodelPtrId, true +} + +// SetPolicybindingmodelPtrId sets field value +func (o *Flow) SetPolicybindingmodelPtrId(v string) { + o.PolicybindingmodelPtrId = v +} + +// GetName returns the Name field value +func (o *Flow) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Flow) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Flow) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Flow) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Flow) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Flow) SetSlug(v string) { + o.Slug = v +} + +// GetTitle returns the Title field value +func (o *Flow) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *Flow) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *Flow) SetTitle(v string) { + o.Title = v +} + +// GetDesignation returns the Designation field value +func (o *Flow) GetDesignation() FlowDesignationEnum { + if o == nil { + var ret FlowDesignationEnum + return ret + } + + return o.Designation +} + +// GetDesignationOk returns a tuple with the Designation field value +// and a boolean to check if the value has been set. +func (o *Flow) GetDesignationOk() (*FlowDesignationEnum, bool) { + if o == nil { + return nil, false + } + return &o.Designation, true +} + +// SetDesignation sets field value +func (o *Flow) SetDesignation(v FlowDesignationEnum) { + o.Designation = v +} + +// GetBackground returns the Background field value if set, zero value otherwise. +func (o *Flow) GetBackground() string { + if o == nil || IsNil(o.Background) { + var ret string + return ret + } + return *o.Background +} + +// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.Background) { + return nil, false + } + return o.Background, true +} + +// HasBackground returns a boolean if a field has been set. +func (o *Flow) HasBackground() bool { + if o != nil && !IsNil(o.Background) { + return true + } + + return false +} + +// SetBackground gets a reference to the given string and assigns it to the Background field. +func (o *Flow) SetBackground(v string) { + o.Background = &v +} + +// GetBackgroundUrl returns the BackgroundUrl field value +func (o *Flow) GetBackgroundUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BackgroundUrl +} + +// GetBackgroundUrlOk returns a tuple with the BackgroundUrl field value +// and a boolean to check if the value has been set. +func (o *Flow) GetBackgroundUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackgroundUrl, true +} + +// SetBackgroundUrl sets field value +func (o *Flow) SetBackgroundUrl(v string) { + o.BackgroundUrl = v +} + +// GetBackgroundThemedUrls returns the BackgroundThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *Flow) GetBackgroundThemedUrls() ThemedUrls { + if o == nil || o.BackgroundThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.BackgroundThemedUrls.Get() +} + +// GetBackgroundThemedUrlsOk returns a tuple with the BackgroundThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Flow) GetBackgroundThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.BackgroundThemedUrls.Get(), o.BackgroundThemedUrls.IsSet() +} + +// SetBackgroundThemedUrls sets field value +func (o *Flow) SetBackgroundThemedUrls(v ThemedUrls) { + o.BackgroundThemedUrls.Set(&v) +} + +// GetStages returns the Stages field value +func (o *Flow) GetStages() []string { + if o == nil { + var ret []string + return ret + } + + return o.Stages +} + +// GetStagesOk returns a tuple with the Stages field value +// and a boolean to check if the value has been set. +func (o *Flow) GetStagesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Stages, true +} + +// SetStages sets field value +func (o *Flow) SetStages(v []string) { + o.Stages = v +} + +// GetPolicies returns the Policies field value +func (o *Flow) GetPolicies() []string { + if o == nil { + var ret []string + return ret + } + + return o.Policies +} + +// GetPoliciesOk returns a tuple with the Policies field value +// and a boolean to check if the value has been set. +func (o *Flow) GetPoliciesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Policies, true +} + +// SetPolicies sets field value +func (o *Flow) SetPolicies(v []string) { + o.Policies = v +} + +// GetCacheCount returns the CacheCount field value +func (o *Flow) GetCacheCount() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.CacheCount +} + +// GetCacheCountOk returns a tuple with the CacheCount field value +// and a boolean to check if the value has been set. +func (o *Flow) GetCacheCountOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.CacheCount, true +} + +// SetCacheCount sets field value +func (o *Flow) SetCacheCount(v int32) { + o.CacheCount = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *Flow) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *Flow) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *Flow) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *Flow) GetCompatibilityMode() bool { + if o == nil || IsNil(o.CompatibilityMode) { + var ret bool + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetCompatibilityModeOk() (*bool, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *Flow) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given bool and assigns it to the CompatibilityMode field. +func (o *Flow) SetCompatibilityMode(v bool) { + o.CompatibilityMode = &v +} + +// GetExportUrl returns the ExportUrl field value +func (o *Flow) GetExportUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ExportUrl +} + +// GetExportUrlOk returns a tuple with the ExportUrl field value +// and a boolean to check if the value has been set. +func (o *Flow) GetExportUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExportUrl, true +} + +// SetExportUrl sets field value +func (o *Flow) SetExportUrl(v string) { + o.ExportUrl = v +} + +// GetLayout returns the Layout field value if set, zero value otherwise. +func (o *Flow) GetLayout() FlowLayoutEnum { + if o == nil || IsNil(o.Layout) { + var ret FlowLayoutEnum + return ret + } + return *o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetLayoutOk() (*FlowLayoutEnum, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *Flow) HasLayout() bool { + if o != nil && !IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given FlowLayoutEnum and assigns it to the Layout field. +func (o *Flow) SetLayout(v FlowLayoutEnum) { + o.Layout = &v +} + +// GetDeniedAction returns the DeniedAction field value if set, zero value otherwise. +func (o *Flow) GetDeniedAction() DeniedActionEnum { + if o == nil || IsNil(o.DeniedAction) { + var ret DeniedActionEnum + return ret + } + return *o.DeniedAction +} + +// GetDeniedActionOk returns a tuple with the DeniedAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetDeniedActionOk() (*DeniedActionEnum, bool) { + if o == nil || IsNil(o.DeniedAction) { + return nil, false + } + return o.DeniedAction, true +} + +// HasDeniedAction returns a boolean if a field has been set. +func (o *Flow) HasDeniedAction() bool { + if o != nil && !IsNil(o.DeniedAction) { + return true + } + + return false +} + +// SetDeniedAction gets a reference to the given DeniedActionEnum and assigns it to the DeniedAction field. +func (o *Flow) SetDeniedAction(v DeniedActionEnum) { + o.DeniedAction = &v +} + +// GetAuthentication returns the Authentication field value if set, zero value otherwise. +func (o *Flow) GetAuthentication() AuthenticationEnum { + if o == nil || IsNil(o.Authentication) { + var ret AuthenticationEnum + return ret + } + return *o.Authentication +} + +// GetAuthenticationOk returns a tuple with the Authentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Flow) GetAuthenticationOk() (*AuthenticationEnum, bool) { + if o == nil || IsNil(o.Authentication) { + return nil, false + } + return o.Authentication, true +} + +// HasAuthentication returns a boolean if a field has been set. +func (o *Flow) HasAuthentication() bool { + if o != nil && !IsNil(o.Authentication) { + return true + } + + return false +} + +// SetAuthentication gets a reference to the given AuthenticationEnum and assigns it to the Authentication field. +func (o *Flow) SetAuthentication(v AuthenticationEnum) { + o.Authentication = &v +} + +func (o Flow) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Flow) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["policybindingmodel_ptr_id"] = o.PolicybindingmodelPtrId + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["title"] = o.Title + toSerialize["designation"] = o.Designation + if !IsNil(o.Background) { + toSerialize["background"] = o.Background + } + toSerialize["background_url"] = o.BackgroundUrl + toSerialize["background_themed_urls"] = o.BackgroundThemedUrls.Get() + toSerialize["stages"] = o.Stages + toSerialize["policies"] = o.Policies + toSerialize["cache_count"] = o.CacheCount + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + toSerialize["export_url"] = o.ExportUrl + if !IsNil(o.Layout) { + toSerialize["layout"] = o.Layout + } + if !IsNil(o.DeniedAction) { + toSerialize["denied_action"] = o.DeniedAction + } + if !IsNil(o.Authentication) { + toSerialize["authentication"] = o.Authentication + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Flow) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "policybindingmodel_ptr_id", + "name", + "slug", + "title", + "designation", + "background_url", + "background_themed_urls", + "stages", + "policies", + "cache_count", + "export_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlow := _Flow{} + + err = json.Unmarshal(data, &varFlow) + + if err != nil { + return err + } + + *o = Flow(varFlow) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "policybindingmodel_ptr_id") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "title") + delete(additionalProperties, "designation") + delete(additionalProperties, "background") + delete(additionalProperties, "background_url") + delete(additionalProperties, "background_themed_urls") + delete(additionalProperties, "stages") + delete(additionalProperties, "policies") + delete(additionalProperties, "cache_count") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "export_url") + delete(additionalProperties, "layout") + delete(additionalProperties, "denied_action") + delete(additionalProperties, "authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlow struct { + value *Flow + isSet bool +} + +func (v NullableFlow) Get() *Flow { + return v.value +} + +func (v *NullableFlow) Set(val *Flow) { + v.value = val + v.isSet = true +} + +func (v NullableFlow) IsSet() bool { + return v.isSet +} + +func (v *NullableFlow) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlow(val *Flow) *NullableFlow { + return &NullableFlow{value: val, isSet: true} +} + +func (v NullableFlow) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlow) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_challenge_response_request.go b/packages/client-go/model_flow_challenge_response_request.go new file mode 100644 index 0000000000..05c7b952e1 --- /dev/null +++ b/packages/client-go/model_flow_challenge_response_request.go @@ -0,0 +1,922 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// FlowChallengeResponseRequest - struct for FlowChallengeResponseRequest +type FlowChallengeResponseRequest struct { + AppleChallengeResponseRequest *AppleChallengeResponseRequest + AuthenticatorDuoChallengeResponseRequest *AuthenticatorDuoChallengeResponseRequest + AuthenticatorEmailChallengeResponseRequest *AuthenticatorEmailChallengeResponseRequest + AuthenticatorSMSChallengeResponseRequest *AuthenticatorSMSChallengeResponseRequest + AuthenticatorStaticChallengeResponseRequest *AuthenticatorStaticChallengeResponseRequest + AuthenticatorTOTPChallengeResponseRequest *AuthenticatorTOTPChallengeResponseRequest + AuthenticatorValidationChallengeResponseRequest *AuthenticatorValidationChallengeResponseRequest + AuthenticatorWebAuthnChallengeResponseRequest *AuthenticatorWebAuthnChallengeResponseRequest + AutoSubmitChallengeResponseRequest *AutoSubmitChallengeResponseRequest + CaptchaChallengeResponseRequest *CaptchaChallengeResponseRequest + ConsentChallengeResponseRequest *ConsentChallengeResponseRequest + DummyChallengeResponseRequest *DummyChallengeResponseRequest + EmailChallengeResponseRequest *EmailChallengeResponseRequest + EndpointAgentChallengeResponseRequest *EndpointAgentChallengeResponseRequest + FrameChallengeResponseRequest *FrameChallengeResponseRequest + IdentificationChallengeResponseRequest *IdentificationChallengeResponseRequest + IframeLogoutChallengeResponseRequest *IframeLogoutChallengeResponseRequest + NativeLogoutChallengeResponseRequest *NativeLogoutChallengeResponseRequest + OAuthDeviceCodeChallengeResponseRequest *OAuthDeviceCodeChallengeResponseRequest + OAuthDeviceCodeFinishChallengeResponseRequest *OAuthDeviceCodeFinishChallengeResponseRequest + PasswordChallengeResponseRequest *PasswordChallengeResponseRequest + PlexAuthenticationChallengeResponseRequest *PlexAuthenticationChallengeResponseRequest + PromptChallengeResponseRequest *PromptChallengeResponseRequest + RedirectChallengeResponseRequest *RedirectChallengeResponseRequest + TelegramChallengeResponseRequest *TelegramChallengeResponseRequest + UserLoginChallengeResponseRequest *UserLoginChallengeResponseRequest +} + +// AppleChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AppleChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AppleChallengeResponseRequestAsFlowChallengeResponseRequest(v *AppleChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AppleChallengeResponseRequest: v, + } +} + +// AuthenticatorDuoChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorDuoChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorDuoChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorDuoChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorDuoChallengeResponseRequest: v, + } +} + +// AuthenticatorEmailChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorEmailChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorEmailChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorEmailChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorEmailChallengeResponseRequest: v, + } +} + +// AuthenticatorSMSChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorSMSChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorSMSChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorSMSChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorSMSChallengeResponseRequest: v, + } +} + +// AuthenticatorStaticChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorStaticChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorStaticChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorStaticChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorStaticChallengeResponseRequest: v, + } +} + +// AuthenticatorTOTPChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorTOTPChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorTOTPChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorTOTPChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorTOTPChallengeResponseRequest: v, + } +} + +// AuthenticatorValidationChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorValidationChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorValidationChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorValidationChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorValidationChallengeResponseRequest: v, + } +} + +// AuthenticatorWebAuthnChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AuthenticatorWebAuthnChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AuthenticatorWebAuthnChallengeResponseRequestAsFlowChallengeResponseRequest(v *AuthenticatorWebAuthnChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AuthenticatorWebAuthnChallengeResponseRequest: v, + } +} + +// AutoSubmitChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns AutoSubmitChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func AutoSubmitChallengeResponseRequestAsFlowChallengeResponseRequest(v *AutoSubmitChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + AutoSubmitChallengeResponseRequest: v, + } +} + +// CaptchaChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns CaptchaChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func CaptchaChallengeResponseRequestAsFlowChallengeResponseRequest(v *CaptchaChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + CaptchaChallengeResponseRequest: v, + } +} + +// ConsentChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns ConsentChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func ConsentChallengeResponseRequestAsFlowChallengeResponseRequest(v *ConsentChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + ConsentChallengeResponseRequest: v, + } +} + +// DummyChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns DummyChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func DummyChallengeResponseRequestAsFlowChallengeResponseRequest(v *DummyChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + DummyChallengeResponseRequest: v, + } +} + +// EmailChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns EmailChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func EmailChallengeResponseRequestAsFlowChallengeResponseRequest(v *EmailChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + EmailChallengeResponseRequest: v, + } +} + +// EndpointAgentChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns EndpointAgentChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func EndpointAgentChallengeResponseRequestAsFlowChallengeResponseRequest(v *EndpointAgentChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + EndpointAgentChallengeResponseRequest: v, + } +} + +// FrameChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns FrameChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func FrameChallengeResponseRequestAsFlowChallengeResponseRequest(v *FrameChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + FrameChallengeResponseRequest: v, + } +} + +// IdentificationChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns IdentificationChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func IdentificationChallengeResponseRequestAsFlowChallengeResponseRequest(v *IdentificationChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + IdentificationChallengeResponseRequest: v, + } +} + +// IframeLogoutChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns IframeLogoutChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func IframeLogoutChallengeResponseRequestAsFlowChallengeResponseRequest(v *IframeLogoutChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + IframeLogoutChallengeResponseRequest: v, + } +} + +// NativeLogoutChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns NativeLogoutChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func NativeLogoutChallengeResponseRequestAsFlowChallengeResponseRequest(v *NativeLogoutChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + NativeLogoutChallengeResponseRequest: v, + } +} + +// OAuthDeviceCodeChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns OAuthDeviceCodeChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func OAuthDeviceCodeChallengeResponseRequestAsFlowChallengeResponseRequest(v *OAuthDeviceCodeChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + OAuthDeviceCodeChallengeResponseRequest: v, + } +} + +// OAuthDeviceCodeFinishChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns OAuthDeviceCodeFinishChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func OAuthDeviceCodeFinishChallengeResponseRequestAsFlowChallengeResponseRequest(v *OAuthDeviceCodeFinishChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + OAuthDeviceCodeFinishChallengeResponseRequest: v, + } +} + +// PasswordChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns PasswordChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func PasswordChallengeResponseRequestAsFlowChallengeResponseRequest(v *PasswordChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + PasswordChallengeResponseRequest: v, + } +} + +// PlexAuthenticationChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns PlexAuthenticationChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func PlexAuthenticationChallengeResponseRequestAsFlowChallengeResponseRequest(v *PlexAuthenticationChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + PlexAuthenticationChallengeResponseRequest: v, + } +} + +// PromptChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns PromptChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func PromptChallengeResponseRequestAsFlowChallengeResponseRequest(v *PromptChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + PromptChallengeResponseRequest: v, + } +} + +// RedirectChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns RedirectChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func RedirectChallengeResponseRequestAsFlowChallengeResponseRequest(v *RedirectChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + RedirectChallengeResponseRequest: v, + } +} + +// TelegramChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns TelegramChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func TelegramChallengeResponseRequestAsFlowChallengeResponseRequest(v *TelegramChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + TelegramChallengeResponseRequest: v, + } +} + +// UserLoginChallengeResponseRequestAsFlowChallengeResponseRequest is a convenience function that returns UserLoginChallengeResponseRequest wrapped in FlowChallengeResponseRequest +func UserLoginChallengeResponseRequestAsFlowChallengeResponseRequest(v *UserLoginChallengeResponseRequest) FlowChallengeResponseRequest { + return FlowChallengeResponseRequest{ + UserLoginChallengeResponseRequest: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *FlowChallengeResponseRequest) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'ak-provider-iframe-logout' + if jsonDict["component"] == "ak-provider-iframe-logout" { + // try to unmarshal JSON data into IframeLogoutChallengeResponseRequest + err = json.Unmarshal(data, &dst.IframeLogoutChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.IframeLogoutChallengeResponseRequest, return on the first match + } else { + dst.IframeLogoutChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as IframeLogoutChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-oauth2-device-code' + if jsonDict["component"] == "ak-provider-oauth2-device-code" { + // try to unmarshal JSON data into OAuthDeviceCodeChallengeResponseRequest + err = json.Unmarshal(data, &dst.OAuthDeviceCodeChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.OAuthDeviceCodeChallengeResponseRequest, return on the first match + } else { + dst.OAuthDeviceCodeChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as OAuthDeviceCodeChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-oauth2-device-code-finish' + if jsonDict["component"] == "ak-provider-oauth2-device-code-finish" { + // try to unmarshal JSON data into OAuthDeviceCodeFinishChallengeResponseRequest + err = json.Unmarshal(data, &dst.OAuthDeviceCodeFinishChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.OAuthDeviceCodeFinishChallengeResponseRequest, return on the first match + } else { + dst.OAuthDeviceCodeFinishChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as OAuthDeviceCodeFinishChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-provider-saml-native-logout' + if jsonDict["component"] == "ak-provider-saml-native-logout" { + // try to unmarshal JSON data into NativeLogoutChallengeResponseRequest + err = json.Unmarshal(data, &dst.NativeLogoutChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.NativeLogoutChallengeResponseRequest, return on the first match + } else { + dst.NativeLogoutChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as NativeLogoutChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-oauth-apple' + if jsonDict["component"] == "ak-source-oauth-apple" { + // try to unmarshal JSON data into AppleChallengeResponseRequest + err = json.Unmarshal(data, &dst.AppleChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AppleChallengeResponseRequest, return on the first match + } else { + dst.AppleChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AppleChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-plex' + if jsonDict["component"] == "ak-source-plex" { + // try to unmarshal JSON data into PlexAuthenticationChallengeResponseRequest + err = json.Unmarshal(data, &dst.PlexAuthenticationChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.PlexAuthenticationChallengeResponseRequest, return on the first match + } else { + dst.PlexAuthenticationChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as PlexAuthenticationChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-telegram' + if jsonDict["component"] == "ak-source-telegram" { + // try to unmarshal JSON data into TelegramChallengeResponseRequest + err = json.Unmarshal(data, &dst.TelegramChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.TelegramChallengeResponseRequest, return on the first match + } else { + dst.TelegramChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as TelegramChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-duo' + if jsonDict["component"] == "ak-stage-authenticator-duo" { + // try to unmarshal JSON data into AuthenticatorDuoChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorDuoChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorDuoChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorDuoChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorDuoChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-email' + if jsonDict["component"] == "ak-stage-authenticator-email" { + // try to unmarshal JSON data into AuthenticatorEmailChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorEmailChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorEmailChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorEmailChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorEmailChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-sms' + if jsonDict["component"] == "ak-stage-authenticator-sms" { + // try to unmarshal JSON data into AuthenticatorSMSChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorSMSChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorSMSChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorSMSChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorSMSChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-static' + if jsonDict["component"] == "ak-stage-authenticator-static" { + // try to unmarshal JSON data into AuthenticatorStaticChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorStaticChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorStaticChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorStaticChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorStaticChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-totp' + if jsonDict["component"] == "ak-stage-authenticator-totp" { + // try to unmarshal JSON data into AuthenticatorTOTPChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorTOTPChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorTOTPChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorTOTPChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorTOTPChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-validate' + if jsonDict["component"] == "ak-stage-authenticator-validate" { + // try to unmarshal JSON data into AuthenticatorValidationChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorValidationChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorValidationChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorValidationChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorValidationChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-authenticator-webauthn' + if jsonDict["component"] == "ak-stage-authenticator-webauthn" { + // try to unmarshal JSON data into AuthenticatorWebAuthnChallengeResponseRequest + err = json.Unmarshal(data, &dst.AuthenticatorWebAuthnChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AuthenticatorWebAuthnChallengeResponseRequest, return on the first match + } else { + dst.AuthenticatorWebAuthnChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AuthenticatorWebAuthnChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-autosubmit' + if jsonDict["component"] == "ak-stage-autosubmit" { + // try to unmarshal JSON data into AutoSubmitChallengeResponseRequest + err = json.Unmarshal(data, &dst.AutoSubmitChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.AutoSubmitChallengeResponseRequest, return on the first match + } else { + dst.AutoSubmitChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as AutoSubmitChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-captcha' + if jsonDict["component"] == "ak-stage-captcha" { + // try to unmarshal JSON data into CaptchaChallengeResponseRequest + err = json.Unmarshal(data, &dst.CaptchaChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.CaptchaChallengeResponseRequest, return on the first match + } else { + dst.CaptchaChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as CaptchaChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-consent' + if jsonDict["component"] == "ak-stage-consent" { + // try to unmarshal JSON data into ConsentChallengeResponseRequest + err = json.Unmarshal(data, &dst.ConsentChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.ConsentChallengeResponseRequest, return on the first match + } else { + dst.ConsentChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as ConsentChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-dummy' + if jsonDict["component"] == "ak-stage-dummy" { + // try to unmarshal JSON data into DummyChallengeResponseRequest + err = json.Unmarshal(data, &dst.DummyChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.DummyChallengeResponseRequest, return on the first match + } else { + dst.DummyChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as DummyChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-email' + if jsonDict["component"] == "ak-stage-email" { + // try to unmarshal JSON data into EmailChallengeResponseRequest + err = json.Unmarshal(data, &dst.EmailChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.EmailChallengeResponseRequest, return on the first match + } else { + dst.EmailChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as EmailChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-endpoint-agent' + if jsonDict["component"] == "ak-stage-endpoint-agent" { + // try to unmarshal JSON data into EndpointAgentChallengeResponseRequest + err = json.Unmarshal(data, &dst.EndpointAgentChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.EndpointAgentChallengeResponseRequest, return on the first match + } else { + dst.EndpointAgentChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as EndpointAgentChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-identification' + if jsonDict["component"] == "ak-stage-identification" { + // try to unmarshal JSON data into IdentificationChallengeResponseRequest + err = json.Unmarshal(data, &dst.IdentificationChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.IdentificationChallengeResponseRequest, return on the first match + } else { + dst.IdentificationChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as IdentificationChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-password' + if jsonDict["component"] == "ak-stage-password" { + // try to unmarshal JSON data into PasswordChallengeResponseRequest + err = json.Unmarshal(data, &dst.PasswordChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.PasswordChallengeResponseRequest, return on the first match + } else { + dst.PasswordChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as PasswordChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-prompt' + if jsonDict["component"] == "ak-stage-prompt" { + // try to unmarshal JSON data into PromptChallengeResponseRequest + err = json.Unmarshal(data, &dst.PromptChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.PromptChallengeResponseRequest, return on the first match + } else { + dst.PromptChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as PromptChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-stage-user-login' + if jsonDict["component"] == "ak-stage-user-login" { + // try to unmarshal JSON data into UserLoginChallengeResponseRequest + err = json.Unmarshal(data, &dst.UserLoginChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.UserLoginChallengeResponseRequest, return on the first match + } else { + dst.UserLoginChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as UserLoginChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-frame' + if jsonDict["component"] == "xak-flow-frame" { + // try to unmarshal JSON data into FrameChallengeResponseRequest + err = json.Unmarshal(data, &dst.FrameChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.FrameChallengeResponseRequest, return on the first match + } else { + dst.FrameChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as FrameChallengeResponseRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-redirect' + if jsonDict["component"] == "xak-flow-redirect" { + // try to unmarshal JSON data into RedirectChallengeResponseRequest + err = json.Unmarshal(data, &dst.RedirectChallengeResponseRequest) + if err == nil { + return nil // data stored in dst.RedirectChallengeResponseRequest, return on the first match + } else { + dst.RedirectChallengeResponseRequest = nil + return fmt.Errorf("failed to unmarshal FlowChallengeResponseRequest as RedirectChallengeResponseRequest: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src FlowChallengeResponseRequest) MarshalJSON() ([]byte, error) { + if src.AppleChallengeResponseRequest != nil { + return json.Marshal(&src.AppleChallengeResponseRequest) + } + + if src.AuthenticatorDuoChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorDuoChallengeResponseRequest) + } + + if src.AuthenticatorEmailChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorEmailChallengeResponseRequest) + } + + if src.AuthenticatorSMSChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorSMSChallengeResponseRequest) + } + + if src.AuthenticatorStaticChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorStaticChallengeResponseRequest) + } + + if src.AuthenticatorTOTPChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorTOTPChallengeResponseRequest) + } + + if src.AuthenticatorValidationChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorValidationChallengeResponseRequest) + } + + if src.AuthenticatorWebAuthnChallengeResponseRequest != nil { + return json.Marshal(&src.AuthenticatorWebAuthnChallengeResponseRequest) + } + + if src.AutoSubmitChallengeResponseRequest != nil { + return json.Marshal(&src.AutoSubmitChallengeResponseRequest) + } + + if src.CaptchaChallengeResponseRequest != nil { + return json.Marshal(&src.CaptchaChallengeResponseRequest) + } + + if src.ConsentChallengeResponseRequest != nil { + return json.Marshal(&src.ConsentChallengeResponseRequest) + } + + if src.DummyChallengeResponseRequest != nil { + return json.Marshal(&src.DummyChallengeResponseRequest) + } + + if src.EmailChallengeResponseRequest != nil { + return json.Marshal(&src.EmailChallengeResponseRequest) + } + + if src.EndpointAgentChallengeResponseRequest != nil { + return json.Marshal(&src.EndpointAgentChallengeResponseRequest) + } + + if src.FrameChallengeResponseRequest != nil { + return json.Marshal(&src.FrameChallengeResponseRequest) + } + + if src.IdentificationChallengeResponseRequest != nil { + return json.Marshal(&src.IdentificationChallengeResponseRequest) + } + + if src.IframeLogoutChallengeResponseRequest != nil { + return json.Marshal(&src.IframeLogoutChallengeResponseRequest) + } + + if src.NativeLogoutChallengeResponseRequest != nil { + return json.Marshal(&src.NativeLogoutChallengeResponseRequest) + } + + if src.OAuthDeviceCodeChallengeResponseRequest != nil { + return json.Marshal(&src.OAuthDeviceCodeChallengeResponseRequest) + } + + if src.OAuthDeviceCodeFinishChallengeResponseRequest != nil { + return json.Marshal(&src.OAuthDeviceCodeFinishChallengeResponseRequest) + } + + if src.PasswordChallengeResponseRequest != nil { + return json.Marshal(&src.PasswordChallengeResponseRequest) + } + + if src.PlexAuthenticationChallengeResponseRequest != nil { + return json.Marshal(&src.PlexAuthenticationChallengeResponseRequest) + } + + if src.PromptChallengeResponseRequest != nil { + return json.Marshal(&src.PromptChallengeResponseRequest) + } + + if src.RedirectChallengeResponseRequest != nil { + return json.Marshal(&src.RedirectChallengeResponseRequest) + } + + if src.TelegramChallengeResponseRequest != nil { + return json.Marshal(&src.TelegramChallengeResponseRequest) + } + + if src.UserLoginChallengeResponseRequest != nil { + return json.Marshal(&src.UserLoginChallengeResponseRequest) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *FlowChallengeResponseRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AppleChallengeResponseRequest != nil { + return obj.AppleChallengeResponseRequest + } + + if obj.AuthenticatorDuoChallengeResponseRequest != nil { + return obj.AuthenticatorDuoChallengeResponseRequest + } + + if obj.AuthenticatorEmailChallengeResponseRequest != nil { + return obj.AuthenticatorEmailChallengeResponseRequest + } + + if obj.AuthenticatorSMSChallengeResponseRequest != nil { + return obj.AuthenticatorSMSChallengeResponseRequest + } + + if obj.AuthenticatorStaticChallengeResponseRequest != nil { + return obj.AuthenticatorStaticChallengeResponseRequest + } + + if obj.AuthenticatorTOTPChallengeResponseRequest != nil { + return obj.AuthenticatorTOTPChallengeResponseRequest + } + + if obj.AuthenticatorValidationChallengeResponseRequest != nil { + return obj.AuthenticatorValidationChallengeResponseRequest + } + + if obj.AuthenticatorWebAuthnChallengeResponseRequest != nil { + return obj.AuthenticatorWebAuthnChallengeResponseRequest + } + + if obj.AutoSubmitChallengeResponseRequest != nil { + return obj.AutoSubmitChallengeResponseRequest + } + + if obj.CaptchaChallengeResponseRequest != nil { + return obj.CaptchaChallengeResponseRequest + } + + if obj.ConsentChallengeResponseRequest != nil { + return obj.ConsentChallengeResponseRequest + } + + if obj.DummyChallengeResponseRequest != nil { + return obj.DummyChallengeResponseRequest + } + + if obj.EmailChallengeResponseRequest != nil { + return obj.EmailChallengeResponseRequest + } + + if obj.EndpointAgentChallengeResponseRequest != nil { + return obj.EndpointAgentChallengeResponseRequest + } + + if obj.FrameChallengeResponseRequest != nil { + return obj.FrameChallengeResponseRequest + } + + if obj.IdentificationChallengeResponseRequest != nil { + return obj.IdentificationChallengeResponseRequest + } + + if obj.IframeLogoutChallengeResponseRequest != nil { + return obj.IframeLogoutChallengeResponseRequest + } + + if obj.NativeLogoutChallengeResponseRequest != nil { + return obj.NativeLogoutChallengeResponseRequest + } + + if obj.OAuthDeviceCodeChallengeResponseRequest != nil { + return obj.OAuthDeviceCodeChallengeResponseRequest + } + + if obj.OAuthDeviceCodeFinishChallengeResponseRequest != nil { + return obj.OAuthDeviceCodeFinishChallengeResponseRequest + } + + if obj.PasswordChallengeResponseRequest != nil { + return obj.PasswordChallengeResponseRequest + } + + if obj.PlexAuthenticationChallengeResponseRequest != nil { + return obj.PlexAuthenticationChallengeResponseRequest + } + + if obj.PromptChallengeResponseRequest != nil { + return obj.PromptChallengeResponseRequest + } + + if obj.RedirectChallengeResponseRequest != nil { + return obj.RedirectChallengeResponseRequest + } + + if obj.TelegramChallengeResponseRequest != nil { + return obj.TelegramChallengeResponseRequest + } + + if obj.UserLoginChallengeResponseRequest != nil { + return obj.UserLoginChallengeResponseRequest + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj FlowChallengeResponseRequest) GetActualInstanceValue() interface{} { + if obj.AppleChallengeResponseRequest != nil { + return *obj.AppleChallengeResponseRequest + } + + if obj.AuthenticatorDuoChallengeResponseRequest != nil { + return *obj.AuthenticatorDuoChallengeResponseRequest + } + + if obj.AuthenticatorEmailChallengeResponseRequest != nil { + return *obj.AuthenticatorEmailChallengeResponseRequest + } + + if obj.AuthenticatorSMSChallengeResponseRequest != nil { + return *obj.AuthenticatorSMSChallengeResponseRequest + } + + if obj.AuthenticatorStaticChallengeResponseRequest != nil { + return *obj.AuthenticatorStaticChallengeResponseRequest + } + + if obj.AuthenticatorTOTPChallengeResponseRequest != nil { + return *obj.AuthenticatorTOTPChallengeResponseRequest + } + + if obj.AuthenticatorValidationChallengeResponseRequest != nil { + return *obj.AuthenticatorValidationChallengeResponseRequest + } + + if obj.AuthenticatorWebAuthnChallengeResponseRequest != nil { + return *obj.AuthenticatorWebAuthnChallengeResponseRequest + } + + if obj.AutoSubmitChallengeResponseRequest != nil { + return *obj.AutoSubmitChallengeResponseRequest + } + + if obj.CaptchaChallengeResponseRequest != nil { + return *obj.CaptchaChallengeResponseRequest + } + + if obj.ConsentChallengeResponseRequest != nil { + return *obj.ConsentChallengeResponseRequest + } + + if obj.DummyChallengeResponseRequest != nil { + return *obj.DummyChallengeResponseRequest + } + + if obj.EmailChallengeResponseRequest != nil { + return *obj.EmailChallengeResponseRequest + } + + if obj.EndpointAgentChallengeResponseRequest != nil { + return *obj.EndpointAgentChallengeResponseRequest + } + + if obj.FrameChallengeResponseRequest != nil { + return *obj.FrameChallengeResponseRequest + } + + if obj.IdentificationChallengeResponseRequest != nil { + return *obj.IdentificationChallengeResponseRequest + } + + if obj.IframeLogoutChallengeResponseRequest != nil { + return *obj.IframeLogoutChallengeResponseRequest + } + + if obj.NativeLogoutChallengeResponseRequest != nil { + return *obj.NativeLogoutChallengeResponseRequest + } + + if obj.OAuthDeviceCodeChallengeResponseRequest != nil { + return *obj.OAuthDeviceCodeChallengeResponseRequest + } + + if obj.OAuthDeviceCodeFinishChallengeResponseRequest != nil { + return *obj.OAuthDeviceCodeFinishChallengeResponseRequest + } + + if obj.PasswordChallengeResponseRequest != nil { + return *obj.PasswordChallengeResponseRequest + } + + if obj.PlexAuthenticationChallengeResponseRequest != nil { + return *obj.PlexAuthenticationChallengeResponseRequest + } + + if obj.PromptChallengeResponseRequest != nil { + return *obj.PromptChallengeResponseRequest + } + + if obj.RedirectChallengeResponseRequest != nil { + return *obj.RedirectChallengeResponseRequest + } + + if obj.TelegramChallengeResponseRequest != nil { + return *obj.TelegramChallengeResponseRequest + } + + if obj.UserLoginChallengeResponseRequest != nil { + return *obj.UserLoginChallengeResponseRequest + } + + // all schemas are nil + return nil +} + +type NullableFlowChallengeResponseRequest struct { + value *FlowChallengeResponseRequest + isSet bool +} + +func (v NullableFlowChallengeResponseRequest) Get() *FlowChallengeResponseRequest { + return v.value +} + +func (v *NullableFlowChallengeResponseRequest) Set(val *FlowChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFlowChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowChallengeResponseRequest(val *FlowChallengeResponseRequest) *NullableFlowChallengeResponseRequest { + return &NullableFlowChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableFlowChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_designation_enum.go b/packages/client-go/model_flow_designation_enum.go new file mode 100644 index 0000000000..f5e7579494 --- /dev/null +++ b/packages/client-go/model_flow_designation_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// FlowDesignationEnum the model 'FlowDesignationEnum' +type FlowDesignationEnum string + +// List of FlowDesignationEnum +const ( + FLOWDESIGNATIONENUM_AUTHENTICATION FlowDesignationEnum = "authentication" + FLOWDESIGNATIONENUM_AUTHORIZATION FlowDesignationEnum = "authorization" + FLOWDESIGNATIONENUM_INVALIDATION FlowDesignationEnum = "invalidation" + FLOWDESIGNATIONENUM_ENROLLMENT FlowDesignationEnum = "enrollment" + FLOWDESIGNATIONENUM_UNENROLLMENT FlowDesignationEnum = "unenrollment" + FLOWDESIGNATIONENUM_RECOVERY FlowDesignationEnum = "recovery" + FLOWDESIGNATIONENUM_STAGE_CONFIGURATION FlowDesignationEnum = "stage_configuration" +) + +// All allowed values of FlowDesignationEnum enum +var AllowedFlowDesignationEnumEnumValues = []FlowDesignationEnum{ + "authentication", + "authorization", + "invalidation", + "enrollment", + "unenrollment", + "recovery", + "stage_configuration", +} + +func (v *FlowDesignationEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlowDesignationEnum(value) + for _, existing := range AllowedFlowDesignationEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlowDesignationEnum", value) +} + +// NewFlowDesignationEnumFromValue returns a pointer to a valid FlowDesignationEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlowDesignationEnumFromValue(v string) (*FlowDesignationEnum, error) { + ev := FlowDesignationEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlowDesignationEnum: valid values are %v", v, AllowedFlowDesignationEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlowDesignationEnum) IsValid() bool { + for _, existing := range AllowedFlowDesignationEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlowDesignationEnum value +func (v FlowDesignationEnum) Ptr() *FlowDesignationEnum { + return &v +} + +type NullableFlowDesignationEnum struct { + value *FlowDesignationEnum + isSet bool +} + +func (v NullableFlowDesignationEnum) Get() *FlowDesignationEnum { + return v.value +} + +func (v *NullableFlowDesignationEnum) Set(val *FlowDesignationEnum) { + v.value = val + v.isSet = true +} + +func (v NullableFlowDesignationEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowDesignationEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowDesignationEnum(val *FlowDesignationEnum) *NullableFlowDesignationEnum { + return &NullableFlowDesignationEnum{value: val, isSet: true} +} + +func (v NullableFlowDesignationEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowDesignationEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_diagram.go b/packages/client-go/model_flow_diagram.go new file mode 100644 index 0000000000..15d973260d --- /dev/null +++ b/packages/client-go/model_flow_diagram.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowDiagram type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowDiagram{} + +// FlowDiagram response of the flow's diagram action +type FlowDiagram struct { + Diagram string `json:"diagram"` + AdditionalProperties map[string]interface{} +} + +type _FlowDiagram FlowDiagram + +// NewFlowDiagram instantiates a new FlowDiagram object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowDiagram(diagram string) *FlowDiagram { + this := FlowDiagram{} + this.Diagram = diagram + return &this +} + +// NewFlowDiagramWithDefaults instantiates a new FlowDiagram object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowDiagramWithDefaults() *FlowDiagram { + this := FlowDiagram{} + return &this +} + +// GetDiagram returns the Diagram field value +func (o *FlowDiagram) GetDiagram() string { + if o == nil { + var ret string + return ret + } + + return o.Diagram +} + +// GetDiagramOk returns a tuple with the Diagram field value +// and a boolean to check if the value has been set. +func (o *FlowDiagram) GetDiagramOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Diagram, true +} + +// SetDiagram sets field value +func (o *FlowDiagram) SetDiagram(v string) { + o.Diagram = v +} + +func (o FlowDiagram) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowDiagram) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["diagram"] = o.Diagram + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowDiagram) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diagram", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowDiagram := _FlowDiagram{} + + err = json.Unmarshal(data, &varFlowDiagram) + + if err != nil { + return err + } + + *o = FlowDiagram(varFlowDiagram) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "diagram") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowDiagram struct { + value *FlowDiagram + isSet bool +} + +func (v NullableFlowDiagram) Get() *FlowDiagram { + return v.value +} + +func (v *NullableFlowDiagram) Set(val *FlowDiagram) { + v.value = val + v.isSet = true +} + +func (v NullableFlowDiagram) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowDiagram) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowDiagram(val *FlowDiagram) *NullableFlowDiagram { + return &NullableFlowDiagram{value: val, isSet: true} +} + +func (v NullableFlowDiagram) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowDiagram) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_error_challenge.go b/packages/client-go/model_flow_error_challenge.go new file mode 100644 index 0000000000..98e0a4559a --- /dev/null +++ b/packages/client-go/model_flow_error_challenge.go @@ -0,0 +1,356 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowErrorChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowErrorChallenge{} + +// FlowErrorChallenge Challenge class when an unhandled error occurs during a stage. Normal users are shown an error message, superusers are shown a full stacktrace. +type FlowErrorChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + RequestId string `json:"request_id"` + Error *string `json:"error,omitempty"` + Traceback *string `json:"traceback,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlowErrorChallenge FlowErrorChallenge + +// NewFlowErrorChallenge instantiates a new FlowErrorChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowErrorChallenge(requestId string) *FlowErrorChallenge { + this := FlowErrorChallenge{} + var component string = "ak-stage-flow-error" + this.Component = &component + this.RequestId = requestId + return &this +} + +// NewFlowErrorChallengeWithDefaults instantiates a new FlowErrorChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowErrorChallengeWithDefaults() *FlowErrorChallenge { + this := FlowErrorChallenge{} + var component string = "ak-stage-flow-error" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *FlowErrorChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *FlowErrorChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *FlowErrorChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *FlowErrorChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *FlowErrorChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *FlowErrorChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *FlowErrorChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *FlowErrorChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *FlowErrorChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetRequestId returns the RequestId field value +func (o *FlowErrorChallenge) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *FlowErrorChallenge) SetRequestId(v string) { + o.RequestId = v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *FlowErrorChallenge) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *FlowErrorChallenge) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *FlowErrorChallenge) SetError(v string) { + o.Error = &v +} + +// GetTraceback returns the Traceback field value if set, zero value otherwise. +func (o *FlowErrorChallenge) GetTraceback() string { + if o == nil || IsNil(o.Traceback) { + var ret string + return ret + } + return *o.Traceback +} + +// GetTracebackOk returns a tuple with the Traceback field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowErrorChallenge) GetTracebackOk() (*string, bool) { + if o == nil || IsNil(o.Traceback) { + return nil, false + } + return o.Traceback, true +} + +// HasTraceback returns a boolean if a field has been set. +func (o *FlowErrorChallenge) HasTraceback() bool { + if o != nil && !IsNil(o.Traceback) { + return true + } + + return false +} + +// SetTraceback gets a reference to the given string and assigns it to the Traceback field. +func (o *FlowErrorChallenge) SetTraceback(v string) { + o.Traceback = &v +} + +func (o FlowErrorChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowErrorChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["request_id"] = o.RequestId + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + if !IsNil(o.Traceback) { + toSerialize["traceback"] = o.Traceback + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowErrorChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "request_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowErrorChallenge := _FlowErrorChallenge{} + + err = json.Unmarshal(data, &varFlowErrorChallenge) + + if err != nil { + return err + } + + *o = FlowErrorChallenge(varFlowErrorChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "request_id") + delete(additionalProperties, "error") + delete(additionalProperties, "traceback") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowErrorChallenge struct { + value *FlowErrorChallenge + isSet bool +} + +func (v NullableFlowErrorChallenge) Get() *FlowErrorChallenge { + return v.value +} + +func (v *NullableFlowErrorChallenge) Set(val *FlowErrorChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableFlowErrorChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowErrorChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowErrorChallenge(val *FlowErrorChallenge) *NullableFlowErrorChallenge { + return &NullableFlowErrorChallenge{value: val, isSet: true} +} + +func (v NullableFlowErrorChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowErrorChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_import_result.go b/packages/client-go/model_flow_import_result.go new file mode 100644 index 0000000000..810fc5664c --- /dev/null +++ b/packages/client-go/model_flow_import_result.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowImportResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowImportResult{} + +// FlowImportResult Logs of an attempted flow import +type FlowImportResult struct { + Logs []LogEvent `json:"logs"` + Success bool `json:"success"` + AdditionalProperties map[string]interface{} +} + +type _FlowImportResult FlowImportResult + +// NewFlowImportResult instantiates a new FlowImportResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowImportResult(logs []LogEvent, success bool) *FlowImportResult { + this := FlowImportResult{} + this.Logs = logs + this.Success = success + return &this +} + +// NewFlowImportResultWithDefaults instantiates a new FlowImportResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowImportResultWithDefaults() *FlowImportResult { + this := FlowImportResult{} + return &this +} + +// GetLogs returns the Logs field value +func (o *FlowImportResult) GetLogs() []LogEvent { + if o == nil { + var ret []LogEvent + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *FlowImportResult) GetLogsOk() ([]LogEvent, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *FlowImportResult) SetLogs(v []LogEvent) { + o.Logs = v +} + +// GetSuccess returns the Success field value +func (o *FlowImportResult) GetSuccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.Success +} + +// GetSuccessOk returns a tuple with the Success field value +// and a boolean to check if the value has been set. +func (o *FlowImportResult) GetSuccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Success, true +} + +// SetSuccess sets field value +func (o *FlowImportResult) SetSuccess(v bool) { + o.Success = v +} + +func (o FlowImportResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowImportResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["logs"] = o.Logs + toSerialize["success"] = o.Success + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowImportResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "logs", + "success", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowImportResult := _FlowImportResult{} + + err = json.Unmarshal(data, &varFlowImportResult) + + if err != nil { + return err + } + + *o = FlowImportResult(varFlowImportResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "logs") + delete(additionalProperties, "success") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowImportResult struct { + value *FlowImportResult + isSet bool +} + +func (v NullableFlowImportResult) Get() *FlowImportResult { + return v.value +} + +func (v *NullableFlowImportResult) Set(val *FlowImportResult) { + v.value = val + v.isSet = true +} + +func (v NullableFlowImportResult) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowImportResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowImportResult(val *FlowImportResult) *NullableFlowImportResult { + return &NullableFlowImportResult{value: val, isSet: true} +} + +func (v NullableFlowImportResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowImportResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_inspection.go b/packages/client-go/model_flow_inspection.go new file mode 100644 index 0000000000..fafa51671d --- /dev/null +++ b/packages/client-go/model_flow_inspection.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowInspection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowInspection{} + +// FlowInspection Serializer for inspect endpoint +type FlowInspection struct { + Plans []FlowInspectorPlan `json:"plans"` + CurrentPlan *FlowInspectorPlan `json:"current_plan,omitempty"` + IsCompleted bool `json:"is_completed"` + AdditionalProperties map[string]interface{} +} + +type _FlowInspection FlowInspection + +// NewFlowInspection instantiates a new FlowInspection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowInspection(plans []FlowInspectorPlan, isCompleted bool) *FlowInspection { + this := FlowInspection{} + this.Plans = plans + this.IsCompleted = isCompleted + return &this +} + +// NewFlowInspectionWithDefaults instantiates a new FlowInspection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowInspectionWithDefaults() *FlowInspection { + this := FlowInspection{} + return &this +} + +// GetPlans returns the Plans field value +func (o *FlowInspection) GetPlans() []FlowInspectorPlan { + if o == nil { + var ret []FlowInspectorPlan + return ret + } + + return o.Plans +} + +// GetPlansOk returns a tuple with the Plans field value +// and a boolean to check if the value has been set. +func (o *FlowInspection) GetPlansOk() ([]FlowInspectorPlan, bool) { + if o == nil { + return nil, false + } + return o.Plans, true +} + +// SetPlans sets field value +func (o *FlowInspection) SetPlans(v []FlowInspectorPlan) { + o.Plans = v +} + +// GetCurrentPlan returns the CurrentPlan field value if set, zero value otherwise. +func (o *FlowInspection) GetCurrentPlan() FlowInspectorPlan { + if o == nil || IsNil(o.CurrentPlan) { + var ret FlowInspectorPlan + return ret + } + return *o.CurrentPlan +} + +// GetCurrentPlanOk returns a tuple with the CurrentPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowInspection) GetCurrentPlanOk() (*FlowInspectorPlan, bool) { + if o == nil || IsNil(o.CurrentPlan) { + return nil, false + } + return o.CurrentPlan, true +} + +// HasCurrentPlan returns a boolean if a field has been set. +func (o *FlowInspection) HasCurrentPlan() bool { + if o != nil && !IsNil(o.CurrentPlan) { + return true + } + + return false +} + +// SetCurrentPlan gets a reference to the given FlowInspectorPlan and assigns it to the CurrentPlan field. +func (o *FlowInspection) SetCurrentPlan(v FlowInspectorPlan) { + o.CurrentPlan = &v +} + +// GetIsCompleted returns the IsCompleted field value +func (o *FlowInspection) GetIsCompleted() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsCompleted +} + +// GetIsCompletedOk returns a tuple with the IsCompleted field value +// and a boolean to check if the value has been set. +func (o *FlowInspection) GetIsCompletedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsCompleted, true +} + +// SetIsCompleted sets field value +func (o *FlowInspection) SetIsCompleted(v bool) { + o.IsCompleted = v +} + +func (o FlowInspection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowInspection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["plans"] = o.Plans + if !IsNil(o.CurrentPlan) { + toSerialize["current_plan"] = o.CurrentPlan + } + toSerialize["is_completed"] = o.IsCompleted + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowInspection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "plans", + "is_completed", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowInspection := _FlowInspection{} + + err = json.Unmarshal(data, &varFlowInspection) + + if err != nil { + return err + } + + *o = FlowInspection(varFlowInspection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "plans") + delete(additionalProperties, "current_plan") + delete(additionalProperties, "is_completed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowInspection struct { + value *FlowInspection + isSet bool +} + +func (v NullableFlowInspection) Get() *FlowInspection { + return v.value +} + +func (v *NullableFlowInspection) Set(val *FlowInspection) { + v.value = val + v.isSet = true +} + +func (v NullableFlowInspection) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowInspection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowInspection(val *FlowInspection) *NullableFlowInspection { + return &NullableFlowInspection{value: val, isSet: true} +} + +func (v NullableFlowInspection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowInspection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_inspector_plan.go b/packages/client-go/model_flow_inspector_plan.go new file mode 100644 index 0000000000..889b9d60e7 --- /dev/null +++ b/packages/client-go/model_flow_inspector_plan.go @@ -0,0 +1,256 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowInspectorPlan type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowInspectorPlan{} + +// FlowInspectorPlan Serializer for an active FlowPlan +type FlowInspectorPlan struct { + CurrentStage FlowStageBinding `json:"current_stage"` + NextPlannedStage FlowStageBinding `json:"next_planned_stage"` + // Get the plan's context, sanitized + PlanContext map[string]interface{} `json:"plan_context"` + // Get a unique session ID + SessionId string `json:"session_id"` + AdditionalProperties map[string]interface{} +} + +type _FlowInspectorPlan FlowInspectorPlan + +// NewFlowInspectorPlan instantiates a new FlowInspectorPlan object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowInspectorPlan(currentStage FlowStageBinding, nextPlannedStage FlowStageBinding, planContext map[string]interface{}, sessionId string) *FlowInspectorPlan { + this := FlowInspectorPlan{} + this.CurrentStage = currentStage + this.NextPlannedStage = nextPlannedStage + this.PlanContext = planContext + this.SessionId = sessionId + return &this +} + +// NewFlowInspectorPlanWithDefaults instantiates a new FlowInspectorPlan object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowInspectorPlanWithDefaults() *FlowInspectorPlan { + this := FlowInspectorPlan{} + return &this +} + +// GetCurrentStage returns the CurrentStage field value +func (o *FlowInspectorPlan) GetCurrentStage() FlowStageBinding { + if o == nil { + var ret FlowStageBinding + return ret + } + + return o.CurrentStage +} + +// GetCurrentStageOk returns a tuple with the CurrentStage field value +// and a boolean to check if the value has been set. +func (o *FlowInspectorPlan) GetCurrentStageOk() (*FlowStageBinding, bool) { + if o == nil { + return nil, false + } + return &o.CurrentStage, true +} + +// SetCurrentStage sets field value +func (o *FlowInspectorPlan) SetCurrentStage(v FlowStageBinding) { + o.CurrentStage = v +} + +// GetNextPlannedStage returns the NextPlannedStage field value +func (o *FlowInspectorPlan) GetNextPlannedStage() FlowStageBinding { + if o == nil { + var ret FlowStageBinding + return ret + } + + return o.NextPlannedStage +} + +// GetNextPlannedStageOk returns a tuple with the NextPlannedStage field value +// and a boolean to check if the value has been set. +func (o *FlowInspectorPlan) GetNextPlannedStageOk() (*FlowStageBinding, bool) { + if o == nil { + return nil, false + } + return &o.NextPlannedStage, true +} + +// SetNextPlannedStage sets field value +func (o *FlowInspectorPlan) SetNextPlannedStage(v FlowStageBinding) { + o.NextPlannedStage = v +} + +// GetPlanContext returns the PlanContext field value +func (o *FlowInspectorPlan) GetPlanContext() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.PlanContext +} + +// GetPlanContextOk returns a tuple with the PlanContext field value +// and a boolean to check if the value has been set. +func (o *FlowInspectorPlan) GetPlanContextOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.PlanContext, true +} + +// SetPlanContext sets field value +func (o *FlowInspectorPlan) SetPlanContext(v map[string]interface{}) { + o.PlanContext = v +} + +// GetSessionId returns the SessionId field value +func (o *FlowInspectorPlan) GetSessionId() string { + if o == nil { + var ret string + return ret + } + + return o.SessionId +} + +// GetSessionIdOk returns a tuple with the SessionId field value +// and a boolean to check if the value has been set. +func (o *FlowInspectorPlan) GetSessionIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SessionId, true +} + +// SetSessionId sets field value +func (o *FlowInspectorPlan) SetSessionId(v string) { + o.SessionId = v +} + +func (o FlowInspectorPlan) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowInspectorPlan) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["current_stage"] = o.CurrentStage + toSerialize["next_planned_stage"] = o.NextPlannedStage + toSerialize["plan_context"] = o.PlanContext + toSerialize["session_id"] = o.SessionId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowInspectorPlan) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "current_stage", + "next_planned_stage", + "plan_context", + "session_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowInspectorPlan := _FlowInspectorPlan{} + + err = json.Unmarshal(data, &varFlowInspectorPlan) + + if err != nil { + return err + } + + *o = FlowInspectorPlan(varFlowInspectorPlan) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "current_stage") + delete(additionalProperties, "next_planned_stage") + delete(additionalProperties, "plan_context") + delete(additionalProperties, "session_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowInspectorPlan struct { + value *FlowInspectorPlan + isSet bool +} + +func (v NullableFlowInspectorPlan) Get() *FlowInspectorPlan { + return v.value +} + +func (v *NullableFlowInspectorPlan) Set(val *FlowInspectorPlan) { + v.value = val + v.isSet = true +} + +func (v NullableFlowInspectorPlan) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowInspectorPlan) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowInspectorPlan(val *FlowInspectorPlan) *NullableFlowInspectorPlan { + return &NullableFlowInspectorPlan{value: val, isSet: true} +} + +func (v NullableFlowInspectorPlan) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowInspectorPlan) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_layout_enum.go b/packages/client-go/model_flow_layout_enum.go new file mode 100644 index 0000000000..1cb8f5d4e1 --- /dev/null +++ b/packages/client-go/model_flow_layout_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// FlowLayoutEnum the model 'FlowLayoutEnum' +type FlowLayoutEnum string + +// List of FlowLayoutEnum +const ( + FLOWLAYOUTENUM_STACKED FlowLayoutEnum = "stacked" + FLOWLAYOUTENUM_CONTENT_LEFT FlowLayoutEnum = "content_left" + FLOWLAYOUTENUM_CONTENT_RIGHT FlowLayoutEnum = "content_right" + FLOWLAYOUTENUM_SIDEBAR_LEFT FlowLayoutEnum = "sidebar_left" + FLOWLAYOUTENUM_SIDEBAR_RIGHT FlowLayoutEnum = "sidebar_right" + FLOWLAYOUTENUM_SIDEBAR_LEFT_FRAME_BACKGROUND FlowLayoutEnum = "sidebar_left_frame_background" + FLOWLAYOUTENUM_SIDEBAR_RIGHT_FRAME_BACKGROUND FlowLayoutEnum = "sidebar_right_frame_background" +) + +// All allowed values of FlowLayoutEnum enum +var AllowedFlowLayoutEnumEnumValues = []FlowLayoutEnum{ + "stacked", + "content_left", + "content_right", + "sidebar_left", + "sidebar_right", + "sidebar_left_frame_background", + "sidebar_right_frame_background", +} + +func (v *FlowLayoutEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := FlowLayoutEnum(value) + for _, existing := range AllowedFlowLayoutEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FlowLayoutEnum", value) +} + +// NewFlowLayoutEnumFromValue returns a pointer to a valid FlowLayoutEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewFlowLayoutEnumFromValue(v string) (*FlowLayoutEnum, error) { + ev := FlowLayoutEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FlowLayoutEnum: valid values are %v", v, AllowedFlowLayoutEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v FlowLayoutEnum) IsValid() bool { + for _, existing := range AllowedFlowLayoutEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlowLayoutEnum value +func (v FlowLayoutEnum) Ptr() *FlowLayoutEnum { + return &v +} + +type NullableFlowLayoutEnum struct { + value *FlowLayoutEnum + isSet bool +} + +func (v NullableFlowLayoutEnum) Get() *FlowLayoutEnum { + return v.value +} + +func (v *NullableFlowLayoutEnum) Set(val *FlowLayoutEnum) { + v.value = val + v.isSet = true +} + +func (v NullableFlowLayoutEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowLayoutEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowLayoutEnum(val *FlowLayoutEnum) *NullableFlowLayoutEnum { + return &NullableFlowLayoutEnum{value: val, isSet: true} +} + +func (v NullableFlowLayoutEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowLayoutEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_request.go b/packages/client-go/model_flow_request.go new file mode 100644 index 0000000000..3d6d2cc2fe --- /dev/null +++ b/packages/client-go/model_flow_request.go @@ -0,0 +1,483 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowRequest{} + +// FlowRequest Flow Serializer +type FlowRequest struct { + Name string `json:"name"` + // Visible in the URL. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + // Shown as the Title in Flow pages. + Title string `json:"title"` + // Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik. + Designation FlowDesignationEnum `json:"designation"` + // Background shown during execution + Background *string `json:"background,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Enable compatibility mode, increases compatibility with password managers on mobile devices. + CompatibilityMode *bool `json:"compatibility_mode,omitempty"` + Layout *FlowLayoutEnum `json:"layout,omitempty"` + // Configure what should happen when a flow denies access to a user. + DeniedAction *DeniedActionEnum `json:"denied_action,omitempty"` + // Required level of authentication and authorization to access a flow. + Authentication *AuthenticationEnum `json:"authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlowRequest FlowRequest + +// NewFlowRequest instantiates a new FlowRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowRequest(name string, slug string, title string, designation FlowDesignationEnum) *FlowRequest { + this := FlowRequest{} + this.Name = name + this.Slug = slug + this.Title = title + this.Designation = designation + return &this +} + +// NewFlowRequestWithDefaults instantiates a new FlowRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowRequestWithDefaults() *FlowRequest { + this := FlowRequest{} + return &this +} + +// GetName returns the Name field value +func (o *FlowRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FlowRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *FlowRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *FlowRequest) SetSlug(v string) { + o.Slug = v +} + +// GetTitle returns the Title field value +func (o *FlowRequest) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *FlowRequest) SetTitle(v string) { + o.Title = v +} + +// GetDesignation returns the Designation field value +func (o *FlowRequest) GetDesignation() FlowDesignationEnum { + if o == nil { + var ret FlowDesignationEnum + return ret + } + + return o.Designation +} + +// GetDesignationOk returns a tuple with the Designation field value +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetDesignationOk() (*FlowDesignationEnum, bool) { + if o == nil { + return nil, false + } + return &o.Designation, true +} + +// SetDesignation sets field value +func (o *FlowRequest) SetDesignation(v FlowDesignationEnum) { + o.Designation = v +} + +// GetBackground returns the Background field value if set, zero value otherwise. +func (o *FlowRequest) GetBackground() string { + if o == nil || IsNil(o.Background) { + var ret string + return ret + } + return *o.Background +} + +// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.Background) { + return nil, false + } + return o.Background, true +} + +// HasBackground returns a boolean if a field has been set. +func (o *FlowRequest) HasBackground() bool { + if o != nil && !IsNil(o.Background) { + return true + } + + return false +} + +// SetBackground gets a reference to the given string and assigns it to the Background field. +func (o *FlowRequest) SetBackground(v string) { + o.Background = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *FlowRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *FlowRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *FlowRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *FlowRequest) GetCompatibilityMode() bool { + if o == nil || IsNil(o.CompatibilityMode) { + var ret bool + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetCompatibilityModeOk() (*bool, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *FlowRequest) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given bool and assigns it to the CompatibilityMode field. +func (o *FlowRequest) SetCompatibilityMode(v bool) { + o.CompatibilityMode = &v +} + +// GetLayout returns the Layout field value if set, zero value otherwise. +func (o *FlowRequest) GetLayout() FlowLayoutEnum { + if o == nil || IsNil(o.Layout) { + var ret FlowLayoutEnum + return ret + } + return *o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetLayoutOk() (*FlowLayoutEnum, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *FlowRequest) HasLayout() bool { + if o != nil && !IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given FlowLayoutEnum and assigns it to the Layout field. +func (o *FlowRequest) SetLayout(v FlowLayoutEnum) { + o.Layout = &v +} + +// GetDeniedAction returns the DeniedAction field value if set, zero value otherwise. +func (o *FlowRequest) GetDeniedAction() DeniedActionEnum { + if o == nil || IsNil(o.DeniedAction) { + var ret DeniedActionEnum + return ret + } + return *o.DeniedAction +} + +// GetDeniedActionOk returns a tuple with the DeniedAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetDeniedActionOk() (*DeniedActionEnum, bool) { + if o == nil || IsNil(o.DeniedAction) { + return nil, false + } + return o.DeniedAction, true +} + +// HasDeniedAction returns a boolean if a field has been set. +func (o *FlowRequest) HasDeniedAction() bool { + if o != nil && !IsNil(o.DeniedAction) { + return true + } + + return false +} + +// SetDeniedAction gets a reference to the given DeniedActionEnum and assigns it to the DeniedAction field. +func (o *FlowRequest) SetDeniedAction(v DeniedActionEnum) { + o.DeniedAction = &v +} + +// GetAuthentication returns the Authentication field value if set, zero value otherwise. +func (o *FlowRequest) GetAuthentication() AuthenticationEnum { + if o == nil || IsNil(o.Authentication) { + var ret AuthenticationEnum + return ret + } + return *o.Authentication +} + +// GetAuthenticationOk returns a tuple with the Authentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowRequest) GetAuthenticationOk() (*AuthenticationEnum, bool) { + if o == nil || IsNil(o.Authentication) { + return nil, false + } + return o.Authentication, true +} + +// HasAuthentication returns a boolean if a field has been set. +func (o *FlowRequest) HasAuthentication() bool { + if o != nil && !IsNil(o.Authentication) { + return true + } + + return false +} + +// SetAuthentication gets a reference to the given AuthenticationEnum and assigns it to the Authentication field. +func (o *FlowRequest) SetAuthentication(v AuthenticationEnum) { + o.Authentication = &v +} + +func (o FlowRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["title"] = o.Title + toSerialize["designation"] = o.Designation + if !IsNil(o.Background) { + toSerialize["background"] = o.Background + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + if !IsNil(o.Layout) { + toSerialize["layout"] = o.Layout + } + if !IsNil(o.DeniedAction) { + toSerialize["denied_action"] = o.DeniedAction + } + if !IsNil(o.Authentication) { + toSerialize["authentication"] = o.Authentication + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "title", + "designation", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowRequest := _FlowRequest{} + + err = json.Unmarshal(data, &varFlowRequest) + + if err != nil { + return err + } + + *o = FlowRequest(varFlowRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "title") + delete(additionalProperties, "designation") + delete(additionalProperties, "background") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "layout") + delete(additionalProperties, "denied_action") + delete(additionalProperties, "authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowRequest struct { + value *FlowRequest + isSet bool +} + +func (v NullableFlowRequest) Get() *FlowRequest { + return v.value +} + +func (v *NullableFlowRequest) Set(val *FlowRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFlowRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowRequest(val *FlowRequest) *NullableFlowRequest { + return &NullableFlowRequest{value: val, isSet: true} +} + +func (v NullableFlowRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_set.go b/packages/client-go/model_flow_set.go new file mode 100644 index 0000000000..20535684d3 --- /dev/null +++ b/packages/client-go/model_flow_set.go @@ -0,0 +1,525 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowSet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowSet{} + +// FlowSet Stripped down flow serializer +type FlowSet struct { + Pk string `json:"pk"` + PolicybindingmodelPtrId string `json:"policybindingmodel_ptr_id"` + Name string `json:"name"` + // Visible in the URL. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + // Shown as the Title in Flow pages. + Title string `json:"title"` + // Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik. + Designation FlowDesignationEnum `json:"designation"` + // Get the URL to the background image + BackgroundUrl string `json:"background_url"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Enable compatibility mode, increases compatibility with password managers on mobile devices. + CompatibilityMode *bool `json:"compatibility_mode,omitempty"` + // Get export URL for flow + ExportUrl string `json:"export_url"` + Layout *FlowLayoutEnum `json:"layout,omitempty"` + // Configure what should happen when a flow denies access to a user. + DeniedAction *DeniedActionEnum `json:"denied_action,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlowSet FlowSet + +// NewFlowSet instantiates a new FlowSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowSet(pk string, policybindingmodelPtrId string, name string, slug string, title string, designation FlowDesignationEnum, backgroundUrl string, exportUrl string) *FlowSet { + this := FlowSet{} + this.Pk = pk + this.PolicybindingmodelPtrId = policybindingmodelPtrId + this.Name = name + this.Slug = slug + this.Title = title + this.Designation = designation + this.BackgroundUrl = backgroundUrl + this.ExportUrl = exportUrl + return &this +} + +// NewFlowSetWithDefaults instantiates a new FlowSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowSetWithDefaults() *FlowSet { + this := FlowSet{} + return &this +} + +// GetPk returns the Pk field value +func (o *FlowSet) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *FlowSet) SetPk(v string) { + o.Pk = v +} + +// GetPolicybindingmodelPtrId returns the PolicybindingmodelPtrId field value +func (o *FlowSet) GetPolicybindingmodelPtrId() string { + if o == nil { + var ret string + return ret + } + + return o.PolicybindingmodelPtrId +} + +// GetPolicybindingmodelPtrIdOk returns a tuple with the PolicybindingmodelPtrId field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetPolicybindingmodelPtrIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicybindingmodelPtrId, true +} + +// SetPolicybindingmodelPtrId sets field value +func (o *FlowSet) SetPolicybindingmodelPtrId(v string) { + o.PolicybindingmodelPtrId = v +} + +// GetName returns the Name field value +func (o *FlowSet) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FlowSet) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *FlowSet) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *FlowSet) SetSlug(v string) { + o.Slug = v +} + +// GetTitle returns the Title field value +func (o *FlowSet) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *FlowSet) SetTitle(v string) { + o.Title = v +} + +// GetDesignation returns the Designation field value +func (o *FlowSet) GetDesignation() FlowDesignationEnum { + if o == nil { + var ret FlowDesignationEnum + return ret + } + + return o.Designation +} + +// GetDesignationOk returns a tuple with the Designation field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetDesignationOk() (*FlowDesignationEnum, bool) { + if o == nil { + return nil, false + } + return &o.Designation, true +} + +// SetDesignation sets field value +func (o *FlowSet) SetDesignation(v FlowDesignationEnum) { + o.Designation = v +} + +// GetBackgroundUrl returns the BackgroundUrl field value +func (o *FlowSet) GetBackgroundUrl() string { + if o == nil { + var ret string + return ret + } + + return o.BackgroundUrl +} + +// GetBackgroundUrlOk returns a tuple with the BackgroundUrl field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetBackgroundUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BackgroundUrl, true +} + +// SetBackgroundUrl sets field value +func (o *FlowSet) SetBackgroundUrl(v string) { + o.BackgroundUrl = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *FlowSet) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowSet) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *FlowSet) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *FlowSet) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *FlowSet) GetCompatibilityMode() bool { + if o == nil || IsNil(o.CompatibilityMode) { + var ret bool + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowSet) GetCompatibilityModeOk() (*bool, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *FlowSet) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given bool and assigns it to the CompatibilityMode field. +func (o *FlowSet) SetCompatibilityMode(v bool) { + o.CompatibilityMode = &v +} + +// GetExportUrl returns the ExportUrl field value +func (o *FlowSet) GetExportUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ExportUrl +} + +// GetExportUrlOk returns a tuple with the ExportUrl field value +// and a boolean to check if the value has been set. +func (o *FlowSet) GetExportUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExportUrl, true +} + +// SetExportUrl sets field value +func (o *FlowSet) SetExportUrl(v string) { + o.ExportUrl = v +} + +// GetLayout returns the Layout field value if set, zero value otherwise. +func (o *FlowSet) GetLayout() FlowLayoutEnum { + if o == nil || IsNil(o.Layout) { + var ret FlowLayoutEnum + return ret + } + return *o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowSet) GetLayoutOk() (*FlowLayoutEnum, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *FlowSet) HasLayout() bool { + if o != nil && !IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given FlowLayoutEnum and assigns it to the Layout field. +func (o *FlowSet) SetLayout(v FlowLayoutEnum) { + o.Layout = &v +} + +// GetDeniedAction returns the DeniedAction field value if set, zero value otherwise. +func (o *FlowSet) GetDeniedAction() DeniedActionEnum { + if o == nil || IsNil(o.DeniedAction) { + var ret DeniedActionEnum + return ret + } + return *o.DeniedAction +} + +// GetDeniedActionOk returns a tuple with the DeniedAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowSet) GetDeniedActionOk() (*DeniedActionEnum, bool) { + if o == nil || IsNil(o.DeniedAction) { + return nil, false + } + return o.DeniedAction, true +} + +// HasDeniedAction returns a boolean if a field has been set. +func (o *FlowSet) HasDeniedAction() bool { + if o != nil && !IsNil(o.DeniedAction) { + return true + } + + return false +} + +// SetDeniedAction gets a reference to the given DeniedActionEnum and assigns it to the DeniedAction field. +func (o *FlowSet) SetDeniedAction(v DeniedActionEnum) { + o.DeniedAction = &v +} + +func (o FlowSet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowSet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["policybindingmodel_ptr_id"] = o.PolicybindingmodelPtrId + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + toSerialize["title"] = o.Title + toSerialize["designation"] = o.Designation + toSerialize["background_url"] = o.BackgroundUrl + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + toSerialize["export_url"] = o.ExportUrl + if !IsNil(o.Layout) { + toSerialize["layout"] = o.Layout + } + if !IsNil(o.DeniedAction) { + toSerialize["denied_action"] = o.DeniedAction + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowSet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "policybindingmodel_ptr_id", + "name", + "slug", + "title", + "designation", + "background_url", + "export_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowSet := _FlowSet{} + + err = json.Unmarshal(data, &varFlowSet) + + if err != nil { + return err + } + + *o = FlowSet(varFlowSet) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "policybindingmodel_ptr_id") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "title") + delete(additionalProperties, "designation") + delete(additionalProperties, "background_url") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "export_url") + delete(additionalProperties, "layout") + delete(additionalProperties, "denied_action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowSet struct { + value *FlowSet + isSet bool +} + +func (v NullableFlowSet) Get() *FlowSet { + return v.value +} + +func (v *NullableFlowSet) Set(val *FlowSet) { + v.value = val + v.isSet = true +} + +func (v NullableFlowSet) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowSet(val *FlowSet) *NullableFlowSet { + return &NullableFlowSet{value: val, isSet: true} +} + +func (v NullableFlowSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_stage_binding.go b/packages/client-go/model_flow_stage_binding.go new file mode 100644 index 0000000000..b2715e92c4 --- /dev/null +++ b/packages/client-go/model_flow_stage_binding.go @@ -0,0 +1,463 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowStageBinding type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowStageBinding{} + +// FlowStageBinding FlowStageBinding Serializer +type FlowStageBinding struct { + Pk string `json:"pk"` + PolicybindingmodelPtrId string `json:"policybindingmodel_ptr_id"` + Target string `json:"target"` + Stage string `json:"stage"` + StageObj Stage `json:"stage_obj"` + // Evaluate policies during the Flow planning process. + EvaluateOnPlan *bool `json:"evaluate_on_plan,omitempty"` + // Evaluate policies when the Stage is presented to the user. + ReEvaluatePolicies *bool `json:"re_evaluate_policies,omitempty"` + Order int32 `json:"order"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor. RESTART restarts the flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the current context. + InvalidResponseAction *InvalidResponseActionEnum `json:"invalid_response_action,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlowStageBinding FlowStageBinding + +// NewFlowStageBinding instantiates a new FlowStageBinding object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowStageBinding(pk string, policybindingmodelPtrId string, target string, stage string, stageObj Stage, order int32) *FlowStageBinding { + this := FlowStageBinding{} + this.Pk = pk + this.PolicybindingmodelPtrId = policybindingmodelPtrId + this.Target = target + this.Stage = stage + this.StageObj = stageObj + this.Order = order + return &this +} + +// NewFlowStageBindingWithDefaults instantiates a new FlowStageBinding object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowStageBindingWithDefaults() *FlowStageBinding { + this := FlowStageBinding{} + return &this +} + +// GetPk returns the Pk field value +func (o *FlowStageBinding) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *FlowStageBinding) SetPk(v string) { + o.Pk = v +} + +// GetPolicybindingmodelPtrId returns the PolicybindingmodelPtrId field value +func (o *FlowStageBinding) GetPolicybindingmodelPtrId() string { + if o == nil { + var ret string + return ret + } + + return o.PolicybindingmodelPtrId +} + +// GetPolicybindingmodelPtrIdOk returns a tuple with the PolicybindingmodelPtrId field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetPolicybindingmodelPtrIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PolicybindingmodelPtrId, true +} + +// SetPolicybindingmodelPtrId sets field value +func (o *FlowStageBinding) SetPolicybindingmodelPtrId(v string) { + o.PolicybindingmodelPtrId = v +} + +// GetTarget returns the Target field value +func (o *FlowStageBinding) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *FlowStageBinding) SetTarget(v string) { + o.Target = v +} + +// GetStage returns the Stage field value +func (o *FlowStageBinding) GetStage() string { + if o == nil { + var ret string + return ret + } + + return o.Stage +} + +// GetStageOk returns a tuple with the Stage field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stage, true +} + +// SetStage sets field value +func (o *FlowStageBinding) SetStage(v string) { + o.Stage = v +} + +// GetStageObj returns the StageObj field value +func (o *FlowStageBinding) GetStageObj() Stage { + if o == nil { + var ret Stage + return ret + } + + return o.StageObj +} + +// GetStageObjOk returns a tuple with the StageObj field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetStageObjOk() (*Stage, bool) { + if o == nil { + return nil, false + } + return &o.StageObj, true +} + +// SetStageObj sets field value +func (o *FlowStageBinding) SetStageObj(v Stage) { + o.StageObj = v +} + +// GetEvaluateOnPlan returns the EvaluateOnPlan field value if set, zero value otherwise. +func (o *FlowStageBinding) GetEvaluateOnPlan() bool { + if o == nil || IsNil(o.EvaluateOnPlan) { + var ret bool + return ret + } + return *o.EvaluateOnPlan +} + +// GetEvaluateOnPlanOk returns a tuple with the EvaluateOnPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetEvaluateOnPlanOk() (*bool, bool) { + if o == nil || IsNil(o.EvaluateOnPlan) { + return nil, false + } + return o.EvaluateOnPlan, true +} + +// HasEvaluateOnPlan returns a boolean if a field has been set. +func (o *FlowStageBinding) HasEvaluateOnPlan() bool { + if o != nil && !IsNil(o.EvaluateOnPlan) { + return true + } + + return false +} + +// SetEvaluateOnPlan gets a reference to the given bool and assigns it to the EvaluateOnPlan field. +func (o *FlowStageBinding) SetEvaluateOnPlan(v bool) { + o.EvaluateOnPlan = &v +} + +// GetReEvaluatePolicies returns the ReEvaluatePolicies field value if set, zero value otherwise. +func (o *FlowStageBinding) GetReEvaluatePolicies() bool { + if o == nil || IsNil(o.ReEvaluatePolicies) { + var ret bool + return ret + } + return *o.ReEvaluatePolicies +} + +// GetReEvaluatePoliciesOk returns a tuple with the ReEvaluatePolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetReEvaluatePoliciesOk() (*bool, bool) { + if o == nil || IsNil(o.ReEvaluatePolicies) { + return nil, false + } + return o.ReEvaluatePolicies, true +} + +// HasReEvaluatePolicies returns a boolean if a field has been set. +func (o *FlowStageBinding) HasReEvaluatePolicies() bool { + if o != nil && !IsNil(o.ReEvaluatePolicies) { + return true + } + + return false +} + +// SetReEvaluatePolicies gets a reference to the given bool and assigns it to the ReEvaluatePolicies field. +func (o *FlowStageBinding) SetReEvaluatePolicies(v bool) { + o.ReEvaluatePolicies = &v +} + +// GetOrder returns the Order field value +func (o *FlowStageBinding) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *FlowStageBinding) SetOrder(v int32) { + o.Order = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *FlowStageBinding) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *FlowStageBinding) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *FlowStageBinding) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetInvalidResponseAction returns the InvalidResponseAction field value if set, zero value otherwise. +func (o *FlowStageBinding) GetInvalidResponseAction() InvalidResponseActionEnum { + if o == nil || IsNil(o.InvalidResponseAction) { + var ret InvalidResponseActionEnum + return ret + } + return *o.InvalidResponseAction +} + +// GetInvalidResponseActionOk returns a tuple with the InvalidResponseAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBinding) GetInvalidResponseActionOk() (*InvalidResponseActionEnum, bool) { + if o == nil || IsNil(o.InvalidResponseAction) { + return nil, false + } + return o.InvalidResponseAction, true +} + +// HasInvalidResponseAction returns a boolean if a field has been set. +func (o *FlowStageBinding) HasInvalidResponseAction() bool { + if o != nil && !IsNil(o.InvalidResponseAction) { + return true + } + + return false +} + +// SetInvalidResponseAction gets a reference to the given InvalidResponseActionEnum and assigns it to the InvalidResponseAction field. +func (o *FlowStageBinding) SetInvalidResponseAction(v InvalidResponseActionEnum) { + o.InvalidResponseAction = &v +} + +func (o FlowStageBinding) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowStageBinding) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["policybindingmodel_ptr_id"] = o.PolicybindingmodelPtrId + toSerialize["target"] = o.Target + toSerialize["stage"] = o.Stage + toSerialize["stage_obj"] = o.StageObj + if !IsNil(o.EvaluateOnPlan) { + toSerialize["evaluate_on_plan"] = o.EvaluateOnPlan + } + if !IsNil(o.ReEvaluatePolicies) { + toSerialize["re_evaluate_policies"] = o.ReEvaluatePolicies + } + toSerialize["order"] = o.Order + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.InvalidResponseAction) { + toSerialize["invalid_response_action"] = o.InvalidResponseAction + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowStageBinding) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "policybindingmodel_ptr_id", + "target", + "stage", + "stage_obj", + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowStageBinding := _FlowStageBinding{} + + err = json.Unmarshal(data, &varFlowStageBinding) + + if err != nil { + return err + } + + *o = FlowStageBinding(varFlowStageBinding) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "policybindingmodel_ptr_id") + delete(additionalProperties, "target") + delete(additionalProperties, "stage") + delete(additionalProperties, "stage_obj") + delete(additionalProperties, "evaluate_on_plan") + delete(additionalProperties, "re_evaluate_policies") + delete(additionalProperties, "order") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "invalid_response_action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowStageBinding struct { + value *FlowStageBinding + isSet bool +} + +func (v NullableFlowStageBinding) Get() *FlowStageBinding { + return v.value +} + +func (v *NullableFlowStageBinding) Set(val *FlowStageBinding) { + v.value = val + v.isSet = true +} + +func (v NullableFlowStageBinding) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowStageBinding) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowStageBinding(val *FlowStageBinding) *NullableFlowStageBinding { + return &NullableFlowStageBinding{value: val, isSet: true} +} + +func (v NullableFlowStageBinding) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowStageBinding) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_flow_stage_binding_request.go b/packages/client-go/model_flow_stage_binding_request.go new file mode 100644 index 0000000000..fb1c092923 --- /dev/null +++ b/packages/client-go/model_flow_stage_binding_request.go @@ -0,0 +1,376 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FlowStageBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FlowStageBindingRequest{} + +// FlowStageBindingRequest FlowStageBinding Serializer +type FlowStageBindingRequest struct { + Target string `json:"target"` + Stage string `json:"stage"` + // Evaluate policies during the Flow planning process. + EvaluateOnPlan *bool `json:"evaluate_on_plan,omitempty"` + // Evaluate policies when the Stage is presented to the user. + ReEvaluatePolicies *bool `json:"re_evaluate_policies,omitempty"` + Order int32 `json:"order"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor. RESTART restarts the flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the current context. + InvalidResponseAction *InvalidResponseActionEnum `json:"invalid_response_action,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FlowStageBindingRequest FlowStageBindingRequest + +// NewFlowStageBindingRequest instantiates a new FlowStageBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlowStageBindingRequest(target string, stage string, order int32) *FlowStageBindingRequest { + this := FlowStageBindingRequest{} + this.Target = target + this.Stage = stage + this.Order = order + return &this +} + +// NewFlowStageBindingRequestWithDefaults instantiates a new FlowStageBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlowStageBindingRequestWithDefaults() *FlowStageBindingRequest { + this := FlowStageBindingRequest{} + return &this +} + +// GetTarget returns the Target field value +func (o *FlowStageBindingRequest) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *FlowStageBindingRequest) SetTarget(v string) { + o.Target = v +} + +// GetStage returns the Stage field value +func (o *FlowStageBindingRequest) GetStage() string { + if o == nil { + var ret string + return ret + } + + return o.Stage +} + +// GetStageOk returns a tuple with the Stage field value +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Stage, true +} + +// SetStage sets field value +func (o *FlowStageBindingRequest) SetStage(v string) { + o.Stage = v +} + +// GetEvaluateOnPlan returns the EvaluateOnPlan field value if set, zero value otherwise. +func (o *FlowStageBindingRequest) GetEvaluateOnPlan() bool { + if o == nil || IsNil(o.EvaluateOnPlan) { + var ret bool + return ret + } + return *o.EvaluateOnPlan +} + +// GetEvaluateOnPlanOk returns a tuple with the EvaluateOnPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetEvaluateOnPlanOk() (*bool, bool) { + if o == nil || IsNil(o.EvaluateOnPlan) { + return nil, false + } + return o.EvaluateOnPlan, true +} + +// HasEvaluateOnPlan returns a boolean if a field has been set. +func (o *FlowStageBindingRequest) HasEvaluateOnPlan() bool { + if o != nil && !IsNil(o.EvaluateOnPlan) { + return true + } + + return false +} + +// SetEvaluateOnPlan gets a reference to the given bool and assigns it to the EvaluateOnPlan field. +func (o *FlowStageBindingRequest) SetEvaluateOnPlan(v bool) { + o.EvaluateOnPlan = &v +} + +// GetReEvaluatePolicies returns the ReEvaluatePolicies field value if set, zero value otherwise. +func (o *FlowStageBindingRequest) GetReEvaluatePolicies() bool { + if o == nil || IsNil(o.ReEvaluatePolicies) { + var ret bool + return ret + } + return *o.ReEvaluatePolicies +} + +// GetReEvaluatePoliciesOk returns a tuple with the ReEvaluatePolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetReEvaluatePoliciesOk() (*bool, bool) { + if o == nil || IsNil(o.ReEvaluatePolicies) { + return nil, false + } + return o.ReEvaluatePolicies, true +} + +// HasReEvaluatePolicies returns a boolean if a field has been set. +func (o *FlowStageBindingRequest) HasReEvaluatePolicies() bool { + if o != nil && !IsNil(o.ReEvaluatePolicies) { + return true + } + + return false +} + +// SetReEvaluatePolicies gets a reference to the given bool and assigns it to the ReEvaluatePolicies field. +func (o *FlowStageBindingRequest) SetReEvaluatePolicies(v bool) { + o.ReEvaluatePolicies = &v +} + +// GetOrder returns the Order field value +func (o *FlowStageBindingRequest) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *FlowStageBindingRequest) SetOrder(v int32) { + o.Order = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *FlowStageBindingRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *FlowStageBindingRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *FlowStageBindingRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetInvalidResponseAction returns the InvalidResponseAction field value if set, zero value otherwise. +func (o *FlowStageBindingRequest) GetInvalidResponseAction() InvalidResponseActionEnum { + if o == nil || IsNil(o.InvalidResponseAction) { + var ret InvalidResponseActionEnum + return ret + } + return *o.InvalidResponseAction +} + +// GetInvalidResponseActionOk returns a tuple with the InvalidResponseAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FlowStageBindingRequest) GetInvalidResponseActionOk() (*InvalidResponseActionEnum, bool) { + if o == nil || IsNil(o.InvalidResponseAction) { + return nil, false + } + return o.InvalidResponseAction, true +} + +// HasInvalidResponseAction returns a boolean if a field has been set. +func (o *FlowStageBindingRequest) HasInvalidResponseAction() bool { + if o != nil && !IsNil(o.InvalidResponseAction) { + return true + } + + return false +} + +// SetInvalidResponseAction gets a reference to the given InvalidResponseActionEnum and assigns it to the InvalidResponseAction field. +func (o *FlowStageBindingRequest) SetInvalidResponseAction(v InvalidResponseActionEnum) { + o.InvalidResponseAction = &v +} + +func (o FlowStageBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FlowStageBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["target"] = o.Target + toSerialize["stage"] = o.Stage + if !IsNil(o.EvaluateOnPlan) { + toSerialize["evaluate_on_plan"] = o.EvaluateOnPlan + } + if !IsNil(o.ReEvaluatePolicies) { + toSerialize["re_evaluate_policies"] = o.ReEvaluatePolicies + } + toSerialize["order"] = o.Order + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.InvalidResponseAction) { + toSerialize["invalid_response_action"] = o.InvalidResponseAction + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FlowStageBindingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "target", + "stage", + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlowStageBindingRequest := _FlowStageBindingRequest{} + + err = json.Unmarshal(data, &varFlowStageBindingRequest) + + if err != nil { + return err + } + + *o = FlowStageBindingRequest(varFlowStageBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "target") + delete(additionalProperties, "stage") + delete(additionalProperties, "evaluate_on_plan") + delete(additionalProperties, "re_evaluate_policies") + delete(additionalProperties, "order") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "invalid_response_action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFlowStageBindingRequest struct { + value *FlowStageBindingRequest + isSet bool +} + +func (v NullableFlowStageBindingRequest) Get() *FlowStageBindingRequest { + return v.value +} + +func (v *NullableFlowStageBindingRequest) Set(val *FlowStageBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFlowStageBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFlowStageBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlowStageBindingRequest(val *FlowStageBindingRequest) *NullableFlowStageBindingRequest { + return &NullableFlowStageBindingRequest{value: val, isSet: true} +} + +func (v NullableFlowStageBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlowStageBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_footer_link.go b/packages/client-go/model_footer_link.go new file mode 100644 index 0000000000..59029649d8 --- /dev/null +++ b/packages/client-go/model_footer_link.go @@ -0,0 +1,198 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FooterLink type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FooterLink{} + +// FooterLink Links returned in Config API +type FooterLink struct { + Href NullableString `json:"href"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _FooterLink FooterLink + +// NewFooterLink instantiates a new FooterLink object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFooterLink(href NullableString, name string) *FooterLink { + this := FooterLink{} + this.Href = href + this.Name = name + return &this +} + +// NewFooterLinkWithDefaults instantiates a new FooterLink object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFooterLinkWithDefaults() *FooterLink { + this := FooterLink{} + return &this +} + +// GetHref returns the Href field value +// If the value is explicit nil, the zero value for string will be returned +func (o *FooterLink) GetHref() string { + if o == nil || o.Href.Get() == nil { + var ret string + return ret + } + + return *o.Href.Get() +} + +// GetHrefOk returns a tuple with the Href field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FooterLink) GetHrefOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Href.Get(), o.Href.IsSet() +} + +// SetHref sets field value +func (o *FooterLink) SetHref(v string) { + o.Href.Set(&v) +} + +// GetName returns the Name field value +func (o *FooterLink) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *FooterLink) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *FooterLink) SetName(v string) { + o.Name = v +} + +func (o FooterLink) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FooterLink) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["href"] = o.Href.Get() + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FooterLink) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "href", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFooterLink := _FooterLink{} + + err = json.Unmarshal(data, &varFooterLink) + + if err != nil { + return err + } + + *o = FooterLink(varFooterLink) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "href") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFooterLink struct { + value *FooterLink + isSet bool +} + +func (v NullableFooterLink) Get() *FooterLink { + return v.value +} + +func (v *NullableFooterLink) Set(val *FooterLink) { + v.value = val + v.isSet = true +} + +func (v NullableFooterLink) IsSet() bool { + return v.isSet +} + +func (v *NullableFooterLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFooterLink(val *FooterLink) *NullableFooterLink { + return &NullableFooterLink{value: val, isSet: true} +} + +func (v NullableFooterLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFooterLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_frame_challenge.go b/packages/client-go/model_frame_challenge.go new file mode 100644 index 0000000000..a51c9c8e51 --- /dev/null +++ b/packages/client-go/model_frame_challenge.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the FrameChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrameChallenge{} + +// FrameChallenge Challenge type to render a frame +type FrameChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Url string `json:"url"` + LoadingOverlay *bool `json:"loading_overlay,omitempty"` + LoadingText string `json:"loading_text"` + AdditionalProperties map[string]interface{} +} + +type _FrameChallenge FrameChallenge + +// NewFrameChallenge instantiates a new FrameChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrameChallenge(url string, loadingText string) *FrameChallenge { + this := FrameChallenge{} + var component string = "xak-flow-frame" + this.Component = &component + this.Url = url + var loadingOverlay bool = false + this.LoadingOverlay = &loadingOverlay + this.LoadingText = loadingText + return &this +} + +// NewFrameChallengeWithDefaults instantiates a new FrameChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrameChallengeWithDefaults() *FrameChallenge { + this := FrameChallenge{} + var component string = "xak-flow-frame" + this.Component = &component + var loadingOverlay bool = false + this.LoadingOverlay = &loadingOverlay + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *FrameChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *FrameChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *FrameChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *FrameChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *FrameChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *FrameChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *FrameChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *FrameChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *FrameChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetUrl returns the Url field value +func (o *FrameChallenge) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *FrameChallenge) SetUrl(v string) { + o.Url = v +} + +// GetLoadingOverlay returns the LoadingOverlay field value if set, zero value otherwise. +func (o *FrameChallenge) GetLoadingOverlay() bool { + if o == nil || IsNil(o.LoadingOverlay) { + var ret bool + return ret + } + return *o.LoadingOverlay +} + +// GetLoadingOverlayOk returns a tuple with the LoadingOverlay field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetLoadingOverlayOk() (*bool, bool) { + if o == nil || IsNil(o.LoadingOverlay) { + return nil, false + } + return o.LoadingOverlay, true +} + +// HasLoadingOverlay returns a boolean if a field has been set. +func (o *FrameChallenge) HasLoadingOverlay() bool { + if o != nil && !IsNil(o.LoadingOverlay) { + return true + } + + return false +} + +// SetLoadingOverlay gets a reference to the given bool and assigns it to the LoadingOverlay field. +func (o *FrameChallenge) SetLoadingOverlay(v bool) { + o.LoadingOverlay = &v +} + +// GetLoadingText returns the LoadingText field value +func (o *FrameChallenge) GetLoadingText() string { + if o == nil { + var ret string + return ret + } + + return o.LoadingText +} + +// GetLoadingTextOk returns a tuple with the LoadingText field value +// and a boolean to check if the value has been set. +func (o *FrameChallenge) GetLoadingTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LoadingText, true +} + +// SetLoadingText sets field value +func (o *FrameChallenge) SetLoadingText(v string) { + o.LoadingText = v +} + +func (o FrameChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrameChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["url"] = o.Url + if !IsNil(o.LoadingOverlay) { + toSerialize["loading_overlay"] = o.LoadingOverlay + } + toSerialize["loading_text"] = o.LoadingText + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrameChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + "loading_text", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFrameChallenge := _FrameChallenge{} + + err = json.Unmarshal(data, &varFrameChallenge) + + if err != nil { + return err + } + + *o = FrameChallenge(varFrameChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "url") + delete(additionalProperties, "loading_overlay") + delete(additionalProperties, "loading_text") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrameChallenge struct { + value *FrameChallenge + isSet bool +} + +func (v NullableFrameChallenge) Get() *FrameChallenge { + return v.value +} + +func (v *NullableFrameChallenge) Set(val *FrameChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableFrameChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableFrameChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrameChallenge(val *FrameChallenge) *NullableFrameChallenge { + return &NullableFrameChallenge{value: val, isSet: true} +} + +func (v NullableFrameChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrameChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_frame_challenge_response_request.go b/packages/client-go/model_frame_challenge_response_request.go new file mode 100644 index 0000000000..8c4b09b83f --- /dev/null +++ b/packages/client-go/model_frame_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the FrameChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FrameChallengeResponseRequest{} + +// FrameChallengeResponseRequest Base class for all challenge responses +type FrameChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _FrameChallengeResponseRequest FrameChallengeResponseRequest + +// NewFrameChallengeResponseRequest instantiates a new FrameChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFrameChallengeResponseRequest() *FrameChallengeResponseRequest { + this := FrameChallengeResponseRequest{} + var component string = "xak-flow-frame" + this.Component = &component + return &this +} + +// NewFrameChallengeResponseRequestWithDefaults instantiates a new FrameChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFrameChallengeResponseRequestWithDefaults() *FrameChallengeResponseRequest { + this := FrameChallengeResponseRequest{} + var component string = "xak-flow-frame" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *FrameChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *FrameChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *FrameChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *FrameChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o FrameChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FrameChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *FrameChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varFrameChallengeResponseRequest := _FrameChallengeResponseRequest{} + + err = json.Unmarshal(data, &varFrameChallengeResponseRequest) + + if err != nil { + return err + } + + *o = FrameChallengeResponseRequest(varFrameChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableFrameChallengeResponseRequest struct { + value *FrameChallengeResponseRequest + isSet bool +} + +func (v NullableFrameChallengeResponseRequest) Get() *FrameChallengeResponseRequest { + return v.value +} + +func (v *NullableFrameChallengeResponseRequest) Set(val *FrameChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableFrameChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableFrameChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFrameChallengeResponseRequest(val *FrameChallengeResponseRequest) *NullableFrameChallengeResponseRequest { + return &NullableFrameChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableFrameChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFrameChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_generic_error.go b/packages/client-go/model_generic_error.go new file mode 100644 index 0000000000..441514338c --- /dev/null +++ b/packages/client-go/model_generic_error.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GenericError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericError{} + +// GenericError Generic API Error +type GenericError struct { + Detail string `json:"detail"` + Code *string `json:"code,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GenericError GenericError + +// NewGenericError instantiates a new GenericError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenericError(detail string) *GenericError { + this := GenericError{} + this.Detail = detail + return &this +} + +// NewGenericErrorWithDefaults instantiates a new GenericError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenericErrorWithDefaults() *GenericError { + this := GenericError{} + return &this +} + +// GetDetail returns the Detail field value +func (o *GenericError) GetDetail() string { + if o == nil { + var ret string + return ret + } + + return o.Detail +} + +// GetDetailOk returns a tuple with the Detail field value +// and a boolean to check if the value has been set. +func (o *GenericError) GetDetailOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Detail, true +} + +// SetDetail sets field value +func (o *GenericError) SetDetail(v string) { + o.Detail = v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *GenericError) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *GenericError) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *GenericError) SetCode(v string) { + o.Code = &v +} + +func (o GenericError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["detail"] = o.Detail + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GenericError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "detail", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericError := _GenericError{} + + err = json.Unmarshal(data, &varGenericError) + + if err != nil { + return err + } + + *o = GenericError(varGenericError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "detail") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGenericError struct { + value *GenericError + isSet bool +} + +func (v NullableGenericError) Get() *GenericError { + return v.value +} + +func (v *NullableGenericError) Set(val *GenericError) { + v.value = val + v.isSet = true +} + +func (v NullableGenericError) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericError(val *GenericError) *NullableGenericError { + return &NullableGenericError{value: val, isSet: true} +} + +func (v NullableGenericError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_geo_ip_policy.go b/packages/client-go/model_geo_ip_policy.go new file mode 100644 index 0000000000..c2ed490076 --- /dev/null +++ b/packages/client-go/model_geo_ip_policy.go @@ -0,0 +1,701 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GeoIPPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GeoIPPolicy{} + +// GeoIPPolicy GeoIP Policy Serializer +type GeoIPPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + Asns []int32 `json:"asns,omitempty"` + Countries []CountryCodeEnum `json:"countries"` + CountriesObj []GeoIPPolicyCountriesObjInner `json:"countries_obj"` + CheckHistoryDistance *bool `json:"check_history_distance,omitempty"` + HistoryMaxDistanceKm *int64 `json:"history_max_distance_km,omitempty"` + DistanceToleranceKm *int32 `json:"distance_tolerance_km,omitempty"` + HistoryLoginCount *int32 `json:"history_login_count,omitempty"` + CheckImpossibleTravel *bool `json:"check_impossible_travel,omitempty"` + ImpossibleToleranceKm *int32 `json:"impossible_tolerance_km,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GeoIPPolicy GeoIPPolicy + +// NewGeoIPPolicy instantiates a new GeoIPPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGeoIPPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32, countries []CountryCodeEnum, countriesObj []GeoIPPolicyCountriesObjInner) *GeoIPPolicy { + this := GeoIPPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + this.Countries = countries + this.CountriesObj = countriesObj + return &this +} + +// NewGeoIPPolicyWithDefaults instantiates a new GeoIPPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGeoIPPolicyWithDefaults() *GeoIPPolicy { + this := GeoIPPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *GeoIPPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GeoIPPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *GeoIPPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GeoIPPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *GeoIPPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *GeoIPPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *GeoIPPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *GeoIPPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *GeoIPPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *GeoIPPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *GeoIPPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *GeoIPPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *GeoIPPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *GeoIPPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *GeoIPPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *GeoIPPolicy) SetAsns(v []int32) { + o.Asns = v +} + +// GetCountries returns the Countries field value +func (o *GeoIPPolicy) GetCountries() []CountryCodeEnum { + if o == nil { + var ret []CountryCodeEnum + return ret + } + + return o.Countries +} + +// GetCountriesOk returns a tuple with the Countries field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetCountriesOk() ([]CountryCodeEnum, bool) { + if o == nil { + return nil, false + } + return o.Countries, true +} + +// SetCountries sets field value +func (o *GeoIPPolicy) SetCountries(v []CountryCodeEnum) { + o.Countries = v +} + +// GetCountriesObj returns the CountriesObj field value +func (o *GeoIPPolicy) GetCountriesObj() []GeoIPPolicyCountriesObjInner { + if o == nil { + var ret []GeoIPPolicyCountriesObjInner + return ret + } + + return o.CountriesObj +} + +// GetCountriesObjOk returns a tuple with the CountriesObj field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetCountriesObjOk() ([]GeoIPPolicyCountriesObjInner, bool) { + if o == nil { + return nil, false + } + return o.CountriesObj, true +} + +// SetCountriesObj sets field value +func (o *GeoIPPolicy) SetCountriesObj(v []GeoIPPolicyCountriesObjInner) { + o.CountriesObj = v +} + +// GetCheckHistoryDistance returns the CheckHistoryDistance field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetCheckHistoryDistance() bool { + if o == nil || IsNil(o.CheckHistoryDistance) { + var ret bool + return ret + } + return *o.CheckHistoryDistance +} + +// GetCheckHistoryDistanceOk returns a tuple with the CheckHistoryDistance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetCheckHistoryDistanceOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHistoryDistance) { + return nil, false + } + return o.CheckHistoryDistance, true +} + +// HasCheckHistoryDistance returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasCheckHistoryDistance() bool { + if o != nil && !IsNil(o.CheckHistoryDistance) { + return true + } + + return false +} + +// SetCheckHistoryDistance gets a reference to the given bool and assigns it to the CheckHistoryDistance field. +func (o *GeoIPPolicy) SetCheckHistoryDistance(v bool) { + o.CheckHistoryDistance = &v +} + +// GetHistoryMaxDistanceKm returns the HistoryMaxDistanceKm field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetHistoryMaxDistanceKm() int64 { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + var ret int64 + return ret + } + return *o.HistoryMaxDistanceKm +} + +// GetHistoryMaxDistanceKmOk returns a tuple with the HistoryMaxDistanceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetHistoryMaxDistanceKmOk() (*int64, bool) { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + return nil, false + } + return o.HistoryMaxDistanceKm, true +} + +// HasHistoryMaxDistanceKm returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasHistoryMaxDistanceKm() bool { + if o != nil && !IsNil(o.HistoryMaxDistanceKm) { + return true + } + + return false +} + +// SetHistoryMaxDistanceKm gets a reference to the given int64 and assigns it to the HistoryMaxDistanceKm field. +func (o *GeoIPPolicy) SetHistoryMaxDistanceKm(v int64) { + o.HistoryMaxDistanceKm = &v +} + +// GetDistanceToleranceKm returns the DistanceToleranceKm field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetDistanceToleranceKm() int32 { + if o == nil || IsNil(o.DistanceToleranceKm) { + var ret int32 + return ret + } + return *o.DistanceToleranceKm +} + +// GetDistanceToleranceKmOk returns a tuple with the DistanceToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetDistanceToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.DistanceToleranceKm) { + return nil, false + } + return o.DistanceToleranceKm, true +} + +// HasDistanceToleranceKm returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasDistanceToleranceKm() bool { + if o != nil && !IsNil(o.DistanceToleranceKm) { + return true + } + + return false +} + +// SetDistanceToleranceKm gets a reference to the given int32 and assigns it to the DistanceToleranceKm field. +func (o *GeoIPPolicy) SetDistanceToleranceKm(v int32) { + o.DistanceToleranceKm = &v +} + +// GetHistoryLoginCount returns the HistoryLoginCount field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetHistoryLoginCount() int32 { + if o == nil || IsNil(o.HistoryLoginCount) { + var ret int32 + return ret + } + return *o.HistoryLoginCount +} + +// GetHistoryLoginCountOk returns a tuple with the HistoryLoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetHistoryLoginCountOk() (*int32, bool) { + if o == nil || IsNil(o.HistoryLoginCount) { + return nil, false + } + return o.HistoryLoginCount, true +} + +// HasHistoryLoginCount returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasHistoryLoginCount() bool { + if o != nil && !IsNil(o.HistoryLoginCount) { + return true + } + + return false +} + +// SetHistoryLoginCount gets a reference to the given int32 and assigns it to the HistoryLoginCount field. +func (o *GeoIPPolicy) SetHistoryLoginCount(v int32) { + o.HistoryLoginCount = &v +} + +// GetCheckImpossibleTravel returns the CheckImpossibleTravel field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetCheckImpossibleTravel() bool { + if o == nil || IsNil(o.CheckImpossibleTravel) { + var ret bool + return ret + } + return *o.CheckImpossibleTravel +} + +// GetCheckImpossibleTravelOk returns a tuple with the CheckImpossibleTravel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetCheckImpossibleTravelOk() (*bool, bool) { + if o == nil || IsNil(o.CheckImpossibleTravel) { + return nil, false + } + return o.CheckImpossibleTravel, true +} + +// HasCheckImpossibleTravel returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasCheckImpossibleTravel() bool { + if o != nil && !IsNil(o.CheckImpossibleTravel) { + return true + } + + return false +} + +// SetCheckImpossibleTravel gets a reference to the given bool and assigns it to the CheckImpossibleTravel field. +func (o *GeoIPPolicy) SetCheckImpossibleTravel(v bool) { + o.CheckImpossibleTravel = &v +} + +// GetImpossibleToleranceKm returns the ImpossibleToleranceKm field value if set, zero value otherwise. +func (o *GeoIPPolicy) GetImpossibleToleranceKm() int32 { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + var ret int32 + return ret + } + return *o.ImpossibleToleranceKm +} + +// GetImpossibleToleranceKmOk returns a tuple with the ImpossibleToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicy) GetImpossibleToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + return nil, false + } + return o.ImpossibleToleranceKm, true +} + +// HasImpossibleToleranceKm returns a boolean if a field has been set. +func (o *GeoIPPolicy) HasImpossibleToleranceKm() bool { + if o != nil && !IsNil(o.ImpossibleToleranceKm) { + return true + } + + return false +} + +// SetImpossibleToleranceKm gets a reference to the given int32 and assigns it to the ImpossibleToleranceKm field. +func (o *GeoIPPolicy) SetImpossibleToleranceKm(v int32) { + o.ImpossibleToleranceKm = &v +} + +func (o GeoIPPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GeoIPPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + toSerialize["countries"] = o.Countries + toSerialize["countries_obj"] = o.CountriesObj + if !IsNil(o.CheckHistoryDistance) { + toSerialize["check_history_distance"] = o.CheckHistoryDistance + } + if !IsNil(o.HistoryMaxDistanceKm) { + toSerialize["history_max_distance_km"] = o.HistoryMaxDistanceKm + } + if !IsNil(o.DistanceToleranceKm) { + toSerialize["distance_tolerance_km"] = o.DistanceToleranceKm + } + if !IsNil(o.HistoryLoginCount) { + toSerialize["history_login_count"] = o.HistoryLoginCount + } + if !IsNil(o.CheckImpossibleTravel) { + toSerialize["check_impossible_travel"] = o.CheckImpossibleTravel + } + if !IsNil(o.ImpossibleToleranceKm) { + toSerialize["impossible_tolerance_km"] = o.ImpossibleToleranceKm + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GeoIPPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + "countries", + "countries_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGeoIPPolicy := _GeoIPPolicy{} + + err = json.Unmarshal(data, &varGeoIPPolicy) + + if err != nil { + return err + } + + *o = GeoIPPolicy(varGeoIPPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "asns") + delete(additionalProperties, "countries") + delete(additionalProperties, "countries_obj") + delete(additionalProperties, "check_history_distance") + delete(additionalProperties, "history_max_distance_km") + delete(additionalProperties, "distance_tolerance_km") + delete(additionalProperties, "history_login_count") + delete(additionalProperties, "check_impossible_travel") + delete(additionalProperties, "impossible_tolerance_km") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGeoIPPolicy struct { + value *GeoIPPolicy + isSet bool +} + +func (v NullableGeoIPPolicy) Get() *GeoIPPolicy { + return v.value +} + +func (v *NullableGeoIPPolicy) Set(val *GeoIPPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableGeoIPPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableGeoIPPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGeoIPPolicy(val *GeoIPPolicy) *NullableGeoIPPolicy { + return &NullableGeoIPPolicy{value: val, isSet: true} +} + +func (v NullableGeoIPPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGeoIPPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_geo_ip_policy_countries_obj_inner.go b/packages/client-go/model_geo_ip_policy_countries_obj_inner.go new file mode 100644 index 0000000000..9f59f4658e --- /dev/null +++ b/packages/client-go/model_geo_ip_policy_countries_obj_inner.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GeoIPPolicyCountriesObjInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GeoIPPolicyCountriesObjInner{} + +// GeoIPPolicyCountriesObjInner struct for GeoIPPolicyCountriesObjInner +type GeoIPPolicyCountriesObjInner struct { + Code string `json:"code"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _GeoIPPolicyCountriesObjInner GeoIPPolicyCountriesObjInner + +// NewGeoIPPolicyCountriesObjInner instantiates a new GeoIPPolicyCountriesObjInner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGeoIPPolicyCountriesObjInner(code string, name string) *GeoIPPolicyCountriesObjInner { + this := GeoIPPolicyCountriesObjInner{} + this.Code = code + this.Name = name + return &this +} + +// NewGeoIPPolicyCountriesObjInnerWithDefaults instantiates a new GeoIPPolicyCountriesObjInner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGeoIPPolicyCountriesObjInnerWithDefaults() *GeoIPPolicyCountriesObjInner { + this := GeoIPPolicyCountriesObjInner{} + return &this +} + +// GetCode returns the Code field value +func (o *GeoIPPolicyCountriesObjInner) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyCountriesObjInner) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *GeoIPPolicyCountriesObjInner) SetCode(v string) { + o.Code = v +} + +// GetName returns the Name field value +func (o *GeoIPPolicyCountriesObjInner) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyCountriesObjInner) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GeoIPPolicyCountriesObjInner) SetName(v string) { + o.Name = v +} + +func (o GeoIPPolicyCountriesObjInner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GeoIPPolicyCountriesObjInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GeoIPPolicyCountriesObjInner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGeoIPPolicyCountriesObjInner := _GeoIPPolicyCountriesObjInner{} + + err = json.Unmarshal(data, &varGeoIPPolicyCountriesObjInner) + + if err != nil { + return err + } + + *o = GeoIPPolicyCountriesObjInner(varGeoIPPolicyCountriesObjInner) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "code") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGeoIPPolicyCountriesObjInner struct { + value *GeoIPPolicyCountriesObjInner + isSet bool +} + +func (v NullableGeoIPPolicyCountriesObjInner) Get() *GeoIPPolicyCountriesObjInner { + return v.value +} + +func (v *NullableGeoIPPolicyCountriesObjInner) Set(val *GeoIPPolicyCountriesObjInner) { + v.value = val + v.isSet = true +} + +func (v NullableGeoIPPolicyCountriesObjInner) IsSet() bool { + return v.isSet +} + +func (v *NullableGeoIPPolicyCountriesObjInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGeoIPPolicyCountriesObjInner(val *GeoIPPolicyCountriesObjInner) *NullableGeoIPPolicyCountriesObjInner { + return &NullableGeoIPPolicyCountriesObjInner{value: val, isSet: true} +} + +func (v NullableGeoIPPolicyCountriesObjInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGeoIPPolicyCountriesObjInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_geo_ip_policy_request.go b/packages/client-go/model_geo_ip_policy_request.go new file mode 100644 index 0000000000..28f2dc7e4f --- /dev/null +++ b/packages/client-go/model_geo_ip_policy_request.go @@ -0,0 +1,493 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GeoIPPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GeoIPPolicyRequest{} + +// GeoIPPolicyRequest GeoIP Policy Serializer +type GeoIPPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Countries []CountryCodeEnum `json:"countries"` + CheckHistoryDistance *bool `json:"check_history_distance,omitempty"` + HistoryMaxDistanceKm *int64 `json:"history_max_distance_km,omitempty"` + DistanceToleranceKm *int32 `json:"distance_tolerance_km,omitempty"` + HistoryLoginCount *int32 `json:"history_login_count,omitempty"` + CheckImpossibleTravel *bool `json:"check_impossible_travel,omitempty"` + ImpossibleToleranceKm *int32 `json:"impossible_tolerance_km,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GeoIPPolicyRequest GeoIPPolicyRequest + +// NewGeoIPPolicyRequest instantiates a new GeoIPPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGeoIPPolicyRequest(name string, countries []CountryCodeEnum) *GeoIPPolicyRequest { + this := GeoIPPolicyRequest{} + this.Name = name + this.Countries = countries + return &this +} + +// NewGeoIPPolicyRequestWithDefaults instantiates a new GeoIPPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGeoIPPolicyRequestWithDefaults() *GeoIPPolicyRequest { + this := GeoIPPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *GeoIPPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GeoIPPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *GeoIPPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *GeoIPPolicyRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetCountries returns the Countries field value +func (o *GeoIPPolicyRequest) GetCountries() []CountryCodeEnum { + if o == nil { + var ret []CountryCodeEnum + return ret + } + + return o.Countries +} + +// GetCountriesOk returns a tuple with the Countries field value +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetCountriesOk() ([]CountryCodeEnum, bool) { + if o == nil { + return nil, false + } + return o.Countries, true +} + +// SetCountries sets field value +func (o *GeoIPPolicyRequest) SetCountries(v []CountryCodeEnum) { + o.Countries = v +} + +// GetCheckHistoryDistance returns the CheckHistoryDistance field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetCheckHistoryDistance() bool { + if o == nil || IsNil(o.CheckHistoryDistance) { + var ret bool + return ret + } + return *o.CheckHistoryDistance +} + +// GetCheckHistoryDistanceOk returns a tuple with the CheckHistoryDistance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetCheckHistoryDistanceOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHistoryDistance) { + return nil, false + } + return o.CheckHistoryDistance, true +} + +// HasCheckHistoryDistance returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasCheckHistoryDistance() bool { + if o != nil && !IsNil(o.CheckHistoryDistance) { + return true + } + + return false +} + +// SetCheckHistoryDistance gets a reference to the given bool and assigns it to the CheckHistoryDistance field. +func (o *GeoIPPolicyRequest) SetCheckHistoryDistance(v bool) { + o.CheckHistoryDistance = &v +} + +// GetHistoryMaxDistanceKm returns the HistoryMaxDistanceKm field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetHistoryMaxDistanceKm() int64 { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + var ret int64 + return ret + } + return *o.HistoryMaxDistanceKm +} + +// GetHistoryMaxDistanceKmOk returns a tuple with the HistoryMaxDistanceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetHistoryMaxDistanceKmOk() (*int64, bool) { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + return nil, false + } + return o.HistoryMaxDistanceKm, true +} + +// HasHistoryMaxDistanceKm returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasHistoryMaxDistanceKm() bool { + if o != nil && !IsNil(o.HistoryMaxDistanceKm) { + return true + } + + return false +} + +// SetHistoryMaxDistanceKm gets a reference to the given int64 and assigns it to the HistoryMaxDistanceKm field. +func (o *GeoIPPolicyRequest) SetHistoryMaxDistanceKm(v int64) { + o.HistoryMaxDistanceKm = &v +} + +// GetDistanceToleranceKm returns the DistanceToleranceKm field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetDistanceToleranceKm() int32 { + if o == nil || IsNil(o.DistanceToleranceKm) { + var ret int32 + return ret + } + return *o.DistanceToleranceKm +} + +// GetDistanceToleranceKmOk returns a tuple with the DistanceToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetDistanceToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.DistanceToleranceKm) { + return nil, false + } + return o.DistanceToleranceKm, true +} + +// HasDistanceToleranceKm returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasDistanceToleranceKm() bool { + if o != nil && !IsNil(o.DistanceToleranceKm) { + return true + } + + return false +} + +// SetDistanceToleranceKm gets a reference to the given int32 and assigns it to the DistanceToleranceKm field. +func (o *GeoIPPolicyRequest) SetDistanceToleranceKm(v int32) { + o.DistanceToleranceKm = &v +} + +// GetHistoryLoginCount returns the HistoryLoginCount field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetHistoryLoginCount() int32 { + if o == nil || IsNil(o.HistoryLoginCount) { + var ret int32 + return ret + } + return *o.HistoryLoginCount +} + +// GetHistoryLoginCountOk returns a tuple with the HistoryLoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetHistoryLoginCountOk() (*int32, bool) { + if o == nil || IsNil(o.HistoryLoginCount) { + return nil, false + } + return o.HistoryLoginCount, true +} + +// HasHistoryLoginCount returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasHistoryLoginCount() bool { + if o != nil && !IsNil(o.HistoryLoginCount) { + return true + } + + return false +} + +// SetHistoryLoginCount gets a reference to the given int32 and assigns it to the HistoryLoginCount field. +func (o *GeoIPPolicyRequest) SetHistoryLoginCount(v int32) { + o.HistoryLoginCount = &v +} + +// GetCheckImpossibleTravel returns the CheckImpossibleTravel field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetCheckImpossibleTravel() bool { + if o == nil || IsNil(o.CheckImpossibleTravel) { + var ret bool + return ret + } + return *o.CheckImpossibleTravel +} + +// GetCheckImpossibleTravelOk returns a tuple with the CheckImpossibleTravel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetCheckImpossibleTravelOk() (*bool, bool) { + if o == nil || IsNil(o.CheckImpossibleTravel) { + return nil, false + } + return o.CheckImpossibleTravel, true +} + +// HasCheckImpossibleTravel returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasCheckImpossibleTravel() bool { + if o != nil && !IsNil(o.CheckImpossibleTravel) { + return true + } + + return false +} + +// SetCheckImpossibleTravel gets a reference to the given bool and assigns it to the CheckImpossibleTravel field. +func (o *GeoIPPolicyRequest) SetCheckImpossibleTravel(v bool) { + o.CheckImpossibleTravel = &v +} + +// GetImpossibleToleranceKm returns the ImpossibleToleranceKm field value if set, zero value otherwise. +func (o *GeoIPPolicyRequest) GetImpossibleToleranceKm() int32 { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + var ret int32 + return ret + } + return *o.ImpossibleToleranceKm +} + +// GetImpossibleToleranceKmOk returns a tuple with the ImpossibleToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GeoIPPolicyRequest) GetImpossibleToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + return nil, false + } + return o.ImpossibleToleranceKm, true +} + +// HasImpossibleToleranceKm returns a boolean if a field has been set. +func (o *GeoIPPolicyRequest) HasImpossibleToleranceKm() bool { + if o != nil && !IsNil(o.ImpossibleToleranceKm) { + return true + } + + return false +} + +// SetImpossibleToleranceKm gets a reference to the given int32 and assigns it to the ImpossibleToleranceKm field. +func (o *GeoIPPolicyRequest) SetImpossibleToleranceKm(v int32) { + o.ImpossibleToleranceKm = &v +} + +func (o GeoIPPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GeoIPPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + toSerialize["countries"] = o.Countries + if !IsNil(o.CheckHistoryDistance) { + toSerialize["check_history_distance"] = o.CheckHistoryDistance + } + if !IsNil(o.HistoryMaxDistanceKm) { + toSerialize["history_max_distance_km"] = o.HistoryMaxDistanceKm + } + if !IsNil(o.DistanceToleranceKm) { + toSerialize["distance_tolerance_km"] = o.DistanceToleranceKm + } + if !IsNil(o.HistoryLoginCount) { + toSerialize["history_login_count"] = o.HistoryLoginCount + } + if !IsNil(o.CheckImpossibleTravel) { + toSerialize["check_impossible_travel"] = o.CheckImpossibleTravel + } + if !IsNil(o.ImpossibleToleranceKm) { + toSerialize["impossible_tolerance_km"] = o.ImpossibleToleranceKm + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GeoIPPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "countries", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGeoIPPolicyRequest := _GeoIPPolicyRequest{} + + err = json.Unmarshal(data, &varGeoIPPolicyRequest) + + if err != nil { + return err + } + + *o = GeoIPPolicyRequest(varGeoIPPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "asns") + delete(additionalProperties, "countries") + delete(additionalProperties, "check_history_distance") + delete(additionalProperties, "history_max_distance_km") + delete(additionalProperties, "distance_tolerance_km") + delete(additionalProperties, "history_login_count") + delete(additionalProperties, "check_impossible_travel") + delete(additionalProperties, "impossible_tolerance_km") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGeoIPPolicyRequest struct { + value *GeoIPPolicyRequest + isSet bool +} + +func (v NullableGeoIPPolicyRequest) Get() *GeoIPPolicyRequest { + return v.value +} + +func (v *NullableGeoIPPolicyRequest) Set(val *GeoIPPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGeoIPPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGeoIPPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGeoIPPolicyRequest(val *GeoIPPolicyRequest) *NullableGeoIPPolicyRequest { + return &NullableGeoIPPolicyRequest{value: val, isSet: true} +} + +func (v NullableGeoIPPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGeoIPPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_geoip_binding_enum.go b/packages/client-go/model_geoip_binding_enum.go new file mode 100644 index 0000000000..130684ffdc --- /dev/null +++ b/packages/client-go/model_geoip_binding_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// GeoipBindingEnum the model 'GeoipBindingEnum' +type GeoipBindingEnum string + +// List of GeoipBindingEnum +const ( + GEOIPBINDINGENUM_NO_BINDING GeoipBindingEnum = "no_binding" + GEOIPBINDINGENUM_BIND_CONTINENT GeoipBindingEnum = "bind_continent" + GEOIPBINDINGENUM_BIND_CONTINENT_COUNTRY GeoipBindingEnum = "bind_continent_country" + GEOIPBINDINGENUM_BIND_CONTINENT_COUNTRY_CITY GeoipBindingEnum = "bind_continent_country_city" +) + +// All allowed values of GeoipBindingEnum enum +var AllowedGeoipBindingEnumEnumValues = []GeoipBindingEnum{ + "no_binding", + "bind_continent", + "bind_continent_country", + "bind_continent_country_city", +} + +func (v *GeoipBindingEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GeoipBindingEnum(value) + for _, existing := range AllowedGeoipBindingEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GeoipBindingEnum", value) +} + +// NewGeoipBindingEnumFromValue returns a pointer to a valid GeoipBindingEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGeoipBindingEnumFromValue(v string) (*GeoipBindingEnum, error) { + ev := GeoipBindingEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GeoipBindingEnum: valid values are %v", v, AllowedGeoipBindingEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GeoipBindingEnum) IsValid() bool { + for _, existing := range AllowedGeoipBindingEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GeoipBindingEnum value +func (v GeoipBindingEnum) Ptr() *GeoipBindingEnum { + return &v +} + +type NullableGeoipBindingEnum struct { + value *GeoipBindingEnum + isSet bool +} + +func (v NullableGeoipBindingEnum) Get() *GeoipBindingEnum { + return v.value +} + +func (v *NullableGeoipBindingEnum) Set(val *GeoipBindingEnum) { + v.value = val + v.isSet = true +} + +func (v NullableGeoipBindingEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableGeoipBindingEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGeoipBindingEnum(val *GeoipBindingEnum) *NullableGeoipBindingEnum { + return &NullableGeoipBindingEnum{value: val, isSet: true} +} + +func (v NullableGeoipBindingEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGeoipBindingEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_global_task_status.go b/packages/client-go/model_global_task_status.go new file mode 100644 index 0000000000..4a0eb678c0 --- /dev/null +++ b/packages/client-go/model_global_task_status.go @@ -0,0 +1,428 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GlobalTaskStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GlobalTaskStatus{} + +// GlobalTaskStatus struct for GlobalTaskStatus +type GlobalTaskStatus struct { + Queued int32 `json:"queued"` + Consumed int32 `json:"consumed"` + Preprocess int32 `json:"preprocess"` + Running int32 `json:"running"` + Postprocess int32 `json:"postprocess"` + Rejected int32 `json:"rejected"` + Done int32 `json:"done"` + Info int32 `json:"info"` + Warning int32 `json:"warning"` + Error int32 `json:"error"` + AdditionalProperties map[string]interface{} +} + +type _GlobalTaskStatus GlobalTaskStatus + +// NewGlobalTaskStatus instantiates a new GlobalTaskStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGlobalTaskStatus(queued int32, consumed int32, preprocess int32, running int32, postprocess int32, rejected int32, done int32, info int32, warning int32, error_ int32) *GlobalTaskStatus { + this := GlobalTaskStatus{} + this.Queued = queued + this.Consumed = consumed + this.Preprocess = preprocess + this.Running = running + this.Postprocess = postprocess + this.Rejected = rejected + this.Done = done + this.Info = info + this.Warning = warning + this.Error = error_ + return &this +} + +// NewGlobalTaskStatusWithDefaults instantiates a new GlobalTaskStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGlobalTaskStatusWithDefaults() *GlobalTaskStatus { + this := GlobalTaskStatus{} + return &this +} + +// GetQueued returns the Queued field value +func (o *GlobalTaskStatus) GetQueued() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Queued +} + +// GetQueuedOk returns a tuple with the Queued field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetQueuedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Queued, true +} + +// SetQueued sets field value +func (o *GlobalTaskStatus) SetQueued(v int32) { + o.Queued = v +} + +// GetConsumed returns the Consumed field value +func (o *GlobalTaskStatus) GetConsumed() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Consumed +} + +// GetConsumedOk returns a tuple with the Consumed field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetConsumedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Consumed, true +} + +// SetConsumed sets field value +func (o *GlobalTaskStatus) SetConsumed(v int32) { + o.Consumed = v +} + +// GetPreprocess returns the Preprocess field value +func (o *GlobalTaskStatus) GetPreprocess() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Preprocess +} + +// GetPreprocessOk returns a tuple with the Preprocess field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetPreprocessOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Preprocess, true +} + +// SetPreprocess sets field value +func (o *GlobalTaskStatus) SetPreprocess(v int32) { + o.Preprocess = v +} + +// GetRunning returns the Running field value +func (o *GlobalTaskStatus) GetRunning() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Running +} + +// GetRunningOk returns a tuple with the Running field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetRunningOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Running, true +} + +// SetRunning sets field value +func (o *GlobalTaskStatus) SetRunning(v int32) { + o.Running = v +} + +// GetPostprocess returns the Postprocess field value +func (o *GlobalTaskStatus) GetPostprocess() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Postprocess +} + +// GetPostprocessOk returns a tuple with the Postprocess field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetPostprocessOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Postprocess, true +} + +// SetPostprocess sets field value +func (o *GlobalTaskStatus) SetPostprocess(v int32) { + o.Postprocess = v +} + +// GetRejected returns the Rejected field value +func (o *GlobalTaskStatus) GetRejected() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Rejected +} + +// GetRejectedOk returns a tuple with the Rejected field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetRejectedOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Rejected, true +} + +// SetRejected sets field value +func (o *GlobalTaskStatus) SetRejected(v int32) { + o.Rejected = v +} + +// GetDone returns the Done field value +func (o *GlobalTaskStatus) GetDone() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Done +} + +// GetDoneOk returns a tuple with the Done field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetDoneOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Done, true +} + +// SetDone sets field value +func (o *GlobalTaskStatus) SetDone(v int32) { + o.Done = v +} + +// GetInfo returns the Info field value +func (o *GlobalTaskStatus) GetInfo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Info +} + +// GetInfoOk returns a tuple with the Info field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetInfoOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Info, true +} + +// SetInfo sets field value +func (o *GlobalTaskStatus) SetInfo(v int32) { + o.Info = v +} + +// GetWarning returns the Warning field value +func (o *GlobalTaskStatus) GetWarning() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Warning +} + +// GetWarningOk returns a tuple with the Warning field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetWarningOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Warning, true +} + +// SetWarning sets field value +func (o *GlobalTaskStatus) SetWarning(v int32) { + o.Warning = v +} + +// GetError returns the Error field value +func (o *GlobalTaskStatus) GetError() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Error +} + +// GetErrorOk returns a tuple with the Error field value +// and a boolean to check if the value has been set. +func (o *GlobalTaskStatus) GetErrorOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Error, true +} + +// SetError sets field value +func (o *GlobalTaskStatus) SetError(v int32) { + o.Error = v +} + +func (o GlobalTaskStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GlobalTaskStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["queued"] = o.Queued + toSerialize["consumed"] = o.Consumed + toSerialize["preprocess"] = o.Preprocess + toSerialize["running"] = o.Running + toSerialize["postprocess"] = o.Postprocess + toSerialize["rejected"] = o.Rejected + toSerialize["done"] = o.Done + toSerialize["info"] = o.Info + toSerialize["warning"] = o.Warning + toSerialize["error"] = o.Error + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GlobalTaskStatus) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "queued", + "consumed", + "preprocess", + "running", + "postprocess", + "rejected", + "done", + "info", + "warning", + "error", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGlobalTaskStatus := _GlobalTaskStatus{} + + err = json.Unmarshal(data, &varGlobalTaskStatus) + + if err != nil { + return err + } + + *o = GlobalTaskStatus(varGlobalTaskStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "queued") + delete(additionalProperties, "consumed") + delete(additionalProperties, "preprocess") + delete(additionalProperties, "running") + delete(additionalProperties, "postprocess") + delete(additionalProperties, "rejected") + delete(additionalProperties, "done") + delete(additionalProperties, "info") + delete(additionalProperties, "warning") + delete(additionalProperties, "error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGlobalTaskStatus struct { + value *GlobalTaskStatus + isSet bool +} + +func (v NullableGlobalTaskStatus) Get() *GlobalTaskStatus { + return v.value +} + +func (v *NullableGlobalTaskStatus) Set(val *GlobalTaskStatus) { + v.value = val + v.isSet = true +} + +func (v NullableGlobalTaskStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableGlobalTaskStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGlobalTaskStatus(val *GlobalTaskStatus) *NullableGlobalTaskStatus { + return &NullableGlobalTaskStatus{value: val, isSet: true} +} + +func (v NullableGlobalTaskStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGlobalTaskStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_chrome_connector.go b/packages/client-go/model_google_chrome_connector.go new file mode 100644 index 0000000000..c6c1c757c6 --- /dev/null +++ b/packages/client-go/model_google_chrome_connector.go @@ -0,0 +1,422 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleChromeConnector type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleChromeConnector{} + +// GoogleChromeConnector GoogleChromeConnector Serializer +type GoogleChromeConnector struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + Credentials map[string]interface{} `json:"credentials"` + // Full URL to be used in Google Workspace configuration + ChromeUrl NullableString `json:"chrome_url"` + AdditionalProperties map[string]interface{} +} + +type _GoogleChromeConnector GoogleChromeConnector + +// NewGoogleChromeConnector instantiates a new GoogleChromeConnector object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleChromeConnector(name string, component string, verboseName string, verboseNamePlural string, metaModelName string, credentials map[string]interface{}, chromeUrl NullableString) *GoogleChromeConnector { + this := GoogleChromeConnector{} + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Credentials = credentials + this.ChromeUrl = chromeUrl + return &this +} + +// NewGoogleChromeConnectorWithDefaults instantiates a new GoogleChromeConnector object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleChromeConnectorWithDefaults() *GoogleChromeConnector { + this := GoogleChromeConnector{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *GoogleChromeConnector) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *GoogleChromeConnector) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *GoogleChromeConnector) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *GoogleChromeConnector) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleChromeConnector) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GoogleChromeConnector) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GoogleChromeConnector) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GoogleChromeConnector) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetComponent returns the Component field value +func (o *GoogleChromeConnector) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *GoogleChromeConnector) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *GoogleChromeConnector) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *GoogleChromeConnector) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *GoogleChromeConnector) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *GoogleChromeConnector) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *GoogleChromeConnector) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *GoogleChromeConnector) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetCredentials returns the Credentials field value +func (o *GoogleChromeConnector) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnector) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *GoogleChromeConnector) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +// GetChromeUrl returns the ChromeUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *GoogleChromeConnector) GetChromeUrl() string { + if o == nil || o.ChromeUrl.Get() == nil { + var ret string + return ret + } + + return *o.ChromeUrl.Get() +} + +// GetChromeUrlOk returns a tuple with the ChromeUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleChromeConnector) GetChromeUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChromeUrl.Get(), o.ChromeUrl.IsSet() +} + +// SetChromeUrl sets field value +func (o *GoogleChromeConnector) SetChromeUrl(v string) { + o.ChromeUrl.Set(&v) +} + +func (o GoogleChromeConnector) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleChromeConnector) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["credentials"] = o.Credentials + toSerialize["chrome_url"] = o.ChromeUrl.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleChromeConnector) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "credentials", + "chrome_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleChromeConnector := _GoogleChromeConnector{} + + err = json.Unmarshal(data, &varGoogleChromeConnector) + + if err != nil { + return err + } + + *o = GoogleChromeConnector(varGoogleChromeConnector) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "credentials") + delete(additionalProperties, "chrome_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleChromeConnector struct { + value *GoogleChromeConnector + isSet bool +} + +func (v NullableGoogleChromeConnector) Get() *GoogleChromeConnector { + return v.value +} + +func (v *NullableGoogleChromeConnector) Set(val *GoogleChromeConnector) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleChromeConnector) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleChromeConnector) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleChromeConnector(val *GoogleChromeConnector) *NullableGoogleChromeConnector { + return &NullableGoogleChromeConnector{value: val, isSet: true} +} + +func (v NullableGoogleChromeConnector) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleChromeConnector) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_chrome_connector_request.go b/packages/client-go/model_google_chrome_connector_request.go new file mode 100644 index 0000000000..b825b8eb32 --- /dev/null +++ b/packages/client-go/model_google_chrome_connector_request.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleChromeConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleChromeConnectorRequest{} + +// GoogleChromeConnectorRequest GoogleChromeConnector Serializer +type GoogleChromeConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name string `json:"name"` + Enabled *bool `json:"enabled,omitempty"` + Credentials map[string]interface{} `json:"credentials"` + AdditionalProperties map[string]interface{} +} + +type _GoogleChromeConnectorRequest GoogleChromeConnectorRequest + +// NewGoogleChromeConnectorRequest instantiates a new GoogleChromeConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleChromeConnectorRequest(name string, credentials map[string]interface{}) *GoogleChromeConnectorRequest { + this := GoogleChromeConnectorRequest{} + this.Name = name + this.Credentials = credentials + return &this +} + +// NewGoogleChromeConnectorRequestWithDefaults instantiates a new GoogleChromeConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleChromeConnectorRequestWithDefaults() *GoogleChromeConnectorRequest { + this := GoogleChromeConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *GoogleChromeConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *GoogleChromeConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *GoogleChromeConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value +func (o *GoogleChromeConnectorRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnectorRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleChromeConnectorRequest) SetName(v string) { + o.Name = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GoogleChromeConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GoogleChromeConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GoogleChromeConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetCredentials returns the Credentials field value +func (o *GoogleChromeConnectorRequest) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *GoogleChromeConnectorRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *GoogleChromeConnectorRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +func (o GoogleChromeConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleChromeConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + toSerialize["name"] = o.Name + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["credentials"] = o.Credentials + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleChromeConnectorRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "credentials", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleChromeConnectorRequest := _GoogleChromeConnectorRequest{} + + err = json.Unmarshal(data, &varGoogleChromeConnectorRequest) + + if err != nil { + return err + } + + *o = GoogleChromeConnectorRequest(varGoogleChromeConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleChromeConnectorRequest struct { + value *GoogleChromeConnectorRequest + isSet bool +} + +func (v NullableGoogleChromeConnectorRequest) Get() *GoogleChromeConnectorRequest { + return v.value +} + +func (v *NullableGoogleChromeConnectorRequest) Set(val *GoogleChromeConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleChromeConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleChromeConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleChromeConnectorRequest(val *GoogleChromeConnectorRequest) *NullableGoogleChromeConnectorRequest { + return &NullableGoogleChromeConnectorRequest{value: val, isSet: true} +} + +func (v NullableGoogleChromeConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleChromeConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_endpoint_device.go b/packages/client-go/model_google_endpoint_device.go new file mode 100644 index 0000000000..5d62e0fdc6 --- /dev/null +++ b/packages/client-go/model_google_endpoint_device.go @@ -0,0 +1,205 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleEndpointDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleEndpointDevice{} + +// GoogleEndpointDevice Serializer for Endpoint authenticator devices +type GoogleEndpointDevice struct { + Pk *string `json:"pk,omitempty"` + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _GoogleEndpointDevice GoogleEndpointDevice + +// NewGoogleEndpointDevice instantiates a new GoogleEndpointDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleEndpointDevice(name string) *GoogleEndpointDevice { + this := GoogleEndpointDevice{} + this.Name = name + return &this +} + +// NewGoogleEndpointDeviceWithDefaults instantiates a new GoogleEndpointDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleEndpointDeviceWithDefaults() *GoogleEndpointDevice { + this := GoogleEndpointDevice{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *GoogleEndpointDevice) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleEndpointDevice) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *GoogleEndpointDevice) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *GoogleEndpointDevice) SetPk(v string) { + o.Pk = &v +} + +// GetName returns the Name field value +func (o *GoogleEndpointDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleEndpointDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleEndpointDevice) SetName(v string) { + o.Name = v +} + +func (o GoogleEndpointDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleEndpointDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleEndpointDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleEndpointDevice := _GoogleEndpointDevice{} + + err = json.Unmarshal(data, &varGoogleEndpointDevice) + + if err != nil { + return err + } + + *o = GoogleEndpointDevice(varGoogleEndpointDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleEndpointDevice struct { + value *GoogleEndpointDevice + isSet bool +} + +func (v NullableGoogleEndpointDevice) Get() *GoogleEndpointDevice { + return v.value +} + +func (v *NullableGoogleEndpointDevice) Set(val *GoogleEndpointDevice) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleEndpointDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleEndpointDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleEndpointDevice(val *GoogleEndpointDevice) *NullableGoogleEndpointDevice { + return &NullableGoogleEndpointDevice{value: val, isSet: true} +} + +func (v NullableGoogleEndpointDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleEndpointDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_endpoint_device_request.go b/packages/client-go/model_google_endpoint_device_request.go new file mode 100644 index 0000000000..fd398676ba --- /dev/null +++ b/packages/client-go/model_google_endpoint_device_request.go @@ -0,0 +1,205 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleEndpointDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleEndpointDeviceRequest{} + +// GoogleEndpointDeviceRequest Serializer for Endpoint authenticator devices +type GoogleEndpointDeviceRequest struct { + Pk *string `json:"pk,omitempty"` + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _GoogleEndpointDeviceRequest GoogleEndpointDeviceRequest + +// NewGoogleEndpointDeviceRequest instantiates a new GoogleEndpointDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleEndpointDeviceRequest(name string) *GoogleEndpointDeviceRequest { + this := GoogleEndpointDeviceRequest{} + this.Name = name + return &this +} + +// NewGoogleEndpointDeviceRequestWithDefaults instantiates a new GoogleEndpointDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleEndpointDeviceRequestWithDefaults() *GoogleEndpointDeviceRequest { + this := GoogleEndpointDeviceRequest{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *GoogleEndpointDeviceRequest) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleEndpointDeviceRequest) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *GoogleEndpointDeviceRequest) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *GoogleEndpointDeviceRequest) SetPk(v string) { + o.Pk = &v +} + +// GetName returns the Name field value +func (o *GoogleEndpointDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleEndpointDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleEndpointDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o GoogleEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleEndpointDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleEndpointDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleEndpointDeviceRequest := _GoogleEndpointDeviceRequest{} + + err = json.Unmarshal(data, &varGoogleEndpointDeviceRequest) + + if err != nil { + return err + } + + *o = GoogleEndpointDeviceRequest(varGoogleEndpointDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleEndpointDeviceRequest struct { + value *GoogleEndpointDeviceRequest + isSet bool +} + +func (v NullableGoogleEndpointDeviceRequest) Get() *GoogleEndpointDeviceRequest { + return v.value +} + +func (v *NullableGoogleEndpointDeviceRequest) Set(val *GoogleEndpointDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleEndpointDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleEndpointDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleEndpointDeviceRequest(val *GoogleEndpointDeviceRequest) *NullableGoogleEndpointDeviceRequest { + return &NullableGoogleEndpointDeviceRequest{value: val, isSet: true} +} + +func (v NullableGoogleEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleEndpointDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider.go b/packages/client-go/model_google_workspace_provider.go new file mode 100644 index 0000000000..c37ac0e0a2 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider.go @@ -0,0 +1,852 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProvider{} + +// GoogleWorkspaceProvider GoogleWorkspaceProvider Serializer +type GoogleWorkspaceProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + DelegatedSubject string `json:"delegated_subject"` + Credentials map[string]interface{} `json:"credentials"` + Scopes *string `json:"scopes,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + DefaultGroupEmailDomain string `json:"default_group_email_domain"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProvider GoogleWorkspaceProvider + +// NewGoogleWorkspaceProvider instantiates a new GoogleWorkspaceProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProvider(pk int32, name string, component string, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, delegatedSubject string, credentials map[string]interface{}, defaultGroupEmailDomain string) *GoogleWorkspaceProvider { + this := GoogleWorkspaceProvider{} + this.Pk = pk + this.Name = name + this.Component = component + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.DelegatedSubject = delegatedSubject + this.Credentials = credentials + this.DefaultGroupEmailDomain = defaultGroupEmailDomain + return &this +} + +// NewGoogleWorkspaceProviderWithDefaults instantiates a new GoogleWorkspaceProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderWithDefaults() *GoogleWorkspaceProvider { + this := GoogleWorkspaceProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *GoogleWorkspaceProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GoogleWorkspaceProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *GoogleWorkspaceProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleWorkspaceProvider) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *GoogleWorkspaceProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *GoogleWorkspaceProvider) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetComponent returns the Component field value +func (o *GoogleWorkspaceProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *GoogleWorkspaceProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *GoogleWorkspaceProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *GoogleWorkspaceProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *GoogleWorkspaceProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *GoogleWorkspaceProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *GoogleWorkspaceProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *GoogleWorkspaceProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *GoogleWorkspaceProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *GoogleWorkspaceProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *GoogleWorkspaceProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *GoogleWorkspaceProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetDelegatedSubject returns the DelegatedSubject field value +func (o *GoogleWorkspaceProvider) GetDelegatedSubject() string { + if o == nil { + var ret string + return ret + } + + return o.DelegatedSubject +} + +// GetDelegatedSubjectOk returns a tuple with the DelegatedSubject field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetDelegatedSubjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DelegatedSubject, true +} + +// SetDelegatedSubject sets field value +func (o *GoogleWorkspaceProvider) SetDelegatedSubject(v string) { + o.DelegatedSubject = v +} + +// GetCredentials returns the Credentials field value +func (o *GoogleWorkspaceProvider) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *GoogleWorkspaceProvider) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetScopes() string { + if o == nil || IsNil(o.Scopes) { + var ret string + return ret + } + return *o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetScopesOk() (*string, bool) { + if o == nil || IsNil(o.Scopes) { + return nil, false + } + return o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasScopes() bool { + if o != nil && !IsNil(o.Scopes) { + return true + } + + return false +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +func (o *GoogleWorkspaceProvider) SetScopes(v string) { + o.Scopes = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *GoogleWorkspaceProvider) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GoogleWorkspaceProvider) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProvider) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *GoogleWorkspaceProvider) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *GoogleWorkspaceProvider) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *GoogleWorkspaceProvider) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *GoogleWorkspaceProvider) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *GoogleWorkspaceProvider) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetDefaultGroupEmailDomain returns the DefaultGroupEmailDomain field value +func (o *GoogleWorkspaceProvider) GetDefaultGroupEmailDomain() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultGroupEmailDomain +} + +// GetDefaultGroupEmailDomainOk returns a tuple with the DefaultGroupEmailDomain field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetDefaultGroupEmailDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultGroupEmailDomain, true +} + +// SetDefaultGroupEmailDomain sets field value +func (o *GoogleWorkspaceProvider) SetDefaultGroupEmailDomain(v string) { + o.DefaultGroupEmailDomain = v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *GoogleWorkspaceProvider) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *GoogleWorkspaceProvider) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *GoogleWorkspaceProvider) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProvider) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *GoogleWorkspaceProvider) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *GoogleWorkspaceProvider) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o GoogleWorkspaceProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["component"] = o.Component + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["delegated_subject"] = o.DelegatedSubject + toSerialize["credentials"] = o.Credentials + if !IsNil(o.Scopes) { + toSerialize["scopes"] = o.Scopes + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + toSerialize["default_group_email_domain"] = o.DefaultGroupEmailDomain + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "delegated_subject", + "credentials", + "default_group_email_domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProvider := _GoogleWorkspaceProvider{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProvider) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProvider(varGoogleWorkspaceProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "delegated_subject") + delete(additionalProperties, "credentials") + delete(additionalProperties, "scopes") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "default_group_email_domain") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProvider struct { + value *GoogleWorkspaceProvider + isSet bool +} + +func (v NullableGoogleWorkspaceProvider) Get() *GoogleWorkspaceProvider { + return v.value +} + +func (v *NullableGoogleWorkspaceProvider) Set(val *GoogleWorkspaceProvider) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProvider(val *GoogleWorkspaceProvider) *NullableGoogleWorkspaceProvider { + return &NullableGoogleWorkspaceProvider{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_group.go b/packages/client-go/model_google_workspace_provider_group.go new file mode 100644 index 0000000000..c555b87bf3 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_group.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderGroup{} + +// GoogleWorkspaceProviderGroup GoogleWorkspaceProviderGroup Serializer +type GoogleWorkspaceProviderGroup struct { + Id string `json:"id"` + GoogleId string `json:"google_id"` + Group string `json:"group"` + GroupObj PartialGroup `json:"group_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderGroup GoogleWorkspaceProviderGroup + +// NewGoogleWorkspaceProviderGroup instantiates a new GoogleWorkspaceProviderGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderGroup(id string, googleId string, group string, groupObj PartialGroup, provider int32, attributes map[string]interface{}) *GoogleWorkspaceProviderGroup { + this := GoogleWorkspaceProviderGroup{} + this.Id = id + this.GoogleId = googleId + this.Group = group + this.GroupObj = groupObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewGoogleWorkspaceProviderGroupWithDefaults instantiates a new GoogleWorkspaceProviderGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderGroupWithDefaults() *GoogleWorkspaceProviderGroup { + this := GoogleWorkspaceProviderGroup{} + return &this +} + +// GetId returns the Id field value +func (o *GoogleWorkspaceProviderGroup) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GoogleWorkspaceProviderGroup) SetId(v string) { + o.Id = v +} + +// GetGoogleId returns the GoogleId field value +func (o *GoogleWorkspaceProviderGroup) GetGoogleId() string { + if o == nil { + var ret string + return ret + } + + return o.GoogleId +} + +// GetGoogleIdOk returns a tuple with the GoogleId field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetGoogleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GoogleId, true +} + +// SetGoogleId sets field value +func (o *GoogleWorkspaceProviderGroup) SetGoogleId(v string) { + o.GoogleId = v +} + +// GetGroup returns the Group field value +func (o *GoogleWorkspaceProviderGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GoogleWorkspaceProviderGroup) SetGroup(v string) { + o.Group = v +} + +// GetGroupObj returns the GroupObj field value +func (o *GoogleWorkspaceProviderGroup) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *GoogleWorkspaceProviderGroup) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetProvider returns the Provider field value +func (o *GoogleWorkspaceProviderGroup) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *GoogleWorkspaceProviderGroup) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *GoogleWorkspaceProviderGroup) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *GoogleWorkspaceProviderGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o GoogleWorkspaceProviderGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["google_id"] = o.GoogleId + toSerialize["group"] = o.Group + toSerialize["group_obj"] = o.GroupObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "google_id", + "group", + "group_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderGroup := _GoogleWorkspaceProviderGroup{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderGroup) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderGroup(varGoogleWorkspaceProviderGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "google_id") + delete(additionalProperties, "group") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderGroup struct { + value *GoogleWorkspaceProviderGroup + isSet bool +} + +func (v NullableGoogleWorkspaceProviderGroup) Get() *GoogleWorkspaceProviderGroup { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderGroup) Set(val *GoogleWorkspaceProviderGroup) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderGroup(val *GoogleWorkspaceProviderGroup) *NullableGoogleWorkspaceProviderGroup { + return &NullableGoogleWorkspaceProviderGroup{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_group_request.go b/packages/client-go/model_google_workspace_provider_group_request.go new file mode 100644 index 0000000000..a025264ec8 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_group_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderGroupRequest{} + +// GoogleWorkspaceProviderGroupRequest GoogleWorkspaceProviderGroup Serializer +type GoogleWorkspaceProviderGroupRequest struct { + GoogleId string `json:"google_id"` + Group string `json:"group"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderGroupRequest GoogleWorkspaceProviderGroupRequest + +// NewGoogleWorkspaceProviderGroupRequest instantiates a new GoogleWorkspaceProviderGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderGroupRequest(googleId string, group string, provider int32) *GoogleWorkspaceProviderGroupRequest { + this := GoogleWorkspaceProviderGroupRequest{} + this.GoogleId = googleId + this.Group = group + this.Provider = provider + return &this +} + +// NewGoogleWorkspaceProviderGroupRequestWithDefaults instantiates a new GoogleWorkspaceProviderGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderGroupRequestWithDefaults() *GoogleWorkspaceProviderGroupRequest { + this := GoogleWorkspaceProviderGroupRequest{} + return &this +} + +// GetGoogleId returns the GoogleId field value +func (o *GoogleWorkspaceProviderGroupRequest) GetGoogleId() string { + if o == nil { + var ret string + return ret + } + + return o.GoogleId +} + +// GetGoogleIdOk returns a tuple with the GoogleId field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroupRequest) GetGoogleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GoogleId, true +} + +// SetGoogleId sets field value +func (o *GoogleWorkspaceProviderGroupRequest) SetGoogleId(v string) { + o.GoogleId = v +} + +// GetGroup returns the Group field value +func (o *GoogleWorkspaceProviderGroupRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroupRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GoogleWorkspaceProviderGroupRequest) SetGroup(v string) { + o.Group = v +} + +// GetProvider returns the Provider field value +func (o *GoogleWorkspaceProviderGroupRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderGroupRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *GoogleWorkspaceProviderGroupRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o GoogleWorkspaceProviderGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["google_id"] = o.GoogleId + toSerialize["group"] = o.Group + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "google_id", + "group", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderGroupRequest := _GoogleWorkspaceProviderGroupRequest{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderGroupRequest) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderGroupRequest(varGoogleWorkspaceProviderGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "google_id") + delete(additionalProperties, "group") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderGroupRequest struct { + value *GoogleWorkspaceProviderGroupRequest + isSet bool +} + +func (v NullableGoogleWorkspaceProviderGroupRequest) Get() *GoogleWorkspaceProviderGroupRequest { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderGroupRequest) Set(val *GoogleWorkspaceProviderGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderGroupRequest(val *GoogleWorkspaceProviderGroupRequest) *NullableGoogleWorkspaceProviderGroupRequest { + return &NullableGoogleWorkspaceProviderGroupRequest{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_mapping.go b/packages/client-go/model_google_workspace_provider_mapping.go new file mode 100644 index 0000000000..fdb85f0da9 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderMapping{} + +// GoogleWorkspaceProviderMapping GoogleWorkspaceProviderMapping Serializer +type GoogleWorkspaceProviderMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderMapping GoogleWorkspaceProviderMapping + +// NewGoogleWorkspaceProviderMapping instantiates a new GoogleWorkspaceProviderMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *GoogleWorkspaceProviderMapping { + this := GoogleWorkspaceProviderMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewGoogleWorkspaceProviderMappingWithDefaults instantiates a new GoogleWorkspaceProviderMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderMappingWithDefaults() *GoogleWorkspaceProviderMapping { + this := GoogleWorkspaceProviderMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *GoogleWorkspaceProviderMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GoogleWorkspaceProviderMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GoogleWorkspaceProviderMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProviderMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *GoogleWorkspaceProviderMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *GoogleWorkspaceProviderMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *GoogleWorkspaceProviderMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *GoogleWorkspaceProviderMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleWorkspaceProviderMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *GoogleWorkspaceProviderMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *GoogleWorkspaceProviderMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *GoogleWorkspaceProviderMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *GoogleWorkspaceProviderMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *GoogleWorkspaceProviderMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *GoogleWorkspaceProviderMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *GoogleWorkspaceProviderMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *GoogleWorkspaceProviderMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *GoogleWorkspaceProviderMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *GoogleWorkspaceProviderMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o GoogleWorkspaceProviderMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderMapping := _GoogleWorkspaceProviderMapping{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderMapping) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderMapping(varGoogleWorkspaceProviderMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderMapping struct { + value *GoogleWorkspaceProviderMapping + isSet bool +} + +func (v NullableGoogleWorkspaceProviderMapping) Get() *GoogleWorkspaceProviderMapping { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderMapping) Set(val *GoogleWorkspaceProviderMapping) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderMapping(val *GoogleWorkspaceProviderMapping) *NullableGoogleWorkspaceProviderMapping { + return &NullableGoogleWorkspaceProviderMapping{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_mapping_request.go b/packages/client-go/model_google_workspace_provider_mapping_request.go new file mode 100644 index 0000000000..d242f7c3af --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderMappingRequest{} + +// GoogleWorkspaceProviderMappingRequest GoogleWorkspaceProviderMapping Serializer +type GoogleWorkspaceProviderMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderMappingRequest GoogleWorkspaceProviderMappingRequest + +// NewGoogleWorkspaceProviderMappingRequest instantiates a new GoogleWorkspaceProviderMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderMappingRequest(name string, expression string) *GoogleWorkspaceProviderMappingRequest { + this := GoogleWorkspaceProviderMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewGoogleWorkspaceProviderMappingRequestWithDefaults instantiates a new GoogleWorkspaceProviderMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderMappingRequestWithDefaults() *GoogleWorkspaceProviderMappingRequest { + this := GoogleWorkspaceProviderMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GoogleWorkspaceProviderMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProviderMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *GoogleWorkspaceProviderMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *GoogleWorkspaceProviderMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *GoogleWorkspaceProviderMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *GoogleWorkspaceProviderMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleWorkspaceProviderMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *GoogleWorkspaceProviderMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *GoogleWorkspaceProviderMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o GoogleWorkspaceProviderMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderMappingRequest := _GoogleWorkspaceProviderMappingRequest{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderMappingRequest) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderMappingRequest(varGoogleWorkspaceProviderMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderMappingRequest struct { + value *GoogleWorkspaceProviderMappingRequest + isSet bool +} + +func (v NullableGoogleWorkspaceProviderMappingRequest) Get() *GoogleWorkspaceProviderMappingRequest { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderMappingRequest) Set(val *GoogleWorkspaceProviderMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderMappingRequest(val *GoogleWorkspaceProviderMappingRequest) *NullableGoogleWorkspaceProviderMappingRequest { + return &NullableGoogleWorkspaceProviderMappingRequest{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_request.go b/packages/client-go/model_google_workspace_provider_request.go new file mode 100644 index 0000000000..3e4ac31e74 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_request.go @@ -0,0 +1,639 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderRequest{} + +// GoogleWorkspaceProviderRequest GoogleWorkspaceProvider Serializer +type GoogleWorkspaceProviderRequest struct { + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + DelegatedSubject string `json:"delegated_subject"` + Credentials map[string]interface{} `json:"credentials"` + Scopes *string `json:"scopes,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + DefaultGroupEmailDomain string `json:"default_group_email_domain"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderRequest GoogleWorkspaceProviderRequest + +// NewGoogleWorkspaceProviderRequest instantiates a new GoogleWorkspaceProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderRequest(name string, delegatedSubject string, credentials map[string]interface{}, defaultGroupEmailDomain string) *GoogleWorkspaceProviderRequest { + this := GoogleWorkspaceProviderRequest{} + this.Name = name + this.DelegatedSubject = delegatedSubject + this.Credentials = credentials + this.DefaultGroupEmailDomain = defaultGroupEmailDomain + return &this +} + +// NewGoogleWorkspaceProviderRequestWithDefaults instantiates a new GoogleWorkspaceProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderRequestWithDefaults() *GoogleWorkspaceProviderRequest { + this := GoogleWorkspaceProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *GoogleWorkspaceProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GoogleWorkspaceProviderRequest) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *GoogleWorkspaceProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *GoogleWorkspaceProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetDelegatedSubject returns the DelegatedSubject field value +func (o *GoogleWorkspaceProviderRequest) GetDelegatedSubject() string { + if o == nil { + var ret string + return ret + } + + return o.DelegatedSubject +} + +// GetDelegatedSubjectOk returns a tuple with the DelegatedSubject field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetDelegatedSubjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DelegatedSubject, true +} + +// SetDelegatedSubject sets field value +func (o *GoogleWorkspaceProviderRequest) SetDelegatedSubject(v string) { + o.DelegatedSubject = v +} + +// GetCredentials returns the Credentials field value +func (o *GoogleWorkspaceProviderRequest) GetCredentials() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// SetCredentials sets field value +func (o *GoogleWorkspaceProviderRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetScopes() string { + if o == nil || IsNil(o.Scopes) { + var ret string + return ret + } + return *o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetScopesOk() (*string, bool) { + if o == nil || IsNil(o.Scopes) { + return nil, false + } + return o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasScopes() bool { + if o != nil && !IsNil(o.Scopes) { + return true + } + + return false +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +func (o *GoogleWorkspaceProviderRequest) SetScopes(v string) { + o.Scopes = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *GoogleWorkspaceProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *GoogleWorkspaceProviderRequest) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *GoogleWorkspaceProviderRequest) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *GoogleWorkspaceProviderRequest) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *GoogleWorkspaceProviderRequest) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *GoogleWorkspaceProviderRequest) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *GoogleWorkspaceProviderRequest) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *GoogleWorkspaceProviderRequest) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetDefaultGroupEmailDomain returns the DefaultGroupEmailDomain field value +func (o *GoogleWorkspaceProviderRequest) GetDefaultGroupEmailDomain() string { + if o == nil { + var ret string + return ret + } + + return o.DefaultGroupEmailDomain +} + +// GetDefaultGroupEmailDomainOk returns a tuple with the DefaultGroupEmailDomain field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetDefaultGroupEmailDomainOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DefaultGroupEmailDomain, true +} + +// SetDefaultGroupEmailDomain sets field value +func (o *GoogleWorkspaceProviderRequest) SetDefaultGroupEmailDomain(v string) { + o.DefaultGroupEmailDomain = v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *GoogleWorkspaceProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *GoogleWorkspaceProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *GoogleWorkspaceProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *GoogleWorkspaceProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *GoogleWorkspaceProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o GoogleWorkspaceProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["delegated_subject"] = o.DelegatedSubject + toSerialize["credentials"] = o.Credentials + if !IsNil(o.Scopes) { + toSerialize["scopes"] = o.Scopes + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + toSerialize["default_group_email_domain"] = o.DefaultGroupEmailDomain + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "delegated_subject", + "credentials", + "default_group_email_domain", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderRequest := _GoogleWorkspaceProviderRequest{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderRequest) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderRequest(varGoogleWorkspaceProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "delegated_subject") + delete(additionalProperties, "credentials") + delete(additionalProperties, "scopes") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "default_group_email_domain") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderRequest struct { + value *GoogleWorkspaceProviderRequest + isSet bool +} + +func (v NullableGoogleWorkspaceProviderRequest) Get() *GoogleWorkspaceProviderRequest { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderRequest) Set(val *GoogleWorkspaceProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderRequest(val *GoogleWorkspaceProviderRequest) *NullableGoogleWorkspaceProviderRequest { + return &NullableGoogleWorkspaceProviderRequest{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_user.go b/packages/client-go/model_google_workspace_provider_user.go new file mode 100644 index 0000000000..6b2c86e2ae --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_user.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderUser{} + +// GoogleWorkspaceProviderUser GoogleWorkspaceProviderUser Serializer +type GoogleWorkspaceProviderUser struct { + Id string `json:"id"` + GoogleId string `json:"google_id"` + User int32 `json:"user"` + UserObj PartialUser `json:"user_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderUser GoogleWorkspaceProviderUser + +// NewGoogleWorkspaceProviderUser instantiates a new GoogleWorkspaceProviderUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderUser(id string, googleId string, user int32, userObj PartialUser, provider int32, attributes map[string]interface{}) *GoogleWorkspaceProviderUser { + this := GoogleWorkspaceProviderUser{} + this.Id = id + this.GoogleId = googleId + this.User = user + this.UserObj = userObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewGoogleWorkspaceProviderUserWithDefaults instantiates a new GoogleWorkspaceProviderUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderUserWithDefaults() *GoogleWorkspaceProviderUser { + this := GoogleWorkspaceProviderUser{} + return &this +} + +// GetId returns the Id field value +func (o *GoogleWorkspaceProviderUser) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *GoogleWorkspaceProviderUser) SetId(v string) { + o.Id = v +} + +// GetGoogleId returns the GoogleId field value +func (o *GoogleWorkspaceProviderUser) GetGoogleId() string { + if o == nil { + var ret string + return ret + } + + return o.GoogleId +} + +// GetGoogleIdOk returns a tuple with the GoogleId field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetGoogleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GoogleId, true +} + +// SetGoogleId sets field value +func (o *GoogleWorkspaceProviderUser) SetGoogleId(v string) { + o.GoogleId = v +} + +// GetUser returns the User field value +func (o *GoogleWorkspaceProviderUser) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *GoogleWorkspaceProviderUser) SetUser(v int32) { + o.User = v +} + +// GetUserObj returns the UserObj field value +func (o *GoogleWorkspaceProviderUser) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *GoogleWorkspaceProviderUser) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetProvider returns the Provider field value +func (o *GoogleWorkspaceProviderUser) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *GoogleWorkspaceProviderUser) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *GoogleWorkspaceProviderUser) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUser) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *GoogleWorkspaceProviderUser) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o GoogleWorkspaceProviderUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["google_id"] = o.GoogleId + toSerialize["user"] = o.User + toSerialize["user_obj"] = o.UserObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "google_id", + "user", + "user_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderUser := _GoogleWorkspaceProviderUser{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderUser) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderUser(varGoogleWorkspaceProviderUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "google_id") + delete(additionalProperties, "user") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderUser struct { + value *GoogleWorkspaceProviderUser + isSet bool +} + +func (v NullableGoogleWorkspaceProviderUser) Get() *GoogleWorkspaceProviderUser { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderUser) Set(val *GoogleWorkspaceProviderUser) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderUser) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderUser(val *GoogleWorkspaceProviderUser) *NullableGoogleWorkspaceProviderUser { + return &NullableGoogleWorkspaceProviderUser{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_google_workspace_provider_user_request.go b/packages/client-go/model_google_workspace_provider_user_request.go new file mode 100644 index 0000000000..67d8773907 --- /dev/null +++ b/packages/client-go/model_google_workspace_provider_user_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GoogleWorkspaceProviderUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GoogleWorkspaceProviderUserRequest{} + +// GoogleWorkspaceProviderUserRequest GoogleWorkspaceProviderUser Serializer +type GoogleWorkspaceProviderUserRequest struct { + GoogleId string `json:"google_id"` + User int32 `json:"user"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _GoogleWorkspaceProviderUserRequest GoogleWorkspaceProviderUserRequest + +// NewGoogleWorkspaceProviderUserRequest instantiates a new GoogleWorkspaceProviderUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGoogleWorkspaceProviderUserRequest(googleId string, user int32, provider int32) *GoogleWorkspaceProviderUserRequest { + this := GoogleWorkspaceProviderUserRequest{} + this.GoogleId = googleId + this.User = user + this.Provider = provider + return &this +} + +// NewGoogleWorkspaceProviderUserRequestWithDefaults instantiates a new GoogleWorkspaceProviderUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGoogleWorkspaceProviderUserRequestWithDefaults() *GoogleWorkspaceProviderUserRequest { + this := GoogleWorkspaceProviderUserRequest{} + return &this +} + +// GetGoogleId returns the GoogleId field value +func (o *GoogleWorkspaceProviderUserRequest) GetGoogleId() string { + if o == nil { + var ret string + return ret + } + + return o.GoogleId +} + +// GetGoogleIdOk returns a tuple with the GoogleId field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUserRequest) GetGoogleIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GoogleId, true +} + +// SetGoogleId sets field value +func (o *GoogleWorkspaceProviderUserRequest) SetGoogleId(v string) { + o.GoogleId = v +} + +// GetUser returns the User field value +func (o *GoogleWorkspaceProviderUserRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUserRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *GoogleWorkspaceProviderUserRequest) SetUser(v int32) { + o.User = v +} + +// GetProvider returns the Provider field value +func (o *GoogleWorkspaceProviderUserRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *GoogleWorkspaceProviderUserRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *GoogleWorkspaceProviderUserRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o GoogleWorkspaceProviderUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GoogleWorkspaceProviderUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["google_id"] = o.GoogleId + toSerialize["user"] = o.User + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GoogleWorkspaceProviderUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "google_id", + "user", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGoogleWorkspaceProviderUserRequest := _GoogleWorkspaceProviderUserRequest{} + + err = json.Unmarshal(data, &varGoogleWorkspaceProviderUserRequest) + + if err != nil { + return err + } + + *o = GoogleWorkspaceProviderUserRequest(varGoogleWorkspaceProviderUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "google_id") + delete(additionalProperties, "user") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGoogleWorkspaceProviderUserRequest struct { + value *GoogleWorkspaceProviderUserRequest + isSet bool +} + +func (v NullableGoogleWorkspaceProviderUserRequest) Get() *GoogleWorkspaceProviderUserRequest { + return v.value +} + +func (v *NullableGoogleWorkspaceProviderUserRequest) Set(val *GoogleWorkspaceProviderUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGoogleWorkspaceProviderUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGoogleWorkspaceProviderUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGoogleWorkspaceProviderUserRequest(val *GoogleWorkspaceProviderUserRequest) *NullableGoogleWorkspaceProviderUserRequest { + return &NullableGoogleWorkspaceProviderUserRequest{value: val, isSet: true} +} + +func (v NullableGoogleWorkspaceProviderUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGoogleWorkspaceProviderUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group.go b/packages/client-go/model_group.go new file mode 100644 index 0000000000..e9617d7d03 --- /dev/null +++ b/packages/client-go/model_group.go @@ -0,0 +1,601 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Group type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Group{} + +// Group Group Serializer +type Group struct { + Pk string `json:"pk"` + NumPk int32 `json:"num_pk"` + Name string `json:"name"` + // Users added to this group will be superusers. + IsSuperuser *bool `json:"is_superuser,omitempty"` + Parents []string `json:"parents,omitempty"` + ParentsObj []RelatedGroup `json:"parents_obj"` + Users []int32 `json:"users,omitempty"` + UsersObj []PartialUser `json:"users_obj"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Roles []string `json:"roles,omitempty"` + RolesObj []Role `json:"roles_obj"` + InheritedRolesObj []Role `json:"inherited_roles_obj"` + Children []string `json:"children"` + ChildrenObj []RelatedGroup `json:"children_obj"` + AdditionalProperties map[string]interface{} +} + +type _Group Group + +// NewGroup instantiates a new Group object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroup(pk string, numPk int32, name string, parentsObj []RelatedGroup, usersObj []PartialUser, rolesObj []Role, inheritedRolesObj []Role, children []string, childrenObj []RelatedGroup) *Group { + this := Group{} + this.Pk = pk + this.NumPk = numPk + this.Name = name + this.ParentsObj = parentsObj + this.UsersObj = usersObj + this.RolesObj = rolesObj + this.InheritedRolesObj = inheritedRolesObj + this.Children = children + this.ChildrenObj = childrenObj + return &this +} + +// NewGroupWithDefaults instantiates a new Group object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupWithDefaults() *Group { + this := Group{} + return &this +} + +// GetPk returns the Pk field value +func (o *Group) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Group) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Group) SetPk(v string) { + o.Pk = v +} + +// GetNumPk returns the NumPk field value +func (o *Group) GetNumPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NumPk +} + +// GetNumPkOk returns a tuple with the NumPk field value +// and a boolean to check if the value has been set. +func (o *Group) GetNumPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NumPk, true +} + +// SetNumPk sets field value +func (o *Group) SetNumPk(v int32) { + o.NumPk = v +} + +// GetName returns the Name field value +func (o *Group) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Group) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Group) SetName(v string) { + o.Name = v +} + +// GetIsSuperuser returns the IsSuperuser field value if set, zero value otherwise. +func (o *Group) GetIsSuperuser() bool { + if o == nil || IsNil(o.IsSuperuser) { + var ret bool + return ret + } + return *o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetIsSuperuserOk() (*bool, bool) { + if o == nil || IsNil(o.IsSuperuser) { + return nil, false + } + return o.IsSuperuser, true +} + +// HasIsSuperuser returns a boolean if a field has been set. +func (o *Group) HasIsSuperuser() bool { + if o != nil && !IsNil(o.IsSuperuser) { + return true + } + + return false +} + +// SetIsSuperuser gets a reference to the given bool and assigns it to the IsSuperuser field. +func (o *Group) SetIsSuperuser(v bool) { + o.IsSuperuser = &v +} + +// GetParents returns the Parents field value if set, zero value otherwise. +func (o *Group) GetParents() []string { + if o == nil || IsNil(o.Parents) { + var ret []string + return ret + } + return o.Parents +} + +// GetParentsOk returns a tuple with the Parents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetParentsOk() ([]string, bool) { + if o == nil || IsNil(o.Parents) { + return nil, false + } + return o.Parents, true +} + +// HasParents returns a boolean if a field has been set. +func (o *Group) HasParents() bool { + if o != nil && !IsNil(o.Parents) { + return true + } + + return false +} + +// SetParents gets a reference to the given []string and assigns it to the Parents field. +func (o *Group) SetParents(v []string) { + o.Parents = v +} + +// GetParentsObj returns the ParentsObj field value +// If the value is explicit nil, the zero value for []RelatedGroup will be returned +func (o *Group) GetParentsObj() []RelatedGroup { + if o == nil { + var ret []RelatedGroup + return ret + } + + return o.ParentsObj +} + +// GetParentsObjOk returns a tuple with the ParentsObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Group) GetParentsObjOk() ([]RelatedGroup, bool) { + if o == nil || IsNil(o.ParentsObj) { + return nil, false + } + return o.ParentsObj, true +} + +// SetParentsObj sets field value +func (o *Group) SetParentsObj(v []RelatedGroup) { + o.ParentsObj = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *Group) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *Group) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *Group) SetUsers(v []int32) { + o.Users = v +} + +// GetUsersObj returns the UsersObj field value +// If the value is explicit nil, the zero value for []PartialUser will be returned +func (o *Group) GetUsersObj() []PartialUser { + if o == nil { + var ret []PartialUser + return ret + } + + return o.UsersObj +} + +// GetUsersObjOk returns a tuple with the UsersObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Group) GetUsersObjOk() ([]PartialUser, bool) { + if o == nil || IsNil(o.UsersObj) { + return nil, false + } + return o.UsersObj, true +} + +// SetUsersObj sets field value +func (o *Group) SetUsersObj(v []PartialUser) { + o.UsersObj = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *Group) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *Group) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *Group) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *Group) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Group) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *Group) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *Group) SetRoles(v []string) { + o.Roles = v +} + +// GetRolesObj returns the RolesObj field value +func (o *Group) GetRolesObj() []Role { + if o == nil { + var ret []Role + return ret + } + + return o.RolesObj +} + +// GetRolesObjOk returns a tuple with the RolesObj field value +// and a boolean to check if the value has been set. +func (o *Group) GetRolesObjOk() ([]Role, bool) { + if o == nil { + return nil, false + } + return o.RolesObj, true +} + +// SetRolesObj sets field value +func (o *Group) SetRolesObj(v []Role) { + o.RolesObj = v +} + +// GetInheritedRolesObj returns the InheritedRolesObj field value +// If the value is explicit nil, the zero value for []Role will be returned +func (o *Group) GetInheritedRolesObj() []Role { + if o == nil { + var ret []Role + return ret + } + + return o.InheritedRolesObj +} + +// GetInheritedRolesObjOk returns a tuple with the InheritedRolesObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Group) GetInheritedRolesObjOk() ([]Role, bool) { + if o == nil || IsNil(o.InheritedRolesObj) { + return nil, false + } + return o.InheritedRolesObj, true +} + +// SetInheritedRolesObj sets field value +func (o *Group) SetInheritedRolesObj(v []Role) { + o.InheritedRolesObj = v +} + +// GetChildren returns the Children field value +func (o *Group) GetChildren() []string { + if o == nil { + var ret []string + return ret + } + + return o.Children +} + +// GetChildrenOk returns a tuple with the Children field value +// and a boolean to check if the value has been set. +func (o *Group) GetChildrenOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Children, true +} + +// SetChildren sets field value +func (o *Group) SetChildren(v []string) { + o.Children = v +} + +// GetChildrenObj returns the ChildrenObj field value +// If the value is explicit nil, the zero value for []RelatedGroup will be returned +func (o *Group) GetChildrenObj() []RelatedGroup { + if o == nil { + var ret []RelatedGroup + return ret + } + + return o.ChildrenObj +} + +// GetChildrenObjOk returns a tuple with the ChildrenObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Group) GetChildrenObjOk() ([]RelatedGroup, bool) { + if o == nil || IsNil(o.ChildrenObj) { + return nil, false + } + return o.ChildrenObj, true +} + +// SetChildrenObj sets field value +func (o *Group) SetChildrenObj(v []RelatedGroup) { + o.ChildrenObj = v +} + +func (o Group) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Group) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["num_pk"] = o.NumPk + toSerialize["name"] = o.Name + if !IsNil(o.IsSuperuser) { + toSerialize["is_superuser"] = o.IsSuperuser + } + if !IsNil(o.Parents) { + toSerialize["parents"] = o.Parents + } + if o.ParentsObj != nil { + toSerialize["parents_obj"] = o.ParentsObj + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + if o.UsersObj != nil { + toSerialize["users_obj"] = o.UsersObj + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + toSerialize["roles_obj"] = o.RolesObj + if o.InheritedRolesObj != nil { + toSerialize["inherited_roles_obj"] = o.InheritedRolesObj + } + toSerialize["children"] = o.Children + if o.ChildrenObj != nil { + toSerialize["children_obj"] = o.ChildrenObj + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Group) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "num_pk", + "name", + "parents_obj", + "users_obj", + "roles_obj", + "inherited_roles_obj", + "children", + "children_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroup := _Group{} + + err = json.Unmarshal(data, &varGroup) + + if err != nil { + return err + } + + *o = Group(varGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "num_pk") + delete(additionalProperties, "name") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "parents") + delete(additionalProperties, "parents_obj") + delete(additionalProperties, "users") + delete(additionalProperties, "users_obj") + delete(additionalProperties, "attributes") + delete(additionalProperties, "roles") + delete(additionalProperties, "roles_obj") + delete(additionalProperties, "inherited_roles_obj") + delete(additionalProperties, "children") + delete(additionalProperties, "children_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroup struct { + value *Group + isSet bool +} + +func (v NullableGroup) Get() *Group { + return v.value +} + +func (v *NullableGroup) Set(val *Group) { + v.value = val + v.isSet = true +} + +func (v NullableGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroup(val *Group) *NullableGroup { + return &NullableGroup{value: val, isSet: true} +} + +func (v NullableGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_kerberos_source_connection.go b/packages/client-go/model_group_kerberos_source_connection.go new file mode 100644 index 0000000000..151c5ef5c5 --- /dev/null +++ b/packages/client-go/model_group_kerberos_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupKerberosSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupKerberosSourceConnection{} + +// GroupKerberosSourceConnection Group Source Connection +type GroupKerberosSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupKerberosSourceConnection GroupKerberosSourceConnection + +// NewGroupKerberosSourceConnection instantiates a new GroupKerberosSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupKerberosSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupKerberosSourceConnection { + this := GroupKerberosSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupKerberosSourceConnectionWithDefaults instantiates a new GroupKerberosSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupKerberosSourceConnectionWithDefaults() *GroupKerberosSourceConnection { + this := GroupKerberosSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupKerberosSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupKerberosSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupKerberosSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupKerberosSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupKerberosSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupKerberosSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupKerberosSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupKerberosSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupKerberosSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupKerberosSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupKerberosSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupKerberosSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupKerberosSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupKerberosSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupKerberosSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupKerberosSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupKerberosSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupKerberosSourceConnection := _GroupKerberosSourceConnection{} + + err = json.Unmarshal(data, &varGroupKerberosSourceConnection) + + if err != nil { + return err + } + + *o = GroupKerberosSourceConnection(varGroupKerberosSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupKerberosSourceConnection struct { + value *GroupKerberosSourceConnection + isSet bool +} + +func (v NullableGroupKerberosSourceConnection) Get() *GroupKerberosSourceConnection { + return v.value +} + +func (v *NullableGroupKerberosSourceConnection) Set(val *GroupKerberosSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupKerberosSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupKerberosSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupKerberosSourceConnection(val *GroupKerberosSourceConnection) *NullableGroupKerberosSourceConnection { + return &NullableGroupKerberosSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupKerberosSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupKerberosSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_kerberos_source_connection_request.go b/packages/client-go/model_group_kerberos_source_connection_request.go new file mode 100644 index 0000000000..3b1da24f40 --- /dev/null +++ b/packages/client-go/model_group_kerberos_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupKerberosSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupKerberosSourceConnectionRequest{} + +// GroupKerberosSourceConnectionRequest Group Source Connection +type GroupKerberosSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupKerberosSourceConnectionRequest GroupKerberosSourceConnectionRequest + +// NewGroupKerberosSourceConnectionRequest instantiates a new GroupKerberosSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupKerberosSourceConnectionRequest(group string, source string, identifier string) *GroupKerberosSourceConnectionRequest { + this := GroupKerberosSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupKerberosSourceConnectionRequestWithDefaults instantiates a new GroupKerberosSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupKerberosSourceConnectionRequestWithDefaults() *GroupKerberosSourceConnectionRequest { + this := GroupKerberosSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupKerberosSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupKerberosSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupKerberosSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupKerberosSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupKerberosSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupKerberosSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupKerberosSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupKerberosSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupKerberosSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupKerberosSourceConnectionRequest := _GroupKerberosSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupKerberosSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupKerberosSourceConnectionRequest(varGroupKerberosSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupKerberosSourceConnectionRequest struct { + value *GroupKerberosSourceConnectionRequest + isSet bool +} + +func (v NullableGroupKerberosSourceConnectionRequest) Get() *GroupKerberosSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupKerberosSourceConnectionRequest) Set(val *GroupKerberosSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupKerberosSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupKerberosSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupKerberosSourceConnectionRequest(val *GroupKerberosSourceConnectionRequest) *NullableGroupKerberosSourceConnectionRequest { + return &NullableGroupKerberosSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupKerberosSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_ldap_source_connection.go b/packages/client-go/model_group_ldap_source_connection.go new file mode 100644 index 0000000000..4fd80ca628 --- /dev/null +++ b/packages/client-go/model_group_ldap_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupLDAPSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupLDAPSourceConnection{} + +// GroupLDAPSourceConnection Group Source Connection +type GroupLDAPSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupLDAPSourceConnection GroupLDAPSourceConnection + +// NewGroupLDAPSourceConnection instantiates a new GroupLDAPSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupLDAPSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupLDAPSourceConnection { + this := GroupLDAPSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupLDAPSourceConnectionWithDefaults instantiates a new GroupLDAPSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupLDAPSourceConnectionWithDefaults() *GroupLDAPSourceConnection { + this := GroupLDAPSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupLDAPSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupLDAPSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupLDAPSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupLDAPSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupLDAPSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupLDAPSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupLDAPSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupLDAPSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupLDAPSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupLDAPSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupLDAPSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupLDAPSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupLDAPSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupLDAPSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupLDAPSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupLDAPSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupLDAPSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupLDAPSourceConnection := _GroupLDAPSourceConnection{} + + err = json.Unmarshal(data, &varGroupLDAPSourceConnection) + + if err != nil { + return err + } + + *o = GroupLDAPSourceConnection(varGroupLDAPSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupLDAPSourceConnection struct { + value *GroupLDAPSourceConnection + isSet bool +} + +func (v NullableGroupLDAPSourceConnection) Get() *GroupLDAPSourceConnection { + return v.value +} + +func (v *NullableGroupLDAPSourceConnection) Set(val *GroupLDAPSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupLDAPSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupLDAPSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupLDAPSourceConnection(val *GroupLDAPSourceConnection) *NullableGroupLDAPSourceConnection { + return &NullableGroupLDAPSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupLDAPSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupLDAPSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_ldap_source_connection_request.go b/packages/client-go/model_group_ldap_source_connection_request.go new file mode 100644 index 0000000000..ab861637d7 --- /dev/null +++ b/packages/client-go/model_group_ldap_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupLDAPSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupLDAPSourceConnectionRequest{} + +// GroupLDAPSourceConnectionRequest Group Source Connection +type GroupLDAPSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupLDAPSourceConnectionRequest GroupLDAPSourceConnectionRequest + +// NewGroupLDAPSourceConnectionRequest instantiates a new GroupLDAPSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupLDAPSourceConnectionRequest(group string, source string, identifier string) *GroupLDAPSourceConnectionRequest { + this := GroupLDAPSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupLDAPSourceConnectionRequestWithDefaults instantiates a new GroupLDAPSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupLDAPSourceConnectionRequestWithDefaults() *GroupLDAPSourceConnectionRequest { + this := GroupLDAPSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupLDAPSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupLDAPSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupLDAPSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupLDAPSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupLDAPSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupLDAPSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupLDAPSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupLDAPSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupLDAPSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupLDAPSourceConnectionRequest := _GroupLDAPSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupLDAPSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupLDAPSourceConnectionRequest(varGroupLDAPSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupLDAPSourceConnectionRequest struct { + value *GroupLDAPSourceConnectionRequest + isSet bool +} + +func (v NullableGroupLDAPSourceConnectionRequest) Get() *GroupLDAPSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupLDAPSourceConnectionRequest) Set(val *GroupLDAPSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupLDAPSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupLDAPSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupLDAPSourceConnectionRequest(val *GroupLDAPSourceConnectionRequest) *NullableGroupLDAPSourceConnectionRequest { + return &NullableGroupLDAPSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupLDAPSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_matching_mode_enum.go b/packages/client-go/model_group_matching_mode_enum.go new file mode 100644 index 0000000000..036bc5cf5b --- /dev/null +++ b/packages/client-go/model_group_matching_mode_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// GroupMatchingModeEnum the model 'GroupMatchingModeEnum' +type GroupMatchingModeEnum string + +// List of GroupMatchingModeEnum +const ( + GROUPMATCHINGMODEENUM_IDENTIFIER GroupMatchingModeEnum = "identifier" + GROUPMATCHINGMODEENUM_NAME_LINK GroupMatchingModeEnum = "name_link" + GROUPMATCHINGMODEENUM_NAME_DENY GroupMatchingModeEnum = "name_deny" +) + +// All allowed values of GroupMatchingModeEnum enum +var AllowedGroupMatchingModeEnumEnumValues = []GroupMatchingModeEnum{ + "identifier", + "name_link", + "name_deny", +} + +func (v *GroupMatchingModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := GroupMatchingModeEnum(value) + for _, existing := range AllowedGroupMatchingModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid GroupMatchingModeEnum", value) +} + +// NewGroupMatchingModeEnumFromValue returns a pointer to a valid GroupMatchingModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewGroupMatchingModeEnumFromValue(v string) (*GroupMatchingModeEnum, error) { + ev := GroupMatchingModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for GroupMatchingModeEnum: valid values are %v", v, AllowedGroupMatchingModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v GroupMatchingModeEnum) IsValid() bool { + for _, existing := range AllowedGroupMatchingModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to GroupMatchingModeEnum value +func (v GroupMatchingModeEnum) Ptr() *GroupMatchingModeEnum { + return &v +} + +type NullableGroupMatchingModeEnum struct { + value *GroupMatchingModeEnum + isSet bool +} + +func (v NullableGroupMatchingModeEnum) Get() *GroupMatchingModeEnum { + return v.value +} + +func (v *NullableGroupMatchingModeEnum) Set(val *GroupMatchingModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableGroupMatchingModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupMatchingModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupMatchingModeEnum(val *GroupMatchingModeEnum) *NullableGroupMatchingModeEnum { + return &NullableGroupMatchingModeEnum{value: val, isSet: true} +} + +func (v NullableGroupMatchingModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupMatchingModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_o_auth_source_connection.go b/packages/client-go/model_group_o_auth_source_connection.go new file mode 100644 index 0000000000..27e4d6f33f --- /dev/null +++ b/packages/client-go/model_group_o_auth_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupOAuthSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupOAuthSourceConnection{} + +// GroupOAuthSourceConnection Group Source Connection +type GroupOAuthSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupOAuthSourceConnection GroupOAuthSourceConnection + +// NewGroupOAuthSourceConnection instantiates a new GroupOAuthSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupOAuthSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupOAuthSourceConnection { + this := GroupOAuthSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupOAuthSourceConnectionWithDefaults instantiates a new GroupOAuthSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupOAuthSourceConnectionWithDefaults() *GroupOAuthSourceConnection { + this := GroupOAuthSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupOAuthSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupOAuthSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupOAuthSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupOAuthSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupOAuthSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupOAuthSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupOAuthSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupOAuthSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupOAuthSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupOAuthSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupOAuthSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupOAuthSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupOAuthSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupOAuthSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupOAuthSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupOAuthSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupOAuthSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupOAuthSourceConnection := _GroupOAuthSourceConnection{} + + err = json.Unmarshal(data, &varGroupOAuthSourceConnection) + + if err != nil { + return err + } + + *o = GroupOAuthSourceConnection(varGroupOAuthSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupOAuthSourceConnection struct { + value *GroupOAuthSourceConnection + isSet bool +} + +func (v NullableGroupOAuthSourceConnection) Get() *GroupOAuthSourceConnection { + return v.value +} + +func (v *NullableGroupOAuthSourceConnection) Set(val *GroupOAuthSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupOAuthSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupOAuthSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupOAuthSourceConnection(val *GroupOAuthSourceConnection) *NullableGroupOAuthSourceConnection { + return &NullableGroupOAuthSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupOAuthSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupOAuthSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_o_auth_source_connection_request.go b/packages/client-go/model_group_o_auth_source_connection_request.go new file mode 100644 index 0000000000..f1f87c159f --- /dev/null +++ b/packages/client-go/model_group_o_auth_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupOAuthSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupOAuthSourceConnectionRequest{} + +// GroupOAuthSourceConnectionRequest Group Source Connection +type GroupOAuthSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupOAuthSourceConnectionRequest GroupOAuthSourceConnectionRequest + +// NewGroupOAuthSourceConnectionRequest instantiates a new GroupOAuthSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupOAuthSourceConnectionRequest(group string, source string, identifier string) *GroupOAuthSourceConnectionRequest { + this := GroupOAuthSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupOAuthSourceConnectionRequestWithDefaults instantiates a new GroupOAuthSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupOAuthSourceConnectionRequestWithDefaults() *GroupOAuthSourceConnectionRequest { + this := GroupOAuthSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupOAuthSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupOAuthSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupOAuthSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupOAuthSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupOAuthSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupOAuthSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupOAuthSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupOAuthSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupOAuthSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupOAuthSourceConnectionRequest := _GroupOAuthSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupOAuthSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupOAuthSourceConnectionRequest(varGroupOAuthSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupOAuthSourceConnectionRequest struct { + value *GroupOAuthSourceConnectionRequest + isSet bool +} + +func (v NullableGroupOAuthSourceConnectionRequest) Get() *GroupOAuthSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupOAuthSourceConnectionRequest) Set(val *GroupOAuthSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupOAuthSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupOAuthSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupOAuthSourceConnectionRequest(val *GroupOAuthSourceConnectionRequest) *NullableGroupOAuthSourceConnectionRequest { + return &NullableGroupOAuthSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupOAuthSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_plex_source_connection.go b/packages/client-go/model_group_plex_source_connection.go new file mode 100644 index 0000000000..d609fdbe3c --- /dev/null +++ b/packages/client-go/model_group_plex_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupPlexSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupPlexSourceConnection{} + +// GroupPlexSourceConnection Group Source Connection +type GroupPlexSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupPlexSourceConnection GroupPlexSourceConnection + +// NewGroupPlexSourceConnection instantiates a new GroupPlexSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupPlexSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupPlexSourceConnection { + this := GroupPlexSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupPlexSourceConnectionWithDefaults instantiates a new GroupPlexSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupPlexSourceConnectionWithDefaults() *GroupPlexSourceConnection { + this := GroupPlexSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupPlexSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupPlexSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupPlexSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupPlexSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupPlexSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupPlexSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupPlexSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupPlexSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupPlexSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupPlexSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupPlexSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupPlexSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupPlexSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupPlexSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupPlexSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupPlexSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupPlexSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupPlexSourceConnection := _GroupPlexSourceConnection{} + + err = json.Unmarshal(data, &varGroupPlexSourceConnection) + + if err != nil { + return err + } + + *o = GroupPlexSourceConnection(varGroupPlexSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupPlexSourceConnection struct { + value *GroupPlexSourceConnection + isSet bool +} + +func (v NullableGroupPlexSourceConnection) Get() *GroupPlexSourceConnection { + return v.value +} + +func (v *NullableGroupPlexSourceConnection) Set(val *GroupPlexSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupPlexSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupPlexSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupPlexSourceConnection(val *GroupPlexSourceConnection) *NullableGroupPlexSourceConnection { + return &NullableGroupPlexSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupPlexSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupPlexSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_plex_source_connection_request.go b/packages/client-go/model_group_plex_source_connection_request.go new file mode 100644 index 0000000000..c09aadf523 --- /dev/null +++ b/packages/client-go/model_group_plex_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupPlexSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupPlexSourceConnectionRequest{} + +// GroupPlexSourceConnectionRequest Group Source Connection +type GroupPlexSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupPlexSourceConnectionRequest GroupPlexSourceConnectionRequest + +// NewGroupPlexSourceConnectionRequest instantiates a new GroupPlexSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupPlexSourceConnectionRequest(group string, source string, identifier string) *GroupPlexSourceConnectionRequest { + this := GroupPlexSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupPlexSourceConnectionRequestWithDefaults instantiates a new GroupPlexSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupPlexSourceConnectionRequestWithDefaults() *GroupPlexSourceConnectionRequest { + this := GroupPlexSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupPlexSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupPlexSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupPlexSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupPlexSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupPlexSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupPlexSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupPlexSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupPlexSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupPlexSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupPlexSourceConnectionRequest := _GroupPlexSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupPlexSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupPlexSourceConnectionRequest(varGroupPlexSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupPlexSourceConnectionRequest struct { + value *GroupPlexSourceConnectionRequest + isSet bool +} + +func (v NullableGroupPlexSourceConnectionRequest) Get() *GroupPlexSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupPlexSourceConnectionRequest) Set(val *GroupPlexSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupPlexSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupPlexSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupPlexSourceConnectionRequest(val *GroupPlexSourceConnectionRequest) *NullableGroupPlexSourceConnectionRequest { + return &NullableGroupPlexSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupPlexSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_request.go b/packages/client-go/model_group_request.go new file mode 100644 index 0000000000..b2ddfee594 --- /dev/null +++ b/packages/client-go/model_group_request.go @@ -0,0 +1,353 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupRequest{} + +// GroupRequest Group Serializer +type GroupRequest struct { + Name string `json:"name"` + // Users added to this group will be superusers. + IsSuperuser *bool `json:"is_superuser,omitempty"` + Parents []string `json:"parents,omitempty"` + Users []int32 `json:"users,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Roles []string `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GroupRequest GroupRequest + +// NewGroupRequest instantiates a new GroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupRequest(name string) *GroupRequest { + this := GroupRequest{} + this.Name = name + return &this +} + +// NewGroupRequestWithDefaults instantiates a new GroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupRequestWithDefaults() *GroupRequest { + this := GroupRequest{} + return &this +} + +// GetName returns the Name field value +func (o *GroupRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *GroupRequest) SetName(v string) { + o.Name = v +} + +// GetIsSuperuser returns the IsSuperuser field value if set, zero value otherwise. +func (o *GroupRequest) GetIsSuperuser() bool { + if o == nil || IsNil(o.IsSuperuser) { + var ret bool + return ret + } + return *o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetIsSuperuserOk() (*bool, bool) { + if o == nil || IsNil(o.IsSuperuser) { + return nil, false + } + return o.IsSuperuser, true +} + +// HasIsSuperuser returns a boolean if a field has been set. +func (o *GroupRequest) HasIsSuperuser() bool { + if o != nil && !IsNil(o.IsSuperuser) { + return true + } + + return false +} + +// SetIsSuperuser gets a reference to the given bool and assigns it to the IsSuperuser field. +func (o *GroupRequest) SetIsSuperuser(v bool) { + o.IsSuperuser = &v +} + +// GetParents returns the Parents field value if set, zero value otherwise. +func (o *GroupRequest) GetParents() []string { + if o == nil || IsNil(o.Parents) { + var ret []string + return ret + } + return o.Parents +} + +// GetParentsOk returns a tuple with the Parents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetParentsOk() ([]string, bool) { + if o == nil || IsNil(o.Parents) { + return nil, false + } + return o.Parents, true +} + +// HasParents returns a boolean if a field has been set. +func (o *GroupRequest) HasParents() bool { + if o != nil && !IsNil(o.Parents) { + return true + } + + return false +} + +// SetParents gets a reference to the given []string and assigns it to the Parents field. +func (o *GroupRequest) SetParents(v []string) { + o.Parents = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *GroupRequest) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *GroupRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *GroupRequest) SetUsers(v []int32) { + o.Users = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *GroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *GroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *GroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *GroupRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GroupRequest) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *GroupRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *GroupRequest) SetRoles(v []string) { + o.Roles = v +} + +func (o GroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.IsSuperuser) { + toSerialize["is_superuser"] = o.IsSuperuser + } + if !IsNil(o.Parents) { + toSerialize["parents"] = o.Parents + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupRequest := _GroupRequest{} + + err = json.Unmarshal(data, &varGroupRequest) + + if err != nil { + return err + } + + *o = GroupRequest(varGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "parents") + delete(additionalProperties, "users") + delete(additionalProperties, "attributes") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupRequest struct { + value *GroupRequest + isSet bool +} + +func (v NullableGroupRequest) Get() *GroupRequest { + return v.value +} + +func (v *NullableGroupRequest) Set(val *GroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupRequest(val *GroupRequest) *NullableGroupRequest { + return &NullableGroupRequest{value: val, isSet: true} +} + +func (v NullableGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_saml_source_connection.go b/packages/client-go/model_group_saml_source_connection.go new file mode 100644 index 0000000000..12cdc6ee8a --- /dev/null +++ b/packages/client-go/model_group_saml_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupSAMLSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupSAMLSourceConnection{} + +// GroupSAMLSourceConnection Group Source Connection +type GroupSAMLSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupSAMLSourceConnection GroupSAMLSourceConnection + +// NewGroupSAMLSourceConnection instantiates a new GroupSAMLSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupSAMLSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupSAMLSourceConnection { + this := GroupSAMLSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupSAMLSourceConnectionWithDefaults instantiates a new GroupSAMLSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSAMLSourceConnectionWithDefaults() *GroupSAMLSourceConnection { + this := GroupSAMLSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupSAMLSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupSAMLSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupSAMLSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupSAMLSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupSAMLSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupSAMLSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupSAMLSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupSAMLSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupSAMLSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupSAMLSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupSAMLSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupSAMLSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupSAMLSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupSAMLSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupSAMLSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupSAMLSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupSAMLSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupSAMLSourceConnection := _GroupSAMLSourceConnection{} + + err = json.Unmarshal(data, &varGroupSAMLSourceConnection) + + if err != nil { + return err + } + + *o = GroupSAMLSourceConnection(varGroupSAMLSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupSAMLSourceConnection struct { + value *GroupSAMLSourceConnection + isSet bool +} + +func (v NullableGroupSAMLSourceConnection) Get() *GroupSAMLSourceConnection { + return v.value +} + +func (v *NullableGroupSAMLSourceConnection) Set(val *GroupSAMLSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupSAMLSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupSAMLSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupSAMLSourceConnection(val *GroupSAMLSourceConnection) *NullableGroupSAMLSourceConnection { + return &NullableGroupSAMLSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupSAMLSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupSAMLSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_saml_source_connection_request.go b/packages/client-go/model_group_saml_source_connection_request.go new file mode 100644 index 0000000000..974192060c --- /dev/null +++ b/packages/client-go/model_group_saml_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupSAMLSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupSAMLSourceConnectionRequest{} + +// GroupSAMLSourceConnectionRequest Group Source Connection +type GroupSAMLSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupSAMLSourceConnectionRequest GroupSAMLSourceConnectionRequest + +// NewGroupSAMLSourceConnectionRequest instantiates a new GroupSAMLSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupSAMLSourceConnectionRequest(group string, source string, identifier string) *GroupSAMLSourceConnectionRequest { + this := GroupSAMLSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupSAMLSourceConnectionRequestWithDefaults instantiates a new GroupSAMLSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSAMLSourceConnectionRequestWithDefaults() *GroupSAMLSourceConnectionRequest { + this := GroupSAMLSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupSAMLSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupSAMLSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupSAMLSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupSAMLSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupSAMLSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupSAMLSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupSAMLSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupSAMLSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupSAMLSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupSAMLSourceConnectionRequest := _GroupSAMLSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupSAMLSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupSAMLSourceConnectionRequest(varGroupSAMLSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupSAMLSourceConnectionRequest struct { + value *GroupSAMLSourceConnectionRequest + isSet bool +} + +func (v NullableGroupSAMLSourceConnectionRequest) Get() *GroupSAMLSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupSAMLSourceConnectionRequest) Set(val *GroupSAMLSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupSAMLSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupSAMLSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupSAMLSourceConnectionRequest(val *GroupSAMLSourceConnectionRequest) *NullableGroupSAMLSourceConnectionRequest { + return &NullableGroupSAMLSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupSAMLSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_source_connection.go b/packages/client-go/model_group_source_connection.go new file mode 100644 index 0000000000..c83d81bae7 --- /dev/null +++ b/packages/client-go/model_group_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupSourceConnection{} + +// GroupSourceConnection Group Source Connection +type GroupSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupSourceConnection GroupSourceConnection + +// NewGroupSourceConnection instantiates a new GroupSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupSourceConnection { + this := GroupSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupSourceConnectionWithDefaults instantiates a new GroupSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSourceConnectionWithDefaults() *GroupSourceConnection { + this := GroupSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupSourceConnection := _GroupSourceConnection{} + + err = json.Unmarshal(data, &varGroupSourceConnection) + + if err != nil { + return err + } + + *o = GroupSourceConnection(varGroupSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupSourceConnection struct { + value *GroupSourceConnection + isSet bool +} + +func (v NullableGroupSourceConnection) Get() *GroupSourceConnection { + return v.value +} + +func (v *NullableGroupSourceConnection) Set(val *GroupSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupSourceConnection(val *GroupSourceConnection) *NullableGroupSourceConnection { + return &NullableGroupSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_source_connection_request.go b/packages/client-go/model_group_source_connection_request.go new file mode 100644 index 0000000000..69f8cc2622 --- /dev/null +++ b/packages/client-go/model_group_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupSourceConnectionRequest{} + +// GroupSourceConnectionRequest Group Source Connection +type GroupSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupSourceConnectionRequest GroupSourceConnectionRequest + +// NewGroupSourceConnectionRequest instantiates a new GroupSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupSourceConnectionRequest(group string, source string, identifier string) *GroupSourceConnectionRequest { + this := GroupSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupSourceConnectionRequestWithDefaults instantiates a new GroupSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupSourceConnectionRequestWithDefaults() *GroupSourceConnectionRequest { + this := GroupSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupSourceConnectionRequest := _GroupSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupSourceConnectionRequest(varGroupSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupSourceConnectionRequest struct { + value *GroupSourceConnectionRequest + isSet bool +} + +func (v NullableGroupSourceConnectionRequest) Get() *GroupSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupSourceConnectionRequest) Set(val *GroupSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupSourceConnectionRequest(val *GroupSourceConnectionRequest) *NullableGroupSourceConnectionRequest { + return &NullableGroupSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_telegram_source_connection.go b/packages/client-go/model_group_telegram_source_connection.go new file mode 100644 index 0000000000..9639a6962c --- /dev/null +++ b/packages/client-go/model_group_telegram_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the GroupTelegramSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupTelegramSourceConnection{} + +// GroupTelegramSourceConnection Group Source Connection +type GroupTelegramSourceConnection struct { + Pk int32 `json:"pk"` + Group string `json:"group"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _GroupTelegramSourceConnection GroupTelegramSourceConnection + +// NewGroupTelegramSourceConnection instantiates a new GroupTelegramSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupTelegramSourceConnection(pk int32, group string, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *GroupTelegramSourceConnection { + this := GroupTelegramSourceConnection{} + this.Pk = pk + this.Group = group + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewGroupTelegramSourceConnectionWithDefaults instantiates a new GroupTelegramSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupTelegramSourceConnectionWithDefaults() *GroupTelegramSourceConnection { + this := GroupTelegramSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *GroupTelegramSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *GroupTelegramSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetGroup returns the Group field value +func (o *GroupTelegramSourceConnection) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupTelegramSourceConnection) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupTelegramSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupTelegramSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *GroupTelegramSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *GroupTelegramSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupTelegramSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupTelegramSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *GroupTelegramSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *GroupTelegramSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *GroupTelegramSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *GroupTelegramSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o GroupTelegramSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupTelegramSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupTelegramSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "group", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupTelegramSourceConnection := _GroupTelegramSourceConnection{} + + err = json.Unmarshal(data, &varGroupTelegramSourceConnection) + + if err != nil { + return err + } + + *o = GroupTelegramSourceConnection(varGroupTelegramSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupTelegramSourceConnection struct { + value *GroupTelegramSourceConnection + isSet bool +} + +func (v NullableGroupTelegramSourceConnection) Get() *GroupTelegramSourceConnection { + return v.value +} + +func (v *NullableGroupTelegramSourceConnection) Set(val *GroupTelegramSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableGroupTelegramSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupTelegramSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupTelegramSourceConnection(val *GroupTelegramSourceConnection) *NullableGroupTelegramSourceConnection { + return &NullableGroupTelegramSourceConnection{value: val, isSet: true} +} + +func (v NullableGroupTelegramSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupTelegramSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_group_telegram_source_connection_request.go b/packages/client-go/model_group_telegram_source_connection_request.go new file mode 100644 index 0000000000..79dff5c3e4 --- /dev/null +++ b/packages/client-go/model_group_telegram_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the GroupTelegramSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GroupTelegramSourceConnectionRequest{} + +// GroupTelegramSourceConnectionRequest Group Source Connection +type GroupTelegramSourceConnectionRequest struct { + Group string `json:"group"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _GroupTelegramSourceConnectionRequest GroupTelegramSourceConnectionRequest + +// NewGroupTelegramSourceConnectionRequest instantiates a new GroupTelegramSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGroupTelegramSourceConnectionRequest(group string, source string, identifier string) *GroupTelegramSourceConnectionRequest { + this := GroupTelegramSourceConnectionRequest{} + this.Group = group + this.Source = source + this.Identifier = identifier + return &this +} + +// NewGroupTelegramSourceConnectionRequestWithDefaults instantiates a new GroupTelegramSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGroupTelegramSourceConnectionRequestWithDefaults() *GroupTelegramSourceConnectionRequest { + this := GroupTelegramSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value +func (o *GroupTelegramSourceConnectionRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *GroupTelegramSourceConnectionRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *GroupTelegramSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *GroupTelegramSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *GroupTelegramSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *GroupTelegramSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *GroupTelegramSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o GroupTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GroupTelegramSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GroupTelegramSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "group", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGroupTelegramSourceConnectionRequest := _GroupTelegramSourceConnectionRequest{} + + err = json.Unmarshal(data, &varGroupTelegramSourceConnectionRequest) + + if err != nil { + return err + } + + *o = GroupTelegramSourceConnectionRequest(varGroupTelegramSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGroupTelegramSourceConnectionRequest struct { + value *GroupTelegramSourceConnectionRequest + isSet bool +} + +func (v NullableGroupTelegramSourceConnectionRequest) Get() *GroupTelegramSourceConnectionRequest { + return v.value +} + +func (v *NullableGroupTelegramSourceConnectionRequest) Set(val *GroupTelegramSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableGroupTelegramSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableGroupTelegramSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGroupTelegramSourceConnectionRequest(val *GroupTelegramSourceConnectionRequest) *NullableGroupTelegramSourceConnectionRequest { + return &NullableGroupTelegramSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableGroupTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGroupTelegramSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_hardware.go b/packages/client-go/model_hardware.go new file mode 100644 index 0000000000..6326b5bd59 --- /dev/null +++ b/packages/client-go/model_hardware.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Hardware type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Hardware{} + +// Hardware struct for Hardware +type Hardware struct { + Model *string `json:"model,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty"` + Serial string `json:"serial"` + CpuName *string `json:"cpu_name,omitempty"` + CpuCount *int32 `json:"cpu_count,omitempty"` + MemoryBytes *int64 `json:"memory_bytes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Hardware Hardware + +// NewHardware instantiates a new Hardware object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHardware(serial string) *Hardware { + this := Hardware{} + this.Serial = serial + return &this +} + +// NewHardwareWithDefaults instantiates a new Hardware object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHardwareWithDefaults() *Hardware { + this := Hardware{} + return &this +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *Hardware) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *Hardware) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *Hardware) SetModel(v string) { + o.Model = &v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise. +func (o *Hardware) GetManufacturer() string { + if o == nil || IsNil(o.Manufacturer) { + var ret string + return ret + } + return *o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetManufacturerOk() (*string, bool) { + if o == nil || IsNil(o.Manufacturer) { + return nil, false + } + return o.Manufacturer, true +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *Hardware) HasManufacturer() bool { + if o != nil && !IsNil(o.Manufacturer) { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given string and assigns it to the Manufacturer field. +func (o *Hardware) SetManufacturer(v string) { + o.Manufacturer = &v +} + +// GetSerial returns the Serial field value +func (o *Hardware) GetSerial() string { + if o == nil { + var ret string + return ret + } + + return o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value +// and a boolean to check if the value has been set. +func (o *Hardware) GetSerialOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Serial, true +} + +// SetSerial sets field value +func (o *Hardware) SetSerial(v string) { + o.Serial = v +} + +// GetCpuName returns the CpuName field value if set, zero value otherwise. +func (o *Hardware) GetCpuName() string { + if o == nil || IsNil(o.CpuName) { + var ret string + return ret + } + return *o.CpuName +} + +// GetCpuNameOk returns a tuple with the CpuName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetCpuNameOk() (*string, bool) { + if o == nil || IsNil(o.CpuName) { + return nil, false + } + return o.CpuName, true +} + +// HasCpuName returns a boolean if a field has been set. +func (o *Hardware) HasCpuName() bool { + if o != nil && !IsNil(o.CpuName) { + return true + } + + return false +} + +// SetCpuName gets a reference to the given string and assigns it to the CpuName field. +func (o *Hardware) SetCpuName(v string) { + o.CpuName = &v +} + +// GetCpuCount returns the CpuCount field value if set, zero value otherwise. +func (o *Hardware) GetCpuCount() int32 { + if o == nil || IsNil(o.CpuCount) { + var ret int32 + return ret + } + return *o.CpuCount +} + +// GetCpuCountOk returns a tuple with the CpuCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetCpuCountOk() (*int32, bool) { + if o == nil || IsNil(o.CpuCount) { + return nil, false + } + return o.CpuCount, true +} + +// HasCpuCount returns a boolean if a field has been set. +func (o *Hardware) HasCpuCount() bool { + if o != nil && !IsNil(o.CpuCount) { + return true + } + + return false +} + +// SetCpuCount gets a reference to the given int32 and assigns it to the CpuCount field. +func (o *Hardware) SetCpuCount(v int32) { + o.CpuCount = &v +} + +// GetMemoryBytes returns the MemoryBytes field value if set, zero value otherwise. +func (o *Hardware) GetMemoryBytes() int64 { + if o == nil || IsNil(o.MemoryBytes) { + var ret int64 + return ret + } + return *o.MemoryBytes +} + +// GetMemoryBytesOk returns a tuple with the MemoryBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Hardware) GetMemoryBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MemoryBytes) { + return nil, false + } + return o.MemoryBytes, true +} + +// HasMemoryBytes returns a boolean if a field has been set. +func (o *Hardware) HasMemoryBytes() bool { + if o != nil && !IsNil(o.MemoryBytes) { + return true + } + + return false +} + +// SetMemoryBytes gets a reference to the given int64 and assigns it to the MemoryBytes field. +func (o *Hardware) SetMemoryBytes(v int64) { + o.MemoryBytes = &v +} + +func (o Hardware) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Hardware) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Manufacturer) { + toSerialize["manufacturer"] = o.Manufacturer + } + toSerialize["serial"] = o.Serial + if !IsNil(o.CpuName) { + toSerialize["cpu_name"] = o.CpuName + } + if !IsNil(o.CpuCount) { + toSerialize["cpu_count"] = o.CpuCount + } + if !IsNil(o.MemoryBytes) { + toSerialize["memory_bytes"] = o.MemoryBytes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Hardware) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "serial", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHardware := _Hardware{} + + err = json.Unmarshal(data, &varHardware) + + if err != nil { + return err + } + + *o = Hardware(varHardware) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "serial") + delete(additionalProperties, "cpu_name") + delete(additionalProperties, "cpu_count") + delete(additionalProperties, "memory_bytes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHardware struct { + value *Hardware + isSet bool +} + +func (v NullableHardware) Get() *Hardware { + return v.value +} + +func (v *NullableHardware) Set(val *Hardware) { + v.value = val + v.isSet = true +} + +func (v NullableHardware) IsSet() bool { + return v.isSet +} + +func (v *NullableHardware) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHardware(val *Hardware) *NullableHardware { + return &NullableHardware{value: val, isSet: true} +} + +func (v NullableHardware) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHardware) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_hardware_request.go b/packages/client-go/model_hardware_request.go new file mode 100644 index 0000000000..5cdfab2708 --- /dev/null +++ b/packages/client-go/model_hardware_request.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the HardwareRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &HardwareRequest{} + +// HardwareRequest struct for HardwareRequest +type HardwareRequest struct { + Model *string `json:"model,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty"` + Serial string `json:"serial"` + CpuName *string `json:"cpu_name,omitempty"` + CpuCount *int32 `json:"cpu_count,omitempty"` + MemoryBytes *int64 `json:"memory_bytes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _HardwareRequest HardwareRequest + +// NewHardwareRequest instantiates a new HardwareRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHardwareRequest(serial string) *HardwareRequest { + this := HardwareRequest{} + this.Serial = serial + return &this +} + +// NewHardwareRequestWithDefaults instantiates a new HardwareRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHardwareRequestWithDefaults() *HardwareRequest { + this := HardwareRequest{} + return &this +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *HardwareRequest) GetModel() string { + if o == nil || IsNil(o.Model) { + var ret string + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetModelOk() (*string, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *HardwareRequest) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given string and assigns it to the Model field. +func (o *HardwareRequest) SetModel(v string) { + o.Model = &v +} + +// GetManufacturer returns the Manufacturer field value if set, zero value otherwise. +func (o *HardwareRequest) GetManufacturer() string { + if o == nil || IsNil(o.Manufacturer) { + var ret string + return ret + } + return *o.Manufacturer +} + +// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetManufacturerOk() (*string, bool) { + if o == nil || IsNil(o.Manufacturer) { + return nil, false + } + return o.Manufacturer, true +} + +// HasManufacturer returns a boolean if a field has been set. +func (o *HardwareRequest) HasManufacturer() bool { + if o != nil && !IsNil(o.Manufacturer) { + return true + } + + return false +} + +// SetManufacturer gets a reference to the given string and assigns it to the Manufacturer field. +func (o *HardwareRequest) SetManufacturer(v string) { + o.Manufacturer = &v +} + +// GetSerial returns the Serial field value +func (o *HardwareRequest) GetSerial() string { + if o == nil { + var ret string + return ret + } + + return o.Serial +} + +// GetSerialOk returns a tuple with the Serial field value +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetSerialOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Serial, true +} + +// SetSerial sets field value +func (o *HardwareRequest) SetSerial(v string) { + o.Serial = v +} + +// GetCpuName returns the CpuName field value if set, zero value otherwise. +func (o *HardwareRequest) GetCpuName() string { + if o == nil || IsNil(o.CpuName) { + var ret string + return ret + } + return *o.CpuName +} + +// GetCpuNameOk returns a tuple with the CpuName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetCpuNameOk() (*string, bool) { + if o == nil || IsNil(o.CpuName) { + return nil, false + } + return o.CpuName, true +} + +// HasCpuName returns a boolean if a field has been set. +func (o *HardwareRequest) HasCpuName() bool { + if o != nil && !IsNil(o.CpuName) { + return true + } + + return false +} + +// SetCpuName gets a reference to the given string and assigns it to the CpuName field. +func (o *HardwareRequest) SetCpuName(v string) { + o.CpuName = &v +} + +// GetCpuCount returns the CpuCount field value if set, zero value otherwise. +func (o *HardwareRequest) GetCpuCount() int32 { + if o == nil || IsNil(o.CpuCount) { + var ret int32 + return ret + } + return *o.CpuCount +} + +// GetCpuCountOk returns a tuple with the CpuCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetCpuCountOk() (*int32, bool) { + if o == nil || IsNil(o.CpuCount) { + return nil, false + } + return o.CpuCount, true +} + +// HasCpuCount returns a boolean if a field has been set. +func (o *HardwareRequest) HasCpuCount() bool { + if o != nil && !IsNil(o.CpuCount) { + return true + } + + return false +} + +// SetCpuCount gets a reference to the given int32 and assigns it to the CpuCount field. +func (o *HardwareRequest) SetCpuCount(v int32) { + o.CpuCount = &v +} + +// GetMemoryBytes returns the MemoryBytes field value if set, zero value otherwise. +func (o *HardwareRequest) GetMemoryBytes() int64 { + if o == nil || IsNil(o.MemoryBytes) { + var ret int64 + return ret + } + return *o.MemoryBytes +} + +// GetMemoryBytesOk returns a tuple with the MemoryBytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HardwareRequest) GetMemoryBytesOk() (*int64, bool) { + if o == nil || IsNil(o.MemoryBytes) { + return nil, false + } + return o.MemoryBytes, true +} + +// HasMemoryBytes returns a boolean if a field has been set. +func (o *HardwareRequest) HasMemoryBytes() bool { + if o != nil && !IsNil(o.MemoryBytes) { + return true + } + + return false +} + +// SetMemoryBytes gets a reference to the given int64 and assigns it to the MemoryBytes field. +func (o *HardwareRequest) SetMemoryBytes(v int64) { + o.MemoryBytes = &v +} + +func (o HardwareRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o HardwareRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.Manufacturer) { + toSerialize["manufacturer"] = o.Manufacturer + } + toSerialize["serial"] = o.Serial + if !IsNil(o.CpuName) { + toSerialize["cpu_name"] = o.CpuName + } + if !IsNil(o.CpuCount) { + toSerialize["cpu_count"] = o.CpuCount + } + if !IsNil(o.MemoryBytes) { + toSerialize["memory_bytes"] = o.MemoryBytes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *HardwareRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "serial", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varHardwareRequest := _HardwareRequest{} + + err = json.Unmarshal(data, &varHardwareRequest) + + if err != nil { + return err + } + + *o = HardwareRequest(varHardwareRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "model") + delete(additionalProperties, "manufacturer") + delete(additionalProperties, "serial") + delete(additionalProperties, "cpu_name") + delete(additionalProperties, "cpu_count") + delete(additionalProperties, "memory_bytes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableHardwareRequest struct { + value *HardwareRequest + isSet bool +} + +func (v NullableHardwareRequest) Get() *HardwareRequest { + return v.value +} + +func (v *NullableHardwareRequest) Set(val *HardwareRequest) { + v.value = val + v.isSet = true +} + +func (v NullableHardwareRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableHardwareRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHardwareRequest(val *HardwareRequest) *NullableHardwareRequest { + return &NullableHardwareRequest{value: val, isSet: true} +} + +func (v NullableHardwareRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHardwareRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_identification_challenge.go b/packages/client-go/model_identification_challenge.go new file mode 100644 index 0000000000..b9c09e010f --- /dev/null +++ b/packages/client-go/model_identification_challenge.go @@ -0,0 +1,840 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the IdentificationChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentificationChallenge{} + +// IdentificationChallenge Identification challenges with all UI elements +type IdentificationChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + UserFields []string `json:"user_fields"` + PendingUserIdentifier NullableString `json:"pending_user_identifier,omitempty"` + PasswordFields bool `json:"password_fields"` + AllowShowPassword *bool `json:"allow_show_password,omitempty"` + ApplicationPre *string `json:"application_pre,omitempty"` + ApplicationPreLaunch *string `json:"application_pre_launch,omitempty"` + FlowDesignation FlowDesignationEnum `json:"flow_designation"` + CaptchaStage NullableCaptchaChallenge `json:"captcha_stage,omitempty"` + EnrollUrl *string `json:"enroll_url,omitempty"` + RecoveryUrl *string `json:"recovery_url,omitempty"` + PasswordlessUrl *string `json:"passwordless_url,omitempty"` + PrimaryAction string `json:"primary_action"` + Sources []LoginSource `json:"sources,omitempty"` + ShowSourceLabels bool `json:"show_source_labels"` + EnableRememberMe *bool `json:"enable_remember_me,omitempty"` + PasskeyChallenge map[string]interface{} `json:"passkey_challenge,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentificationChallenge IdentificationChallenge + +// NewIdentificationChallenge instantiates a new IdentificationChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentificationChallenge(userFields []string, passwordFields bool, flowDesignation FlowDesignationEnum, primaryAction string, showSourceLabels bool) *IdentificationChallenge { + this := IdentificationChallenge{} + var component string = "ak-stage-identification" + this.Component = &component + this.UserFields = userFields + this.PasswordFields = passwordFields + var allowShowPassword bool = false + this.AllowShowPassword = &allowShowPassword + this.FlowDesignation = flowDesignation + this.PrimaryAction = primaryAction + this.ShowSourceLabels = showSourceLabels + var enableRememberMe bool = true + this.EnableRememberMe = &enableRememberMe + return &this +} + +// NewIdentificationChallengeWithDefaults instantiates a new IdentificationChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentificationChallengeWithDefaults() *IdentificationChallenge { + this := IdentificationChallenge{} + var component string = "ak-stage-identification" + this.Component = &component + var allowShowPassword bool = false + this.AllowShowPassword = &allowShowPassword + var enableRememberMe bool = true + this.EnableRememberMe = &enableRememberMe + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *IdentificationChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *IdentificationChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *IdentificationChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetUserFields returns the UserFields field value +// If the value is explicit nil, the zero value for []string will be returned +func (o *IdentificationChallenge) GetUserFields() []string { + if o == nil { + var ret []string + return ret + } + + return o.UserFields +} + +// GetUserFieldsOk returns a tuple with the UserFields field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallenge) GetUserFieldsOk() ([]string, bool) { + if o == nil || IsNil(o.UserFields) { + return nil, false + } + return o.UserFields, true +} + +// SetUserFields sets field value +func (o *IdentificationChallenge) SetUserFields(v []string) { + o.UserFields = v +} + +// GetPendingUserIdentifier returns the PendingUserIdentifier field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallenge) GetPendingUserIdentifier() string { + if o == nil || IsNil(o.PendingUserIdentifier.Get()) { + var ret string + return ret + } + return *o.PendingUserIdentifier.Get() +} + +// GetPendingUserIdentifierOk returns a tuple with the PendingUserIdentifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallenge) GetPendingUserIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PendingUserIdentifier.Get(), o.PendingUserIdentifier.IsSet() +} + +// HasPendingUserIdentifier returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasPendingUserIdentifier() bool { + if o != nil && o.PendingUserIdentifier.IsSet() { + return true + } + + return false +} + +// SetPendingUserIdentifier gets a reference to the given NullableString and assigns it to the PendingUserIdentifier field. +func (o *IdentificationChallenge) SetPendingUserIdentifier(v string) { + o.PendingUserIdentifier.Set(&v) +} + +// SetPendingUserIdentifierNil sets the value for PendingUserIdentifier to be an explicit nil +func (o *IdentificationChallenge) SetPendingUserIdentifierNil() { + o.PendingUserIdentifier.Set(nil) +} + +// UnsetPendingUserIdentifier ensures that no value is present for PendingUserIdentifier, not even an explicit nil +func (o *IdentificationChallenge) UnsetPendingUserIdentifier() { + o.PendingUserIdentifier.Unset() +} + +// GetPasswordFields returns the PasswordFields field value +func (o *IdentificationChallenge) GetPasswordFields() bool { + if o == nil { + var ret bool + return ret + } + + return o.PasswordFields +} + +// GetPasswordFieldsOk returns a tuple with the PasswordFields field value +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetPasswordFieldsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.PasswordFields, true +} + +// SetPasswordFields sets field value +func (o *IdentificationChallenge) SetPasswordFields(v bool) { + o.PasswordFields = v +} + +// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetAllowShowPassword() bool { + if o == nil || IsNil(o.AllowShowPassword) { + var ret bool + return ret + } + return *o.AllowShowPassword +} + +// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetAllowShowPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.AllowShowPassword) { + return nil, false + } + return o.AllowShowPassword, true +} + +// HasAllowShowPassword returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasAllowShowPassword() bool { + if o != nil && !IsNil(o.AllowShowPassword) { + return true + } + + return false +} + +// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field. +func (o *IdentificationChallenge) SetAllowShowPassword(v bool) { + o.AllowShowPassword = &v +} + +// GetApplicationPre returns the ApplicationPre field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetApplicationPre() string { + if o == nil || IsNil(o.ApplicationPre) { + var ret string + return ret + } + return *o.ApplicationPre +} + +// GetApplicationPreOk returns a tuple with the ApplicationPre field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetApplicationPreOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationPre) { + return nil, false + } + return o.ApplicationPre, true +} + +// HasApplicationPre returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasApplicationPre() bool { + if o != nil && !IsNil(o.ApplicationPre) { + return true + } + + return false +} + +// SetApplicationPre gets a reference to the given string and assigns it to the ApplicationPre field. +func (o *IdentificationChallenge) SetApplicationPre(v string) { + o.ApplicationPre = &v +} + +// GetApplicationPreLaunch returns the ApplicationPreLaunch field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetApplicationPreLaunch() string { + if o == nil || IsNil(o.ApplicationPreLaunch) { + var ret string + return ret + } + return *o.ApplicationPreLaunch +} + +// GetApplicationPreLaunchOk returns a tuple with the ApplicationPreLaunch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetApplicationPreLaunchOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationPreLaunch) { + return nil, false + } + return o.ApplicationPreLaunch, true +} + +// HasApplicationPreLaunch returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasApplicationPreLaunch() bool { + if o != nil && !IsNil(o.ApplicationPreLaunch) { + return true + } + + return false +} + +// SetApplicationPreLaunch gets a reference to the given string and assigns it to the ApplicationPreLaunch field. +func (o *IdentificationChallenge) SetApplicationPreLaunch(v string) { + o.ApplicationPreLaunch = &v +} + +// GetFlowDesignation returns the FlowDesignation field value +func (o *IdentificationChallenge) GetFlowDesignation() FlowDesignationEnum { + if o == nil { + var ret FlowDesignationEnum + return ret + } + + return o.FlowDesignation +} + +// GetFlowDesignationOk returns a tuple with the FlowDesignation field value +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetFlowDesignationOk() (*FlowDesignationEnum, bool) { + if o == nil { + return nil, false + } + return &o.FlowDesignation, true +} + +// SetFlowDesignation sets field value +func (o *IdentificationChallenge) SetFlowDesignation(v FlowDesignationEnum) { + o.FlowDesignation = v +} + +// GetCaptchaStage returns the CaptchaStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallenge) GetCaptchaStage() CaptchaChallenge { + if o == nil || IsNil(o.CaptchaStage.Get()) { + var ret CaptchaChallenge + return ret + } + return *o.CaptchaStage.Get() +} + +// GetCaptchaStageOk returns a tuple with the CaptchaStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallenge) GetCaptchaStageOk() (*CaptchaChallenge, bool) { + if o == nil { + return nil, false + } + return o.CaptchaStage.Get(), o.CaptchaStage.IsSet() +} + +// HasCaptchaStage returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasCaptchaStage() bool { + if o != nil && o.CaptchaStage.IsSet() { + return true + } + + return false +} + +// SetCaptchaStage gets a reference to the given NullableCaptchaChallenge and assigns it to the CaptchaStage field. +func (o *IdentificationChallenge) SetCaptchaStage(v CaptchaChallenge) { + o.CaptchaStage.Set(&v) +} + +// SetCaptchaStageNil sets the value for CaptchaStage to be an explicit nil +func (o *IdentificationChallenge) SetCaptchaStageNil() { + o.CaptchaStage.Set(nil) +} + +// UnsetCaptchaStage ensures that no value is present for CaptchaStage, not even an explicit nil +func (o *IdentificationChallenge) UnsetCaptchaStage() { + o.CaptchaStage.Unset() +} + +// GetEnrollUrl returns the EnrollUrl field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetEnrollUrl() string { + if o == nil || IsNil(o.EnrollUrl) { + var ret string + return ret + } + return *o.EnrollUrl +} + +// GetEnrollUrlOk returns a tuple with the EnrollUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetEnrollUrlOk() (*string, bool) { + if o == nil || IsNil(o.EnrollUrl) { + return nil, false + } + return o.EnrollUrl, true +} + +// HasEnrollUrl returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasEnrollUrl() bool { + if o != nil && !IsNil(o.EnrollUrl) { + return true + } + + return false +} + +// SetEnrollUrl gets a reference to the given string and assigns it to the EnrollUrl field. +func (o *IdentificationChallenge) SetEnrollUrl(v string) { + o.EnrollUrl = &v +} + +// GetRecoveryUrl returns the RecoveryUrl field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetRecoveryUrl() string { + if o == nil || IsNil(o.RecoveryUrl) { + var ret string + return ret + } + return *o.RecoveryUrl +} + +// GetRecoveryUrlOk returns a tuple with the RecoveryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetRecoveryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RecoveryUrl) { + return nil, false + } + return o.RecoveryUrl, true +} + +// HasRecoveryUrl returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasRecoveryUrl() bool { + if o != nil && !IsNil(o.RecoveryUrl) { + return true + } + + return false +} + +// SetRecoveryUrl gets a reference to the given string and assigns it to the RecoveryUrl field. +func (o *IdentificationChallenge) SetRecoveryUrl(v string) { + o.RecoveryUrl = &v +} + +// GetPasswordlessUrl returns the PasswordlessUrl field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetPasswordlessUrl() string { + if o == nil || IsNil(o.PasswordlessUrl) { + var ret string + return ret + } + return *o.PasswordlessUrl +} + +// GetPasswordlessUrlOk returns a tuple with the PasswordlessUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetPasswordlessUrlOk() (*string, bool) { + if o == nil || IsNil(o.PasswordlessUrl) { + return nil, false + } + return o.PasswordlessUrl, true +} + +// HasPasswordlessUrl returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasPasswordlessUrl() bool { + if o != nil && !IsNil(o.PasswordlessUrl) { + return true + } + + return false +} + +// SetPasswordlessUrl gets a reference to the given string and assigns it to the PasswordlessUrl field. +func (o *IdentificationChallenge) SetPasswordlessUrl(v string) { + o.PasswordlessUrl = &v +} + +// GetPrimaryAction returns the PrimaryAction field value +func (o *IdentificationChallenge) GetPrimaryAction() string { + if o == nil { + var ret string + return ret + } + + return o.PrimaryAction +} + +// GetPrimaryActionOk returns a tuple with the PrimaryAction field value +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetPrimaryActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PrimaryAction, true +} + +// SetPrimaryAction sets field value +func (o *IdentificationChallenge) SetPrimaryAction(v string) { + o.PrimaryAction = v +} + +// GetSources returns the Sources field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetSources() []LoginSource { + if o == nil || IsNil(o.Sources) { + var ret []LoginSource + return ret + } + return o.Sources +} + +// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetSourcesOk() ([]LoginSource, bool) { + if o == nil || IsNil(o.Sources) { + return nil, false + } + return o.Sources, true +} + +// HasSources returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasSources() bool { + if o != nil && !IsNil(o.Sources) { + return true + } + + return false +} + +// SetSources gets a reference to the given []LoginSource and assigns it to the Sources field. +func (o *IdentificationChallenge) SetSources(v []LoginSource) { + o.Sources = v +} + +// GetShowSourceLabels returns the ShowSourceLabels field value +func (o *IdentificationChallenge) GetShowSourceLabels() bool { + if o == nil { + var ret bool + return ret + } + + return o.ShowSourceLabels +} + +// GetShowSourceLabelsOk returns a tuple with the ShowSourceLabels field value +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetShowSourceLabelsOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ShowSourceLabels, true +} + +// SetShowSourceLabels sets field value +func (o *IdentificationChallenge) SetShowSourceLabels(v bool) { + o.ShowSourceLabels = v +} + +// GetEnableRememberMe returns the EnableRememberMe field value if set, zero value otherwise. +func (o *IdentificationChallenge) GetEnableRememberMe() bool { + if o == nil || IsNil(o.EnableRememberMe) { + var ret bool + return ret + } + return *o.EnableRememberMe +} + +// GetEnableRememberMeOk returns a tuple with the EnableRememberMe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallenge) GetEnableRememberMeOk() (*bool, bool) { + if o == nil || IsNil(o.EnableRememberMe) { + return nil, false + } + return o.EnableRememberMe, true +} + +// HasEnableRememberMe returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasEnableRememberMe() bool { + if o != nil && !IsNil(o.EnableRememberMe) { + return true + } + + return false +} + +// SetEnableRememberMe gets a reference to the given bool and assigns it to the EnableRememberMe field. +func (o *IdentificationChallenge) SetEnableRememberMe(v bool) { + o.EnableRememberMe = &v +} + +// GetPasskeyChallenge returns the PasskeyChallenge field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallenge) GetPasskeyChallenge() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.PasskeyChallenge +} + +// GetPasskeyChallengeOk returns a tuple with the PasskeyChallenge field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallenge) GetPasskeyChallengeOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.PasskeyChallenge) { + return map[string]interface{}{}, false + } + return o.PasskeyChallenge, true +} + +// HasPasskeyChallenge returns a boolean if a field has been set. +func (o *IdentificationChallenge) HasPasskeyChallenge() bool { + if o != nil && !IsNil(o.PasskeyChallenge) { + return true + } + + return false +} + +// SetPasskeyChallenge gets a reference to the given map[string]interface{} and assigns it to the PasskeyChallenge field. +func (o *IdentificationChallenge) SetPasskeyChallenge(v map[string]interface{}) { + o.PasskeyChallenge = v +} + +func (o IdentificationChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentificationChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + if o.UserFields != nil { + toSerialize["user_fields"] = o.UserFields + } + if o.PendingUserIdentifier.IsSet() { + toSerialize["pending_user_identifier"] = o.PendingUserIdentifier.Get() + } + toSerialize["password_fields"] = o.PasswordFields + if !IsNil(o.AllowShowPassword) { + toSerialize["allow_show_password"] = o.AllowShowPassword + } + if !IsNil(o.ApplicationPre) { + toSerialize["application_pre"] = o.ApplicationPre + } + if !IsNil(o.ApplicationPreLaunch) { + toSerialize["application_pre_launch"] = o.ApplicationPreLaunch + } + toSerialize["flow_designation"] = o.FlowDesignation + if o.CaptchaStage.IsSet() { + toSerialize["captcha_stage"] = o.CaptchaStage.Get() + } + if !IsNil(o.EnrollUrl) { + toSerialize["enroll_url"] = o.EnrollUrl + } + if !IsNil(o.RecoveryUrl) { + toSerialize["recovery_url"] = o.RecoveryUrl + } + if !IsNil(o.PasswordlessUrl) { + toSerialize["passwordless_url"] = o.PasswordlessUrl + } + toSerialize["primary_action"] = o.PrimaryAction + if !IsNil(o.Sources) { + toSerialize["sources"] = o.Sources + } + toSerialize["show_source_labels"] = o.ShowSourceLabels + if !IsNil(o.EnableRememberMe) { + toSerialize["enable_remember_me"] = o.EnableRememberMe + } + if o.PasskeyChallenge != nil { + toSerialize["passkey_challenge"] = o.PasskeyChallenge + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IdentificationChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user_fields", + "password_fields", + "flow_designation", + "primary_action", + "show_source_labels", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIdentificationChallenge := _IdentificationChallenge{} + + err = json.Unmarshal(data, &varIdentificationChallenge) + + if err != nil { + return err + } + + *o = IdentificationChallenge(varIdentificationChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "user_fields") + delete(additionalProperties, "pending_user_identifier") + delete(additionalProperties, "password_fields") + delete(additionalProperties, "allow_show_password") + delete(additionalProperties, "application_pre") + delete(additionalProperties, "application_pre_launch") + delete(additionalProperties, "flow_designation") + delete(additionalProperties, "captcha_stage") + delete(additionalProperties, "enroll_url") + delete(additionalProperties, "recovery_url") + delete(additionalProperties, "passwordless_url") + delete(additionalProperties, "primary_action") + delete(additionalProperties, "sources") + delete(additionalProperties, "show_source_labels") + delete(additionalProperties, "enable_remember_me") + delete(additionalProperties, "passkey_challenge") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentificationChallenge struct { + value *IdentificationChallenge + isSet bool +} + +func (v NullableIdentificationChallenge) Get() *IdentificationChallenge { + return v.value +} + +func (v *NullableIdentificationChallenge) Set(val *IdentificationChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableIdentificationChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentificationChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentificationChallenge(val *IdentificationChallenge) *NullableIdentificationChallenge { + return &NullableIdentificationChallenge{value: val, isSet: true} +} + +func (v NullableIdentificationChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentificationChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_identification_challenge_response_request.go b/packages/client-go/model_identification_challenge_response_request.go new file mode 100644 index 0000000000..2428001742 --- /dev/null +++ b/packages/client-go/model_identification_challenge_response_request.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the IdentificationChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentificationChallengeResponseRequest{} + +// IdentificationChallengeResponseRequest Identification challenge +type IdentificationChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + UidField NullableString `json:"uid_field,omitempty"` + Password NullableString `json:"password,omitempty"` + CaptchaToken NullableString `json:"captcha_token,omitempty"` + Passkey map[string]interface{} `json:"passkey,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentificationChallengeResponseRequest IdentificationChallengeResponseRequest + +// NewIdentificationChallengeResponseRequest instantiates a new IdentificationChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentificationChallengeResponseRequest() *IdentificationChallengeResponseRequest { + this := IdentificationChallengeResponseRequest{} + var component string = "ak-stage-identification" + this.Component = &component + return &this +} + +// NewIdentificationChallengeResponseRequestWithDefaults instantiates a new IdentificationChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentificationChallengeResponseRequestWithDefaults() *IdentificationChallengeResponseRequest { + this := IdentificationChallengeResponseRequest{} + var component string = "ak-stage-identification" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *IdentificationChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *IdentificationChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *IdentificationChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetUidField returns the UidField field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallengeResponseRequest) GetUidField() string { + if o == nil || IsNil(o.UidField.Get()) { + var ret string + return ret + } + return *o.UidField.Get() +} + +// GetUidFieldOk returns a tuple with the UidField field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallengeResponseRequest) GetUidFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UidField.Get(), o.UidField.IsSet() +} + +// HasUidField returns a boolean if a field has been set. +func (o *IdentificationChallengeResponseRequest) HasUidField() bool { + if o != nil && o.UidField.IsSet() { + return true + } + + return false +} + +// SetUidField gets a reference to the given NullableString and assigns it to the UidField field. +func (o *IdentificationChallengeResponseRequest) SetUidField(v string) { + o.UidField.Set(&v) +} + +// SetUidFieldNil sets the value for UidField to be an explicit nil +func (o *IdentificationChallengeResponseRequest) SetUidFieldNil() { + o.UidField.Set(nil) +} + +// UnsetUidField ensures that no value is present for UidField, not even an explicit nil +func (o *IdentificationChallengeResponseRequest) UnsetUidField() { + o.UidField.Unset() +} + +// GetPassword returns the Password field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallengeResponseRequest) GetPassword() string { + if o == nil || IsNil(o.Password.Get()) { + var ret string + return ret + } + return *o.Password.Get() +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallengeResponseRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Password.Get(), o.Password.IsSet() +} + +// HasPassword returns a boolean if a field has been set. +func (o *IdentificationChallengeResponseRequest) HasPassword() bool { + if o != nil && o.Password.IsSet() { + return true + } + + return false +} + +// SetPassword gets a reference to the given NullableString and assigns it to the Password field. +func (o *IdentificationChallengeResponseRequest) SetPassword(v string) { + o.Password.Set(&v) +} + +// SetPasswordNil sets the value for Password to be an explicit nil +func (o *IdentificationChallengeResponseRequest) SetPasswordNil() { + o.Password.Set(nil) +} + +// UnsetPassword ensures that no value is present for Password, not even an explicit nil +func (o *IdentificationChallengeResponseRequest) UnsetPassword() { + o.Password.Unset() +} + +// GetCaptchaToken returns the CaptchaToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallengeResponseRequest) GetCaptchaToken() string { + if o == nil || IsNil(o.CaptchaToken.Get()) { + var ret string + return ret + } + return *o.CaptchaToken.Get() +} + +// GetCaptchaTokenOk returns a tuple with the CaptchaToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallengeResponseRequest) GetCaptchaTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaptchaToken.Get(), o.CaptchaToken.IsSet() +} + +// HasCaptchaToken returns a boolean if a field has been set. +func (o *IdentificationChallengeResponseRequest) HasCaptchaToken() bool { + if o != nil && o.CaptchaToken.IsSet() { + return true + } + + return false +} + +// SetCaptchaToken gets a reference to the given NullableString and assigns it to the CaptchaToken field. +func (o *IdentificationChallengeResponseRequest) SetCaptchaToken(v string) { + o.CaptchaToken.Set(&v) +} + +// SetCaptchaTokenNil sets the value for CaptchaToken to be an explicit nil +func (o *IdentificationChallengeResponseRequest) SetCaptchaTokenNil() { + o.CaptchaToken.Set(nil) +} + +// UnsetCaptchaToken ensures that no value is present for CaptchaToken, not even an explicit nil +func (o *IdentificationChallengeResponseRequest) UnsetCaptchaToken() { + o.CaptchaToken.Unset() +} + +// GetPasskey returns the Passkey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationChallengeResponseRequest) GetPasskey() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + return o.Passkey +} + +// GetPasskeyOk returns a tuple with the Passkey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationChallengeResponseRequest) GetPasskeyOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Passkey) { + return map[string]interface{}{}, false + } + return o.Passkey, true +} + +// HasPasskey returns a boolean if a field has been set. +func (o *IdentificationChallengeResponseRequest) HasPasskey() bool { + if o != nil && !IsNil(o.Passkey) { + return true + } + + return false +} + +// SetPasskey gets a reference to the given map[string]interface{} and assigns it to the Passkey field. +func (o *IdentificationChallengeResponseRequest) SetPasskey(v map[string]interface{}) { + o.Passkey = v +} + +func (o IdentificationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentificationChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if o.UidField.IsSet() { + toSerialize["uid_field"] = o.UidField.Get() + } + if o.Password.IsSet() { + toSerialize["password"] = o.Password.Get() + } + if o.CaptchaToken.IsSet() { + toSerialize["captcha_token"] = o.CaptchaToken.Get() + } + if o.Passkey != nil { + toSerialize["passkey"] = o.Passkey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IdentificationChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varIdentificationChallengeResponseRequest := _IdentificationChallengeResponseRequest{} + + err = json.Unmarshal(data, &varIdentificationChallengeResponseRequest) + + if err != nil { + return err + } + + *o = IdentificationChallengeResponseRequest(varIdentificationChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "uid_field") + delete(additionalProperties, "password") + delete(additionalProperties, "captcha_token") + delete(additionalProperties, "passkey") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentificationChallengeResponseRequest struct { + value *IdentificationChallengeResponseRequest + isSet bool +} + +func (v NullableIdentificationChallengeResponseRequest) Get() *IdentificationChallengeResponseRequest { + return v.value +} + +func (v *NullableIdentificationChallengeResponseRequest) Set(val *IdentificationChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIdentificationChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentificationChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentificationChallengeResponseRequest(val *IdentificationChallengeResponseRequest) *NullableIdentificationChallengeResponseRequest { + return &NullableIdentificationChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableIdentificationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentificationChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_identification_stage.go b/packages/client-go/model_identification_stage.go new file mode 100644 index 0000000000..f02c4967b8 --- /dev/null +++ b/packages/client-go/model_identification_stage.go @@ -0,0 +1,904 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the IdentificationStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentificationStage{} + +// IdentificationStage IdentificationStage Serializer +type IdentificationStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Fields of the user object to match against. (Hold shift to select multiple options) + UserFields []UserFieldsEnum `json:"user_fields,omitempty"` + // When set, shows a password field, instead of showing the password field as separate step. + PasswordStage NullableString `json:"password_stage,omitempty"` + // When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage. + CaptchaStage NullableString `json:"captcha_stage,omitempty"` + // When enabled, user fields are matched regardless of their casing. + CaseInsensitiveMatching *bool `json:"case_insensitive_matching,omitempty"` + // When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown + ShowMatchedUser *bool `json:"show_matched_user,omitempty"` + // Optional enrollment flow, which is linked at the bottom of the page. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + // Optional recovery flow, which is linked at the bottom of the page. + RecoveryFlow NullableString `json:"recovery_flow,omitempty"` + // Optional passwordless flow, which is linked at the bottom of the page. + PasswordlessFlow NullableString `json:"passwordless_flow,omitempty"` + // Specify which sources should be shown. + Sources []string `json:"sources,omitempty"` + ShowSourceLabels *bool `json:"show_source_labels,omitempty"` + // When enabled, the stage will succeed and continue even when incorrect user info is entered. + PretendUserExists *bool `json:"pretend_user_exists,omitempty"` + // Show the user the 'Remember me on this device' toggle, allowing repeat users to skip straight to entering their password. + EnableRememberMe *bool `json:"enable_remember_me,omitempty"` + // When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor. + WebauthnStage NullableString `json:"webauthn_stage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentificationStage IdentificationStage + +// NewIdentificationStage instantiates a new IdentificationStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentificationStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *IdentificationStage { + this := IdentificationStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewIdentificationStageWithDefaults instantiates a new IdentificationStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentificationStageWithDefaults() *IdentificationStage { + this := IdentificationStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *IdentificationStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *IdentificationStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *IdentificationStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IdentificationStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *IdentificationStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *IdentificationStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *IdentificationStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *IdentificationStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *IdentificationStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *IdentificationStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *IdentificationStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *IdentificationStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *IdentificationStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *IdentificationStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetUserFields returns the UserFields field value if set, zero value otherwise. +func (o *IdentificationStage) GetUserFields() []UserFieldsEnum { + if o == nil || IsNil(o.UserFields) { + var ret []UserFieldsEnum + return ret + } + return o.UserFields +} + +// GetUserFieldsOk returns a tuple with the UserFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetUserFieldsOk() ([]UserFieldsEnum, bool) { + if o == nil || IsNil(o.UserFields) { + return nil, false + } + return o.UserFields, true +} + +// HasUserFields returns a boolean if a field has been set. +func (o *IdentificationStage) HasUserFields() bool { + if o != nil && !IsNil(o.UserFields) { + return true + } + + return false +} + +// SetUserFields gets a reference to the given []UserFieldsEnum and assigns it to the UserFields field. +func (o *IdentificationStage) SetUserFields(v []UserFieldsEnum) { + o.UserFields = v +} + +// GetPasswordStage returns the PasswordStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetPasswordStage() string { + if o == nil || IsNil(o.PasswordStage.Get()) { + var ret string + return ret + } + return *o.PasswordStage.Get() +} + +// GetPasswordStageOk returns a tuple with the PasswordStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetPasswordStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordStage.Get(), o.PasswordStage.IsSet() +} + +// HasPasswordStage returns a boolean if a field has been set. +func (o *IdentificationStage) HasPasswordStage() bool { + if o != nil && o.PasswordStage.IsSet() { + return true + } + + return false +} + +// SetPasswordStage gets a reference to the given NullableString and assigns it to the PasswordStage field. +func (o *IdentificationStage) SetPasswordStage(v string) { + o.PasswordStage.Set(&v) +} + +// SetPasswordStageNil sets the value for PasswordStage to be an explicit nil +func (o *IdentificationStage) SetPasswordStageNil() { + o.PasswordStage.Set(nil) +} + +// UnsetPasswordStage ensures that no value is present for PasswordStage, not even an explicit nil +func (o *IdentificationStage) UnsetPasswordStage() { + o.PasswordStage.Unset() +} + +// GetCaptchaStage returns the CaptchaStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetCaptchaStage() string { + if o == nil || IsNil(o.CaptchaStage.Get()) { + var ret string + return ret + } + return *o.CaptchaStage.Get() +} + +// GetCaptchaStageOk returns a tuple with the CaptchaStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetCaptchaStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaptchaStage.Get(), o.CaptchaStage.IsSet() +} + +// HasCaptchaStage returns a boolean if a field has been set. +func (o *IdentificationStage) HasCaptchaStage() bool { + if o != nil && o.CaptchaStage.IsSet() { + return true + } + + return false +} + +// SetCaptchaStage gets a reference to the given NullableString and assigns it to the CaptchaStage field. +func (o *IdentificationStage) SetCaptchaStage(v string) { + o.CaptchaStage.Set(&v) +} + +// SetCaptchaStageNil sets the value for CaptchaStage to be an explicit nil +func (o *IdentificationStage) SetCaptchaStageNil() { + o.CaptchaStage.Set(nil) +} + +// UnsetCaptchaStage ensures that no value is present for CaptchaStage, not even an explicit nil +func (o *IdentificationStage) UnsetCaptchaStage() { + o.CaptchaStage.Unset() +} + +// GetCaseInsensitiveMatching returns the CaseInsensitiveMatching field value if set, zero value otherwise. +func (o *IdentificationStage) GetCaseInsensitiveMatching() bool { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + var ret bool + return ret + } + return *o.CaseInsensitiveMatching +} + +// GetCaseInsensitiveMatchingOk returns a tuple with the CaseInsensitiveMatching field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetCaseInsensitiveMatchingOk() (*bool, bool) { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + return nil, false + } + return o.CaseInsensitiveMatching, true +} + +// HasCaseInsensitiveMatching returns a boolean if a field has been set. +func (o *IdentificationStage) HasCaseInsensitiveMatching() bool { + if o != nil && !IsNil(o.CaseInsensitiveMatching) { + return true + } + + return false +} + +// SetCaseInsensitiveMatching gets a reference to the given bool and assigns it to the CaseInsensitiveMatching field. +func (o *IdentificationStage) SetCaseInsensitiveMatching(v bool) { + o.CaseInsensitiveMatching = &v +} + +// GetShowMatchedUser returns the ShowMatchedUser field value if set, zero value otherwise. +func (o *IdentificationStage) GetShowMatchedUser() bool { + if o == nil || IsNil(o.ShowMatchedUser) { + var ret bool + return ret + } + return *o.ShowMatchedUser +} + +// GetShowMatchedUserOk returns a tuple with the ShowMatchedUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetShowMatchedUserOk() (*bool, bool) { + if o == nil || IsNil(o.ShowMatchedUser) { + return nil, false + } + return o.ShowMatchedUser, true +} + +// HasShowMatchedUser returns a boolean if a field has been set. +func (o *IdentificationStage) HasShowMatchedUser() bool { + if o != nil && !IsNil(o.ShowMatchedUser) { + return true + } + + return false +} + +// SetShowMatchedUser gets a reference to the given bool and assigns it to the ShowMatchedUser field. +func (o *IdentificationStage) SetShowMatchedUser(v bool) { + o.ShowMatchedUser = &v +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *IdentificationStage) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *IdentificationStage) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *IdentificationStage) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *IdentificationStage) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetRecoveryFlow returns the RecoveryFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetRecoveryFlow() string { + if o == nil || IsNil(o.RecoveryFlow.Get()) { + var ret string + return ret + } + return *o.RecoveryFlow.Get() +} + +// GetRecoveryFlowOk returns a tuple with the RecoveryFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetRecoveryFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecoveryFlow.Get(), o.RecoveryFlow.IsSet() +} + +// HasRecoveryFlow returns a boolean if a field has been set. +func (o *IdentificationStage) HasRecoveryFlow() bool { + if o != nil && o.RecoveryFlow.IsSet() { + return true + } + + return false +} + +// SetRecoveryFlow gets a reference to the given NullableString and assigns it to the RecoveryFlow field. +func (o *IdentificationStage) SetRecoveryFlow(v string) { + o.RecoveryFlow.Set(&v) +} + +// SetRecoveryFlowNil sets the value for RecoveryFlow to be an explicit nil +func (o *IdentificationStage) SetRecoveryFlowNil() { + o.RecoveryFlow.Set(nil) +} + +// UnsetRecoveryFlow ensures that no value is present for RecoveryFlow, not even an explicit nil +func (o *IdentificationStage) UnsetRecoveryFlow() { + o.RecoveryFlow.Unset() +} + +// GetPasswordlessFlow returns the PasswordlessFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetPasswordlessFlow() string { + if o == nil || IsNil(o.PasswordlessFlow.Get()) { + var ret string + return ret + } + return *o.PasswordlessFlow.Get() +} + +// GetPasswordlessFlowOk returns a tuple with the PasswordlessFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetPasswordlessFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordlessFlow.Get(), o.PasswordlessFlow.IsSet() +} + +// HasPasswordlessFlow returns a boolean if a field has been set. +func (o *IdentificationStage) HasPasswordlessFlow() bool { + if o != nil && o.PasswordlessFlow.IsSet() { + return true + } + + return false +} + +// SetPasswordlessFlow gets a reference to the given NullableString and assigns it to the PasswordlessFlow field. +func (o *IdentificationStage) SetPasswordlessFlow(v string) { + o.PasswordlessFlow.Set(&v) +} + +// SetPasswordlessFlowNil sets the value for PasswordlessFlow to be an explicit nil +func (o *IdentificationStage) SetPasswordlessFlowNil() { + o.PasswordlessFlow.Set(nil) +} + +// UnsetPasswordlessFlow ensures that no value is present for PasswordlessFlow, not even an explicit nil +func (o *IdentificationStage) UnsetPasswordlessFlow() { + o.PasswordlessFlow.Unset() +} + +// GetSources returns the Sources field value if set, zero value otherwise. +func (o *IdentificationStage) GetSources() []string { + if o == nil || IsNil(o.Sources) { + var ret []string + return ret + } + return o.Sources +} + +// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.Sources) { + return nil, false + } + return o.Sources, true +} + +// HasSources returns a boolean if a field has been set. +func (o *IdentificationStage) HasSources() bool { + if o != nil && !IsNil(o.Sources) { + return true + } + + return false +} + +// SetSources gets a reference to the given []string and assigns it to the Sources field. +func (o *IdentificationStage) SetSources(v []string) { + o.Sources = v +} + +// GetShowSourceLabels returns the ShowSourceLabels field value if set, zero value otherwise. +func (o *IdentificationStage) GetShowSourceLabels() bool { + if o == nil || IsNil(o.ShowSourceLabels) { + var ret bool + return ret + } + return *o.ShowSourceLabels +} + +// GetShowSourceLabelsOk returns a tuple with the ShowSourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetShowSourceLabelsOk() (*bool, bool) { + if o == nil || IsNil(o.ShowSourceLabels) { + return nil, false + } + return o.ShowSourceLabels, true +} + +// HasShowSourceLabels returns a boolean if a field has been set. +func (o *IdentificationStage) HasShowSourceLabels() bool { + if o != nil && !IsNil(o.ShowSourceLabels) { + return true + } + + return false +} + +// SetShowSourceLabels gets a reference to the given bool and assigns it to the ShowSourceLabels field. +func (o *IdentificationStage) SetShowSourceLabels(v bool) { + o.ShowSourceLabels = &v +} + +// GetPretendUserExists returns the PretendUserExists field value if set, zero value otherwise. +func (o *IdentificationStage) GetPretendUserExists() bool { + if o == nil || IsNil(o.PretendUserExists) { + var ret bool + return ret + } + return *o.PretendUserExists +} + +// GetPretendUserExistsOk returns a tuple with the PretendUserExists field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetPretendUserExistsOk() (*bool, bool) { + if o == nil || IsNil(o.PretendUserExists) { + return nil, false + } + return o.PretendUserExists, true +} + +// HasPretendUserExists returns a boolean if a field has been set. +func (o *IdentificationStage) HasPretendUserExists() bool { + if o != nil && !IsNil(o.PretendUserExists) { + return true + } + + return false +} + +// SetPretendUserExists gets a reference to the given bool and assigns it to the PretendUserExists field. +func (o *IdentificationStage) SetPretendUserExists(v bool) { + o.PretendUserExists = &v +} + +// GetEnableRememberMe returns the EnableRememberMe field value if set, zero value otherwise. +func (o *IdentificationStage) GetEnableRememberMe() bool { + if o == nil || IsNil(o.EnableRememberMe) { + var ret bool + return ret + } + return *o.EnableRememberMe +} + +// GetEnableRememberMeOk returns a tuple with the EnableRememberMe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStage) GetEnableRememberMeOk() (*bool, bool) { + if o == nil || IsNil(o.EnableRememberMe) { + return nil, false + } + return o.EnableRememberMe, true +} + +// HasEnableRememberMe returns a boolean if a field has been set. +func (o *IdentificationStage) HasEnableRememberMe() bool { + if o != nil && !IsNil(o.EnableRememberMe) { + return true + } + + return false +} + +// SetEnableRememberMe gets a reference to the given bool and assigns it to the EnableRememberMe field. +func (o *IdentificationStage) SetEnableRememberMe(v bool) { + o.EnableRememberMe = &v +} + +// GetWebauthnStage returns the WebauthnStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStage) GetWebauthnStage() string { + if o == nil || IsNil(o.WebauthnStage.Get()) { + var ret string + return ret + } + return *o.WebauthnStage.Get() +} + +// GetWebauthnStageOk returns a tuple with the WebauthnStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStage) GetWebauthnStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebauthnStage.Get(), o.WebauthnStage.IsSet() +} + +// HasWebauthnStage returns a boolean if a field has been set. +func (o *IdentificationStage) HasWebauthnStage() bool { + if o != nil && o.WebauthnStage.IsSet() { + return true + } + + return false +} + +// SetWebauthnStage gets a reference to the given NullableString and assigns it to the WebauthnStage field. +func (o *IdentificationStage) SetWebauthnStage(v string) { + o.WebauthnStage.Set(&v) +} + +// SetWebauthnStageNil sets the value for WebauthnStage to be an explicit nil +func (o *IdentificationStage) SetWebauthnStageNil() { + o.WebauthnStage.Set(nil) +} + +// UnsetWebauthnStage ensures that no value is present for WebauthnStage, not even an explicit nil +func (o *IdentificationStage) UnsetWebauthnStage() { + o.WebauthnStage.Unset() +} + +func (o IdentificationStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentificationStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.UserFields) { + toSerialize["user_fields"] = o.UserFields + } + if o.PasswordStage.IsSet() { + toSerialize["password_stage"] = o.PasswordStage.Get() + } + if o.CaptchaStage.IsSet() { + toSerialize["captcha_stage"] = o.CaptchaStage.Get() + } + if !IsNil(o.CaseInsensitiveMatching) { + toSerialize["case_insensitive_matching"] = o.CaseInsensitiveMatching + } + if !IsNil(o.ShowMatchedUser) { + toSerialize["show_matched_user"] = o.ShowMatchedUser + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if o.RecoveryFlow.IsSet() { + toSerialize["recovery_flow"] = o.RecoveryFlow.Get() + } + if o.PasswordlessFlow.IsSet() { + toSerialize["passwordless_flow"] = o.PasswordlessFlow.Get() + } + if !IsNil(o.Sources) { + toSerialize["sources"] = o.Sources + } + if !IsNil(o.ShowSourceLabels) { + toSerialize["show_source_labels"] = o.ShowSourceLabels + } + if !IsNil(o.PretendUserExists) { + toSerialize["pretend_user_exists"] = o.PretendUserExists + } + if !IsNil(o.EnableRememberMe) { + toSerialize["enable_remember_me"] = o.EnableRememberMe + } + if o.WebauthnStage.IsSet() { + toSerialize["webauthn_stage"] = o.WebauthnStage.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IdentificationStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIdentificationStage := _IdentificationStage{} + + err = json.Unmarshal(data, &varIdentificationStage) + + if err != nil { + return err + } + + *o = IdentificationStage(varIdentificationStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "user_fields") + delete(additionalProperties, "password_stage") + delete(additionalProperties, "captcha_stage") + delete(additionalProperties, "case_insensitive_matching") + delete(additionalProperties, "show_matched_user") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "recovery_flow") + delete(additionalProperties, "passwordless_flow") + delete(additionalProperties, "sources") + delete(additionalProperties, "show_source_labels") + delete(additionalProperties, "pretend_user_exists") + delete(additionalProperties, "enable_remember_me") + delete(additionalProperties, "webauthn_stage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentificationStage struct { + value *IdentificationStage + isSet bool +} + +func (v NullableIdentificationStage) Get() *IdentificationStage { + return v.value +} + +func (v *NullableIdentificationStage) Set(val *IdentificationStage) { + v.value = val + v.isSet = true +} + +func (v NullableIdentificationStage) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentificationStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentificationStage(val *IdentificationStage) *NullableIdentificationStage { + return &NullableIdentificationStage{value: val, isSet: true} +} + +func (v NullableIdentificationStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentificationStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_identification_stage_request.go b/packages/client-go/model_identification_stage_request.go new file mode 100644 index 0000000000..301bbb1c5a --- /dev/null +++ b/packages/client-go/model_identification_stage_request.go @@ -0,0 +1,726 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the IdentificationStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IdentificationStageRequest{} + +// IdentificationStageRequest IdentificationStage Serializer +type IdentificationStageRequest struct { + Name string `json:"name"` + // Fields of the user object to match against. (Hold shift to select multiple options) + UserFields []UserFieldsEnum `json:"user_fields,omitempty"` + // When set, shows a password field, instead of showing the password field as separate step. + PasswordStage NullableString `json:"password_stage,omitempty"` + // When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage. + CaptchaStage NullableString `json:"captcha_stage,omitempty"` + // When enabled, user fields are matched regardless of their casing. + CaseInsensitiveMatching *bool `json:"case_insensitive_matching,omitempty"` + // When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown + ShowMatchedUser *bool `json:"show_matched_user,omitempty"` + // Optional enrollment flow, which is linked at the bottom of the page. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + // Optional recovery flow, which is linked at the bottom of the page. + RecoveryFlow NullableString `json:"recovery_flow,omitempty"` + // Optional passwordless flow, which is linked at the bottom of the page. + PasswordlessFlow NullableString `json:"passwordless_flow,omitempty"` + // Specify which sources should be shown. + Sources []string `json:"sources,omitempty"` + ShowSourceLabels *bool `json:"show_source_labels,omitempty"` + // When enabled, the stage will succeed and continue even when incorrect user info is entered. + PretendUserExists *bool `json:"pretend_user_exists,omitempty"` + // Show the user the 'Remember me on this device' toggle, allowing repeat users to skip straight to entering their password. + EnableRememberMe *bool `json:"enable_remember_me,omitempty"` + // When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor. + WebauthnStage NullableString `json:"webauthn_stage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IdentificationStageRequest IdentificationStageRequest + +// NewIdentificationStageRequest instantiates a new IdentificationStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIdentificationStageRequest(name string) *IdentificationStageRequest { + this := IdentificationStageRequest{} + this.Name = name + return &this +} + +// NewIdentificationStageRequestWithDefaults instantiates a new IdentificationStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIdentificationStageRequestWithDefaults() *IdentificationStageRequest { + this := IdentificationStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *IdentificationStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *IdentificationStageRequest) SetName(v string) { + o.Name = v +} + +// GetUserFields returns the UserFields field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetUserFields() []UserFieldsEnum { + if o == nil || IsNil(o.UserFields) { + var ret []UserFieldsEnum + return ret + } + return o.UserFields +} + +// GetUserFieldsOk returns a tuple with the UserFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetUserFieldsOk() ([]UserFieldsEnum, bool) { + if o == nil || IsNil(o.UserFields) { + return nil, false + } + return o.UserFields, true +} + +// HasUserFields returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasUserFields() bool { + if o != nil && !IsNil(o.UserFields) { + return true + } + + return false +} + +// SetUserFields gets a reference to the given []UserFieldsEnum and assigns it to the UserFields field. +func (o *IdentificationStageRequest) SetUserFields(v []UserFieldsEnum) { + o.UserFields = v +} + +// GetPasswordStage returns the PasswordStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetPasswordStage() string { + if o == nil || IsNil(o.PasswordStage.Get()) { + var ret string + return ret + } + return *o.PasswordStage.Get() +} + +// GetPasswordStageOk returns a tuple with the PasswordStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetPasswordStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordStage.Get(), o.PasswordStage.IsSet() +} + +// HasPasswordStage returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasPasswordStage() bool { + if o != nil && o.PasswordStage.IsSet() { + return true + } + + return false +} + +// SetPasswordStage gets a reference to the given NullableString and assigns it to the PasswordStage field. +func (o *IdentificationStageRequest) SetPasswordStage(v string) { + o.PasswordStage.Set(&v) +} + +// SetPasswordStageNil sets the value for PasswordStage to be an explicit nil +func (o *IdentificationStageRequest) SetPasswordStageNil() { + o.PasswordStage.Set(nil) +} + +// UnsetPasswordStage ensures that no value is present for PasswordStage, not even an explicit nil +func (o *IdentificationStageRequest) UnsetPasswordStage() { + o.PasswordStage.Unset() +} + +// GetCaptchaStage returns the CaptchaStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetCaptchaStage() string { + if o == nil || IsNil(o.CaptchaStage.Get()) { + var ret string + return ret + } + return *o.CaptchaStage.Get() +} + +// GetCaptchaStageOk returns a tuple with the CaptchaStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetCaptchaStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaptchaStage.Get(), o.CaptchaStage.IsSet() +} + +// HasCaptchaStage returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasCaptchaStage() bool { + if o != nil && o.CaptchaStage.IsSet() { + return true + } + + return false +} + +// SetCaptchaStage gets a reference to the given NullableString and assigns it to the CaptchaStage field. +func (o *IdentificationStageRequest) SetCaptchaStage(v string) { + o.CaptchaStage.Set(&v) +} + +// SetCaptchaStageNil sets the value for CaptchaStage to be an explicit nil +func (o *IdentificationStageRequest) SetCaptchaStageNil() { + o.CaptchaStage.Set(nil) +} + +// UnsetCaptchaStage ensures that no value is present for CaptchaStage, not even an explicit nil +func (o *IdentificationStageRequest) UnsetCaptchaStage() { + o.CaptchaStage.Unset() +} + +// GetCaseInsensitiveMatching returns the CaseInsensitiveMatching field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetCaseInsensitiveMatching() bool { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + var ret bool + return ret + } + return *o.CaseInsensitiveMatching +} + +// GetCaseInsensitiveMatchingOk returns a tuple with the CaseInsensitiveMatching field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetCaseInsensitiveMatchingOk() (*bool, bool) { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + return nil, false + } + return o.CaseInsensitiveMatching, true +} + +// HasCaseInsensitiveMatching returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasCaseInsensitiveMatching() bool { + if o != nil && !IsNil(o.CaseInsensitiveMatching) { + return true + } + + return false +} + +// SetCaseInsensitiveMatching gets a reference to the given bool and assigns it to the CaseInsensitiveMatching field. +func (o *IdentificationStageRequest) SetCaseInsensitiveMatching(v bool) { + o.CaseInsensitiveMatching = &v +} + +// GetShowMatchedUser returns the ShowMatchedUser field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetShowMatchedUser() bool { + if o == nil || IsNil(o.ShowMatchedUser) { + var ret bool + return ret + } + return *o.ShowMatchedUser +} + +// GetShowMatchedUserOk returns a tuple with the ShowMatchedUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetShowMatchedUserOk() (*bool, bool) { + if o == nil || IsNil(o.ShowMatchedUser) { + return nil, false + } + return o.ShowMatchedUser, true +} + +// HasShowMatchedUser returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasShowMatchedUser() bool { + if o != nil && !IsNil(o.ShowMatchedUser) { + return true + } + + return false +} + +// SetShowMatchedUser gets a reference to the given bool and assigns it to the ShowMatchedUser field. +func (o *IdentificationStageRequest) SetShowMatchedUser(v bool) { + o.ShowMatchedUser = &v +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *IdentificationStageRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *IdentificationStageRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *IdentificationStageRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetRecoveryFlow returns the RecoveryFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetRecoveryFlow() string { + if o == nil || IsNil(o.RecoveryFlow.Get()) { + var ret string + return ret + } + return *o.RecoveryFlow.Get() +} + +// GetRecoveryFlowOk returns a tuple with the RecoveryFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetRecoveryFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecoveryFlow.Get(), o.RecoveryFlow.IsSet() +} + +// HasRecoveryFlow returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasRecoveryFlow() bool { + if o != nil && o.RecoveryFlow.IsSet() { + return true + } + + return false +} + +// SetRecoveryFlow gets a reference to the given NullableString and assigns it to the RecoveryFlow field. +func (o *IdentificationStageRequest) SetRecoveryFlow(v string) { + o.RecoveryFlow.Set(&v) +} + +// SetRecoveryFlowNil sets the value for RecoveryFlow to be an explicit nil +func (o *IdentificationStageRequest) SetRecoveryFlowNil() { + o.RecoveryFlow.Set(nil) +} + +// UnsetRecoveryFlow ensures that no value is present for RecoveryFlow, not even an explicit nil +func (o *IdentificationStageRequest) UnsetRecoveryFlow() { + o.RecoveryFlow.Unset() +} + +// GetPasswordlessFlow returns the PasswordlessFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetPasswordlessFlow() string { + if o == nil || IsNil(o.PasswordlessFlow.Get()) { + var ret string + return ret + } + return *o.PasswordlessFlow.Get() +} + +// GetPasswordlessFlowOk returns a tuple with the PasswordlessFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetPasswordlessFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordlessFlow.Get(), o.PasswordlessFlow.IsSet() +} + +// HasPasswordlessFlow returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasPasswordlessFlow() bool { + if o != nil && o.PasswordlessFlow.IsSet() { + return true + } + + return false +} + +// SetPasswordlessFlow gets a reference to the given NullableString and assigns it to the PasswordlessFlow field. +func (o *IdentificationStageRequest) SetPasswordlessFlow(v string) { + o.PasswordlessFlow.Set(&v) +} + +// SetPasswordlessFlowNil sets the value for PasswordlessFlow to be an explicit nil +func (o *IdentificationStageRequest) SetPasswordlessFlowNil() { + o.PasswordlessFlow.Set(nil) +} + +// UnsetPasswordlessFlow ensures that no value is present for PasswordlessFlow, not even an explicit nil +func (o *IdentificationStageRequest) UnsetPasswordlessFlow() { + o.PasswordlessFlow.Unset() +} + +// GetSources returns the Sources field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetSources() []string { + if o == nil || IsNil(o.Sources) { + var ret []string + return ret + } + return o.Sources +} + +// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.Sources) { + return nil, false + } + return o.Sources, true +} + +// HasSources returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasSources() bool { + if o != nil && !IsNil(o.Sources) { + return true + } + + return false +} + +// SetSources gets a reference to the given []string and assigns it to the Sources field. +func (o *IdentificationStageRequest) SetSources(v []string) { + o.Sources = v +} + +// GetShowSourceLabels returns the ShowSourceLabels field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetShowSourceLabels() bool { + if o == nil || IsNil(o.ShowSourceLabels) { + var ret bool + return ret + } + return *o.ShowSourceLabels +} + +// GetShowSourceLabelsOk returns a tuple with the ShowSourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetShowSourceLabelsOk() (*bool, bool) { + if o == nil || IsNil(o.ShowSourceLabels) { + return nil, false + } + return o.ShowSourceLabels, true +} + +// HasShowSourceLabels returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasShowSourceLabels() bool { + if o != nil && !IsNil(o.ShowSourceLabels) { + return true + } + + return false +} + +// SetShowSourceLabels gets a reference to the given bool and assigns it to the ShowSourceLabels field. +func (o *IdentificationStageRequest) SetShowSourceLabels(v bool) { + o.ShowSourceLabels = &v +} + +// GetPretendUserExists returns the PretendUserExists field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetPretendUserExists() bool { + if o == nil || IsNil(o.PretendUserExists) { + var ret bool + return ret + } + return *o.PretendUserExists +} + +// GetPretendUserExistsOk returns a tuple with the PretendUserExists field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetPretendUserExistsOk() (*bool, bool) { + if o == nil || IsNil(o.PretendUserExists) { + return nil, false + } + return o.PretendUserExists, true +} + +// HasPretendUserExists returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasPretendUserExists() bool { + if o != nil && !IsNil(o.PretendUserExists) { + return true + } + + return false +} + +// SetPretendUserExists gets a reference to the given bool and assigns it to the PretendUserExists field. +func (o *IdentificationStageRequest) SetPretendUserExists(v bool) { + o.PretendUserExists = &v +} + +// GetEnableRememberMe returns the EnableRememberMe field value if set, zero value otherwise. +func (o *IdentificationStageRequest) GetEnableRememberMe() bool { + if o == nil || IsNil(o.EnableRememberMe) { + var ret bool + return ret + } + return *o.EnableRememberMe +} + +// GetEnableRememberMeOk returns a tuple with the EnableRememberMe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IdentificationStageRequest) GetEnableRememberMeOk() (*bool, bool) { + if o == nil || IsNil(o.EnableRememberMe) { + return nil, false + } + return o.EnableRememberMe, true +} + +// HasEnableRememberMe returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasEnableRememberMe() bool { + if o != nil && !IsNil(o.EnableRememberMe) { + return true + } + + return false +} + +// SetEnableRememberMe gets a reference to the given bool and assigns it to the EnableRememberMe field. +func (o *IdentificationStageRequest) SetEnableRememberMe(v bool) { + o.EnableRememberMe = &v +} + +// GetWebauthnStage returns the WebauthnStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *IdentificationStageRequest) GetWebauthnStage() string { + if o == nil || IsNil(o.WebauthnStage.Get()) { + var ret string + return ret + } + return *o.WebauthnStage.Get() +} + +// GetWebauthnStageOk returns a tuple with the WebauthnStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *IdentificationStageRequest) GetWebauthnStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebauthnStage.Get(), o.WebauthnStage.IsSet() +} + +// HasWebauthnStage returns a boolean if a field has been set. +func (o *IdentificationStageRequest) HasWebauthnStage() bool { + if o != nil && o.WebauthnStage.IsSet() { + return true + } + + return false +} + +// SetWebauthnStage gets a reference to the given NullableString and assigns it to the WebauthnStage field. +func (o *IdentificationStageRequest) SetWebauthnStage(v string) { + o.WebauthnStage.Set(&v) +} + +// SetWebauthnStageNil sets the value for WebauthnStage to be an explicit nil +func (o *IdentificationStageRequest) SetWebauthnStageNil() { + o.WebauthnStage.Set(nil) +} + +// UnsetWebauthnStage ensures that no value is present for WebauthnStage, not even an explicit nil +func (o *IdentificationStageRequest) UnsetWebauthnStage() { + o.WebauthnStage.Unset() +} + +func (o IdentificationStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IdentificationStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.UserFields) { + toSerialize["user_fields"] = o.UserFields + } + if o.PasswordStage.IsSet() { + toSerialize["password_stage"] = o.PasswordStage.Get() + } + if o.CaptchaStage.IsSet() { + toSerialize["captcha_stage"] = o.CaptchaStage.Get() + } + if !IsNil(o.CaseInsensitiveMatching) { + toSerialize["case_insensitive_matching"] = o.CaseInsensitiveMatching + } + if !IsNil(o.ShowMatchedUser) { + toSerialize["show_matched_user"] = o.ShowMatchedUser + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if o.RecoveryFlow.IsSet() { + toSerialize["recovery_flow"] = o.RecoveryFlow.Get() + } + if o.PasswordlessFlow.IsSet() { + toSerialize["passwordless_flow"] = o.PasswordlessFlow.Get() + } + if !IsNil(o.Sources) { + toSerialize["sources"] = o.Sources + } + if !IsNil(o.ShowSourceLabels) { + toSerialize["show_source_labels"] = o.ShowSourceLabels + } + if !IsNil(o.PretendUserExists) { + toSerialize["pretend_user_exists"] = o.PretendUserExists + } + if !IsNil(o.EnableRememberMe) { + toSerialize["enable_remember_me"] = o.EnableRememberMe + } + if o.WebauthnStage.IsSet() { + toSerialize["webauthn_stage"] = o.WebauthnStage.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IdentificationStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varIdentificationStageRequest := _IdentificationStageRequest{} + + err = json.Unmarshal(data, &varIdentificationStageRequest) + + if err != nil { + return err + } + + *o = IdentificationStageRequest(varIdentificationStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "user_fields") + delete(additionalProperties, "password_stage") + delete(additionalProperties, "captcha_stage") + delete(additionalProperties, "case_insensitive_matching") + delete(additionalProperties, "show_matched_user") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "recovery_flow") + delete(additionalProperties, "passwordless_flow") + delete(additionalProperties, "sources") + delete(additionalProperties, "show_source_labels") + delete(additionalProperties, "pretend_user_exists") + delete(additionalProperties, "enable_remember_me") + delete(additionalProperties, "webauthn_stage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIdentificationStageRequest struct { + value *IdentificationStageRequest + isSet bool +} + +func (v NullableIdentificationStageRequest) Get() *IdentificationStageRequest { + return v.value +} + +func (v *NullableIdentificationStageRequest) Set(val *IdentificationStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIdentificationStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIdentificationStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIdentificationStageRequest(val *IdentificationStageRequest) *NullableIdentificationStageRequest { + return &NullableIdentificationStageRequest{value: val, isSet: true} +} + +func (v NullableIdentificationStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIdentificationStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_iframe_logout_challenge.go b/packages/client-go/model_iframe_logout_challenge.go new file mode 100644 index 0000000000..7c277a56c7 --- /dev/null +++ b/packages/client-go/model_iframe_logout_challenge.go @@ -0,0 +1,269 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the IframeLogoutChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IframeLogoutChallenge{} + +// IframeLogoutChallenge Challenge for iframe logout +type IframeLogoutChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + LogoutUrls []LogoutURL `json:"logout_urls,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IframeLogoutChallenge IframeLogoutChallenge + +// NewIframeLogoutChallenge instantiates a new IframeLogoutChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIframeLogoutChallenge() *IframeLogoutChallenge { + this := IframeLogoutChallenge{} + var component string = "ak-provider-iframe-logout" + this.Component = &component + return &this +} + +// NewIframeLogoutChallengeWithDefaults instantiates a new IframeLogoutChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIframeLogoutChallengeWithDefaults() *IframeLogoutChallenge { + this := IframeLogoutChallenge{} + var component string = "ak-provider-iframe-logout" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *IframeLogoutChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IframeLogoutChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *IframeLogoutChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *IframeLogoutChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *IframeLogoutChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IframeLogoutChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *IframeLogoutChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *IframeLogoutChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *IframeLogoutChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IframeLogoutChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *IframeLogoutChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *IframeLogoutChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetLogoutUrls returns the LogoutUrls field value if set, zero value otherwise. +func (o *IframeLogoutChallenge) GetLogoutUrls() []LogoutURL { + if o == nil || IsNil(o.LogoutUrls) { + var ret []LogoutURL + return ret + } + return o.LogoutUrls +} + +// GetLogoutUrlsOk returns a tuple with the LogoutUrls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IframeLogoutChallenge) GetLogoutUrlsOk() ([]LogoutURL, bool) { + if o == nil || IsNil(o.LogoutUrls) { + return nil, false + } + return o.LogoutUrls, true +} + +// HasLogoutUrls returns a boolean if a field has been set. +func (o *IframeLogoutChallenge) HasLogoutUrls() bool { + if o != nil && !IsNil(o.LogoutUrls) { + return true + } + + return false +} + +// SetLogoutUrls gets a reference to the given []LogoutURL and assigns it to the LogoutUrls field. +func (o *IframeLogoutChallenge) SetLogoutUrls(v []LogoutURL) { + o.LogoutUrls = v +} + +func (o IframeLogoutChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IframeLogoutChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + if !IsNil(o.LogoutUrls) { + toSerialize["logout_urls"] = o.LogoutUrls + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IframeLogoutChallenge) UnmarshalJSON(data []byte) (err error) { + varIframeLogoutChallenge := _IframeLogoutChallenge{} + + err = json.Unmarshal(data, &varIframeLogoutChallenge) + + if err != nil { + return err + } + + *o = IframeLogoutChallenge(varIframeLogoutChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "logout_urls") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIframeLogoutChallenge struct { + value *IframeLogoutChallenge + isSet bool +} + +func (v NullableIframeLogoutChallenge) Get() *IframeLogoutChallenge { + return v.value +} + +func (v *NullableIframeLogoutChallenge) Set(val *IframeLogoutChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableIframeLogoutChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableIframeLogoutChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIframeLogoutChallenge(val *IframeLogoutChallenge) *NullableIframeLogoutChallenge { + return &NullableIframeLogoutChallenge{value: val, isSet: true} +} + +func (v NullableIframeLogoutChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIframeLogoutChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_iframe_logout_challenge_response_request.go b/packages/client-go/model_iframe_logout_challenge_response_request.go new file mode 100644 index 0000000000..92971b4472 --- /dev/null +++ b/packages/client-go/model_iframe_logout_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the IframeLogoutChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &IframeLogoutChallengeResponseRequest{} + +// IframeLogoutChallengeResponseRequest Response for iframe logout +type IframeLogoutChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _IframeLogoutChallengeResponseRequest IframeLogoutChallengeResponseRequest + +// NewIframeLogoutChallengeResponseRequest instantiates a new IframeLogoutChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewIframeLogoutChallengeResponseRequest() *IframeLogoutChallengeResponseRequest { + this := IframeLogoutChallengeResponseRequest{} + var component string = "ak-provider-iframe-logout" + this.Component = &component + return &this +} + +// NewIframeLogoutChallengeResponseRequestWithDefaults instantiates a new IframeLogoutChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewIframeLogoutChallengeResponseRequestWithDefaults() *IframeLogoutChallengeResponseRequest { + this := IframeLogoutChallengeResponseRequest{} + var component string = "ak-provider-iframe-logout" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *IframeLogoutChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IframeLogoutChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *IframeLogoutChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *IframeLogoutChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o IframeLogoutChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o IframeLogoutChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *IframeLogoutChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varIframeLogoutChallengeResponseRequest := _IframeLogoutChallengeResponseRequest{} + + err = json.Unmarshal(data, &varIframeLogoutChallengeResponseRequest) + + if err != nil { + return err + } + + *o = IframeLogoutChallengeResponseRequest(varIframeLogoutChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableIframeLogoutChallengeResponseRequest struct { + value *IframeLogoutChallengeResponseRequest + isSet bool +} + +func (v NullableIframeLogoutChallengeResponseRequest) Get() *IframeLogoutChallengeResponseRequest { + return v.value +} + +func (v *NullableIframeLogoutChallengeResponseRequest) Set(val *IframeLogoutChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableIframeLogoutChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableIframeLogoutChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIframeLogoutChallengeResponseRequest(val *IframeLogoutChallengeResponseRequest) *NullableIframeLogoutChallengeResponseRequest { + return &NullableIframeLogoutChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableIframeLogoutChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIframeLogoutChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_impersonation_request.go b/packages/client-go/model_impersonation_request.go new file mode 100644 index 0000000000..17e45d5122 --- /dev/null +++ b/packages/client-go/model_impersonation_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ImpersonationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImpersonationRequest{} + +// ImpersonationRequest struct for ImpersonationRequest +type ImpersonationRequest struct { + Reason string `json:"reason"` + AdditionalProperties map[string]interface{} +} + +type _ImpersonationRequest ImpersonationRequest + +// NewImpersonationRequest instantiates a new ImpersonationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImpersonationRequest(reason string) *ImpersonationRequest { + this := ImpersonationRequest{} + this.Reason = reason + return &this +} + +// NewImpersonationRequestWithDefaults instantiates a new ImpersonationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImpersonationRequestWithDefaults() *ImpersonationRequest { + this := ImpersonationRequest{} + return &this +} + +// GetReason returns the Reason field value +func (o *ImpersonationRequest) GetReason() string { + if o == nil { + var ret string + return ret + } + + return o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value +// and a boolean to check if the value has been set. +func (o *ImpersonationRequest) GetReasonOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Reason, true +} + +// SetReason sets field value +func (o *ImpersonationRequest) SetReason(v string) { + o.Reason = v +} + +func (o ImpersonationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImpersonationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["reason"] = o.Reason + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ImpersonationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "reason", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImpersonationRequest := _ImpersonationRequest{} + + err = json.Unmarshal(data, &varImpersonationRequest) + + if err != nil { + return err + } + + *o = ImpersonationRequest(varImpersonationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "reason") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableImpersonationRequest struct { + value *ImpersonationRequest + isSet bool +} + +func (v NullableImpersonationRequest) Get() *ImpersonationRequest { + return v.value +} + +func (v *NullableImpersonationRequest) Set(val *ImpersonationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableImpersonationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableImpersonationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImpersonationRequest(val *ImpersonationRequest) *NullableImpersonationRequest { + return &NullableImpersonationRequest{value: val, isSet: true} +} + +func (v NullableImpersonationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImpersonationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_initial_permissions.go b/packages/client-go/model_initial_permissions.go new file mode 100644 index 0000000000..8038a5e93c --- /dev/null +++ b/packages/client-go/model_initial_permissions.go @@ -0,0 +1,291 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InitialPermissions type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitialPermissions{} + +// InitialPermissions InitialPermissions serializer +type InitialPermissions struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + Role string `json:"role"` + Permissions []int32 `json:"permissions,omitempty"` + PermissionsObj []Permission `json:"permissions_obj"` + AdditionalProperties map[string]interface{} +} + +type _InitialPermissions InitialPermissions + +// NewInitialPermissions instantiates a new InitialPermissions object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInitialPermissions(pk int32, name string, role string, permissionsObj []Permission) *InitialPermissions { + this := InitialPermissions{} + this.Pk = pk + this.Name = name + this.Role = role + this.PermissionsObj = permissionsObj + return &this +} + +// NewInitialPermissionsWithDefaults instantiates a new InitialPermissions object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitialPermissionsWithDefaults() *InitialPermissions { + this := InitialPermissions{} + return &this +} + +// GetPk returns the Pk field value +func (o *InitialPermissions) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *InitialPermissions) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *InitialPermissions) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *InitialPermissions) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InitialPermissions) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InitialPermissions) SetName(v string) { + o.Name = v +} + +// GetRole returns the Role field value +func (o *InitialPermissions) GetRole() string { + if o == nil { + var ret string + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *InitialPermissions) GetRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *InitialPermissions) SetRole(v string) { + o.Role = v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *InitialPermissions) GetPermissions() []int32 { + if o == nil || IsNil(o.Permissions) { + var ret []int32 + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitialPermissions) GetPermissionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *InitialPermissions) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []int32 and assigns it to the Permissions field. +func (o *InitialPermissions) SetPermissions(v []int32) { + o.Permissions = v +} + +// GetPermissionsObj returns the PermissionsObj field value +func (o *InitialPermissions) GetPermissionsObj() []Permission { + if o == nil { + var ret []Permission + return ret + } + + return o.PermissionsObj +} + +// GetPermissionsObjOk returns a tuple with the PermissionsObj field value +// and a boolean to check if the value has been set. +func (o *InitialPermissions) GetPermissionsObjOk() ([]Permission, bool) { + if o == nil { + return nil, false + } + return o.PermissionsObj, true +} + +// SetPermissionsObj sets field value +func (o *InitialPermissions) SetPermissionsObj(v []Permission) { + o.PermissionsObj = v +} + +func (o InitialPermissions) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitialPermissions) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["role"] = o.Role + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + toSerialize["permissions_obj"] = o.PermissionsObj + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InitialPermissions) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "role", + "permissions_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInitialPermissions := _InitialPermissions{} + + err = json.Unmarshal(data, &varInitialPermissions) + + if err != nil { + return err + } + + *o = InitialPermissions(varInitialPermissions) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "permissions") + delete(additionalProperties, "permissions_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInitialPermissions struct { + value *InitialPermissions + isSet bool +} + +func (v NullableInitialPermissions) Get() *InitialPermissions { + return v.value +} + +func (v *NullableInitialPermissions) Set(val *InitialPermissions) { + v.value = val + v.isSet = true +} + +func (v NullableInitialPermissions) IsSet() bool { + return v.isSet +} + +func (v *NullableInitialPermissions) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitialPermissions(val *InitialPermissions) *NullableInitialPermissions { + return &NullableInitialPermissions{value: val, isSet: true} +} + +func (v NullableInitialPermissions) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitialPermissions) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_initial_permissions_request.go b/packages/client-go/model_initial_permissions_request.go new file mode 100644 index 0000000000..ae096cb97b --- /dev/null +++ b/packages/client-go/model_initial_permissions_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InitialPermissionsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InitialPermissionsRequest{} + +// InitialPermissionsRequest InitialPermissions serializer +type InitialPermissionsRequest struct { + Name string `json:"name"` + Role string `json:"role"` + Permissions []int32 `json:"permissions,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InitialPermissionsRequest InitialPermissionsRequest + +// NewInitialPermissionsRequest instantiates a new InitialPermissionsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInitialPermissionsRequest(name string, role string) *InitialPermissionsRequest { + this := InitialPermissionsRequest{} + this.Name = name + this.Role = role + return &this +} + +// NewInitialPermissionsRequestWithDefaults instantiates a new InitialPermissionsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInitialPermissionsRequestWithDefaults() *InitialPermissionsRequest { + this := InitialPermissionsRequest{} + return &this +} + +// GetName returns the Name field value +func (o *InitialPermissionsRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InitialPermissionsRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InitialPermissionsRequest) SetName(v string) { + o.Name = v +} + +// GetRole returns the Role field value +func (o *InitialPermissionsRequest) GetRole() string { + if o == nil { + var ret string + return ret + } + + return o.Role +} + +// GetRoleOk returns a tuple with the Role field value +// and a boolean to check if the value has been set. +func (o *InitialPermissionsRequest) GetRoleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Role, true +} + +// SetRole sets field value +func (o *InitialPermissionsRequest) SetRole(v string) { + o.Role = v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *InitialPermissionsRequest) GetPermissions() []int32 { + if o == nil || IsNil(o.Permissions) { + var ret []int32 + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InitialPermissionsRequest) GetPermissionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *InitialPermissionsRequest) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []int32 and assigns it to the Permissions field. +func (o *InitialPermissionsRequest) SetPermissions(v []int32) { + o.Permissions = v +} + +func (o InitialPermissionsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InitialPermissionsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["role"] = o.Role + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InitialPermissionsRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "role", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInitialPermissionsRequest := _InitialPermissionsRequest{} + + err = json.Unmarshal(data, &varInitialPermissionsRequest) + + if err != nil { + return err + } + + *o = InitialPermissionsRequest(varInitialPermissionsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "permissions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInitialPermissionsRequest struct { + value *InitialPermissionsRequest + isSet bool +} + +func (v NullableInitialPermissionsRequest) Get() *InitialPermissionsRequest { + return v.value +} + +func (v *NullableInitialPermissionsRequest) Set(val *InitialPermissionsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInitialPermissionsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInitialPermissionsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInitialPermissionsRequest(val *InitialPermissionsRequest) *NullableInitialPermissionsRequest { + return &NullableInitialPermissionsRequest{value: val, isSet: true} +} + +func (v NullableInitialPermissionsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInitialPermissionsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_install_id.go b/packages/client-go/model_install_id.go new file mode 100644 index 0000000000..a391b3d3b8 --- /dev/null +++ b/packages/client-go/model_install_id.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InstallID type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InstallID{} + +// InstallID struct for InstallID +type InstallID struct { + InstallId string `json:"install_id"` + AdditionalProperties map[string]interface{} +} + +type _InstallID InstallID + +// NewInstallID instantiates a new InstallID object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstallID(installId string) *InstallID { + this := InstallID{} + this.InstallId = installId + return &this +} + +// NewInstallIDWithDefaults instantiates a new InstallID object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstallIDWithDefaults() *InstallID { + this := InstallID{} + return &this +} + +// GetInstallId returns the InstallId field value +func (o *InstallID) GetInstallId() string { + if o == nil { + var ret string + return ret + } + + return o.InstallId +} + +// GetInstallIdOk returns a tuple with the InstallId field value +// and a boolean to check if the value has been set. +func (o *InstallID) GetInstallIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InstallId, true +} + +// SetInstallId sets field value +func (o *InstallID) SetInstallId(v string) { + o.InstallId = v +} + +func (o InstallID) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InstallID) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["install_id"] = o.InstallId + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InstallID) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "install_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstallID := _InstallID{} + + err = json.Unmarshal(data, &varInstallID) + + if err != nil { + return err + } + + *o = InstallID(varInstallID) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "install_id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInstallID struct { + value *InstallID + isSet bool +} + +func (v NullableInstallID) Get() *InstallID { + return v.value +} + +func (v *NullableInstallID) Set(val *InstallID) { + v.value = val + v.isSet = true +} + +func (v NullableInstallID) IsSet() bool { + return v.isSet +} + +func (v *NullableInstallID) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstallID(val *InstallID) *NullableInstallID { + return &NullableInstallID{value: val, isSet: true} +} + +func (v NullableInstallID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstallID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_intent_enum.go b/packages/client-go/model_intent_enum.go new file mode 100644 index 0000000000..727770ed3d --- /dev/null +++ b/packages/client-go/model_intent_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// IntentEnum the model 'IntentEnum' +type IntentEnum string + +// List of IntentEnum +const ( + INTENTENUM_VERIFICATION IntentEnum = "verification" + INTENTENUM_API IntentEnum = "api" + INTENTENUM_RECOVERY IntentEnum = "recovery" + INTENTENUM_APP_PASSWORD IntentEnum = "app_password" +) + +// All allowed values of IntentEnum enum +var AllowedIntentEnumEnumValues = []IntentEnum{ + "verification", + "api", + "recovery", + "app_password", +} + +func (v *IntentEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IntentEnum(value) + for _, existing := range AllowedIntentEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IntentEnum", value) +} + +// NewIntentEnumFromValue returns a pointer to a valid IntentEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIntentEnumFromValue(v string) (*IntentEnum, error) { + ev := IntentEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IntentEnum: valid values are %v", v, AllowedIntentEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IntentEnum) IsValid() bool { + for _, existing := range AllowedIntentEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IntentEnum value +func (v IntentEnum) Ptr() *IntentEnum { + return &v +} + +type NullableIntentEnum struct { + value *IntentEnum + isSet bool +} + +func (v NullableIntentEnum) Get() *IntentEnum { + return v.value +} + +func (v *NullableIntentEnum) Set(val *IntentEnum) { + v.value = val + v.isSet = true +} + +func (v NullableIntentEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableIntentEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIntentEnum(val *IntentEnum) *NullableIntentEnum { + return &NullableIntentEnum{value: val, isSet: true} +} + +func (v NullableIntentEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIntentEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invalid_response_action_enum.go b/packages/client-go/model_invalid_response_action_enum.go new file mode 100644 index 0000000000..7428a21de3 --- /dev/null +++ b/packages/client-go/model_invalid_response_action_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// InvalidResponseActionEnum the model 'InvalidResponseActionEnum' +type InvalidResponseActionEnum string + +// List of InvalidResponseActionEnum +const ( + INVALIDRESPONSEACTIONENUM_RETRY InvalidResponseActionEnum = "retry" + INVALIDRESPONSEACTIONENUM_RESTART InvalidResponseActionEnum = "restart" + INVALIDRESPONSEACTIONENUM_RESTART_WITH_CONTEXT InvalidResponseActionEnum = "restart_with_context" +) + +// All allowed values of InvalidResponseActionEnum enum +var AllowedInvalidResponseActionEnumEnumValues = []InvalidResponseActionEnum{ + "retry", + "restart", + "restart_with_context", +} + +func (v *InvalidResponseActionEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := InvalidResponseActionEnum(value) + for _, existing := range AllowedInvalidResponseActionEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid InvalidResponseActionEnum", value) +} + +// NewInvalidResponseActionEnumFromValue returns a pointer to a valid InvalidResponseActionEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewInvalidResponseActionEnumFromValue(v string) (*InvalidResponseActionEnum, error) { + ev := InvalidResponseActionEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for InvalidResponseActionEnum: valid values are %v", v, AllowedInvalidResponseActionEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v InvalidResponseActionEnum) IsValid() bool { + for _, existing := range AllowedInvalidResponseActionEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to InvalidResponseActionEnum value +func (v InvalidResponseActionEnum) Ptr() *InvalidResponseActionEnum { + return &v +} + +type NullableInvalidResponseActionEnum struct { + value *InvalidResponseActionEnum + isSet bool +} + +func (v NullableInvalidResponseActionEnum) Get() *InvalidResponseActionEnum { + return v.value +} + +func (v *NullableInvalidResponseActionEnum) Set(val *InvalidResponseActionEnum) { + v.value = val + v.isSet = true +} + +func (v NullableInvalidResponseActionEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableInvalidResponseActionEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvalidResponseActionEnum(val *InvalidResponseActionEnum) *NullableInvalidResponseActionEnum { + return &NullableInvalidResponseActionEnum{value: val, isSet: true} +} + +func (v NullableInvalidResponseActionEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvalidResponseActionEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invitation.go b/packages/client-go/model_invitation.go new file mode 100644 index 0000000000..47c2ee2de9 --- /dev/null +++ b/packages/client-go/model_invitation.go @@ -0,0 +1,427 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Invitation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Invitation{} + +// Invitation Invitation Serializer +type Invitation struct { + Pk string `json:"pk"` + Name string `json:"name" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Expires NullableTime `json:"expires,omitempty"` + FixedData map[string]interface{} `json:"fixed_data,omitempty"` + CreatedBy PartialUser `json:"created_by"` + // When enabled, the invitation will be deleted after usage. + SingleUse *bool `json:"single_use,omitempty"` + // When set, only the configured flow can use this invitation. + Flow NullableString `json:"flow,omitempty"` + FlowObj Flow `json:"flow_obj"` + AdditionalProperties map[string]interface{} +} + +type _Invitation Invitation + +// NewInvitation instantiates a new Invitation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitation(pk string, name string, createdBy PartialUser, flowObj Flow) *Invitation { + this := Invitation{} + this.Pk = pk + this.Name = name + this.CreatedBy = createdBy + this.FlowObj = flowObj + return &this +} + +// NewInvitationWithDefaults instantiates a new Invitation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationWithDefaults() *Invitation { + this := Invitation{} + return &this +} + +// GetPk returns the Pk field value +func (o *Invitation) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Invitation) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Invitation) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Invitation) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Invitation) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Invitation) SetName(v string) { + o.Name = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Invitation) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Invitation) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *Invitation) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *Invitation) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *Invitation) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *Invitation) UnsetExpires() { + o.Expires.Unset() +} + +// GetFixedData returns the FixedData field value if set, zero value otherwise. +func (o *Invitation) GetFixedData() map[string]interface{} { + if o == nil || IsNil(o.FixedData) { + var ret map[string]interface{} + return ret + } + return o.FixedData +} + +// GetFixedDataOk returns a tuple with the FixedData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetFixedDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FixedData) { + return map[string]interface{}{}, false + } + return o.FixedData, true +} + +// HasFixedData returns a boolean if a field has been set. +func (o *Invitation) HasFixedData() bool { + if o != nil && !IsNil(o.FixedData) { + return true + } + + return false +} + +// SetFixedData gets a reference to the given map[string]interface{} and assigns it to the FixedData field. +func (o *Invitation) SetFixedData(v map[string]interface{}) { + o.FixedData = v +} + +// GetCreatedBy returns the CreatedBy field value +func (o *Invitation) GetCreatedBy() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *Invitation) GetCreatedByOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value +func (o *Invitation) SetCreatedBy(v PartialUser) { + o.CreatedBy = v +} + +// GetSingleUse returns the SingleUse field value if set, zero value otherwise. +func (o *Invitation) GetSingleUse() bool { + if o == nil || IsNil(o.SingleUse) { + var ret bool + return ret + } + return *o.SingleUse +} + +// GetSingleUseOk returns a tuple with the SingleUse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Invitation) GetSingleUseOk() (*bool, bool) { + if o == nil || IsNil(o.SingleUse) { + return nil, false + } + return o.SingleUse, true +} + +// HasSingleUse returns a boolean if a field has been set. +func (o *Invitation) HasSingleUse() bool { + if o != nil && !IsNil(o.SingleUse) { + return true + } + + return false +} + +// SetSingleUse gets a reference to the given bool and assigns it to the SingleUse field. +func (o *Invitation) SetSingleUse(v bool) { + o.SingleUse = &v +} + +// GetFlow returns the Flow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Invitation) GetFlow() string { + if o == nil || IsNil(o.Flow.Get()) { + var ret string + return ret + } + return *o.Flow.Get() +} + +// GetFlowOk returns a tuple with the Flow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Invitation) GetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Flow.Get(), o.Flow.IsSet() +} + +// HasFlow returns a boolean if a field has been set. +func (o *Invitation) HasFlow() bool { + if o != nil && o.Flow.IsSet() { + return true + } + + return false +} + +// SetFlow gets a reference to the given NullableString and assigns it to the Flow field. +func (o *Invitation) SetFlow(v string) { + o.Flow.Set(&v) +} + +// SetFlowNil sets the value for Flow to be an explicit nil +func (o *Invitation) SetFlowNil() { + o.Flow.Set(nil) +} + +// UnsetFlow ensures that no value is present for Flow, not even an explicit nil +func (o *Invitation) UnsetFlow() { + o.Flow.Unset() +} + +// GetFlowObj returns the FlowObj field value +func (o *Invitation) GetFlowObj() Flow { + if o == nil { + var ret Flow + return ret + } + + return o.FlowObj +} + +// GetFlowObjOk returns a tuple with the FlowObj field value +// and a boolean to check if the value has been set. +func (o *Invitation) GetFlowObjOk() (*Flow, bool) { + if o == nil { + return nil, false + } + return &o.FlowObj, true +} + +// SetFlowObj sets field value +func (o *Invitation) SetFlowObj(v Flow) { + o.FlowObj = v +} + +func (o Invitation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Invitation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.FixedData) { + toSerialize["fixed_data"] = o.FixedData + } + toSerialize["created_by"] = o.CreatedBy + if !IsNil(o.SingleUse) { + toSerialize["single_use"] = o.SingleUse + } + if o.Flow.IsSet() { + toSerialize["flow"] = o.Flow.Get() + } + toSerialize["flow_obj"] = o.FlowObj + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Invitation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "created_by", + "flow_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitation := _Invitation{} + + err = json.Unmarshal(data, &varInvitation) + + if err != nil { + return err + } + + *o = Invitation(varInvitation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "expires") + delete(additionalProperties, "fixed_data") + delete(additionalProperties, "created_by") + delete(additionalProperties, "single_use") + delete(additionalProperties, "flow") + delete(additionalProperties, "flow_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitation struct { + value *Invitation + isSet bool +} + +func (v NullableInvitation) Get() *Invitation { + return v.value +} + +func (v *NullableInvitation) Set(val *Invitation) { + v.value = val + v.isSet = true +} + +func (v NullableInvitation) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitation(val *Invitation) *NullableInvitation { + return &NullableInvitation{value: val, isSet: true} +} + +func (v NullableInvitation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invitation_request.go b/packages/client-go/model_invitation_request.go new file mode 100644 index 0000000000..e4fe5d99e2 --- /dev/null +++ b/packages/client-go/model_invitation_request.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the InvitationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationRequest{} + +// InvitationRequest Invitation Serializer +type InvitationRequest struct { + Name string `json:"name" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Expires NullableTime `json:"expires,omitempty"` + FixedData map[string]interface{} `json:"fixed_data,omitempty"` + // When enabled, the invitation will be deleted after usage. + SingleUse *bool `json:"single_use,omitempty"` + // When set, only the configured flow can use this invitation. + Flow NullableString `json:"flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationRequest InvitationRequest + +// NewInvitationRequest instantiates a new InvitationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationRequest(name string) *InvitationRequest { + this := InvitationRequest{} + this.Name = name + return &this +} + +// NewInvitationRequestWithDefaults instantiates a new InvitationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationRequestWithDefaults() *InvitationRequest { + this := InvitationRequest{} + return &this +} + +// GetName returns the Name field value +func (o *InvitationRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InvitationRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InvitationRequest) SetName(v string) { + o.Name = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvitationRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvitationRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *InvitationRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *InvitationRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *InvitationRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *InvitationRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetFixedData returns the FixedData field value if set, zero value otherwise. +func (o *InvitationRequest) GetFixedData() map[string]interface{} { + if o == nil || IsNil(o.FixedData) { + var ret map[string]interface{} + return ret + } + return o.FixedData +} + +// GetFixedDataOk returns a tuple with the FixedData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationRequest) GetFixedDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FixedData) { + return map[string]interface{}{}, false + } + return o.FixedData, true +} + +// HasFixedData returns a boolean if a field has been set. +func (o *InvitationRequest) HasFixedData() bool { + if o != nil && !IsNil(o.FixedData) { + return true + } + + return false +} + +// SetFixedData gets a reference to the given map[string]interface{} and assigns it to the FixedData field. +func (o *InvitationRequest) SetFixedData(v map[string]interface{}) { + o.FixedData = v +} + +// GetSingleUse returns the SingleUse field value if set, zero value otherwise. +func (o *InvitationRequest) GetSingleUse() bool { + if o == nil || IsNil(o.SingleUse) { + var ret bool + return ret + } + return *o.SingleUse +} + +// GetSingleUseOk returns a tuple with the SingleUse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationRequest) GetSingleUseOk() (*bool, bool) { + if o == nil || IsNil(o.SingleUse) { + return nil, false + } + return o.SingleUse, true +} + +// HasSingleUse returns a boolean if a field has been set. +func (o *InvitationRequest) HasSingleUse() bool { + if o != nil && !IsNil(o.SingleUse) { + return true + } + + return false +} + +// SetSingleUse gets a reference to the given bool and assigns it to the SingleUse field. +func (o *InvitationRequest) SetSingleUse(v bool) { + o.SingleUse = &v +} + +// GetFlow returns the Flow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *InvitationRequest) GetFlow() string { + if o == nil || IsNil(o.Flow.Get()) { + var ret string + return ret + } + return *o.Flow.Get() +} + +// GetFlowOk returns a tuple with the Flow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *InvitationRequest) GetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Flow.Get(), o.Flow.IsSet() +} + +// HasFlow returns a boolean if a field has been set. +func (o *InvitationRequest) HasFlow() bool { + if o != nil && o.Flow.IsSet() { + return true + } + + return false +} + +// SetFlow gets a reference to the given NullableString and assigns it to the Flow field. +func (o *InvitationRequest) SetFlow(v string) { + o.Flow.Set(&v) +} + +// SetFlowNil sets the value for Flow to be an explicit nil +func (o *InvitationRequest) SetFlowNil() { + o.Flow.Set(nil) +} + +// UnsetFlow ensures that no value is present for Flow, not even an explicit nil +func (o *InvitationRequest) UnsetFlow() { + o.Flow.Unset() +} + +func (o InvitationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.FixedData) { + toSerialize["fixed_data"] = o.FixedData + } + if !IsNil(o.SingleUse) { + toSerialize["single_use"] = o.SingleUse + } + if o.Flow.IsSet() { + toSerialize["flow"] = o.Flow.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitationRequest := _InvitationRequest{} + + err = json.Unmarshal(data, &varInvitationRequest) + + if err != nil { + return err + } + + *o = InvitationRequest(varInvitationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "expires") + delete(additionalProperties, "fixed_data") + delete(additionalProperties, "single_use") + delete(additionalProperties, "flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationRequest struct { + value *InvitationRequest + isSet bool +} + +func (v NullableInvitationRequest) Get() *InvitationRequest { + return v.value +} + +func (v *NullableInvitationRequest) Set(val *InvitationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationRequest(val *InvitationRequest) *NullableInvitationRequest { + return &NullableInvitationRequest{value: val, isSet: true} +} + +func (v NullableInvitationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invitation_send_email_request.go b/packages/client-go/model_invitation_send_email_request.go new file mode 100644 index 0000000000..12668efe73 --- /dev/null +++ b/packages/client-go/model_invitation_send_email_request.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InvitationSendEmailRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationSendEmailRequest{} + +// InvitationSendEmailRequest Serializer for sending invitation emails +type InvitationSendEmailRequest struct { + EmailAddresses []interface{} `json:"email_addresses"` + CcAddresses []interface{} `json:"cc_addresses,omitempty"` + BccAddresses []interface{} `json:"bcc_addresses,omitempty"` + Template *string `json:"template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationSendEmailRequest InvitationSendEmailRequest + +// NewInvitationSendEmailRequest instantiates a new InvitationSendEmailRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationSendEmailRequest(emailAddresses []interface{}) *InvitationSendEmailRequest { + this := InvitationSendEmailRequest{} + this.EmailAddresses = emailAddresses + var template string = "invitation" + this.Template = &template + return &this +} + +// NewInvitationSendEmailRequestWithDefaults instantiates a new InvitationSendEmailRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationSendEmailRequestWithDefaults() *InvitationSendEmailRequest { + this := InvitationSendEmailRequest{} + var template string = "invitation" + this.Template = &template + return &this +} + +// GetEmailAddresses returns the EmailAddresses field value +func (o *InvitationSendEmailRequest) GetEmailAddresses() []interface{} { + if o == nil { + var ret []interface{} + return ret + } + + return o.EmailAddresses +} + +// GetEmailAddressesOk returns a tuple with the EmailAddresses field value +// and a boolean to check if the value has been set. +func (o *InvitationSendEmailRequest) GetEmailAddressesOk() ([]interface{}, bool) { + if o == nil { + return nil, false + } + return o.EmailAddresses, true +} + +// SetEmailAddresses sets field value +func (o *InvitationSendEmailRequest) SetEmailAddresses(v []interface{}) { + o.EmailAddresses = v +} + +// GetCcAddresses returns the CcAddresses field value if set, zero value otherwise. +func (o *InvitationSendEmailRequest) GetCcAddresses() []interface{} { + if o == nil || IsNil(o.CcAddresses) { + var ret []interface{} + return ret + } + return o.CcAddresses +} + +// GetCcAddressesOk returns a tuple with the CcAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationSendEmailRequest) GetCcAddressesOk() ([]interface{}, bool) { + if o == nil || IsNil(o.CcAddresses) { + return nil, false + } + return o.CcAddresses, true +} + +// HasCcAddresses returns a boolean if a field has been set. +func (o *InvitationSendEmailRequest) HasCcAddresses() bool { + if o != nil && !IsNil(o.CcAddresses) { + return true + } + + return false +} + +// SetCcAddresses gets a reference to the given []interface{} and assigns it to the CcAddresses field. +func (o *InvitationSendEmailRequest) SetCcAddresses(v []interface{}) { + o.CcAddresses = v +} + +// GetBccAddresses returns the BccAddresses field value if set, zero value otherwise. +func (o *InvitationSendEmailRequest) GetBccAddresses() []interface{} { + if o == nil || IsNil(o.BccAddresses) { + var ret []interface{} + return ret + } + return o.BccAddresses +} + +// GetBccAddressesOk returns a tuple with the BccAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationSendEmailRequest) GetBccAddressesOk() ([]interface{}, bool) { + if o == nil || IsNil(o.BccAddresses) { + return nil, false + } + return o.BccAddresses, true +} + +// HasBccAddresses returns a boolean if a field has been set. +func (o *InvitationSendEmailRequest) HasBccAddresses() bool { + if o != nil && !IsNil(o.BccAddresses) { + return true + } + + return false +} + +// SetBccAddresses gets a reference to the given []interface{} and assigns it to the BccAddresses field. +func (o *InvitationSendEmailRequest) SetBccAddresses(v []interface{}) { + o.BccAddresses = v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *InvitationSendEmailRequest) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationSendEmailRequest) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *InvitationSendEmailRequest) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *InvitationSendEmailRequest) SetTemplate(v string) { + o.Template = &v +} + +func (o InvitationSendEmailRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationSendEmailRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["email_addresses"] = o.EmailAddresses + if !IsNil(o.CcAddresses) { + toSerialize["cc_addresses"] = o.CcAddresses + } + if !IsNil(o.BccAddresses) { + toSerialize["bcc_addresses"] = o.BccAddresses + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationSendEmailRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "email_addresses", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitationSendEmailRequest := _InvitationSendEmailRequest{} + + err = json.Unmarshal(data, &varInvitationSendEmailRequest) + + if err != nil { + return err + } + + *o = InvitationSendEmailRequest(varInvitationSendEmailRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "email_addresses") + delete(additionalProperties, "cc_addresses") + delete(additionalProperties, "bcc_addresses") + delete(additionalProperties, "template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationSendEmailRequest struct { + value *InvitationSendEmailRequest + isSet bool +} + +func (v NullableInvitationSendEmailRequest) Get() *InvitationSendEmailRequest { + return v.value +} + +func (v *NullableInvitationSendEmailRequest) Set(val *InvitationSendEmailRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationSendEmailRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationSendEmailRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationSendEmailRequest(val *InvitationSendEmailRequest) *NullableInvitationSendEmailRequest { + return &NullableInvitationSendEmailRequest{value: val, isSet: true} +} + +func (v NullableInvitationSendEmailRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationSendEmailRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invitation_stage.go b/packages/client-go/model_invitation_stage.go new file mode 100644 index 0000000000..7bcdfd1f71 --- /dev/null +++ b/packages/client-go/model_invitation_stage.go @@ -0,0 +1,383 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InvitationStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationStage{} + +// InvitationStage InvitationStage Serializer +type InvitationStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By default this Stage will cancel the Flow when no invitation is given. + ContinueFlowWithoutInvitation *bool `json:"continue_flow_without_invitation,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationStage InvitationStage + +// NewInvitationStage instantiates a new InvitationStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *InvitationStage { + this := InvitationStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewInvitationStageWithDefaults instantiates a new InvitationStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationStageWithDefaults() *InvitationStage { + this := InvitationStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *InvitationStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *InvitationStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *InvitationStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InvitationStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *InvitationStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *InvitationStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *InvitationStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *InvitationStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *InvitationStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *InvitationStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *InvitationStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *InvitationStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *InvitationStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *InvitationStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetContinueFlowWithoutInvitation returns the ContinueFlowWithoutInvitation field value if set, zero value otherwise. +func (o *InvitationStage) GetContinueFlowWithoutInvitation() bool { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + var ret bool + return ret + } + return *o.ContinueFlowWithoutInvitation +} + +// GetContinueFlowWithoutInvitationOk returns a tuple with the ContinueFlowWithoutInvitation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationStage) GetContinueFlowWithoutInvitationOk() (*bool, bool) { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + return nil, false + } + return o.ContinueFlowWithoutInvitation, true +} + +// HasContinueFlowWithoutInvitation returns a boolean if a field has been set. +func (o *InvitationStage) HasContinueFlowWithoutInvitation() bool { + if o != nil && !IsNil(o.ContinueFlowWithoutInvitation) { + return true + } + + return false +} + +// SetContinueFlowWithoutInvitation gets a reference to the given bool and assigns it to the ContinueFlowWithoutInvitation field. +func (o *InvitationStage) SetContinueFlowWithoutInvitation(v bool) { + o.ContinueFlowWithoutInvitation = &v +} + +func (o InvitationStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.ContinueFlowWithoutInvitation) { + toSerialize["continue_flow_without_invitation"] = o.ContinueFlowWithoutInvitation + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitationStage := _InvitationStage{} + + err = json.Unmarshal(data, &varInvitationStage) + + if err != nil { + return err + } + + *o = InvitationStage(varInvitationStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "continue_flow_without_invitation") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationStage struct { + value *InvitationStage + isSet bool +} + +func (v NullableInvitationStage) Get() *InvitationStage { + return v.value +} + +func (v *NullableInvitationStage) Set(val *InvitationStage) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationStage) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationStage(val *InvitationStage) *NullableInvitationStage { + return &NullableInvitationStage{value: val, isSet: true} +} + +func (v NullableInvitationStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_invitation_stage_request.go b/packages/client-go/model_invitation_stage_request.go new file mode 100644 index 0000000000..0cd60629aa --- /dev/null +++ b/packages/client-go/model_invitation_stage_request.go @@ -0,0 +1,205 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the InvitationStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InvitationStageRequest{} + +// InvitationStageRequest InvitationStage Serializer +type InvitationStageRequest struct { + Name string `json:"name"` + // If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By default this Stage will cancel the Flow when no invitation is given. + ContinueFlowWithoutInvitation *bool `json:"continue_flow_without_invitation,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _InvitationStageRequest InvitationStageRequest + +// NewInvitationStageRequest instantiates a new InvitationStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInvitationStageRequest(name string) *InvitationStageRequest { + this := InvitationStageRequest{} + this.Name = name + return &this +} + +// NewInvitationStageRequestWithDefaults instantiates a new InvitationStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInvitationStageRequestWithDefaults() *InvitationStageRequest { + this := InvitationStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *InvitationStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *InvitationStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *InvitationStageRequest) SetName(v string) { + o.Name = v +} + +// GetContinueFlowWithoutInvitation returns the ContinueFlowWithoutInvitation field value if set, zero value otherwise. +func (o *InvitationStageRequest) GetContinueFlowWithoutInvitation() bool { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + var ret bool + return ret + } + return *o.ContinueFlowWithoutInvitation +} + +// GetContinueFlowWithoutInvitationOk returns a tuple with the ContinueFlowWithoutInvitation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InvitationStageRequest) GetContinueFlowWithoutInvitationOk() (*bool, bool) { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + return nil, false + } + return o.ContinueFlowWithoutInvitation, true +} + +// HasContinueFlowWithoutInvitation returns a boolean if a field has been set. +func (o *InvitationStageRequest) HasContinueFlowWithoutInvitation() bool { + if o != nil && !IsNil(o.ContinueFlowWithoutInvitation) { + return true + } + + return false +} + +// SetContinueFlowWithoutInvitation gets a reference to the given bool and assigns it to the ContinueFlowWithoutInvitation field. +func (o *InvitationStageRequest) SetContinueFlowWithoutInvitation(v bool) { + o.ContinueFlowWithoutInvitation = &v +} + +func (o InvitationStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InvitationStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ContinueFlowWithoutInvitation) { + toSerialize["continue_flow_without_invitation"] = o.ContinueFlowWithoutInvitation + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *InvitationStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInvitationStageRequest := _InvitationStageRequest{} + + err = json.Unmarshal(data, &varInvitationStageRequest) + + if err != nil { + return err + } + + *o = InvitationStageRequest(varInvitationStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "continue_flow_without_invitation") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableInvitationStageRequest struct { + value *InvitationStageRequest + isSet bool +} + +func (v NullableInvitationStageRequest) Get() *InvitationStageRequest { + return v.value +} + +func (v *NullableInvitationStageRequest) Set(val *InvitationStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableInvitationStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableInvitationStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInvitationStageRequest(val *InvitationStageRequest) *NullableInvitationStageRequest { + return &NullableInvitationStageRequest{value: val, isSet: true} +} + +func (v NullableInvitationStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInvitationStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_issuer_mode_enum.go b/packages/client-go/model_issuer_mode_enum.go new file mode 100644 index 0000000000..b750b1699b --- /dev/null +++ b/packages/client-go/model_issuer_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// IssuerModeEnum the model 'IssuerModeEnum' +type IssuerModeEnum string + +// List of IssuerModeEnum +const ( + ISSUERMODEENUM_GLOBAL IssuerModeEnum = "global" + ISSUERMODEENUM_PER_PROVIDER IssuerModeEnum = "per_provider" +) + +// All allowed values of IssuerModeEnum enum +var AllowedIssuerModeEnumEnumValues = []IssuerModeEnum{ + "global", + "per_provider", +} + +func (v *IssuerModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := IssuerModeEnum(value) + for _, existing := range AllowedIssuerModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid IssuerModeEnum", value) +} + +// NewIssuerModeEnumFromValue returns a pointer to a valid IssuerModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewIssuerModeEnumFromValue(v string) (*IssuerModeEnum, error) { + ev := IssuerModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for IssuerModeEnum: valid values are %v", v, AllowedIssuerModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v IssuerModeEnum) IsValid() bool { + for _, existing := range AllowedIssuerModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to IssuerModeEnum value +func (v IssuerModeEnum) Ptr() *IssuerModeEnum { + return &v +} + +type NullableIssuerModeEnum struct { + value *IssuerModeEnum + isSet bool +} + +func (v NullableIssuerModeEnum) Get() *IssuerModeEnum { + return v.value +} + +func (v *NullableIssuerModeEnum) Set(val *IssuerModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableIssuerModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableIssuerModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableIssuerModeEnum(val *IssuerModeEnum) *NullableIssuerModeEnum { + return &NullableIssuerModeEnum{value: val, isSet: true} +} + +func (v NullableIssuerModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableIssuerModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kadmin_type_enum.go b/packages/client-go/model_kadmin_type_enum.go new file mode 100644 index 0000000000..d159298ec3 --- /dev/null +++ b/packages/client-go/model_kadmin_type_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// KadminTypeEnum the model 'KadminTypeEnum' +type KadminTypeEnum string + +// List of KadminTypeEnum +const ( + KADMINTYPEENUM_MIT KadminTypeEnum = "MIT" + KADMINTYPEENUM_HEIMDAL KadminTypeEnum = "Heimdal" +) + +// All allowed values of KadminTypeEnum enum +var AllowedKadminTypeEnumEnumValues = []KadminTypeEnum{ + "MIT", + "Heimdal", +} + +func (v *KadminTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := KadminTypeEnum(value) + for _, existing := range AllowedKadminTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid KadminTypeEnum", value) +} + +// NewKadminTypeEnumFromValue returns a pointer to a valid KadminTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewKadminTypeEnumFromValue(v string) (*KadminTypeEnum, error) { + ev := KadminTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for KadminTypeEnum: valid values are %v", v, AllowedKadminTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v KadminTypeEnum) IsValid() bool { + for _, existing := range AllowedKadminTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to KadminTypeEnum value +func (v KadminTypeEnum) Ptr() *KadminTypeEnum { + return &v +} + +type NullableKadminTypeEnum struct { + value *KadminTypeEnum + isSet bool +} + +func (v NullableKadminTypeEnum) Get() *KadminTypeEnum { + return v.value +} + +func (v *NullableKadminTypeEnum) Set(val *KadminTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableKadminTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableKadminTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKadminTypeEnum(val *KadminTypeEnum) *NullableKadminTypeEnum { + return &NullableKadminTypeEnum{value: val, isSet: true} +} + +func (v NullableKadminTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKadminTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kerberos_source.go b/packages/client-go/model_kerberos_source.go new file mode 100644 index 0000000000..442a930cd0 --- /dev/null +++ b/packages/client-go/model_kerberos_source.go @@ -0,0 +1,1317 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KerberosSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosSource{} + +// KerberosSource Kerberos Source Serializer +type KerberosSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl string `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Kerberos realm + Realm string `json:"realm"` + // Custom krb5.conf to use. Uses the system one by default + Krb5Conf *string `json:"krb5_conf,omitempty"` + // KAdmin server type + KadminType *KadminTypeEnum `json:"kadmin_type,omitempty"` + // Sync users from Kerberos into authentik + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to Kerberos + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + // Principal to authenticate to kadmin for sync. + SyncPrincipal *string `json:"sync_principal,omitempty"` + // Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + SyncCcache *string `json:"sync_ccache,omitempty"` + // Get cached source connectivity + Connectivity map[string]string `json:"connectivity"` + // Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + SpnegoServerName *string `json:"spnego_server_name,omitempty"` + // Credential cache to use for SPNEGO in form type:residual + SpnegoCcache *string `json:"spnego_ccache,omitempty"` + // If enabled, the authentik-stored password will be updated upon login with the Kerberos password backend + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _KerberosSource KerberosSource + +// NewKerberosSource instantiates a new KerberosSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKerberosSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl string, iconThemedUrls NullableThemedUrls, realm string, connectivity map[string]string) *KerberosSource { + this := KerberosSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.Realm = realm + this.Connectivity = connectivity + return &this +} + +// NewKerberosSourceWithDefaults instantiates a new KerberosSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKerberosSourceWithDefaults() *KerberosSource { + this := KerberosSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *KerberosSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *KerberosSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *KerberosSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KerberosSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *KerberosSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *KerberosSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *KerberosSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *KerberosSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *KerberosSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *KerberosSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *KerberosSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *KerberosSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *KerberosSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *KerberosSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *KerberosSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *KerberosSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *KerberosSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *KerberosSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *KerberosSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *KerberosSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *KerberosSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *KerberosSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *KerberosSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *KerberosSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *KerberosSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *KerberosSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *KerberosSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *KerberosSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *KerberosSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *KerberosSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *KerberosSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *KerberosSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *KerberosSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *KerberosSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *KerberosSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *KerberosSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *KerberosSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *KerberosSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *KerberosSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *KerberosSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *KerberosSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *KerberosSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *KerberosSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *KerberosSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *KerberosSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *KerberosSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *KerberosSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *KerberosSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +func (o *KerberosSource) GetIconUrl() string { + if o == nil { + var ret string + return ret + } + + return o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IconUrl, true +} + +// SetIconUrl sets field value +func (o *KerberosSource) SetIconUrl(v string) { + o.IconUrl = v +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *KerberosSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *KerberosSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *KerberosSource) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *KerberosSource) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *KerberosSource) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetRealm returns the Realm field value +func (o *KerberosSource) GetRealm() string { + if o == nil { + var ret string + return ret + } + + return o.Realm +} + +// GetRealmOk returns a tuple with the Realm field value +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetRealmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Realm, true +} + +// SetRealm sets field value +func (o *KerberosSource) SetRealm(v string) { + o.Realm = v +} + +// GetKrb5Conf returns the Krb5Conf field value if set, zero value otherwise. +func (o *KerberosSource) GetKrb5Conf() string { + if o == nil || IsNil(o.Krb5Conf) { + var ret string + return ret + } + return *o.Krb5Conf +} + +// GetKrb5ConfOk returns a tuple with the Krb5Conf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetKrb5ConfOk() (*string, bool) { + if o == nil || IsNil(o.Krb5Conf) { + return nil, false + } + return o.Krb5Conf, true +} + +// HasKrb5Conf returns a boolean if a field has been set. +func (o *KerberosSource) HasKrb5Conf() bool { + if o != nil && !IsNil(o.Krb5Conf) { + return true + } + + return false +} + +// SetKrb5Conf gets a reference to the given string and assigns it to the Krb5Conf field. +func (o *KerberosSource) SetKrb5Conf(v string) { + o.Krb5Conf = &v +} + +// GetKadminType returns the KadminType field value if set, zero value otherwise. +func (o *KerberosSource) GetKadminType() KadminTypeEnum { + if o == nil || IsNil(o.KadminType) { + var ret KadminTypeEnum + return ret + } + return *o.KadminType +} + +// GetKadminTypeOk returns a tuple with the KadminType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetKadminTypeOk() (*KadminTypeEnum, bool) { + if o == nil || IsNil(o.KadminType) { + return nil, false + } + return o.KadminType, true +} + +// HasKadminType returns a boolean if a field has been set. +func (o *KerberosSource) HasKadminType() bool { + if o != nil && !IsNil(o.KadminType) { + return true + } + + return false +} + +// SetKadminType gets a reference to the given KadminTypeEnum and assigns it to the KadminType field. +func (o *KerberosSource) SetKadminType(v KadminTypeEnum) { + o.KadminType = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *KerberosSource) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *KerberosSource) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *KerberosSource) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *KerberosSource) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *KerberosSource) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *KerberosSource) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncPrincipal returns the SyncPrincipal field value if set, zero value otherwise. +func (o *KerberosSource) GetSyncPrincipal() string { + if o == nil || IsNil(o.SyncPrincipal) { + var ret string + return ret + } + return *o.SyncPrincipal +} + +// GetSyncPrincipalOk returns a tuple with the SyncPrincipal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSyncPrincipalOk() (*string, bool) { + if o == nil || IsNil(o.SyncPrincipal) { + return nil, false + } + return o.SyncPrincipal, true +} + +// HasSyncPrincipal returns a boolean if a field has been set. +func (o *KerberosSource) HasSyncPrincipal() bool { + if o != nil && !IsNil(o.SyncPrincipal) { + return true + } + + return false +} + +// SetSyncPrincipal gets a reference to the given string and assigns it to the SyncPrincipal field. +func (o *KerberosSource) SetSyncPrincipal(v string) { + o.SyncPrincipal = &v +} + +// GetSyncCcache returns the SyncCcache field value if set, zero value otherwise. +func (o *KerberosSource) GetSyncCcache() string { + if o == nil || IsNil(o.SyncCcache) { + var ret string + return ret + } + return *o.SyncCcache +} + +// GetSyncCcacheOk returns a tuple with the SyncCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSyncCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SyncCcache) { + return nil, false + } + return o.SyncCcache, true +} + +// HasSyncCcache returns a boolean if a field has been set. +func (o *KerberosSource) HasSyncCcache() bool { + if o != nil && !IsNil(o.SyncCcache) { + return true + } + + return false +} + +// SetSyncCcache gets a reference to the given string and assigns it to the SyncCcache field. +func (o *KerberosSource) SetSyncCcache(v string) { + o.SyncCcache = &v +} + +// GetConnectivity returns the Connectivity field value +// If the value is explicit nil, the zero value for map[string]string will be returned +func (o *KerberosSource) GetConnectivity() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Connectivity +} + +// GetConnectivityOk returns a tuple with the Connectivity field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSource) GetConnectivityOk() (*map[string]string, bool) { + if o == nil || IsNil(o.Connectivity) { + return nil, false + } + return &o.Connectivity, true +} + +// SetConnectivity sets field value +func (o *KerberosSource) SetConnectivity(v map[string]string) { + o.Connectivity = v +} + +// GetSpnegoServerName returns the SpnegoServerName field value if set, zero value otherwise. +func (o *KerberosSource) GetSpnegoServerName() string { + if o == nil || IsNil(o.SpnegoServerName) { + var ret string + return ret + } + return *o.SpnegoServerName +} + +// GetSpnegoServerNameOk returns a tuple with the SpnegoServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSpnegoServerNameOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoServerName) { + return nil, false + } + return o.SpnegoServerName, true +} + +// HasSpnegoServerName returns a boolean if a field has been set. +func (o *KerberosSource) HasSpnegoServerName() bool { + if o != nil && !IsNil(o.SpnegoServerName) { + return true + } + + return false +} + +// SetSpnegoServerName gets a reference to the given string and assigns it to the SpnegoServerName field. +func (o *KerberosSource) SetSpnegoServerName(v string) { + o.SpnegoServerName = &v +} + +// GetSpnegoCcache returns the SpnegoCcache field value if set, zero value otherwise. +func (o *KerberosSource) GetSpnegoCcache() string { + if o == nil || IsNil(o.SpnegoCcache) { + var ret string + return ret + } + return *o.SpnegoCcache +} + +// GetSpnegoCcacheOk returns a tuple with the SpnegoCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSpnegoCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoCcache) { + return nil, false + } + return o.SpnegoCcache, true +} + +// HasSpnegoCcache returns a boolean if a field has been set. +func (o *KerberosSource) HasSpnegoCcache() bool { + if o != nil && !IsNil(o.SpnegoCcache) { + return true + } + + return false +} + +// SetSpnegoCcache gets a reference to the given string and assigns it to the SpnegoCcache field. +func (o *KerberosSource) SetSpnegoCcache(v string) { + o.SpnegoCcache = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *KerberosSource) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *KerberosSource) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *KerberosSource) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *KerberosSource) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSource) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *KerberosSource) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *KerberosSource) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o KerberosSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["realm"] = o.Realm + if !IsNil(o.Krb5Conf) { + toSerialize["krb5_conf"] = o.Krb5Conf + } + if !IsNil(o.KadminType) { + toSerialize["kadmin_type"] = o.KadminType + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncPrincipal) { + toSerialize["sync_principal"] = o.SyncPrincipal + } + if !IsNil(o.SyncCcache) { + toSerialize["sync_ccache"] = o.SyncCcache + } + if o.Connectivity != nil { + toSerialize["connectivity"] = o.Connectivity + } + if !IsNil(o.SpnegoServerName) { + toSerialize["spnego_server_name"] = o.SpnegoServerName + } + if !IsNil(o.SpnegoCcache) { + toSerialize["spnego_ccache"] = o.SpnegoCcache + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KerberosSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "realm", + "connectivity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKerberosSource := _KerberosSource{} + + err = json.Unmarshal(data, &varKerberosSource) + + if err != nil { + return err + } + + *o = KerberosSource(varKerberosSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "realm") + delete(additionalProperties, "krb5_conf") + delete(additionalProperties, "kadmin_type") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_principal") + delete(additionalProperties, "sync_ccache") + delete(additionalProperties, "connectivity") + delete(additionalProperties, "spnego_server_name") + delete(additionalProperties, "spnego_ccache") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKerberosSource struct { + value *KerberosSource + isSet bool +} + +func (v NullableKerberosSource) Get() *KerberosSource { + return v.value +} + +func (v *NullableKerberosSource) Set(val *KerberosSource) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosSource) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosSource(val *KerberosSource) *NullableKerberosSource { + return &NullableKerberosSource{value: val, isSet: true} +} + +func (v NullableKerberosSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kerberos_source_property_mapping.go b/packages/client-go/model_kerberos_source_property_mapping.go new file mode 100644 index 0000000000..f68eb7ff4c --- /dev/null +++ b/packages/client-go/model_kerberos_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KerberosSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosSourcePropertyMapping{} + +// KerberosSourcePropertyMapping Kerberos PropertyMapping Serializer +type KerberosSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _KerberosSourcePropertyMapping KerberosSourcePropertyMapping + +// NewKerberosSourcePropertyMapping instantiates a new KerberosSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKerberosSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *KerberosSourcePropertyMapping { + this := KerberosSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewKerberosSourcePropertyMappingWithDefaults instantiates a new KerberosSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKerberosSourcePropertyMappingWithDefaults() *KerberosSourcePropertyMapping { + this := KerberosSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *KerberosSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *KerberosSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *KerberosSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *KerberosSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *KerberosSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *KerberosSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *KerberosSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KerberosSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *KerberosSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *KerberosSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *KerberosSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *KerberosSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *KerberosSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *KerberosSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *KerberosSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *KerberosSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *KerberosSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *KerberosSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o KerberosSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KerberosSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKerberosSourcePropertyMapping := _KerberosSourcePropertyMapping{} + + err = json.Unmarshal(data, &varKerberosSourcePropertyMapping) + + if err != nil { + return err + } + + *o = KerberosSourcePropertyMapping(varKerberosSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKerberosSourcePropertyMapping struct { + value *KerberosSourcePropertyMapping + isSet bool +} + +func (v NullableKerberosSourcePropertyMapping) Get() *KerberosSourcePropertyMapping { + return v.value +} + +func (v *NullableKerberosSourcePropertyMapping) Set(val *KerberosSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosSourcePropertyMapping(val *KerberosSourcePropertyMapping) *NullableKerberosSourcePropertyMapping { + return &NullableKerberosSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableKerberosSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kerberos_source_property_mapping_request.go b/packages/client-go/model_kerberos_source_property_mapping_request.go new file mode 100644 index 0000000000..cf1b658e4b --- /dev/null +++ b/packages/client-go/model_kerberos_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KerberosSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosSourcePropertyMappingRequest{} + +// KerberosSourcePropertyMappingRequest Kerberos PropertyMapping Serializer +type KerberosSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _KerberosSourcePropertyMappingRequest KerberosSourcePropertyMappingRequest + +// NewKerberosSourcePropertyMappingRequest instantiates a new KerberosSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKerberosSourcePropertyMappingRequest(name string, expression string) *KerberosSourcePropertyMappingRequest { + this := KerberosSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewKerberosSourcePropertyMappingRequestWithDefaults instantiates a new KerberosSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKerberosSourcePropertyMappingRequestWithDefaults() *KerberosSourcePropertyMappingRequest { + this := KerberosSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *KerberosSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *KerberosSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *KerberosSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *KerberosSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *KerberosSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KerberosSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *KerberosSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *KerberosSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *KerberosSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o KerberosSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KerberosSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKerberosSourcePropertyMappingRequest := _KerberosSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varKerberosSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = KerberosSourcePropertyMappingRequest(varKerberosSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKerberosSourcePropertyMappingRequest struct { + value *KerberosSourcePropertyMappingRequest + isSet bool +} + +func (v NullableKerberosSourcePropertyMappingRequest) Get() *KerberosSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableKerberosSourcePropertyMappingRequest) Set(val *KerberosSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosSourcePropertyMappingRequest(val *KerberosSourcePropertyMappingRequest) *NullableKerberosSourcePropertyMappingRequest { + return &NullableKerberosSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableKerberosSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kerberos_source_request.go b/packages/client-go/model_kerberos_source_request.go new file mode 100644 index 0000000000..ca85f4410f --- /dev/null +++ b/packages/client-go/model_kerberos_source_request.go @@ -0,0 +1,1156 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KerberosSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KerberosSourceRequest{} + +// KerberosSourceRequest Kerberos Source Serializer +type KerberosSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Kerberos realm + Realm string `json:"realm"` + // Custom krb5.conf to use. Uses the system one by default + Krb5Conf *string `json:"krb5_conf,omitempty"` + // KAdmin server type + KadminType *KadminTypeEnum `json:"kadmin_type,omitempty"` + // Sync users from Kerberos into authentik + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to Kerberos + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + // Principal to authenticate to kadmin for sync. + SyncPrincipal *string `json:"sync_principal,omitempty"` + // Password to authenticate to kadmin for sync + SyncPassword *string `json:"sync_password,omitempty"` + // Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form TYPE:residual + SyncKeytab *string `json:"sync_keytab,omitempty"` + // Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + SyncCcache *string `json:"sync_ccache,omitempty"` + // Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + SpnegoServerName *string `json:"spnego_server_name,omitempty"` + // SPNEGO keytab base64-encoded or path to keytab in the form FILE:path + SpnegoKeytab *string `json:"spnego_keytab,omitempty"` + // Credential cache to use for SPNEGO in form type:residual + SpnegoCcache *string `json:"spnego_ccache,omitempty"` + // If enabled, the authentik-stored password will be updated upon login with the Kerberos password backend + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _KerberosSourceRequest KerberosSourceRequest + +// NewKerberosSourceRequest instantiates a new KerberosSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKerberosSourceRequest(name string, slug string, realm string) *KerberosSourceRequest { + this := KerberosSourceRequest{} + this.Name = name + this.Slug = slug + this.Realm = realm + return &this +} + +// NewKerberosSourceRequestWithDefaults instantiates a new KerberosSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKerberosSourceRequestWithDefaults() *KerberosSourceRequest { + this := KerberosSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *KerberosSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KerberosSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *KerberosSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *KerberosSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *KerberosSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *KerberosSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *KerberosSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *KerberosSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *KerberosSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *KerberosSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *KerberosSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *KerberosSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *KerberosSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *KerberosSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *KerberosSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *KerberosSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *KerberosSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *KerberosSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *KerberosSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *KerberosSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *KerberosSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetRealm returns the Realm field value +func (o *KerberosSourceRequest) GetRealm() string { + if o == nil { + var ret string + return ret + } + + return o.Realm +} + +// GetRealmOk returns a tuple with the Realm field value +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetRealmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Realm, true +} + +// SetRealm sets field value +func (o *KerberosSourceRequest) SetRealm(v string) { + o.Realm = v +} + +// GetKrb5Conf returns the Krb5Conf field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetKrb5Conf() string { + if o == nil || IsNil(o.Krb5Conf) { + var ret string + return ret + } + return *o.Krb5Conf +} + +// GetKrb5ConfOk returns a tuple with the Krb5Conf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetKrb5ConfOk() (*string, bool) { + if o == nil || IsNil(o.Krb5Conf) { + return nil, false + } + return o.Krb5Conf, true +} + +// HasKrb5Conf returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasKrb5Conf() bool { + if o != nil && !IsNil(o.Krb5Conf) { + return true + } + + return false +} + +// SetKrb5Conf gets a reference to the given string and assigns it to the Krb5Conf field. +func (o *KerberosSourceRequest) SetKrb5Conf(v string) { + o.Krb5Conf = &v +} + +// GetKadminType returns the KadminType field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetKadminType() KadminTypeEnum { + if o == nil || IsNil(o.KadminType) { + var ret KadminTypeEnum + return ret + } + return *o.KadminType +} + +// GetKadminTypeOk returns a tuple with the KadminType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetKadminTypeOk() (*KadminTypeEnum, bool) { + if o == nil || IsNil(o.KadminType) { + return nil, false + } + return o.KadminType, true +} + +// HasKadminType returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasKadminType() bool { + if o != nil && !IsNil(o.KadminType) { + return true + } + + return false +} + +// SetKadminType gets a reference to the given KadminTypeEnum and assigns it to the KadminType field. +func (o *KerberosSourceRequest) SetKadminType(v KadminTypeEnum) { + o.KadminType = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *KerberosSourceRequest) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *KerberosSourceRequest) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncPrincipal returns the SyncPrincipal field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncPrincipal() string { + if o == nil || IsNil(o.SyncPrincipal) { + var ret string + return ret + } + return *o.SyncPrincipal +} + +// GetSyncPrincipalOk returns a tuple with the SyncPrincipal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncPrincipalOk() (*string, bool) { + if o == nil || IsNil(o.SyncPrincipal) { + return nil, false + } + return o.SyncPrincipal, true +} + +// HasSyncPrincipal returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncPrincipal() bool { + if o != nil && !IsNil(o.SyncPrincipal) { + return true + } + + return false +} + +// SetSyncPrincipal gets a reference to the given string and assigns it to the SyncPrincipal field. +func (o *KerberosSourceRequest) SetSyncPrincipal(v string) { + o.SyncPrincipal = &v +} + +// GetSyncPassword returns the SyncPassword field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncPassword() string { + if o == nil || IsNil(o.SyncPassword) { + var ret string + return ret + } + return *o.SyncPassword +} + +// GetSyncPasswordOk returns a tuple with the SyncPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncPasswordOk() (*string, bool) { + if o == nil || IsNil(o.SyncPassword) { + return nil, false + } + return o.SyncPassword, true +} + +// HasSyncPassword returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncPassword() bool { + if o != nil && !IsNil(o.SyncPassword) { + return true + } + + return false +} + +// SetSyncPassword gets a reference to the given string and assigns it to the SyncPassword field. +func (o *KerberosSourceRequest) SetSyncPassword(v string) { + o.SyncPassword = &v +} + +// GetSyncKeytab returns the SyncKeytab field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncKeytab() string { + if o == nil || IsNil(o.SyncKeytab) { + var ret string + return ret + } + return *o.SyncKeytab +} + +// GetSyncKeytabOk returns a tuple with the SyncKeytab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncKeytabOk() (*string, bool) { + if o == nil || IsNil(o.SyncKeytab) { + return nil, false + } + return o.SyncKeytab, true +} + +// HasSyncKeytab returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncKeytab() bool { + if o != nil && !IsNil(o.SyncKeytab) { + return true + } + + return false +} + +// SetSyncKeytab gets a reference to the given string and assigns it to the SyncKeytab field. +func (o *KerberosSourceRequest) SetSyncKeytab(v string) { + o.SyncKeytab = &v +} + +// GetSyncCcache returns the SyncCcache field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncCcache() string { + if o == nil || IsNil(o.SyncCcache) { + var ret string + return ret + } + return *o.SyncCcache +} + +// GetSyncCcacheOk returns a tuple with the SyncCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SyncCcache) { + return nil, false + } + return o.SyncCcache, true +} + +// HasSyncCcache returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncCcache() bool { + if o != nil && !IsNil(o.SyncCcache) { + return true + } + + return false +} + +// SetSyncCcache gets a reference to the given string and assigns it to the SyncCcache field. +func (o *KerberosSourceRequest) SetSyncCcache(v string) { + o.SyncCcache = &v +} + +// GetSpnegoServerName returns the SpnegoServerName field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSpnegoServerName() string { + if o == nil || IsNil(o.SpnegoServerName) { + var ret string + return ret + } + return *o.SpnegoServerName +} + +// GetSpnegoServerNameOk returns a tuple with the SpnegoServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSpnegoServerNameOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoServerName) { + return nil, false + } + return o.SpnegoServerName, true +} + +// HasSpnegoServerName returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSpnegoServerName() bool { + if o != nil && !IsNil(o.SpnegoServerName) { + return true + } + + return false +} + +// SetSpnegoServerName gets a reference to the given string and assigns it to the SpnegoServerName field. +func (o *KerberosSourceRequest) SetSpnegoServerName(v string) { + o.SpnegoServerName = &v +} + +// GetSpnegoKeytab returns the SpnegoKeytab field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSpnegoKeytab() string { + if o == nil || IsNil(o.SpnegoKeytab) { + var ret string + return ret + } + return *o.SpnegoKeytab +} + +// GetSpnegoKeytabOk returns a tuple with the SpnegoKeytab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSpnegoKeytabOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoKeytab) { + return nil, false + } + return o.SpnegoKeytab, true +} + +// HasSpnegoKeytab returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSpnegoKeytab() bool { + if o != nil && !IsNil(o.SpnegoKeytab) { + return true + } + + return false +} + +// SetSpnegoKeytab gets a reference to the given string and assigns it to the SpnegoKeytab field. +func (o *KerberosSourceRequest) SetSpnegoKeytab(v string) { + o.SpnegoKeytab = &v +} + +// GetSpnegoCcache returns the SpnegoCcache field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSpnegoCcache() string { + if o == nil || IsNil(o.SpnegoCcache) { + var ret string + return ret + } + return *o.SpnegoCcache +} + +// GetSpnegoCcacheOk returns a tuple with the SpnegoCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSpnegoCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoCcache) { + return nil, false + } + return o.SpnegoCcache, true +} + +// HasSpnegoCcache returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSpnegoCcache() bool { + if o != nil && !IsNil(o.SpnegoCcache) { + return true + } + + return false +} + +// SetSpnegoCcache gets a reference to the given string and assigns it to the SpnegoCcache field. +func (o *KerberosSourceRequest) SetSpnegoCcache(v string) { + o.SpnegoCcache = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *KerberosSourceRequest) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *KerberosSourceRequest) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KerberosSourceRequest) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *KerberosSourceRequest) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *KerberosSourceRequest) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o KerberosSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KerberosSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["realm"] = o.Realm + if !IsNil(o.Krb5Conf) { + toSerialize["krb5_conf"] = o.Krb5Conf + } + if !IsNil(o.KadminType) { + toSerialize["kadmin_type"] = o.KadminType + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncPrincipal) { + toSerialize["sync_principal"] = o.SyncPrincipal + } + if !IsNil(o.SyncPassword) { + toSerialize["sync_password"] = o.SyncPassword + } + if !IsNil(o.SyncKeytab) { + toSerialize["sync_keytab"] = o.SyncKeytab + } + if !IsNil(o.SyncCcache) { + toSerialize["sync_ccache"] = o.SyncCcache + } + if !IsNil(o.SpnegoServerName) { + toSerialize["spnego_server_name"] = o.SpnegoServerName + } + if !IsNil(o.SpnegoKeytab) { + toSerialize["spnego_keytab"] = o.SpnegoKeytab + } + if !IsNil(o.SpnegoCcache) { + toSerialize["spnego_ccache"] = o.SpnegoCcache + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KerberosSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "realm", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKerberosSourceRequest := _KerberosSourceRequest{} + + err = json.Unmarshal(data, &varKerberosSourceRequest) + + if err != nil { + return err + } + + *o = KerberosSourceRequest(varKerberosSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "realm") + delete(additionalProperties, "krb5_conf") + delete(additionalProperties, "kadmin_type") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_principal") + delete(additionalProperties, "sync_password") + delete(additionalProperties, "sync_keytab") + delete(additionalProperties, "sync_ccache") + delete(additionalProperties, "spnego_server_name") + delete(additionalProperties, "spnego_keytab") + delete(additionalProperties, "spnego_ccache") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKerberosSourceRequest struct { + value *KerberosSourceRequest + isSet bool +} + +func (v NullableKerberosSourceRequest) Get() *KerberosSourceRequest { + return v.value +} + +func (v *NullableKerberosSourceRequest) Set(val *KerberosSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableKerberosSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableKerberosSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKerberosSourceRequest(val *KerberosSourceRequest) *NullableKerberosSourceRequest { + return &NullableKerberosSourceRequest{value: val, isSet: true} +} + +func (v NullableKerberosSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKerberosSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_key_type_enum.go b/packages/client-go/model_key_type_enum.go new file mode 100644 index 0000000000..aa13f65ca4 --- /dev/null +++ b/packages/client-go/model_key_type_enum.go @@ -0,0 +1,117 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// KeyTypeEnum the model 'KeyTypeEnum' +type KeyTypeEnum string + +// List of KeyTypeEnum +const ( + KEYTYPEENUM_RSA KeyTypeEnum = "rsa" + KEYTYPEENUM_EC KeyTypeEnum = "ec" + KEYTYPEENUM_DSA KeyTypeEnum = "dsa" + KEYTYPEENUM_ED25519 KeyTypeEnum = "ed25519" + KEYTYPEENUM_ED448 KeyTypeEnum = "ed448" +) + +// All allowed values of KeyTypeEnum enum +var AllowedKeyTypeEnumEnumValues = []KeyTypeEnum{ + "rsa", + "ec", + "dsa", + "ed25519", + "ed448", +} + +func (v *KeyTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := KeyTypeEnum(value) + for _, existing := range AllowedKeyTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid KeyTypeEnum", value) +} + +// NewKeyTypeEnumFromValue returns a pointer to a valid KeyTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewKeyTypeEnumFromValue(v string) (*KeyTypeEnum, error) { + ev := KeyTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for KeyTypeEnum: valid values are %v", v, AllowedKeyTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v KeyTypeEnum) IsValid() bool { + for _, existing := range AllowedKeyTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to KeyTypeEnum value +func (v KeyTypeEnum) Ptr() *KeyTypeEnum { + return &v +} + +type NullableKeyTypeEnum struct { + value *KeyTypeEnum + isSet bool +} + +func (v NullableKeyTypeEnum) Get() *KeyTypeEnum { + return v.value +} + +func (v *NullableKeyTypeEnum) Set(val *KeyTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableKeyTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyTypeEnum(val *KeyTypeEnum) *NullableKeyTypeEnum { + return &NullableKeyTypeEnum{value: val, isSet: true} +} + +func (v NullableKeyTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kubernetes_service_connection.go b/packages/client-go/model_kubernetes_service_connection.go new file mode 100644 index 0000000000..958094129f --- /dev/null +++ b/packages/client-go/model_kubernetes_service_connection.go @@ -0,0 +1,429 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KubernetesServiceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KubernetesServiceConnection{} + +// KubernetesServiceConnection KubernetesServiceConnection Serializer +type KubernetesServiceConnection struct { + Pk string `json:"pk"` + Name string `json:"name"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Paste your kubeconfig here. authentik will automatically use the currently selected context. + Kubeconfig map[string]interface{} `json:"kubeconfig,omitempty"` + // Verify SSL Certificates of the Kubernetes API endpoint + VerifySsl *bool `json:"verify_ssl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _KubernetesServiceConnection KubernetesServiceConnection + +// NewKubernetesServiceConnection instantiates a new KubernetesServiceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesServiceConnection(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string) *KubernetesServiceConnection { + this := KubernetesServiceConnection{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewKubernetesServiceConnectionWithDefaults instantiates a new KubernetesServiceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesServiceConnectionWithDefaults() *KubernetesServiceConnection { + this := KubernetesServiceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *KubernetesServiceConnection) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *KubernetesServiceConnection) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *KubernetesServiceConnection) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KubernetesServiceConnection) SetName(v string) { + o.Name = v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *KubernetesServiceConnection) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *KubernetesServiceConnection) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *KubernetesServiceConnection) SetLocal(v bool) { + o.Local = &v +} + +// GetComponent returns the Component field value +func (o *KubernetesServiceConnection) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *KubernetesServiceConnection) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *KubernetesServiceConnection) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *KubernetesServiceConnection) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *KubernetesServiceConnection) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *KubernetesServiceConnection) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *KubernetesServiceConnection) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *KubernetesServiceConnection) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. +func (o *KubernetesServiceConnection) GetKubeconfig() map[string]interface{} { + if o == nil || IsNil(o.Kubeconfig) { + var ret map[string]interface{} + return ret + } + return o.Kubeconfig +} + +// GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetKubeconfigOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Kubeconfig) { + return map[string]interface{}{}, false + } + return o.Kubeconfig, true +} + +// HasKubeconfig returns a boolean if a field has been set. +func (o *KubernetesServiceConnection) HasKubeconfig() bool { + if o != nil && !IsNil(o.Kubeconfig) { + return true + } + + return false +} + +// SetKubeconfig gets a reference to the given map[string]interface{} and assigns it to the Kubeconfig field. +func (o *KubernetesServiceConnection) SetKubeconfig(v map[string]interface{}) { + o.Kubeconfig = v +} + +// GetVerifySsl returns the VerifySsl field value if set, zero value otherwise. +func (o *KubernetesServiceConnection) GetVerifySsl() bool { + if o == nil || IsNil(o.VerifySsl) { + var ret bool + return ret + } + return *o.VerifySsl +} + +// GetVerifySslOk returns a tuple with the VerifySsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnection) GetVerifySslOk() (*bool, bool) { + if o == nil || IsNil(o.VerifySsl) { + return nil, false + } + return o.VerifySsl, true +} + +// HasVerifySsl returns a boolean if a field has been set. +func (o *KubernetesServiceConnection) HasVerifySsl() bool { + if o != nil && !IsNil(o.VerifySsl) { + return true + } + + return false +} + +// SetVerifySsl gets a reference to the given bool and assigns it to the VerifySsl field. +func (o *KubernetesServiceConnection) SetVerifySsl(v bool) { + o.VerifySsl = &v +} + +func (o KubernetesServiceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KubernetesServiceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.Kubeconfig) { + toSerialize["kubeconfig"] = o.Kubeconfig + } + if !IsNil(o.VerifySsl) { + toSerialize["verify_ssl"] = o.VerifySsl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KubernetesServiceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKubernetesServiceConnection := _KubernetesServiceConnection{} + + err = json.Unmarshal(data, &varKubernetesServiceConnection) + + if err != nil { + return err + } + + *o = KubernetesServiceConnection(varKubernetesServiceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "kubeconfig") + delete(additionalProperties, "verify_ssl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKubernetesServiceConnection struct { + value *KubernetesServiceConnection + isSet bool +} + +func (v NullableKubernetesServiceConnection) Get() *KubernetesServiceConnection { + return v.value +} + +func (v *NullableKubernetesServiceConnection) Set(val *KubernetesServiceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesServiceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesServiceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesServiceConnection(val *KubernetesServiceConnection) *NullableKubernetesServiceConnection { + return &NullableKubernetesServiceConnection{value: val, isSet: true} +} + +func (v NullableKubernetesServiceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesServiceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_kubernetes_service_connection_request.go b/packages/client-go/model_kubernetes_service_connection_request.go new file mode 100644 index 0000000000..0de4328ad5 --- /dev/null +++ b/packages/client-go/model_kubernetes_service_connection_request.go @@ -0,0 +1,281 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the KubernetesServiceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KubernetesServiceConnectionRequest{} + +// KubernetesServiceConnectionRequest KubernetesServiceConnection Serializer +type KubernetesServiceConnectionRequest struct { + Name string `json:"name"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + // Paste your kubeconfig here. authentik will automatically use the currently selected context. + Kubeconfig map[string]interface{} `json:"kubeconfig,omitempty"` + // Verify SSL Certificates of the Kubernetes API endpoint + VerifySsl *bool `json:"verify_ssl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _KubernetesServiceConnectionRequest KubernetesServiceConnectionRequest + +// NewKubernetesServiceConnectionRequest instantiates a new KubernetesServiceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKubernetesServiceConnectionRequest(name string) *KubernetesServiceConnectionRequest { + this := KubernetesServiceConnectionRequest{} + this.Name = name + return &this +} + +// NewKubernetesServiceConnectionRequestWithDefaults instantiates a new KubernetesServiceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKubernetesServiceConnectionRequestWithDefaults() *KubernetesServiceConnectionRequest { + this := KubernetesServiceConnectionRequest{} + return &this +} + +// GetName returns the Name field value +func (o *KubernetesServiceConnectionRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnectionRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *KubernetesServiceConnectionRequest) SetName(v string) { + o.Name = v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *KubernetesServiceConnectionRequest) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnectionRequest) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *KubernetesServiceConnectionRequest) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *KubernetesServiceConnectionRequest) SetLocal(v bool) { + o.Local = &v +} + +// GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. +func (o *KubernetesServiceConnectionRequest) GetKubeconfig() map[string]interface{} { + if o == nil || IsNil(o.Kubeconfig) { + var ret map[string]interface{} + return ret + } + return o.Kubeconfig +} + +// GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnectionRequest) GetKubeconfigOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Kubeconfig) { + return map[string]interface{}{}, false + } + return o.Kubeconfig, true +} + +// HasKubeconfig returns a boolean if a field has been set. +func (o *KubernetesServiceConnectionRequest) HasKubeconfig() bool { + if o != nil && !IsNil(o.Kubeconfig) { + return true + } + + return false +} + +// SetKubeconfig gets a reference to the given map[string]interface{} and assigns it to the Kubeconfig field. +func (o *KubernetesServiceConnectionRequest) SetKubeconfig(v map[string]interface{}) { + o.Kubeconfig = v +} + +// GetVerifySsl returns the VerifySsl field value if set, zero value otherwise. +func (o *KubernetesServiceConnectionRequest) GetVerifySsl() bool { + if o == nil || IsNil(o.VerifySsl) { + var ret bool + return ret + } + return *o.VerifySsl +} + +// GetVerifySslOk returns a tuple with the VerifySsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *KubernetesServiceConnectionRequest) GetVerifySslOk() (*bool, bool) { + if o == nil || IsNil(o.VerifySsl) { + return nil, false + } + return o.VerifySsl, true +} + +// HasVerifySsl returns a boolean if a field has been set. +func (o *KubernetesServiceConnectionRequest) HasVerifySsl() bool { + if o != nil && !IsNil(o.VerifySsl) { + return true + } + + return false +} + +// SetVerifySsl gets a reference to the given bool and assigns it to the VerifySsl field. +func (o *KubernetesServiceConnectionRequest) SetVerifySsl(v bool) { + o.VerifySsl = &v +} + +func (o KubernetesServiceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KubernetesServiceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + if !IsNil(o.Kubeconfig) { + toSerialize["kubeconfig"] = o.Kubeconfig + } + if !IsNil(o.VerifySsl) { + toSerialize["verify_ssl"] = o.VerifySsl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *KubernetesServiceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKubernetesServiceConnectionRequest := _KubernetesServiceConnectionRequest{} + + err = json.Unmarshal(data, &varKubernetesServiceConnectionRequest) + + if err != nil { + return err + } + + *o = KubernetesServiceConnectionRequest(varKubernetesServiceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "kubeconfig") + delete(additionalProperties, "verify_ssl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableKubernetesServiceConnectionRequest struct { + value *KubernetesServiceConnectionRequest + isSet bool +} + +func (v NullableKubernetesServiceConnectionRequest) Get() *KubernetesServiceConnectionRequest { + return v.value +} + +func (v *NullableKubernetesServiceConnectionRequest) Set(val *KubernetesServiceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableKubernetesServiceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableKubernetesServiceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKubernetesServiceConnectionRequest(val *KubernetesServiceConnectionRequest) *NullableKubernetesServiceConnectionRequest { + return &NullableKubernetesServiceConnectionRequest{value: val, isSet: true} +} + +func (v NullableKubernetesServiceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKubernetesServiceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_last_task_status_enum.go b/packages/client-go/model_last_task_status_enum.go new file mode 100644 index 0000000000..b5ab7b059e --- /dev/null +++ b/packages/client-go/model_last_task_status_enum.go @@ -0,0 +1,127 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LastTaskStatusEnum the model 'LastTaskStatusEnum' +type LastTaskStatusEnum string + +// List of LastTaskStatusEnum +const ( + LASTTASKSTATUSENUM_QUEUED LastTaskStatusEnum = "queued" + LASTTASKSTATUSENUM_CONSUMED LastTaskStatusEnum = "consumed" + LASTTASKSTATUSENUM_PREPROCESS LastTaskStatusEnum = "preprocess" + LASTTASKSTATUSENUM_RUNNING LastTaskStatusEnum = "running" + LASTTASKSTATUSENUM_POSTPROCESS LastTaskStatusEnum = "postprocess" + LASTTASKSTATUSENUM_REJECTED LastTaskStatusEnum = "rejected" + LASTTASKSTATUSENUM_DONE LastTaskStatusEnum = "done" + LASTTASKSTATUSENUM_INFO LastTaskStatusEnum = "info" + LASTTASKSTATUSENUM_WARNING LastTaskStatusEnum = "warning" + LASTTASKSTATUSENUM_ERROR LastTaskStatusEnum = "error" +) + +// All allowed values of LastTaskStatusEnum enum +var AllowedLastTaskStatusEnumEnumValues = []LastTaskStatusEnum{ + "queued", + "consumed", + "preprocess", + "running", + "postprocess", + "rejected", + "done", + "info", + "warning", + "error", +} + +func (v *LastTaskStatusEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LastTaskStatusEnum(value) + for _, existing := range AllowedLastTaskStatusEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LastTaskStatusEnum", value) +} + +// NewLastTaskStatusEnumFromValue returns a pointer to a valid LastTaskStatusEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLastTaskStatusEnumFromValue(v string) (*LastTaskStatusEnum, error) { + ev := LastTaskStatusEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LastTaskStatusEnum: valid values are %v", v, AllowedLastTaskStatusEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LastTaskStatusEnum) IsValid() bool { + for _, existing := range AllowedLastTaskStatusEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LastTaskStatusEnum value +func (v LastTaskStatusEnum) Ptr() *LastTaskStatusEnum { + return &v +} + +type NullableLastTaskStatusEnum struct { + value *LastTaskStatusEnum + isSet bool +} + +func (v NullableLastTaskStatusEnum) Get() *LastTaskStatusEnum { + return v.value +} + +func (v *NullableLastTaskStatusEnum) Set(val *LastTaskStatusEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLastTaskStatusEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLastTaskStatusEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLastTaskStatusEnum(val *LastTaskStatusEnum) *NullableLastTaskStatusEnum { + return &NullableLastTaskStatusEnum{value: val, isSet: true} +} + +func (v NullableLastTaskStatusEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLastTaskStatusEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_check_access.go b/packages/client-go/model_ldap_check_access.go new file mode 100644 index 0000000000..cc16d7f37c --- /dev/null +++ b/packages/client-go/model_ldap_check_access.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPCheckAccess type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPCheckAccess{} + +// LDAPCheckAccess Base serializer class which doesn't implement create/update methods +type LDAPCheckAccess struct { + HasSearchPermission *bool `json:"has_search_permission,omitempty"` + Access PolicyTestResult `json:"access"` + AdditionalProperties map[string]interface{} +} + +type _LDAPCheckAccess LDAPCheckAccess + +// NewLDAPCheckAccess instantiates a new LDAPCheckAccess object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPCheckAccess(access PolicyTestResult) *LDAPCheckAccess { + this := LDAPCheckAccess{} + this.Access = access + return &this +} + +// NewLDAPCheckAccessWithDefaults instantiates a new LDAPCheckAccess object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPCheckAccessWithDefaults() *LDAPCheckAccess { + this := LDAPCheckAccess{} + return &this +} + +// GetHasSearchPermission returns the HasSearchPermission field value if set, zero value otherwise. +func (o *LDAPCheckAccess) GetHasSearchPermission() bool { + if o == nil || IsNil(o.HasSearchPermission) { + var ret bool + return ret + } + return *o.HasSearchPermission +} + +// GetHasSearchPermissionOk returns a tuple with the HasSearchPermission field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPCheckAccess) GetHasSearchPermissionOk() (*bool, bool) { + if o == nil || IsNil(o.HasSearchPermission) { + return nil, false + } + return o.HasSearchPermission, true +} + +// HasHasSearchPermission returns a boolean if a field has been set. +func (o *LDAPCheckAccess) HasHasSearchPermission() bool { + if o != nil && !IsNil(o.HasSearchPermission) { + return true + } + + return false +} + +// SetHasSearchPermission gets a reference to the given bool and assigns it to the HasSearchPermission field. +func (o *LDAPCheckAccess) SetHasSearchPermission(v bool) { + o.HasSearchPermission = &v +} + +// GetAccess returns the Access field value +func (o *LDAPCheckAccess) GetAccess() PolicyTestResult { + if o == nil { + var ret PolicyTestResult + return ret + } + + return o.Access +} + +// GetAccessOk returns a tuple with the Access field value +// and a boolean to check if the value has been set. +func (o *LDAPCheckAccess) GetAccessOk() (*PolicyTestResult, bool) { + if o == nil { + return nil, false + } + return &o.Access, true +} + +// SetAccess sets field value +func (o *LDAPCheckAccess) SetAccess(v PolicyTestResult) { + o.Access = v +} + +func (o LDAPCheckAccess) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPCheckAccess) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HasSearchPermission) { + toSerialize["has_search_permission"] = o.HasSearchPermission + } + toSerialize["access"] = o.Access + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPCheckAccess) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "access", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPCheckAccess := _LDAPCheckAccess{} + + err = json.Unmarshal(data, &varLDAPCheckAccess) + + if err != nil { + return err + } + + *o = LDAPCheckAccess(varLDAPCheckAccess) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "has_search_permission") + delete(additionalProperties, "access") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPCheckAccess struct { + value *LDAPCheckAccess + isSet bool +} + +func (v NullableLDAPCheckAccess) Get() *LDAPCheckAccess { + return v.value +} + +func (v *NullableLDAPCheckAccess) Set(val *LDAPCheckAccess) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPCheckAccess) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPCheckAccess) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPCheckAccess(val *LDAPCheckAccess) *NullableLDAPCheckAccess { + return &NullableLDAPCheckAccess{value: val, isSet: true} +} + +func (v NullableLDAPCheckAccess) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPCheckAccess) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_debug.go b/packages/client-go/model_ldap_debug.go new file mode 100644 index 0000000000..2cd4fd88c3 --- /dev/null +++ b/packages/client-go/model_ldap_debug.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPDebug type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPDebug{} + +// LDAPDebug struct for LDAPDebug +type LDAPDebug struct { + User []map[string]interface{} `json:"user"` + Group []map[string]interface{} `json:"group"` + Membership []map[string]interface{} `json:"membership"` + AdditionalProperties map[string]interface{} +} + +type _LDAPDebug LDAPDebug + +// NewLDAPDebug instantiates a new LDAPDebug object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPDebug(user []map[string]interface{}, group []map[string]interface{}, membership []map[string]interface{}) *LDAPDebug { + this := LDAPDebug{} + this.User = user + this.Group = group + this.Membership = membership + return &this +} + +// NewLDAPDebugWithDefaults instantiates a new LDAPDebug object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPDebugWithDefaults() *LDAPDebug { + this := LDAPDebug{} + return &this +} + +// GetUser returns the User field value +func (o *LDAPDebug) GetUser() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *LDAPDebug) GetUserOk() ([]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.User, true +} + +// SetUser sets field value +func (o *LDAPDebug) SetUser(v []map[string]interface{}) { + o.User = v +} + +// GetGroup returns the Group field value +func (o *LDAPDebug) GetGroup() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *LDAPDebug) GetGroupOk() ([]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Group, true +} + +// SetGroup sets field value +func (o *LDAPDebug) SetGroup(v []map[string]interface{}) { + o.Group = v +} + +// GetMembership returns the Membership field value +func (o *LDAPDebug) GetMembership() []map[string]interface{} { + if o == nil { + var ret []map[string]interface{} + return ret + } + + return o.Membership +} + +// GetMembershipOk returns a tuple with the Membership field value +// and a boolean to check if the value has been set. +func (o *LDAPDebug) GetMembershipOk() ([]map[string]interface{}, bool) { + if o == nil { + return nil, false + } + return o.Membership, true +} + +// SetMembership sets field value +func (o *LDAPDebug) SetMembership(v []map[string]interface{}) { + o.Membership = v +} + +func (o LDAPDebug) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPDebug) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["group"] = o.Group + toSerialize["membership"] = o.Membership + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPDebug) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "group", + "membership", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPDebug := _LDAPDebug{} + + err = json.Unmarshal(data, &varLDAPDebug) + + if err != nil { + return err + } + + *o = LDAPDebug(varLDAPDebug) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "group") + delete(additionalProperties, "membership") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPDebug struct { + value *LDAPDebug + isSet bool +} + +func (v NullableLDAPDebug) Get() *LDAPDebug { + return v.value +} + +func (v *NullableLDAPDebug) Set(val *LDAPDebug) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPDebug) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPDebug) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPDebug(val *LDAPDebug) *NullableLDAPDebug { + return &NullableLDAPDebug{value: val, isSet: true} +} + +func (v NullableLDAPDebug) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPDebug) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_outpost_config.go b/packages/client-go/model_ldap_outpost_config.go new file mode 100644 index 0000000000..b0f89f709e --- /dev/null +++ b/packages/client-go/model_ldap_outpost_config.go @@ -0,0 +1,598 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPOutpostConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPOutpostConfig{} + +// LDAPOutpostConfig LDAPProvider Serializer +type LDAPOutpostConfig struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // DN under which objects are accessible. + BaseDn *string `json:"base_dn,omitempty"` + BindFlowSlug string `json:"bind_flow_slug"` + // Get slug for unbind flow, defaulting to brand's default flow. + UnbindFlowSlug NullableString `json:"unbind_flow_slug"` + // Prioritise backchannel slug over direct application slug + ApplicationSlug string `json:"application_slug"` + Certificate NullableString `json:"certificate,omitempty"` + TlsServerName *string `json:"tls_server_name,omitempty"` + // The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber + UidStartNumber *int32 `json:"uid_start_number,omitempty"` + // The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber + GidStartNumber *int32 `json:"gid_start_number,omitempty"` + SearchMode *LDAPAPIAccessMode `json:"search_mode,omitempty"` + BindMode *LDAPAPIAccessMode `json:"bind_mode,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LDAPOutpostConfig LDAPOutpostConfig + +// NewLDAPOutpostConfig instantiates a new LDAPOutpostConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPOutpostConfig(pk int32, name string, bindFlowSlug string, unbindFlowSlug NullableString, applicationSlug string) *LDAPOutpostConfig { + this := LDAPOutpostConfig{} + this.Pk = pk + this.Name = name + this.BindFlowSlug = bindFlowSlug + this.UnbindFlowSlug = unbindFlowSlug + this.ApplicationSlug = applicationSlug + return &this +} + +// NewLDAPOutpostConfigWithDefaults instantiates a new LDAPOutpostConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPOutpostConfigWithDefaults() *LDAPOutpostConfig { + this := LDAPOutpostConfig{} + return &this +} + +// GetPk returns the Pk field value +func (o *LDAPOutpostConfig) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *LDAPOutpostConfig) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *LDAPOutpostConfig) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPOutpostConfig) SetName(v string) { + o.Name = v +} + +// GetBaseDn returns the BaseDn field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetBaseDn() string { + if o == nil || IsNil(o.BaseDn) { + var ret string + return ret + } + return *o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetBaseDnOk() (*string, bool) { + if o == nil || IsNil(o.BaseDn) { + return nil, false + } + return o.BaseDn, true +} + +// HasBaseDn returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasBaseDn() bool { + if o != nil && !IsNil(o.BaseDn) { + return true + } + + return false +} + +// SetBaseDn gets a reference to the given string and assigns it to the BaseDn field. +func (o *LDAPOutpostConfig) SetBaseDn(v string) { + o.BaseDn = &v +} + +// GetBindFlowSlug returns the BindFlowSlug field value +func (o *LDAPOutpostConfig) GetBindFlowSlug() string { + if o == nil { + var ret string + return ret + } + + return o.BindFlowSlug +} + +// GetBindFlowSlugOk returns a tuple with the BindFlowSlug field value +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetBindFlowSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BindFlowSlug, true +} + +// SetBindFlowSlug sets field value +func (o *LDAPOutpostConfig) SetBindFlowSlug(v string) { + o.BindFlowSlug = v +} + +// GetUnbindFlowSlug returns the UnbindFlowSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPOutpostConfig) GetUnbindFlowSlug() string { + if o == nil || o.UnbindFlowSlug.Get() == nil { + var ret string + return ret + } + + return *o.UnbindFlowSlug.Get() +} + +// GetUnbindFlowSlugOk returns a tuple with the UnbindFlowSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPOutpostConfig) GetUnbindFlowSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.UnbindFlowSlug.Get(), o.UnbindFlowSlug.IsSet() +} + +// SetUnbindFlowSlug sets field value +func (o *LDAPOutpostConfig) SetUnbindFlowSlug(v string) { + o.UnbindFlowSlug.Set(&v) +} + +// GetApplicationSlug returns the ApplicationSlug field value +func (o *LDAPOutpostConfig) GetApplicationSlug() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationSlug +} + +// GetApplicationSlugOk returns a tuple with the ApplicationSlug field value +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationSlug, true +} + +// SetApplicationSlug sets field value +func (o *LDAPOutpostConfig) SetApplicationSlug(v string) { + o.ApplicationSlug = v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPOutpostConfig) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPOutpostConfig) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *LDAPOutpostConfig) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *LDAPOutpostConfig) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *LDAPOutpostConfig) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetTlsServerName returns the TlsServerName field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetTlsServerName() string { + if o == nil || IsNil(o.TlsServerName) { + var ret string + return ret + } + return *o.TlsServerName +} + +// GetTlsServerNameOk returns a tuple with the TlsServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetTlsServerNameOk() (*string, bool) { + if o == nil || IsNil(o.TlsServerName) { + return nil, false + } + return o.TlsServerName, true +} + +// HasTlsServerName returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasTlsServerName() bool { + if o != nil && !IsNil(o.TlsServerName) { + return true + } + + return false +} + +// SetTlsServerName gets a reference to the given string and assigns it to the TlsServerName field. +func (o *LDAPOutpostConfig) SetTlsServerName(v string) { + o.TlsServerName = &v +} + +// GetUidStartNumber returns the UidStartNumber field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetUidStartNumber() int32 { + if o == nil || IsNil(o.UidStartNumber) { + var ret int32 + return ret + } + return *o.UidStartNumber +} + +// GetUidStartNumberOk returns a tuple with the UidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetUidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.UidStartNumber) { + return nil, false + } + return o.UidStartNumber, true +} + +// HasUidStartNumber returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasUidStartNumber() bool { + if o != nil && !IsNil(o.UidStartNumber) { + return true + } + + return false +} + +// SetUidStartNumber gets a reference to the given int32 and assigns it to the UidStartNumber field. +func (o *LDAPOutpostConfig) SetUidStartNumber(v int32) { + o.UidStartNumber = &v +} + +// GetGidStartNumber returns the GidStartNumber field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetGidStartNumber() int32 { + if o == nil || IsNil(o.GidStartNumber) { + var ret int32 + return ret + } + return *o.GidStartNumber +} + +// GetGidStartNumberOk returns a tuple with the GidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetGidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.GidStartNumber) { + return nil, false + } + return o.GidStartNumber, true +} + +// HasGidStartNumber returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasGidStartNumber() bool { + if o != nil && !IsNil(o.GidStartNumber) { + return true + } + + return false +} + +// SetGidStartNumber gets a reference to the given int32 and assigns it to the GidStartNumber field. +func (o *LDAPOutpostConfig) SetGidStartNumber(v int32) { + o.GidStartNumber = &v +} + +// GetSearchMode returns the SearchMode field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetSearchMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.SearchMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.SearchMode +} + +// GetSearchModeOk returns a tuple with the SearchMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetSearchModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.SearchMode) { + return nil, false + } + return o.SearchMode, true +} + +// HasSearchMode returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasSearchMode() bool { + if o != nil && !IsNil(o.SearchMode) { + return true + } + + return false +} + +// SetSearchMode gets a reference to the given LDAPAPIAccessMode and assigns it to the SearchMode field. +func (o *LDAPOutpostConfig) SetSearchMode(v LDAPAPIAccessMode) { + o.SearchMode = &v +} + +// GetBindMode returns the BindMode field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetBindMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.BindMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.BindMode +} + +// GetBindModeOk returns a tuple with the BindMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetBindModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.BindMode) { + return nil, false + } + return o.BindMode, true +} + +// HasBindMode returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasBindMode() bool { + if o != nil && !IsNil(o.BindMode) { + return true + } + + return false +} + +// SetBindMode gets a reference to the given LDAPAPIAccessMode and assigns it to the BindMode field. +func (o *LDAPOutpostConfig) SetBindMode(v LDAPAPIAccessMode) { + o.BindMode = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *LDAPOutpostConfig) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPOutpostConfig) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *LDAPOutpostConfig) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *LDAPOutpostConfig) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +func (o LDAPOutpostConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPOutpostConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.BaseDn) { + toSerialize["base_dn"] = o.BaseDn + } + toSerialize["bind_flow_slug"] = o.BindFlowSlug + toSerialize["unbind_flow_slug"] = o.UnbindFlowSlug.Get() + toSerialize["application_slug"] = o.ApplicationSlug + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.TlsServerName) { + toSerialize["tls_server_name"] = o.TlsServerName + } + if !IsNil(o.UidStartNumber) { + toSerialize["uid_start_number"] = o.UidStartNumber + } + if !IsNil(o.GidStartNumber) { + toSerialize["gid_start_number"] = o.GidStartNumber + } + if !IsNil(o.SearchMode) { + toSerialize["search_mode"] = o.SearchMode + } + if !IsNil(o.BindMode) { + toSerialize["bind_mode"] = o.BindMode + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPOutpostConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "bind_flow_slug", + "unbind_flow_slug", + "application_slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPOutpostConfig := _LDAPOutpostConfig{} + + err = json.Unmarshal(data, &varLDAPOutpostConfig) + + if err != nil { + return err + } + + *o = LDAPOutpostConfig(varLDAPOutpostConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "bind_flow_slug") + delete(additionalProperties, "unbind_flow_slug") + delete(additionalProperties, "application_slug") + delete(additionalProperties, "certificate") + delete(additionalProperties, "tls_server_name") + delete(additionalProperties, "uid_start_number") + delete(additionalProperties, "gid_start_number") + delete(additionalProperties, "search_mode") + delete(additionalProperties, "bind_mode") + delete(additionalProperties, "mfa_support") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPOutpostConfig struct { + value *LDAPOutpostConfig + isSet bool +} + +func (v NullableLDAPOutpostConfig) Get() *LDAPOutpostConfig { + return v.value +} + +func (v *NullableLDAPOutpostConfig) Set(val *LDAPOutpostConfig) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPOutpostConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPOutpostConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPOutpostConfig(val *LDAPOutpostConfig) *NullableLDAPOutpostConfig { + return &NullableLDAPOutpostConfig{value: val, isSet: true} +} + +func (v NullableLDAPOutpostConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPOutpostConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_provider.go b/packages/client-go/model_ldap_provider.go new file mode 100644 index 0000000000..3dd72826c4 --- /dev/null +++ b/packages/client-go/model_ldap_provider.go @@ -0,0 +1,930 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPProvider{} + +// LDAPProvider LDAPProvider Serializer +type LDAPProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // DN under which objects are accessible. + BaseDn *string `json:"base_dn,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + TlsServerName *string `json:"tls_server_name,omitempty"` + // The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber + UidStartNumber *int32 `json:"uid_start_number,omitempty"` + // The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber + GidStartNumber *int32 `json:"gid_start_number,omitempty"` + OutpostSet []string `json:"outpost_set"` + SearchMode *LDAPAPIAccessMode `json:"search_mode,omitempty"` + BindMode *LDAPAPIAccessMode `json:"bind_mode,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LDAPProvider LDAPProvider + +// NewLDAPProvider instantiates a new LDAPProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, outpostSet []string) *LDAPProvider { + this := LDAPProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.OutpostSet = outpostSet + return &this +} + +// NewLDAPProviderWithDefaults instantiates a new LDAPProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPProviderWithDefaults() *LDAPProvider { + this := LDAPProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *LDAPProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *LDAPProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *LDAPProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *LDAPProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *LDAPProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *LDAPProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *LDAPProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *LDAPProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *LDAPProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *LDAPProvider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *LDAPProvider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *LDAPProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *LDAPProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *LDAPProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *LDAPProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *LDAPProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *LDAPProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *LDAPProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *LDAPProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *LDAPProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *LDAPProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *LDAPProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *LDAPProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *LDAPProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *LDAPProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *LDAPProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBaseDn returns the BaseDn field value if set, zero value otherwise. +func (o *LDAPProvider) GetBaseDn() string { + if o == nil || IsNil(o.BaseDn) { + var ret string + return ret + } + return *o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetBaseDnOk() (*string, bool) { + if o == nil || IsNil(o.BaseDn) { + return nil, false + } + return o.BaseDn, true +} + +// HasBaseDn returns a boolean if a field has been set. +func (o *LDAPProvider) HasBaseDn() bool { + if o != nil && !IsNil(o.BaseDn) { + return true + } + + return false +} + +// SetBaseDn gets a reference to the given string and assigns it to the BaseDn field. +func (o *LDAPProvider) SetBaseDn(v string) { + o.BaseDn = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPProvider) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProvider) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *LDAPProvider) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *LDAPProvider) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *LDAPProvider) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *LDAPProvider) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetTlsServerName returns the TlsServerName field value if set, zero value otherwise. +func (o *LDAPProvider) GetTlsServerName() string { + if o == nil || IsNil(o.TlsServerName) { + var ret string + return ret + } + return *o.TlsServerName +} + +// GetTlsServerNameOk returns a tuple with the TlsServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetTlsServerNameOk() (*string, bool) { + if o == nil || IsNil(o.TlsServerName) { + return nil, false + } + return o.TlsServerName, true +} + +// HasTlsServerName returns a boolean if a field has been set. +func (o *LDAPProvider) HasTlsServerName() bool { + if o != nil && !IsNil(o.TlsServerName) { + return true + } + + return false +} + +// SetTlsServerName gets a reference to the given string and assigns it to the TlsServerName field. +func (o *LDAPProvider) SetTlsServerName(v string) { + o.TlsServerName = &v +} + +// GetUidStartNumber returns the UidStartNumber field value if set, zero value otherwise. +func (o *LDAPProvider) GetUidStartNumber() int32 { + if o == nil || IsNil(o.UidStartNumber) { + var ret int32 + return ret + } + return *o.UidStartNumber +} + +// GetUidStartNumberOk returns a tuple with the UidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetUidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.UidStartNumber) { + return nil, false + } + return o.UidStartNumber, true +} + +// HasUidStartNumber returns a boolean if a field has been set. +func (o *LDAPProvider) HasUidStartNumber() bool { + if o != nil && !IsNil(o.UidStartNumber) { + return true + } + + return false +} + +// SetUidStartNumber gets a reference to the given int32 and assigns it to the UidStartNumber field. +func (o *LDAPProvider) SetUidStartNumber(v int32) { + o.UidStartNumber = &v +} + +// GetGidStartNumber returns the GidStartNumber field value if set, zero value otherwise. +func (o *LDAPProvider) GetGidStartNumber() int32 { + if o == nil || IsNil(o.GidStartNumber) { + var ret int32 + return ret + } + return *o.GidStartNumber +} + +// GetGidStartNumberOk returns a tuple with the GidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetGidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.GidStartNumber) { + return nil, false + } + return o.GidStartNumber, true +} + +// HasGidStartNumber returns a boolean if a field has been set. +func (o *LDAPProvider) HasGidStartNumber() bool { + if o != nil && !IsNil(o.GidStartNumber) { + return true + } + + return false +} + +// SetGidStartNumber gets a reference to the given int32 and assigns it to the GidStartNumber field. +func (o *LDAPProvider) SetGidStartNumber(v int32) { + o.GidStartNumber = &v +} + +// GetOutpostSet returns the OutpostSet field value +func (o *LDAPProvider) GetOutpostSet() []string { + if o == nil { + var ret []string + return ret + } + + return o.OutpostSet +} + +// GetOutpostSetOk returns a tuple with the OutpostSet field value +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetOutpostSetOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.OutpostSet, true +} + +// SetOutpostSet sets field value +func (o *LDAPProvider) SetOutpostSet(v []string) { + o.OutpostSet = v +} + +// GetSearchMode returns the SearchMode field value if set, zero value otherwise. +func (o *LDAPProvider) GetSearchMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.SearchMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.SearchMode +} + +// GetSearchModeOk returns a tuple with the SearchMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetSearchModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.SearchMode) { + return nil, false + } + return o.SearchMode, true +} + +// HasSearchMode returns a boolean if a field has been set. +func (o *LDAPProvider) HasSearchMode() bool { + if o != nil && !IsNil(o.SearchMode) { + return true + } + + return false +} + +// SetSearchMode gets a reference to the given LDAPAPIAccessMode and assigns it to the SearchMode field. +func (o *LDAPProvider) SetSearchMode(v LDAPAPIAccessMode) { + o.SearchMode = &v +} + +// GetBindMode returns the BindMode field value if set, zero value otherwise. +func (o *LDAPProvider) GetBindMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.BindMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.BindMode +} + +// GetBindModeOk returns a tuple with the BindMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetBindModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.BindMode) { + return nil, false + } + return o.BindMode, true +} + +// HasBindMode returns a boolean if a field has been set. +func (o *LDAPProvider) HasBindMode() bool { + if o != nil && !IsNil(o.BindMode) { + return true + } + + return false +} + +// SetBindMode gets a reference to the given LDAPAPIAccessMode and assigns it to the BindMode field. +func (o *LDAPProvider) SetBindMode(v LDAPAPIAccessMode) { + o.BindMode = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *LDAPProvider) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProvider) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *LDAPProvider) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *LDAPProvider) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +func (o LDAPProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.BaseDn) { + toSerialize["base_dn"] = o.BaseDn + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.TlsServerName) { + toSerialize["tls_server_name"] = o.TlsServerName + } + if !IsNil(o.UidStartNumber) { + toSerialize["uid_start_number"] = o.UidStartNumber + } + if !IsNil(o.GidStartNumber) { + toSerialize["gid_start_number"] = o.GidStartNumber + } + toSerialize["outpost_set"] = o.OutpostSet + if !IsNil(o.SearchMode) { + toSerialize["search_mode"] = o.SearchMode + } + if !IsNil(o.BindMode) { + toSerialize["bind_mode"] = o.BindMode + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "outpost_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPProvider := _LDAPProvider{} + + err = json.Unmarshal(data, &varLDAPProvider) + + if err != nil { + return err + } + + *o = LDAPProvider(varLDAPProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "certificate") + delete(additionalProperties, "tls_server_name") + delete(additionalProperties, "uid_start_number") + delete(additionalProperties, "gid_start_number") + delete(additionalProperties, "outpost_set") + delete(additionalProperties, "search_mode") + delete(additionalProperties, "bind_mode") + delete(additionalProperties, "mfa_support") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPProvider struct { + value *LDAPProvider + isSet bool +} + +func (v NullableLDAPProvider) Get() *LDAPProvider { + return v.value +} + +func (v *NullableLDAPProvider) Set(val *LDAPProvider) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPProvider(val *LDAPProvider) *NullableLDAPProvider { + return &NullableLDAPProvider{value: val, isSet: true} +} + +func (v NullableLDAPProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_provider_request.go b/packages/client-go/model_ldap_provider_request.go new file mode 100644 index 0000000000..d47ea94b1a --- /dev/null +++ b/packages/client-go/model_ldap_provider_request.go @@ -0,0 +1,624 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPProviderRequest{} + +// LDAPProviderRequest LDAPProvider Serializer +type LDAPProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // DN under which objects are accessible. + BaseDn *string `json:"base_dn,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + TlsServerName *string `json:"tls_server_name,omitempty"` + // The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber + UidStartNumber *int32 `json:"uid_start_number,omitempty"` + // The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber + GidStartNumber *int32 `json:"gid_start_number,omitempty"` + SearchMode *LDAPAPIAccessMode `json:"search_mode,omitempty"` + BindMode *LDAPAPIAccessMode `json:"bind_mode,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LDAPProviderRequest LDAPProviderRequest + +// NewLDAPProviderRequest instantiates a new LDAPProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPProviderRequest(name string, authorizationFlow string, invalidationFlow string) *LDAPProviderRequest { + this := LDAPProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + return &this +} + +// NewLDAPProviderRequestWithDefaults instantiates a new LDAPProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPProviderRequestWithDefaults() *LDAPProviderRequest { + this := LDAPProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *LDAPProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *LDAPProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *LDAPProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *LDAPProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *LDAPProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *LDAPProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *LDAPProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *LDAPProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *LDAPProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetBaseDn returns the BaseDn field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetBaseDn() string { + if o == nil || IsNil(o.BaseDn) { + var ret string + return ret + } + return *o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetBaseDnOk() (*string, bool) { + if o == nil || IsNil(o.BaseDn) { + return nil, false + } + return o.BaseDn, true +} + +// HasBaseDn returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasBaseDn() bool { + if o != nil && !IsNil(o.BaseDn) { + return true + } + + return false +} + +// SetBaseDn gets a reference to the given string and assigns it to the BaseDn field. +func (o *LDAPProviderRequest) SetBaseDn(v string) { + o.BaseDn = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *LDAPProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *LDAPProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *LDAPProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetTlsServerName returns the TlsServerName field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetTlsServerName() string { + if o == nil || IsNil(o.TlsServerName) { + var ret string + return ret + } + return *o.TlsServerName +} + +// GetTlsServerNameOk returns a tuple with the TlsServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetTlsServerNameOk() (*string, bool) { + if o == nil || IsNil(o.TlsServerName) { + return nil, false + } + return o.TlsServerName, true +} + +// HasTlsServerName returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasTlsServerName() bool { + if o != nil && !IsNil(o.TlsServerName) { + return true + } + + return false +} + +// SetTlsServerName gets a reference to the given string and assigns it to the TlsServerName field. +func (o *LDAPProviderRequest) SetTlsServerName(v string) { + o.TlsServerName = &v +} + +// GetUidStartNumber returns the UidStartNumber field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetUidStartNumber() int32 { + if o == nil || IsNil(o.UidStartNumber) { + var ret int32 + return ret + } + return *o.UidStartNumber +} + +// GetUidStartNumberOk returns a tuple with the UidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetUidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.UidStartNumber) { + return nil, false + } + return o.UidStartNumber, true +} + +// HasUidStartNumber returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasUidStartNumber() bool { + if o != nil && !IsNil(o.UidStartNumber) { + return true + } + + return false +} + +// SetUidStartNumber gets a reference to the given int32 and assigns it to the UidStartNumber field. +func (o *LDAPProviderRequest) SetUidStartNumber(v int32) { + o.UidStartNumber = &v +} + +// GetGidStartNumber returns the GidStartNumber field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetGidStartNumber() int32 { + if o == nil || IsNil(o.GidStartNumber) { + var ret int32 + return ret + } + return *o.GidStartNumber +} + +// GetGidStartNumberOk returns a tuple with the GidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetGidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.GidStartNumber) { + return nil, false + } + return o.GidStartNumber, true +} + +// HasGidStartNumber returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasGidStartNumber() bool { + if o != nil && !IsNil(o.GidStartNumber) { + return true + } + + return false +} + +// SetGidStartNumber gets a reference to the given int32 and assigns it to the GidStartNumber field. +func (o *LDAPProviderRequest) SetGidStartNumber(v int32) { + o.GidStartNumber = &v +} + +// GetSearchMode returns the SearchMode field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetSearchMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.SearchMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.SearchMode +} + +// GetSearchModeOk returns a tuple with the SearchMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetSearchModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.SearchMode) { + return nil, false + } + return o.SearchMode, true +} + +// HasSearchMode returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasSearchMode() bool { + if o != nil && !IsNil(o.SearchMode) { + return true + } + + return false +} + +// SetSearchMode gets a reference to the given LDAPAPIAccessMode and assigns it to the SearchMode field. +func (o *LDAPProviderRequest) SetSearchMode(v LDAPAPIAccessMode) { + o.SearchMode = &v +} + +// GetBindMode returns the BindMode field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetBindMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.BindMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.BindMode +} + +// GetBindModeOk returns a tuple with the BindMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetBindModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.BindMode) { + return nil, false + } + return o.BindMode, true +} + +// HasBindMode returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasBindMode() bool { + if o != nil && !IsNil(o.BindMode) { + return true + } + + return false +} + +// SetBindMode gets a reference to the given LDAPAPIAccessMode and assigns it to the BindMode field. +func (o *LDAPProviderRequest) SetBindMode(v LDAPAPIAccessMode) { + o.BindMode = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *LDAPProviderRequest) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPProviderRequest) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *LDAPProviderRequest) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *LDAPProviderRequest) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +func (o LDAPProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.BaseDn) { + toSerialize["base_dn"] = o.BaseDn + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.TlsServerName) { + toSerialize["tls_server_name"] = o.TlsServerName + } + if !IsNil(o.UidStartNumber) { + toSerialize["uid_start_number"] = o.UidStartNumber + } + if !IsNil(o.GidStartNumber) { + toSerialize["gid_start_number"] = o.GidStartNumber + } + if !IsNil(o.SearchMode) { + toSerialize["search_mode"] = o.SearchMode + } + if !IsNil(o.BindMode) { + toSerialize["bind_mode"] = o.BindMode + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPProviderRequest := _LDAPProviderRequest{} + + err = json.Unmarshal(data, &varLDAPProviderRequest) + + if err != nil { + return err + } + + *o = LDAPProviderRequest(varLDAPProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "certificate") + delete(additionalProperties, "tls_server_name") + delete(additionalProperties, "uid_start_number") + delete(additionalProperties, "gid_start_number") + delete(additionalProperties, "search_mode") + delete(additionalProperties, "bind_mode") + delete(additionalProperties, "mfa_support") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPProviderRequest struct { + value *LDAPProviderRequest + isSet bool +} + +func (v NullableLDAPProviderRequest) Get() *LDAPProviderRequest { + return v.value +} + +func (v *NullableLDAPProviderRequest) Set(val *LDAPProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPProviderRequest(val *LDAPProviderRequest) *NullableLDAPProviderRequest { + return &NullableLDAPProviderRequest{value: val, isSet: true} +} + +func (v NullableLDAPProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_source.go b/packages/client-go/model_ldap_source.go new file mode 100644 index 0000000000..4f07a05514 --- /dev/null +++ b/packages/client-go/model_ldap_source.go @@ -0,0 +1,1714 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPSource{} + +// LDAPSource LDAP Source Serializer +type LDAPSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl string `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + ServerUri string `json:"server_uri"` + // Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + PeerCertificate NullableString `json:"peer_certificate,omitempty"` + // Client certificate to authenticate against the LDAP Server's Certificate. + ClientCertificate NullableString `json:"client_certificate,omitempty"` + BindCn *string `json:"bind_cn,omitempty"` + StartTls *bool `json:"start_tls,omitempty"` + Sni *bool `json:"sni,omitempty"` + BaseDn string `json:"base_dn"` + // Prepended to Base DN for User-queries. + AdditionalUserDn *string `json:"additional_user_dn,omitempty"` + // Prepended to Base DN for Group-queries. + AdditionalGroupDn *string `json:"additional_group_dn,omitempty"` + // Consider Objects matching this filter to be Users. + UserObjectFilter *string `json:"user_object_filter,omitempty"` + // Consider Objects matching this filter to be Groups. + GroupObjectFilter *string `json:"group_object_filter,omitempty"` + // Field which contains members of a group. + GroupMembershipField *string `json:"group_membership_field,omitempty"` + // Attribute which matches the value of `group_membership_field`. + UserMembershipAttribute *string `json:"user_membership_attribute,omitempty"` + // Field which contains a unique Identifier. + ObjectUniquenessField *string `json:"object_uniqueness_field,omitempty"` + // Update internal authentik password when login succeeds with LDAP + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source. + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + SyncGroups *bool `json:"sync_groups,omitempty"` + SyncParentGroup NullableString `json:"sync_parent_group,omitempty"` + // Get cached source connectivity + Connectivity map[string]map[string]string `json:"connectivity"` + // Lookup group membership based on a user attribute instead of a group attribute. This allows nested group resolution on systems like FreeIPA and Active Directory + LookupGroupsFromUser *bool `json:"lookup_groups_from_user,omitempty"` + // Delete authentik users and groups which were previously supplied by this source, but are now missing from it. + DeleteNotFoundObjects *bool `json:"delete_not_found_objects,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LDAPSource LDAPSource + +// NewLDAPSource instantiates a new LDAPSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl string, iconThemedUrls NullableThemedUrls, serverUri string, baseDn string, connectivity map[string]map[string]string) *LDAPSource { + this := LDAPSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.ServerUri = serverUri + this.BaseDn = baseDn + this.Connectivity = connectivity + return &this +} + +// NewLDAPSourceWithDefaults instantiates a new LDAPSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPSourceWithDefaults() *LDAPSource { + this := LDAPSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *LDAPSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *LDAPSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *LDAPSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *LDAPSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *LDAPSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *LDAPSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *LDAPSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *LDAPSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *LDAPSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *LDAPSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *LDAPSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *LDAPSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *LDAPSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *LDAPSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *LDAPSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *LDAPSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *LDAPSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *LDAPSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *LDAPSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *LDAPSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *LDAPSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *LDAPSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *LDAPSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *LDAPSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *LDAPSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *LDAPSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *LDAPSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *LDAPSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *LDAPSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *LDAPSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *LDAPSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *LDAPSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *LDAPSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *LDAPSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *LDAPSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *LDAPSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *LDAPSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *LDAPSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *LDAPSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *LDAPSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *LDAPSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *LDAPSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *LDAPSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *LDAPSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *LDAPSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *LDAPSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *LDAPSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +func (o *LDAPSource) GetIconUrl() string { + if o == nil { + var ret string + return ret + } + + return o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IconUrl, true +} + +// SetIconUrl sets field value +func (o *LDAPSource) SetIconUrl(v string) { + o.IconUrl = v +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *LDAPSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *LDAPSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetServerUri returns the ServerUri field value +func (o *LDAPSource) GetServerUri() string { + if o == nil { + var ret string + return ret + } + + return o.ServerUri +} + +// GetServerUriOk returns a tuple with the ServerUri field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetServerUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerUri, true +} + +// SetServerUri sets field value +func (o *LDAPSource) SetServerUri(v string) { + o.ServerUri = v +} + +// GetPeerCertificate returns the PeerCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSource) GetPeerCertificate() string { + if o == nil || IsNil(o.PeerCertificate.Get()) { + var ret string + return ret + } + return *o.PeerCertificate.Get() +} + +// GetPeerCertificateOk returns a tuple with the PeerCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetPeerCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PeerCertificate.Get(), o.PeerCertificate.IsSet() +} + +// HasPeerCertificate returns a boolean if a field has been set. +func (o *LDAPSource) HasPeerCertificate() bool { + if o != nil && o.PeerCertificate.IsSet() { + return true + } + + return false +} + +// SetPeerCertificate gets a reference to the given NullableString and assigns it to the PeerCertificate field. +func (o *LDAPSource) SetPeerCertificate(v string) { + o.PeerCertificate.Set(&v) +} + +// SetPeerCertificateNil sets the value for PeerCertificate to be an explicit nil +func (o *LDAPSource) SetPeerCertificateNil() { + o.PeerCertificate.Set(nil) +} + +// UnsetPeerCertificate ensures that no value is present for PeerCertificate, not even an explicit nil +func (o *LDAPSource) UnsetPeerCertificate() { + o.PeerCertificate.Unset() +} + +// GetClientCertificate returns the ClientCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSource) GetClientCertificate() string { + if o == nil || IsNil(o.ClientCertificate.Get()) { + var ret string + return ret + } + return *o.ClientCertificate.Get() +} + +// GetClientCertificateOk returns a tuple with the ClientCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetClientCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientCertificate.Get(), o.ClientCertificate.IsSet() +} + +// HasClientCertificate returns a boolean if a field has been set. +func (o *LDAPSource) HasClientCertificate() bool { + if o != nil && o.ClientCertificate.IsSet() { + return true + } + + return false +} + +// SetClientCertificate gets a reference to the given NullableString and assigns it to the ClientCertificate field. +func (o *LDAPSource) SetClientCertificate(v string) { + o.ClientCertificate.Set(&v) +} + +// SetClientCertificateNil sets the value for ClientCertificate to be an explicit nil +func (o *LDAPSource) SetClientCertificateNil() { + o.ClientCertificate.Set(nil) +} + +// UnsetClientCertificate ensures that no value is present for ClientCertificate, not even an explicit nil +func (o *LDAPSource) UnsetClientCertificate() { + o.ClientCertificate.Unset() +} + +// GetBindCn returns the BindCn field value if set, zero value otherwise. +func (o *LDAPSource) GetBindCn() string { + if o == nil || IsNil(o.BindCn) { + var ret string + return ret + } + return *o.BindCn +} + +// GetBindCnOk returns a tuple with the BindCn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetBindCnOk() (*string, bool) { + if o == nil || IsNil(o.BindCn) { + return nil, false + } + return o.BindCn, true +} + +// HasBindCn returns a boolean if a field has been set. +func (o *LDAPSource) HasBindCn() bool { + if o != nil && !IsNil(o.BindCn) { + return true + } + + return false +} + +// SetBindCn gets a reference to the given string and assigns it to the BindCn field. +func (o *LDAPSource) SetBindCn(v string) { + o.BindCn = &v +} + +// GetStartTls returns the StartTls field value if set, zero value otherwise. +func (o *LDAPSource) GetStartTls() bool { + if o == nil || IsNil(o.StartTls) { + var ret bool + return ret + } + return *o.StartTls +} + +// GetStartTlsOk returns a tuple with the StartTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetStartTlsOk() (*bool, bool) { + if o == nil || IsNil(o.StartTls) { + return nil, false + } + return o.StartTls, true +} + +// HasStartTls returns a boolean if a field has been set. +func (o *LDAPSource) HasStartTls() bool { + if o != nil && !IsNil(o.StartTls) { + return true + } + + return false +} + +// SetStartTls gets a reference to the given bool and assigns it to the StartTls field. +func (o *LDAPSource) SetStartTls(v bool) { + o.StartTls = &v +} + +// GetSni returns the Sni field value if set, zero value otherwise. +func (o *LDAPSource) GetSni() bool { + if o == nil || IsNil(o.Sni) { + var ret bool + return ret + } + return *o.Sni +} + +// GetSniOk returns a tuple with the Sni field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSniOk() (*bool, bool) { + if o == nil || IsNil(o.Sni) { + return nil, false + } + return o.Sni, true +} + +// HasSni returns a boolean if a field has been set. +func (o *LDAPSource) HasSni() bool { + if o != nil && !IsNil(o.Sni) { + return true + } + + return false +} + +// SetSni gets a reference to the given bool and assigns it to the Sni field. +func (o *LDAPSource) SetSni(v bool) { + o.Sni = &v +} + +// GetBaseDn returns the BaseDn field value +func (o *LDAPSource) GetBaseDn() string { + if o == nil { + var ret string + return ret + } + + return o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetBaseDnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BaseDn, true +} + +// SetBaseDn sets field value +func (o *LDAPSource) SetBaseDn(v string) { + o.BaseDn = v +} + +// GetAdditionalUserDn returns the AdditionalUserDn field value if set, zero value otherwise. +func (o *LDAPSource) GetAdditionalUserDn() string { + if o == nil || IsNil(o.AdditionalUserDn) { + var ret string + return ret + } + return *o.AdditionalUserDn +} + +// GetAdditionalUserDnOk returns a tuple with the AdditionalUserDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetAdditionalUserDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalUserDn) { + return nil, false + } + return o.AdditionalUserDn, true +} + +// HasAdditionalUserDn returns a boolean if a field has been set. +func (o *LDAPSource) HasAdditionalUserDn() bool { + if o != nil && !IsNil(o.AdditionalUserDn) { + return true + } + + return false +} + +// SetAdditionalUserDn gets a reference to the given string and assigns it to the AdditionalUserDn field. +func (o *LDAPSource) SetAdditionalUserDn(v string) { + o.AdditionalUserDn = &v +} + +// GetAdditionalGroupDn returns the AdditionalGroupDn field value if set, zero value otherwise. +func (o *LDAPSource) GetAdditionalGroupDn() string { + if o == nil || IsNil(o.AdditionalGroupDn) { + var ret string + return ret + } + return *o.AdditionalGroupDn +} + +// GetAdditionalGroupDnOk returns a tuple with the AdditionalGroupDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetAdditionalGroupDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalGroupDn) { + return nil, false + } + return o.AdditionalGroupDn, true +} + +// HasAdditionalGroupDn returns a boolean if a field has been set. +func (o *LDAPSource) HasAdditionalGroupDn() bool { + if o != nil && !IsNil(o.AdditionalGroupDn) { + return true + } + + return false +} + +// SetAdditionalGroupDn gets a reference to the given string and assigns it to the AdditionalGroupDn field. +func (o *LDAPSource) SetAdditionalGroupDn(v string) { + o.AdditionalGroupDn = &v +} + +// GetUserObjectFilter returns the UserObjectFilter field value if set, zero value otherwise. +func (o *LDAPSource) GetUserObjectFilter() string { + if o == nil || IsNil(o.UserObjectFilter) { + var ret string + return ret + } + return *o.UserObjectFilter +} + +// GetUserObjectFilterOk returns a tuple with the UserObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetUserObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.UserObjectFilter) { + return nil, false + } + return o.UserObjectFilter, true +} + +// HasUserObjectFilter returns a boolean if a field has been set. +func (o *LDAPSource) HasUserObjectFilter() bool { + if o != nil && !IsNil(o.UserObjectFilter) { + return true + } + + return false +} + +// SetUserObjectFilter gets a reference to the given string and assigns it to the UserObjectFilter field. +func (o *LDAPSource) SetUserObjectFilter(v string) { + o.UserObjectFilter = &v +} + +// GetGroupObjectFilter returns the GroupObjectFilter field value if set, zero value otherwise. +func (o *LDAPSource) GetGroupObjectFilter() string { + if o == nil || IsNil(o.GroupObjectFilter) { + var ret string + return ret + } + return *o.GroupObjectFilter +} + +// GetGroupObjectFilterOk returns a tuple with the GroupObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetGroupObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.GroupObjectFilter) { + return nil, false + } + return o.GroupObjectFilter, true +} + +// HasGroupObjectFilter returns a boolean if a field has been set. +func (o *LDAPSource) HasGroupObjectFilter() bool { + if o != nil && !IsNil(o.GroupObjectFilter) { + return true + } + + return false +} + +// SetGroupObjectFilter gets a reference to the given string and assigns it to the GroupObjectFilter field. +func (o *LDAPSource) SetGroupObjectFilter(v string) { + o.GroupObjectFilter = &v +} + +// GetGroupMembershipField returns the GroupMembershipField field value if set, zero value otherwise. +func (o *LDAPSource) GetGroupMembershipField() string { + if o == nil || IsNil(o.GroupMembershipField) { + var ret string + return ret + } + return *o.GroupMembershipField +} + +// GetGroupMembershipFieldOk returns a tuple with the GroupMembershipField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetGroupMembershipFieldOk() (*string, bool) { + if o == nil || IsNil(o.GroupMembershipField) { + return nil, false + } + return o.GroupMembershipField, true +} + +// HasGroupMembershipField returns a boolean if a field has been set. +func (o *LDAPSource) HasGroupMembershipField() bool { + if o != nil && !IsNil(o.GroupMembershipField) { + return true + } + + return false +} + +// SetGroupMembershipField gets a reference to the given string and assigns it to the GroupMembershipField field. +func (o *LDAPSource) SetGroupMembershipField(v string) { + o.GroupMembershipField = &v +} + +// GetUserMembershipAttribute returns the UserMembershipAttribute field value if set, zero value otherwise. +func (o *LDAPSource) GetUserMembershipAttribute() string { + if o == nil || IsNil(o.UserMembershipAttribute) { + var ret string + return ret + } + return *o.UserMembershipAttribute +} + +// GetUserMembershipAttributeOk returns a tuple with the UserMembershipAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetUserMembershipAttributeOk() (*string, bool) { + if o == nil || IsNil(o.UserMembershipAttribute) { + return nil, false + } + return o.UserMembershipAttribute, true +} + +// HasUserMembershipAttribute returns a boolean if a field has been set. +func (o *LDAPSource) HasUserMembershipAttribute() bool { + if o != nil && !IsNil(o.UserMembershipAttribute) { + return true + } + + return false +} + +// SetUserMembershipAttribute gets a reference to the given string and assigns it to the UserMembershipAttribute field. +func (o *LDAPSource) SetUserMembershipAttribute(v string) { + o.UserMembershipAttribute = &v +} + +// GetObjectUniquenessField returns the ObjectUniquenessField field value if set, zero value otherwise. +func (o *LDAPSource) GetObjectUniquenessField() string { + if o == nil || IsNil(o.ObjectUniquenessField) { + var ret string + return ret + } + return *o.ObjectUniquenessField +} + +// GetObjectUniquenessFieldOk returns a tuple with the ObjectUniquenessField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetObjectUniquenessFieldOk() (*string, bool) { + if o == nil || IsNil(o.ObjectUniquenessField) { + return nil, false + } + return o.ObjectUniquenessField, true +} + +// HasObjectUniquenessField returns a boolean if a field has been set. +func (o *LDAPSource) HasObjectUniquenessField() bool { + if o != nil && !IsNil(o.ObjectUniquenessField) { + return true + } + + return false +} + +// SetObjectUniquenessField gets a reference to the given string and assigns it to the ObjectUniquenessField field. +func (o *LDAPSource) SetObjectUniquenessField(v string) { + o.ObjectUniquenessField = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *LDAPSource) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *LDAPSource) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *LDAPSource) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *LDAPSource) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *LDAPSource) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *LDAPSource) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *LDAPSource) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *LDAPSource) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *LDAPSource) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncGroups returns the SyncGroups field value if set, zero value otherwise. +func (o *LDAPSource) GetSyncGroups() bool { + if o == nil || IsNil(o.SyncGroups) { + var ret bool + return ret + } + return *o.SyncGroups +} + +// GetSyncGroupsOk returns a tuple with the SyncGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSyncGroupsOk() (*bool, bool) { + if o == nil || IsNil(o.SyncGroups) { + return nil, false + } + return o.SyncGroups, true +} + +// HasSyncGroups returns a boolean if a field has been set. +func (o *LDAPSource) HasSyncGroups() bool { + if o != nil && !IsNil(o.SyncGroups) { + return true + } + + return false +} + +// SetSyncGroups gets a reference to the given bool and assigns it to the SyncGroups field. +func (o *LDAPSource) SetSyncGroups(v bool) { + o.SyncGroups = &v +} + +// GetSyncParentGroup returns the SyncParentGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSource) GetSyncParentGroup() string { + if o == nil || IsNil(o.SyncParentGroup.Get()) { + var ret string + return ret + } + return *o.SyncParentGroup.Get() +} + +// GetSyncParentGroupOk returns a tuple with the SyncParentGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetSyncParentGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SyncParentGroup.Get(), o.SyncParentGroup.IsSet() +} + +// HasSyncParentGroup returns a boolean if a field has been set. +func (o *LDAPSource) HasSyncParentGroup() bool { + if o != nil && o.SyncParentGroup.IsSet() { + return true + } + + return false +} + +// SetSyncParentGroup gets a reference to the given NullableString and assigns it to the SyncParentGroup field. +func (o *LDAPSource) SetSyncParentGroup(v string) { + o.SyncParentGroup.Set(&v) +} + +// SetSyncParentGroupNil sets the value for SyncParentGroup to be an explicit nil +func (o *LDAPSource) SetSyncParentGroupNil() { + o.SyncParentGroup.Set(nil) +} + +// UnsetSyncParentGroup ensures that no value is present for SyncParentGroup, not even an explicit nil +func (o *LDAPSource) UnsetSyncParentGroup() { + o.SyncParentGroup.Unset() +} + +// GetConnectivity returns the Connectivity field value +// If the value is explicit nil, the zero value for map[string]map[string]string will be returned +func (o *LDAPSource) GetConnectivity() map[string]map[string]string { + if o == nil { + var ret map[string]map[string]string + return ret + } + + return o.Connectivity +} + +// GetConnectivityOk returns a tuple with the Connectivity field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSource) GetConnectivityOk() (*map[string]map[string]string, bool) { + if o == nil || IsNil(o.Connectivity) { + return nil, false + } + return &o.Connectivity, true +} + +// SetConnectivity sets field value +func (o *LDAPSource) SetConnectivity(v map[string]map[string]string) { + o.Connectivity = v +} + +// GetLookupGroupsFromUser returns the LookupGroupsFromUser field value if set, zero value otherwise. +func (o *LDAPSource) GetLookupGroupsFromUser() bool { + if o == nil || IsNil(o.LookupGroupsFromUser) { + var ret bool + return ret + } + return *o.LookupGroupsFromUser +} + +// GetLookupGroupsFromUserOk returns a tuple with the LookupGroupsFromUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetLookupGroupsFromUserOk() (*bool, bool) { + if o == nil || IsNil(o.LookupGroupsFromUser) { + return nil, false + } + return o.LookupGroupsFromUser, true +} + +// HasLookupGroupsFromUser returns a boolean if a field has been set. +func (o *LDAPSource) HasLookupGroupsFromUser() bool { + if o != nil && !IsNil(o.LookupGroupsFromUser) { + return true + } + + return false +} + +// SetLookupGroupsFromUser gets a reference to the given bool and assigns it to the LookupGroupsFromUser field. +func (o *LDAPSource) SetLookupGroupsFromUser(v bool) { + o.LookupGroupsFromUser = &v +} + +// GetDeleteNotFoundObjects returns the DeleteNotFoundObjects field value if set, zero value otherwise. +func (o *LDAPSource) GetDeleteNotFoundObjects() bool { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + var ret bool + return ret + } + return *o.DeleteNotFoundObjects +} + +// GetDeleteNotFoundObjectsOk returns a tuple with the DeleteNotFoundObjects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetDeleteNotFoundObjectsOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + return nil, false + } + return o.DeleteNotFoundObjects, true +} + +// HasDeleteNotFoundObjects returns a boolean if a field has been set. +func (o *LDAPSource) HasDeleteNotFoundObjects() bool { + if o != nil && !IsNil(o.DeleteNotFoundObjects) { + return true + } + + return false +} + +// SetDeleteNotFoundObjects gets a reference to the given bool and assigns it to the DeleteNotFoundObjects field. +func (o *LDAPSource) SetDeleteNotFoundObjects(v bool) { + o.DeleteNotFoundObjects = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *LDAPSource) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSource) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *LDAPSource) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *LDAPSource) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o LDAPSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + toSerialize["server_uri"] = o.ServerUri + if o.PeerCertificate.IsSet() { + toSerialize["peer_certificate"] = o.PeerCertificate.Get() + } + if o.ClientCertificate.IsSet() { + toSerialize["client_certificate"] = o.ClientCertificate.Get() + } + if !IsNil(o.BindCn) { + toSerialize["bind_cn"] = o.BindCn + } + if !IsNil(o.StartTls) { + toSerialize["start_tls"] = o.StartTls + } + if !IsNil(o.Sni) { + toSerialize["sni"] = o.Sni + } + toSerialize["base_dn"] = o.BaseDn + if !IsNil(o.AdditionalUserDn) { + toSerialize["additional_user_dn"] = o.AdditionalUserDn + } + if !IsNil(o.AdditionalGroupDn) { + toSerialize["additional_group_dn"] = o.AdditionalGroupDn + } + if !IsNil(o.UserObjectFilter) { + toSerialize["user_object_filter"] = o.UserObjectFilter + } + if !IsNil(o.GroupObjectFilter) { + toSerialize["group_object_filter"] = o.GroupObjectFilter + } + if !IsNil(o.GroupMembershipField) { + toSerialize["group_membership_field"] = o.GroupMembershipField + } + if !IsNil(o.UserMembershipAttribute) { + toSerialize["user_membership_attribute"] = o.UserMembershipAttribute + } + if !IsNil(o.ObjectUniquenessField) { + toSerialize["object_uniqueness_field"] = o.ObjectUniquenessField + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncGroups) { + toSerialize["sync_groups"] = o.SyncGroups + } + if o.SyncParentGroup.IsSet() { + toSerialize["sync_parent_group"] = o.SyncParentGroup.Get() + } + if o.Connectivity != nil { + toSerialize["connectivity"] = o.Connectivity + } + if !IsNil(o.LookupGroupsFromUser) { + toSerialize["lookup_groups_from_user"] = o.LookupGroupsFromUser + } + if !IsNil(o.DeleteNotFoundObjects) { + toSerialize["delete_not_found_objects"] = o.DeleteNotFoundObjects + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "server_uri", + "base_dn", + "connectivity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPSource := _LDAPSource{} + + err = json.Unmarshal(data, &varLDAPSource) + + if err != nil { + return err + } + + *o = LDAPSource(varLDAPSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "server_uri") + delete(additionalProperties, "peer_certificate") + delete(additionalProperties, "client_certificate") + delete(additionalProperties, "bind_cn") + delete(additionalProperties, "start_tls") + delete(additionalProperties, "sni") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "additional_user_dn") + delete(additionalProperties, "additional_group_dn") + delete(additionalProperties, "user_object_filter") + delete(additionalProperties, "group_object_filter") + delete(additionalProperties, "group_membership_field") + delete(additionalProperties, "user_membership_attribute") + delete(additionalProperties, "object_uniqueness_field") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_groups") + delete(additionalProperties, "sync_parent_group") + delete(additionalProperties, "connectivity") + delete(additionalProperties, "lookup_groups_from_user") + delete(additionalProperties, "delete_not_found_objects") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPSource struct { + value *LDAPSource + isSet bool +} + +func (v NullableLDAPSource) Get() *LDAPSource { + return v.value +} + +func (v *NullableLDAPSource) Set(val *LDAPSource) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPSource) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPSource(val *LDAPSource) *NullableLDAPSource { + return &NullableLDAPSource{value: val, isSet: true} +} + +func (v NullableLDAPSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_source_property_mapping.go b/packages/client-go/model_ldap_source_property_mapping.go new file mode 100644 index 0000000000..e538f5787b --- /dev/null +++ b/packages/client-go/model_ldap_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPSourcePropertyMapping{} + +// LDAPSourcePropertyMapping LDAP PropertyMapping Serializer +type LDAPSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _LDAPSourcePropertyMapping LDAPSourcePropertyMapping + +// NewLDAPSourcePropertyMapping instantiates a new LDAPSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *LDAPSourcePropertyMapping { + this := LDAPSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewLDAPSourcePropertyMappingWithDefaults instantiates a new LDAPSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPSourcePropertyMappingWithDefaults() *LDAPSourcePropertyMapping { + this := LDAPSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *LDAPSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *LDAPSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *LDAPSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *LDAPSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *LDAPSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *LDAPSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *LDAPSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *LDAPSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *LDAPSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *LDAPSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *LDAPSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *LDAPSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *LDAPSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *LDAPSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *LDAPSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *LDAPSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *LDAPSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o LDAPSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPSourcePropertyMapping := _LDAPSourcePropertyMapping{} + + err = json.Unmarshal(data, &varLDAPSourcePropertyMapping) + + if err != nil { + return err + } + + *o = LDAPSourcePropertyMapping(varLDAPSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPSourcePropertyMapping struct { + value *LDAPSourcePropertyMapping + isSet bool +} + +func (v NullableLDAPSourcePropertyMapping) Get() *LDAPSourcePropertyMapping { + return v.value +} + +func (v *NullableLDAPSourcePropertyMapping) Set(val *LDAPSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPSourcePropertyMapping(val *LDAPSourcePropertyMapping) *NullableLDAPSourcePropertyMapping { + return &NullableLDAPSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableLDAPSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_source_property_mapping_request.go b/packages/client-go/model_ldap_source_property_mapping_request.go new file mode 100644 index 0000000000..89bfc1b84a --- /dev/null +++ b/packages/client-go/model_ldap_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPSourcePropertyMappingRequest{} + +// LDAPSourcePropertyMappingRequest LDAP PropertyMapping Serializer +type LDAPSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _LDAPSourcePropertyMappingRequest LDAPSourcePropertyMappingRequest + +// NewLDAPSourcePropertyMappingRequest instantiates a new LDAPSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPSourcePropertyMappingRequest(name string, expression string) *LDAPSourcePropertyMappingRequest { + this := LDAPSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewLDAPSourcePropertyMappingRequestWithDefaults instantiates a new LDAPSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPSourcePropertyMappingRequestWithDefaults() *LDAPSourcePropertyMappingRequest { + this := LDAPSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *LDAPSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *LDAPSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *LDAPSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *LDAPSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *LDAPSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *LDAPSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *LDAPSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *LDAPSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o LDAPSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPSourcePropertyMappingRequest := _LDAPSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varLDAPSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = LDAPSourcePropertyMappingRequest(varLDAPSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPSourcePropertyMappingRequest struct { + value *LDAPSourcePropertyMappingRequest + isSet bool +} + +func (v NullableLDAPSourcePropertyMappingRequest) Get() *LDAPSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableLDAPSourcePropertyMappingRequest) Set(val *LDAPSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPSourcePropertyMappingRequest(val *LDAPSourcePropertyMappingRequest) *NullableLDAPSourcePropertyMappingRequest { + return &NullableLDAPSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableLDAPSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldap_source_request.go b/packages/client-go/model_ldap_source_request.go new file mode 100644 index 0000000000..88d05a3ce8 --- /dev/null +++ b/packages/client-go/model_ldap_source_request.go @@ -0,0 +1,1476 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LDAPSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LDAPSourceRequest{} + +// LDAPSourceRequest LDAP Source Serializer +type LDAPSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + ServerUri string `json:"server_uri"` + // Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + PeerCertificate NullableString `json:"peer_certificate,omitempty"` + // Client certificate to authenticate against the LDAP Server's Certificate. + ClientCertificate NullableString `json:"client_certificate,omitempty"` + BindCn *string `json:"bind_cn,omitempty"` + BindPassword *string `json:"bind_password,omitempty"` + StartTls *bool `json:"start_tls,omitempty"` + Sni *bool `json:"sni,omitempty"` + BaseDn string `json:"base_dn"` + // Prepended to Base DN for User-queries. + AdditionalUserDn *string `json:"additional_user_dn,omitempty"` + // Prepended to Base DN for Group-queries. + AdditionalGroupDn *string `json:"additional_group_dn,omitempty"` + // Consider Objects matching this filter to be Users. + UserObjectFilter *string `json:"user_object_filter,omitempty"` + // Consider Objects matching this filter to be Groups. + GroupObjectFilter *string `json:"group_object_filter,omitempty"` + // Field which contains members of a group. + GroupMembershipField *string `json:"group_membership_field,omitempty"` + // Attribute which matches the value of `group_membership_field`. + UserMembershipAttribute *string `json:"user_membership_attribute,omitempty"` + // Field which contains a unique Identifier. + ObjectUniquenessField *string `json:"object_uniqueness_field,omitempty"` + // Update internal authentik password when login succeeds with LDAP + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source. + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + SyncGroups *bool `json:"sync_groups,omitempty"` + SyncParentGroup NullableString `json:"sync_parent_group,omitempty"` + // Lookup group membership based on a user attribute instead of a group attribute. This allows nested group resolution on systems like FreeIPA and Active Directory + LookupGroupsFromUser *bool `json:"lookup_groups_from_user,omitempty"` + // Delete authentik users and groups which were previously supplied by this source, but are now missing from it. + DeleteNotFoundObjects *bool `json:"delete_not_found_objects,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LDAPSourceRequest LDAPSourceRequest + +// NewLDAPSourceRequest instantiates a new LDAPSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLDAPSourceRequest(name string, slug string, serverUri string, baseDn string) *LDAPSourceRequest { + this := LDAPSourceRequest{} + this.Name = name + this.Slug = slug + this.ServerUri = serverUri + this.BaseDn = baseDn + return &this +} + +// NewLDAPSourceRequestWithDefaults instantiates a new LDAPSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLDAPSourceRequestWithDefaults() *LDAPSourceRequest { + this := LDAPSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *LDAPSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LDAPSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *LDAPSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *LDAPSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *LDAPSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *LDAPSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *LDAPSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *LDAPSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *LDAPSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *LDAPSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *LDAPSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *LDAPSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *LDAPSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *LDAPSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *LDAPSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *LDAPSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *LDAPSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *LDAPSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetServerUri returns the ServerUri field value +func (o *LDAPSourceRequest) GetServerUri() string { + if o == nil { + var ret string + return ret + } + + return o.ServerUri +} + +// GetServerUriOk returns a tuple with the ServerUri field value +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetServerUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServerUri, true +} + +// SetServerUri sets field value +func (o *LDAPSourceRequest) SetServerUri(v string) { + o.ServerUri = v +} + +// GetPeerCertificate returns the PeerCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourceRequest) GetPeerCertificate() string { + if o == nil || IsNil(o.PeerCertificate.Get()) { + var ret string + return ret + } + return *o.PeerCertificate.Get() +} + +// GetPeerCertificateOk returns a tuple with the PeerCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourceRequest) GetPeerCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PeerCertificate.Get(), o.PeerCertificate.IsSet() +} + +// HasPeerCertificate returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasPeerCertificate() bool { + if o != nil && o.PeerCertificate.IsSet() { + return true + } + + return false +} + +// SetPeerCertificate gets a reference to the given NullableString and assigns it to the PeerCertificate field. +func (o *LDAPSourceRequest) SetPeerCertificate(v string) { + o.PeerCertificate.Set(&v) +} + +// SetPeerCertificateNil sets the value for PeerCertificate to be an explicit nil +func (o *LDAPSourceRequest) SetPeerCertificateNil() { + o.PeerCertificate.Set(nil) +} + +// UnsetPeerCertificate ensures that no value is present for PeerCertificate, not even an explicit nil +func (o *LDAPSourceRequest) UnsetPeerCertificate() { + o.PeerCertificate.Unset() +} + +// GetClientCertificate returns the ClientCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourceRequest) GetClientCertificate() string { + if o == nil || IsNil(o.ClientCertificate.Get()) { + var ret string + return ret + } + return *o.ClientCertificate.Get() +} + +// GetClientCertificateOk returns a tuple with the ClientCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourceRequest) GetClientCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientCertificate.Get(), o.ClientCertificate.IsSet() +} + +// HasClientCertificate returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasClientCertificate() bool { + if o != nil && o.ClientCertificate.IsSet() { + return true + } + + return false +} + +// SetClientCertificate gets a reference to the given NullableString and assigns it to the ClientCertificate field. +func (o *LDAPSourceRequest) SetClientCertificate(v string) { + o.ClientCertificate.Set(&v) +} + +// SetClientCertificateNil sets the value for ClientCertificate to be an explicit nil +func (o *LDAPSourceRequest) SetClientCertificateNil() { + o.ClientCertificate.Set(nil) +} + +// UnsetClientCertificate ensures that no value is present for ClientCertificate, not even an explicit nil +func (o *LDAPSourceRequest) UnsetClientCertificate() { + o.ClientCertificate.Unset() +} + +// GetBindCn returns the BindCn field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetBindCn() string { + if o == nil || IsNil(o.BindCn) { + var ret string + return ret + } + return *o.BindCn +} + +// GetBindCnOk returns a tuple with the BindCn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetBindCnOk() (*string, bool) { + if o == nil || IsNil(o.BindCn) { + return nil, false + } + return o.BindCn, true +} + +// HasBindCn returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasBindCn() bool { + if o != nil && !IsNil(o.BindCn) { + return true + } + + return false +} + +// SetBindCn gets a reference to the given string and assigns it to the BindCn field. +func (o *LDAPSourceRequest) SetBindCn(v string) { + o.BindCn = &v +} + +// GetBindPassword returns the BindPassword field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetBindPassword() string { + if o == nil || IsNil(o.BindPassword) { + var ret string + return ret + } + return *o.BindPassword +} + +// GetBindPasswordOk returns a tuple with the BindPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetBindPasswordOk() (*string, bool) { + if o == nil || IsNil(o.BindPassword) { + return nil, false + } + return o.BindPassword, true +} + +// HasBindPassword returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasBindPassword() bool { + if o != nil && !IsNil(o.BindPassword) { + return true + } + + return false +} + +// SetBindPassword gets a reference to the given string and assigns it to the BindPassword field. +func (o *LDAPSourceRequest) SetBindPassword(v string) { + o.BindPassword = &v +} + +// GetStartTls returns the StartTls field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetStartTls() bool { + if o == nil || IsNil(o.StartTls) { + var ret bool + return ret + } + return *o.StartTls +} + +// GetStartTlsOk returns a tuple with the StartTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetStartTlsOk() (*bool, bool) { + if o == nil || IsNil(o.StartTls) { + return nil, false + } + return o.StartTls, true +} + +// HasStartTls returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasStartTls() bool { + if o != nil && !IsNil(o.StartTls) { + return true + } + + return false +} + +// SetStartTls gets a reference to the given bool and assigns it to the StartTls field. +func (o *LDAPSourceRequest) SetStartTls(v bool) { + o.StartTls = &v +} + +// GetSni returns the Sni field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetSni() bool { + if o == nil || IsNil(o.Sni) { + var ret bool + return ret + } + return *o.Sni +} + +// GetSniOk returns a tuple with the Sni field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSniOk() (*bool, bool) { + if o == nil || IsNil(o.Sni) { + return nil, false + } + return o.Sni, true +} + +// HasSni returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSni() bool { + if o != nil && !IsNil(o.Sni) { + return true + } + + return false +} + +// SetSni gets a reference to the given bool and assigns it to the Sni field. +func (o *LDAPSourceRequest) SetSni(v bool) { + o.Sni = &v +} + +// GetBaseDn returns the BaseDn field value +func (o *LDAPSourceRequest) GetBaseDn() string { + if o == nil { + var ret string + return ret + } + + return o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetBaseDnOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BaseDn, true +} + +// SetBaseDn sets field value +func (o *LDAPSourceRequest) SetBaseDn(v string) { + o.BaseDn = v +} + +// GetAdditionalUserDn returns the AdditionalUserDn field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetAdditionalUserDn() string { + if o == nil || IsNil(o.AdditionalUserDn) { + var ret string + return ret + } + return *o.AdditionalUserDn +} + +// GetAdditionalUserDnOk returns a tuple with the AdditionalUserDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetAdditionalUserDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalUserDn) { + return nil, false + } + return o.AdditionalUserDn, true +} + +// HasAdditionalUserDn returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasAdditionalUserDn() bool { + if o != nil && !IsNil(o.AdditionalUserDn) { + return true + } + + return false +} + +// SetAdditionalUserDn gets a reference to the given string and assigns it to the AdditionalUserDn field. +func (o *LDAPSourceRequest) SetAdditionalUserDn(v string) { + o.AdditionalUserDn = &v +} + +// GetAdditionalGroupDn returns the AdditionalGroupDn field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetAdditionalGroupDn() string { + if o == nil || IsNil(o.AdditionalGroupDn) { + var ret string + return ret + } + return *o.AdditionalGroupDn +} + +// GetAdditionalGroupDnOk returns a tuple with the AdditionalGroupDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetAdditionalGroupDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalGroupDn) { + return nil, false + } + return o.AdditionalGroupDn, true +} + +// HasAdditionalGroupDn returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasAdditionalGroupDn() bool { + if o != nil && !IsNil(o.AdditionalGroupDn) { + return true + } + + return false +} + +// SetAdditionalGroupDn gets a reference to the given string and assigns it to the AdditionalGroupDn field. +func (o *LDAPSourceRequest) SetAdditionalGroupDn(v string) { + o.AdditionalGroupDn = &v +} + +// GetUserObjectFilter returns the UserObjectFilter field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetUserObjectFilter() string { + if o == nil || IsNil(o.UserObjectFilter) { + var ret string + return ret + } + return *o.UserObjectFilter +} + +// GetUserObjectFilterOk returns a tuple with the UserObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetUserObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.UserObjectFilter) { + return nil, false + } + return o.UserObjectFilter, true +} + +// HasUserObjectFilter returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasUserObjectFilter() bool { + if o != nil && !IsNil(o.UserObjectFilter) { + return true + } + + return false +} + +// SetUserObjectFilter gets a reference to the given string and assigns it to the UserObjectFilter field. +func (o *LDAPSourceRequest) SetUserObjectFilter(v string) { + o.UserObjectFilter = &v +} + +// GetGroupObjectFilter returns the GroupObjectFilter field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetGroupObjectFilter() string { + if o == nil || IsNil(o.GroupObjectFilter) { + var ret string + return ret + } + return *o.GroupObjectFilter +} + +// GetGroupObjectFilterOk returns a tuple with the GroupObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetGroupObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.GroupObjectFilter) { + return nil, false + } + return o.GroupObjectFilter, true +} + +// HasGroupObjectFilter returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasGroupObjectFilter() bool { + if o != nil && !IsNil(o.GroupObjectFilter) { + return true + } + + return false +} + +// SetGroupObjectFilter gets a reference to the given string and assigns it to the GroupObjectFilter field. +func (o *LDAPSourceRequest) SetGroupObjectFilter(v string) { + o.GroupObjectFilter = &v +} + +// GetGroupMembershipField returns the GroupMembershipField field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetGroupMembershipField() string { + if o == nil || IsNil(o.GroupMembershipField) { + var ret string + return ret + } + return *o.GroupMembershipField +} + +// GetGroupMembershipFieldOk returns a tuple with the GroupMembershipField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetGroupMembershipFieldOk() (*string, bool) { + if o == nil || IsNil(o.GroupMembershipField) { + return nil, false + } + return o.GroupMembershipField, true +} + +// HasGroupMembershipField returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasGroupMembershipField() bool { + if o != nil && !IsNil(o.GroupMembershipField) { + return true + } + + return false +} + +// SetGroupMembershipField gets a reference to the given string and assigns it to the GroupMembershipField field. +func (o *LDAPSourceRequest) SetGroupMembershipField(v string) { + o.GroupMembershipField = &v +} + +// GetUserMembershipAttribute returns the UserMembershipAttribute field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetUserMembershipAttribute() string { + if o == nil || IsNil(o.UserMembershipAttribute) { + var ret string + return ret + } + return *o.UserMembershipAttribute +} + +// GetUserMembershipAttributeOk returns a tuple with the UserMembershipAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetUserMembershipAttributeOk() (*string, bool) { + if o == nil || IsNil(o.UserMembershipAttribute) { + return nil, false + } + return o.UserMembershipAttribute, true +} + +// HasUserMembershipAttribute returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasUserMembershipAttribute() bool { + if o != nil && !IsNil(o.UserMembershipAttribute) { + return true + } + + return false +} + +// SetUserMembershipAttribute gets a reference to the given string and assigns it to the UserMembershipAttribute field. +func (o *LDAPSourceRequest) SetUserMembershipAttribute(v string) { + o.UserMembershipAttribute = &v +} + +// GetObjectUniquenessField returns the ObjectUniquenessField field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetObjectUniquenessField() string { + if o == nil || IsNil(o.ObjectUniquenessField) { + var ret string + return ret + } + return *o.ObjectUniquenessField +} + +// GetObjectUniquenessFieldOk returns a tuple with the ObjectUniquenessField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetObjectUniquenessFieldOk() (*string, bool) { + if o == nil || IsNil(o.ObjectUniquenessField) { + return nil, false + } + return o.ObjectUniquenessField, true +} + +// HasObjectUniquenessField returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasObjectUniquenessField() bool { + if o != nil && !IsNil(o.ObjectUniquenessField) { + return true + } + + return false +} + +// SetObjectUniquenessField gets a reference to the given string and assigns it to the ObjectUniquenessField field. +func (o *LDAPSourceRequest) SetObjectUniquenessField(v string) { + o.ObjectUniquenessField = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *LDAPSourceRequest) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *LDAPSourceRequest) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *LDAPSourceRequest) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncGroups returns the SyncGroups field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetSyncGroups() bool { + if o == nil || IsNil(o.SyncGroups) { + var ret bool + return ret + } + return *o.SyncGroups +} + +// GetSyncGroupsOk returns a tuple with the SyncGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSyncGroupsOk() (*bool, bool) { + if o == nil || IsNil(o.SyncGroups) { + return nil, false + } + return o.SyncGroups, true +} + +// HasSyncGroups returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSyncGroups() bool { + if o != nil && !IsNil(o.SyncGroups) { + return true + } + + return false +} + +// SetSyncGroups gets a reference to the given bool and assigns it to the SyncGroups field. +func (o *LDAPSourceRequest) SetSyncGroups(v bool) { + o.SyncGroups = &v +} + +// GetSyncParentGroup returns the SyncParentGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LDAPSourceRequest) GetSyncParentGroup() string { + if o == nil || IsNil(o.SyncParentGroup.Get()) { + var ret string + return ret + } + return *o.SyncParentGroup.Get() +} + +// GetSyncParentGroupOk returns a tuple with the SyncParentGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LDAPSourceRequest) GetSyncParentGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SyncParentGroup.Get(), o.SyncParentGroup.IsSet() +} + +// HasSyncParentGroup returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSyncParentGroup() bool { + if o != nil && o.SyncParentGroup.IsSet() { + return true + } + + return false +} + +// SetSyncParentGroup gets a reference to the given NullableString and assigns it to the SyncParentGroup field. +func (o *LDAPSourceRequest) SetSyncParentGroup(v string) { + o.SyncParentGroup.Set(&v) +} + +// SetSyncParentGroupNil sets the value for SyncParentGroup to be an explicit nil +func (o *LDAPSourceRequest) SetSyncParentGroupNil() { + o.SyncParentGroup.Set(nil) +} + +// UnsetSyncParentGroup ensures that no value is present for SyncParentGroup, not even an explicit nil +func (o *LDAPSourceRequest) UnsetSyncParentGroup() { + o.SyncParentGroup.Unset() +} + +// GetLookupGroupsFromUser returns the LookupGroupsFromUser field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetLookupGroupsFromUser() bool { + if o == nil || IsNil(o.LookupGroupsFromUser) { + var ret bool + return ret + } + return *o.LookupGroupsFromUser +} + +// GetLookupGroupsFromUserOk returns a tuple with the LookupGroupsFromUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetLookupGroupsFromUserOk() (*bool, bool) { + if o == nil || IsNil(o.LookupGroupsFromUser) { + return nil, false + } + return o.LookupGroupsFromUser, true +} + +// HasLookupGroupsFromUser returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasLookupGroupsFromUser() bool { + if o != nil && !IsNil(o.LookupGroupsFromUser) { + return true + } + + return false +} + +// SetLookupGroupsFromUser gets a reference to the given bool and assigns it to the LookupGroupsFromUser field. +func (o *LDAPSourceRequest) SetLookupGroupsFromUser(v bool) { + o.LookupGroupsFromUser = &v +} + +// GetDeleteNotFoundObjects returns the DeleteNotFoundObjects field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetDeleteNotFoundObjects() bool { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + var ret bool + return ret + } + return *o.DeleteNotFoundObjects +} + +// GetDeleteNotFoundObjectsOk returns a tuple with the DeleteNotFoundObjects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetDeleteNotFoundObjectsOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + return nil, false + } + return o.DeleteNotFoundObjects, true +} + +// HasDeleteNotFoundObjects returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasDeleteNotFoundObjects() bool { + if o != nil && !IsNil(o.DeleteNotFoundObjects) { + return true + } + + return false +} + +// SetDeleteNotFoundObjects gets a reference to the given bool and assigns it to the DeleteNotFoundObjects field. +func (o *LDAPSourceRequest) SetDeleteNotFoundObjects(v bool) { + o.DeleteNotFoundObjects = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *LDAPSourceRequest) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LDAPSourceRequest) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *LDAPSourceRequest) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *LDAPSourceRequest) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o LDAPSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LDAPSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["server_uri"] = o.ServerUri + if o.PeerCertificate.IsSet() { + toSerialize["peer_certificate"] = o.PeerCertificate.Get() + } + if o.ClientCertificate.IsSet() { + toSerialize["client_certificate"] = o.ClientCertificate.Get() + } + if !IsNil(o.BindCn) { + toSerialize["bind_cn"] = o.BindCn + } + if !IsNil(o.BindPassword) { + toSerialize["bind_password"] = o.BindPassword + } + if !IsNil(o.StartTls) { + toSerialize["start_tls"] = o.StartTls + } + if !IsNil(o.Sni) { + toSerialize["sni"] = o.Sni + } + toSerialize["base_dn"] = o.BaseDn + if !IsNil(o.AdditionalUserDn) { + toSerialize["additional_user_dn"] = o.AdditionalUserDn + } + if !IsNil(o.AdditionalGroupDn) { + toSerialize["additional_group_dn"] = o.AdditionalGroupDn + } + if !IsNil(o.UserObjectFilter) { + toSerialize["user_object_filter"] = o.UserObjectFilter + } + if !IsNil(o.GroupObjectFilter) { + toSerialize["group_object_filter"] = o.GroupObjectFilter + } + if !IsNil(o.GroupMembershipField) { + toSerialize["group_membership_field"] = o.GroupMembershipField + } + if !IsNil(o.UserMembershipAttribute) { + toSerialize["user_membership_attribute"] = o.UserMembershipAttribute + } + if !IsNil(o.ObjectUniquenessField) { + toSerialize["object_uniqueness_field"] = o.ObjectUniquenessField + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncGroups) { + toSerialize["sync_groups"] = o.SyncGroups + } + if o.SyncParentGroup.IsSet() { + toSerialize["sync_parent_group"] = o.SyncParentGroup.Get() + } + if !IsNil(o.LookupGroupsFromUser) { + toSerialize["lookup_groups_from_user"] = o.LookupGroupsFromUser + } + if !IsNil(o.DeleteNotFoundObjects) { + toSerialize["delete_not_found_objects"] = o.DeleteNotFoundObjects + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LDAPSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "server_uri", + "base_dn", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLDAPSourceRequest := _LDAPSourceRequest{} + + err = json.Unmarshal(data, &varLDAPSourceRequest) + + if err != nil { + return err + } + + *o = LDAPSourceRequest(varLDAPSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "server_uri") + delete(additionalProperties, "peer_certificate") + delete(additionalProperties, "client_certificate") + delete(additionalProperties, "bind_cn") + delete(additionalProperties, "bind_password") + delete(additionalProperties, "start_tls") + delete(additionalProperties, "sni") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "additional_user_dn") + delete(additionalProperties, "additional_group_dn") + delete(additionalProperties, "user_object_filter") + delete(additionalProperties, "group_object_filter") + delete(additionalProperties, "group_membership_field") + delete(additionalProperties, "user_membership_attribute") + delete(additionalProperties, "object_uniqueness_field") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_groups") + delete(additionalProperties, "sync_parent_group") + delete(additionalProperties, "lookup_groups_from_user") + delete(additionalProperties, "delete_not_found_objects") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLDAPSourceRequest struct { + value *LDAPSourceRequest + isSet bool +} + +func (v NullableLDAPSourceRequest) Get() *LDAPSourceRequest { + return v.value +} + +func (v *NullableLDAPSourceRequest) Set(val *LDAPSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPSourceRequest(val *LDAPSourceRequest) *NullableLDAPSourceRequest { + return &NullableLDAPSourceRequest{value: val, isSet: true} +} + +func (v NullableLDAPSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ldapapi_access_mode.go b/packages/client-go/model_ldapapi_access_mode.go new file mode 100644 index 0000000000..d363ec375a --- /dev/null +++ b/packages/client-go/model_ldapapi_access_mode.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LDAPAPIAccessMode the model 'LDAPAPIAccessMode' +type LDAPAPIAccessMode string + +// List of LDAPAPIAccessMode +const ( + LDAPAPIACCESSMODE_DIRECT LDAPAPIAccessMode = "direct" + LDAPAPIACCESSMODE_CACHED LDAPAPIAccessMode = "cached" +) + +// All allowed values of LDAPAPIAccessMode enum +var AllowedLDAPAPIAccessModeEnumValues = []LDAPAPIAccessMode{ + "direct", + "cached", +} + +func (v *LDAPAPIAccessMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LDAPAPIAccessMode(value) + for _, existing := range AllowedLDAPAPIAccessModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LDAPAPIAccessMode", value) +} + +// NewLDAPAPIAccessModeFromValue returns a pointer to a valid LDAPAPIAccessMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLDAPAPIAccessModeFromValue(v string) (*LDAPAPIAccessMode, error) { + ev := LDAPAPIAccessMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LDAPAPIAccessMode: valid values are %v", v, AllowedLDAPAPIAccessModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LDAPAPIAccessMode) IsValid() bool { + for _, existing := range AllowedLDAPAPIAccessModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LDAPAPIAccessMode value +func (v LDAPAPIAccessMode) Ptr() *LDAPAPIAccessMode { + return &v +} + +type NullableLDAPAPIAccessMode struct { + value *LDAPAPIAccessMode + isSet bool +} + +func (v NullableLDAPAPIAccessMode) Get() *LDAPAPIAccessMode { + return v.value +} + +func (v *NullableLDAPAPIAccessMode) Set(val *LDAPAPIAccessMode) { + v.value = val + v.isSet = true +} + +func (v NullableLDAPAPIAccessMode) IsSet() bool { + return v.isSet +} + +func (v *NullableLDAPAPIAccessMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLDAPAPIAccessMode(val *LDAPAPIAccessMode) *NullableLDAPAPIAccessMode { + return &NullableLDAPAPIAccessMode{value: val, isSet: true} +} + +func (v NullableLDAPAPIAccessMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLDAPAPIAccessMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license.go b/packages/client-go/model_license.go new file mode 100644 index 0000000000..ffd697c566 --- /dev/null +++ b/packages/client-go/model_license.go @@ -0,0 +1,313 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the License type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &License{} + +// License License Serializer +type License struct { + LicenseUuid string `json:"license_uuid"` + Name string `json:"name"` + Key string `json:"key"` + Expiry time.Time `json:"expiry"` + InternalUsers int32 `json:"internal_users"` + ExternalUsers int32 `json:"external_users"` + AdditionalProperties map[string]interface{} +} + +type _License License + +// NewLicense instantiates a new License object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicense(licenseUuid string, name string, key string, expiry time.Time, internalUsers int32, externalUsers int32) *License { + this := License{} + this.LicenseUuid = licenseUuid + this.Name = name + this.Key = key + this.Expiry = expiry + this.InternalUsers = internalUsers + this.ExternalUsers = externalUsers + return &this +} + +// NewLicenseWithDefaults instantiates a new License object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseWithDefaults() *License { + this := License{} + return &this +} + +// GetLicenseUuid returns the LicenseUuid field value +func (o *License) GetLicenseUuid() string { + if o == nil { + var ret string + return ret + } + + return o.LicenseUuid +} + +// GetLicenseUuidOk returns a tuple with the LicenseUuid field value +// and a boolean to check if the value has been set. +func (o *License) GetLicenseUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.LicenseUuid, true +} + +// SetLicenseUuid sets field value +func (o *License) SetLicenseUuid(v string) { + o.LicenseUuid = v +} + +// GetName returns the Name field value +func (o *License) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *License) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *License) SetName(v string) { + o.Name = v +} + +// GetKey returns the Key field value +func (o *License) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *License) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *License) SetKey(v string) { + o.Key = v +} + +// GetExpiry returns the Expiry field value +func (o *License) GetExpiry() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Expiry +} + +// GetExpiryOk returns a tuple with the Expiry field value +// and a boolean to check if the value has been set. +func (o *License) GetExpiryOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Expiry, true +} + +// SetExpiry sets field value +func (o *License) SetExpiry(v time.Time) { + o.Expiry = v +} + +// GetInternalUsers returns the InternalUsers field value +func (o *License) GetInternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InternalUsers +} + +// GetInternalUsersOk returns a tuple with the InternalUsers field value +// and a boolean to check if the value has been set. +func (o *License) GetInternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InternalUsers, true +} + +// SetInternalUsers sets field value +func (o *License) SetInternalUsers(v int32) { + o.InternalUsers = v +} + +// GetExternalUsers returns the ExternalUsers field value +func (o *License) GetExternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ExternalUsers +} + +// GetExternalUsersOk returns a tuple with the ExternalUsers field value +// and a boolean to check if the value has been set. +func (o *License) GetExternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ExternalUsers, true +} + +// SetExternalUsers sets field value +func (o *License) SetExternalUsers(v int32) { + o.ExternalUsers = v +} + +func (o License) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o License) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["license_uuid"] = o.LicenseUuid + toSerialize["name"] = o.Name + toSerialize["key"] = o.Key + toSerialize["expiry"] = o.Expiry + toSerialize["internal_users"] = o.InternalUsers + toSerialize["external_users"] = o.ExternalUsers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *License) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "license_uuid", + "name", + "key", + "expiry", + "internal_users", + "external_users", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLicense := _License{} + + err = json.Unmarshal(data, &varLicense) + + if err != nil { + return err + } + + *o = License(varLicense) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "license_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "key") + delete(additionalProperties, "expiry") + delete(additionalProperties, "internal_users") + delete(additionalProperties, "external_users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicense struct { + value *License + isSet bool +} + +func (v NullableLicense) Get() *License { + return v.value +} + +func (v *NullableLicense) Set(val *License) { + v.value = val + v.isSet = true +} + +func (v NullableLicense) IsSet() bool { + return v.isSet +} + +func (v *NullableLicense) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicense(val *License) *NullableLicense { + return &NullableLicense{value: val, isSet: true} +} + +func (v NullableLicense) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicense) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_flags_enum.go b/packages/client-go/model_license_flags_enum.go new file mode 100644 index 0000000000..6e5ffba367 --- /dev/null +++ b/packages/client-go/model_license_flags_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LicenseFlagsEnum the model 'LicenseFlagsEnum' +type LicenseFlagsEnum string + +// List of LicenseFlagsEnum +const ( + LICENSEFLAGSENUM_TRIAL LicenseFlagsEnum = "trial" + LICENSEFLAGSENUM_NON_PRODUCTION LicenseFlagsEnum = "non_production" +) + +// All allowed values of LicenseFlagsEnum enum +var AllowedLicenseFlagsEnumEnumValues = []LicenseFlagsEnum{ + "trial", + "non_production", +} + +func (v *LicenseFlagsEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LicenseFlagsEnum(value) + for _, existing := range AllowedLicenseFlagsEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LicenseFlagsEnum", value) +} + +// NewLicenseFlagsEnumFromValue returns a pointer to a valid LicenseFlagsEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLicenseFlagsEnumFromValue(v string) (*LicenseFlagsEnum, error) { + ev := LicenseFlagsEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LicenseFlagsEnum: valid values are %v", v, AllowedLicenseFlagsEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LicenseFlagsEnum) IsValid() bool { + for _, existing := range AllowedLicenseFlagsEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LicenseFlagsEnum value +func (v LicenseFlagsEnum) Ptr() *LicenseFlagsEnum { + return &v +} + +type NullableLicenseFlagsEnum struct { + value *LicenseFlagsEnum + isSet bool +} + +func (v NullableLicenseFlagsEnum) Get() *LicenseFlagsEnum { + return v.value +} + +func (v *NullableLicenseFlagsEnum) Set(val *LicenseFlagsEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseFlagsEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseFlagsEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseFlagsEnum(val *LicenseFlagsEnum) *NullableLicenseFlagsEnum { + return &NullableLicenseFlagsEnum{value: val, isSet: true} +} + +func (v NullableLicenseFlagsEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseFlagsEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_forecast.go b/packages/client-go/model_license_forecast.go new file mode 100644 index 0000000000..11c4b06cd7 --- /dev/null +++ b/packages/client-go/model_license_forecast.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LicenseForecast type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseForecast{} + +// LicenseForecast Serializer for license forecast +type LicenseForecast struct { + InternalUsers int32 `json:"internal_users"` + ExternalUsers int32 `json:"external_users"` + ForecastedInternalUsers int32 `json:"forecasted_internal_users"` + ForecastedExternalUsers int32 `json:"forecasted_external_users"` + AdditionalProperties map[string]interface{} +} + +type _LicenseForecast LicenseForecast + +// NewLicenseForecast instantiates a new LicenseForecast object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseForecast(internalUsers int32, externalUsers int32, forecastedInternalUsers int32, forecastedExternalUsers int32) *LicenseForecast { + this := LicenseForecast{} + this.InternalUsers = internalUsers + this.ExternalUsers = externalUsers + this.ForecastedInternalUsers = forecastedInternalUsers + this.ForecastedExternalUsers = forecastedExternalUsers + return &this +} + +// NewLicenseForecastWithDefaults instantiates a new LicenseForecast object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseForecastWithDefaults() *LicenseForecast { + this := LicenseForecast{} + return &this +} + +// GetInternalUsers returns the InternalUsers field value +func (o *LicenseForecast) GetInternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InternalUsers +} + +// GetInternalUsersOk returns a tuple with the InternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseForecast) GetInternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InternalUsers, true +} + +// SetInternalUsers sets field value +func (o *LicenseForecast) SetInternalUsers(v int32) { + o.InternalUsers = v +} + +// GetExternalUsers returns the ExternalUsers field value +func (o *LicenseForecast) GetExternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ExternalUsers +} + +// GetExternalUsersOk returns a tuple with the ExternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseForecast) GetExternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ExternalUsers, true +} + +// SetExternalUsers sets field value +func (o *LicenseForecast) SetExternalUsers(v int32) { + o.ExternalUsers = v +} + +// GetForecastedInternalUsers returns the ForecastedInternalUsers field value +func (o *LicenseForecast) GetForecastedInternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ForecastedInternalUsers +} + +// GetForecastedInternalUsersOk returns a tuple with the ForecastedInternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseForecast) GetForecastedInternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ForecastedInternalUsers, true +} + +// SetForecastedInternalUsers sets field value +func (o *LicenseForecast) SetForecastedInternalUsers(v int32) { + o.ForecastedInternalUsers = v +} + +// GetForecastedExternalUsers returns the ForecastedExternalUsers field value +func (o *LicenseForecast) GetForecastedExternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ForecastedExternalUsers +} + +// GetForecastedExternalUsersOk returns a tuple with the ForecastedExternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseForecast) GetForecastedExternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ForecastedExternalUsers, true +} + +// SetForecastedExternalUsers sets field value +func (o *LicenseForecast) SetForecastedExternalUsers(v int32) { + o.ForecastedExternalUsers = v +} + +func (o LicenseForecast) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseForecast) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["internal_users"] = o.InternalUsers + toSerialize["external_users"] = o.ExternalUsers + toSerialize["forecasted_internal_users"] = o.ForecastedInternalUsers + toSerialize["forecasted_external_users"] = o.ForecastedExternalUsers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseForecast) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "internal_users", + "external_users", + "forecasted_internal_users", + "forecasted_external_users", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLicenseForecast := _LicenseForecast{} + + err = json.Unmarshal(data, &varLicenseForecast) + + if err != nil { + return err + } + + *o = LicenseForecast(varLicenseForecast) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "internal_users") + delete(additionalProperties, "external_users") + delete(additionalProperties, "forecasted_internal_users") + delete(additionalProperties, "forecasted_external_users") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseForecast struct { + value *LicenseForecast + isSet bool +} + +func (v NullableLicenseForecast) Get() *LicenseForecast { + return v.value +} + +func (v *NullableLicenseForecast) Set(val *LicenseForecast) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseForecast) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseForecast) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseForecast(val *LicenseForecast) *NullableLicenseForecast { + return &NullableLicenseForecast{value: val, isSet: true} +} + +func (v NullableLicenseForecast) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseForecast) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_request.go b/packages/client-go/model_license_request.go new file mode 100644 index 0000000000..d0febbb844 --- /dev/null +++ b/packages/client-go/model_license_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LicenseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseRequest{} + +// LicenseRequest License Serializer +type LicenseRequest struct { + Key string `json:"key"` + AdditionalProperties map[string]interface{} +} + +type _LicenseRequest LicenseRequest + +// NewLicenseRequest instantiates a new LicenseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseRequest(key string) *LicenseRequest { + this := LicenseRequest{} + this.Key = key + return &this +} + +// NewLicenseRequestWithDefaults instantiates a new LicenseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseRequestWithDefaults() *LicenseRequest { + this := LicenseRequest{} + return &this +} + +// GetKey returns the Key field value +func (o *LicenseRequest) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *LicenseRequest) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *LicenseRequest) SetKey(v string) { + o.Key = v +} + +func (o LicenseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLicenseRequest := _LicenseRequest{} + + err = json.Unmarshal(data, &varLicenseRequest) + + if err != nil { + return err + } + + *o = LicenseRequest(varLicenseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseRequest struct { + value *LicenseRequest + isSet bool +} + +func (v NullableLicenseRequest) Get() *LicenseRequest { + return v.value +} + +func (v *NullableLicenseRequest) Set(val *LicenseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseRequest(val *LicenseRequest) *NullableLicenseRequest { + return &NullableLicenseRequest{value: val, isSet: true} +} + +func (v NullableLicenseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_status_enum.go b/packages/client-go/model_license_status_enum.go new file mode 100644 index 0000000000..fc73d0abec --- /dev/null +++ b/packages/client-go/model_license_status_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LicenseStatusEnum the model 'LicenseStatusEnum' +type LicenseStatusEnum string + +// List of LicenseStatusEnum +const ( + LICENSESTATUSENUM_UNLICENSED LicenseStatusEnum = "unlicensed" + LICENSESTATUSENUM_VALID LicenseStatusEnum = "valid" + LICENSESTATUSENUM_EXPIRED LicenseStatusEnum = "expired" + LICENSESTATUSENUM_EXPIRY_SOON LicenseStatusEnum = "expiry_soon" + LICENSESTATUSENUM_LIMIT_EXCEEDED_ADMIN LicenseStatusEnum = "limit_exceeded_admin" + LICENSESTATUSENUM_LIMIT_EXCEEDED_USER LicenseStatusEnum = "limit_exceeded_user" + LICENSESTATUSENUM_READ_ONLY LicenseStatusEnum = "read_only" +) + +// All allowed values of LicenseStatusEnum enum +var AllowedLicenseStatusEnumEnumValues = []LicenseStatusEnum{ + "unlicensed", + "valid", + "expired", + "expiry_soon", + "limit_exceeded_admin", + "limit_exceeded_user", + "read_only", +} + +func (v *LicenseStatusEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LicenseStatusEnum(value) + for _, existing := range AllowedLicenseStatusEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LicenseStatusEnum", value) +} + +// NewLicenseStatusEnumFromValue returns a pointer to a valid LicenseStatusEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLicenseStatusEnumFromValue(v string) (*LicenseStatusEnum, error) { + ev := LicenseStatusEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LicenseStatusEnum: valid values are %v", v, AllowedLicenseStatusEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LicenseStatusEnum) IsValid() bool { + for _, existing := range AllowedLicenseStatusEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LicenseStatusEnum value +func (v LicenseStatusEnum) Ptr() *LicenseStatusEnum { + return &v +} + +type NullableLicenseStatusEnum struct { + value *LicenseStatusEnum + isSet bool +} + +func (v NullableLicenseStatusEnum) Get() *LicenseStatusEnum { + return v.value +} + +func (v *NullableLicenseStatusEnum) Set(val *LicenseStatusEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseStatusEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseStatusEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseStatusEnum(val *LicenseStatusEnum) *NullableLicenseStatusEnum { + return &NullableLicenseStatusEnum{value: val, isSet: true} +} + +func (v NullableLicenseStatusEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseStatusEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_summary.go b/packages/client-go/model_license_summary.go new file mode 100644 index 0000000000..d245f02567 --- /dev/null +++ b/packages/client-go/model_license_summary.go @@ -0,0 +1,284 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the LicenseSummary type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LicenseSummary{} + +// LicenseSummary Serializer for license status +type LicenseSummary struct { + InternalUsers int32 `json:"internal_users"` + ExternalUsers int32 `json:"external_users"` + Status LicenseSummaryStatusEnum `json:"status"` + LatestValid time.Time `json:"latest_valid"` + LicenseFlags []LicenseFlagsEnum `json:"license_flags"` + AdditionalProperties map[string]interface{} +} + +type _LicenseSummary LicenseSummary + +// NewLicenseSummary instantiates a new LicenseSummary object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLicenseSummary(internalUsers int32, externalUsers int32, status LicenseSummaryStatusEnum, latestValid time.Time, licenseFlags []LicenseFlagsEnum) *LicenseSummary { + this := LicenseSummary{} + this.InternalUsers = internalUsers + this.ExternalUsers = externalUsers + this.Status = status + this.LatestValid = latestValid + this.LicenseFlags = licenseFlags + return &this +} + +// NewLicenseSummaryWithDefaults instantiates a new LicenseSummary object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLicenseSummaryWithDefaults() *LicenseSummary { + this := LicenseSummary{} + return &this +} + +// GetInternalUsers returns the InternalUsers field value +func (o *LicenseSummary) GetInternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.InternalUsers +} + +// GetInternalUsersOk returns a tuple with the InternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseSummary) GetInternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.InternalUsers, true +} + +// SetInternalUsers sets field value +func (o *LicenseSummary) SetInternalUsers(v int32) { + o.InternalUsers = v +} + +// GetExternalUsers returns the ExternalUsers field value +func (o *LicenseSummary) GetExternalUsers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.ExternalUsers +} + +// GetExternalUsersOk returns a tuple with the ExternalUsers field value +// and a boolean to check if the value has been set. +func (o *LicenseSummary) GetExternalUsersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.ExternalUsers, true +} + +// SetExternalUsers sets field value +func (o *LicenseSummary) SetExternalUsers(v int32) { + o.ExternalUsers = v +} + +// GetStatus returns the Status field value +func (o *LicenseSummary) GetStatus() LicenseSummaryStatusEnum { + if o == nil { + var ret LicenseSummaryStatusEnum + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *LicenseSummary) GetStatusOk() (*LicenseSummaryStatusEnum, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *LicenseSummary) SetStatus(v LicenseSummaryStatusEnum) { + o.Status = v +} + +// GetLatestValid returns the LatestValid field value +func (o *LicenseSummary) GetLatestValid() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LatestValid +} + +// GetLatestValidOk returns a tuple with the LatestValid field value +// and a boolean to check if the value has been set. +func (o *LicenseSummary) GetLatestValidOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LatestValid, true +} + +// SetLatestValid sets field value +func (o *LicenseSummary) SetLatestValid(v time.Time) { + o.LatestValid = v +} + +// GetLicenseFlags returns the LicenseFlags field value +func (o *LicenseSummary) GetLicenseFlags() []LicenseFlagsEnum { + if o == nil { + var ret []LicenseFlagsEnum + return ret + } + + return o.LicenseFlags +} + +// GetLicenseFlagsOk returns a tuple with the LicenseFlags field value +// and a boolean to check if the value has been set. +func (o *LicenseSummary) GetLicenseFlagsOk() ([]LicenseFlagsEnum, bool) { + if o == nil { + return nil, false + } + return o.LicenseFlags, true +} + +// SetLicenseFlags sets field value +func (o *LicenseSummary) SetLicenseFlags(v []LicenseFlagsEnum) { + o.LicenseFlags = v +} + +func (o LicenseSummary) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LicenseSummary) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["internal_users"] = o.InternalUsers + toSerialize["external_users"] = o.ExternalUsers + toSerialize["status"] = o.Status + toSerialize["latest_valid"] = o.LatestValid + toSerialize["license_flags"] = o.LicenseFlags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LicenseSummary) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "internal_users", + "external_users", + "status", + "latest_valid", + "license_flags", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLicenseSummary := _LicenseSummary{} + + err = json.Unmarshal(data, &varLicenseSummary) + + if err != nil { + return err + } + + *o = LicenseSummary(varLicenseSummary) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "internal_users") + delete(additionalProperties, "external_users") + delete(additionalProperties, "status") + delete(additionalProperties, "latest_valid") + delete(additionalProperties, "license_flags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLicenseSummary struct { + value *LicenseSummary + isSet bool +} + +func (v NullableLicenseSummary) Get() *LicenseSummary { + return v.value +} + +func (v *NullableLicenseSummary) Set(val *LicenseSummary) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseSummary) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseSummary) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseSummary(val *LicenseSummary) *NullableLicenseSummary { + return &NullableLicenseSummary{value: val, isSet: true} +} + +func (v NullableLicenseSummary) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseSummary) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_license_summary_status_enum.go b/packages/client-go/model_license_summary_status_enum.go new file mode 100644 index 0000000000..ff1d089cf6 --- /dev/null +++ b/packages/client-go/model_license_summary_status_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LicenseSummaryStatusEnum the model 'LicenseSummaryStatusEnum' +type LicenseSummaryStatusEnum string + +// List of LicenseSummaryStatusEnum +const ( + LICENSESUMMARYSTATUSENUM_UNLICENSED LicenseSummaryStatusEnum = "unlicensed" + LICENSESUMMARYSTATUSENUM_VALID LicenseSummaryStatusEnum = "valid" + LICENSESUMMARYSTATUSENUM_EXPIRED LicenseSummaryStatusEnum = "expired" + LICENSESUMMARYSTATUSENUM_EXPIRY_SOON LicenseSummaryStatusEnum = "expiry_soon" + LICENSESUMMARYSTATUSENUM_LIMIT_EXCEEDED_ADMIN LicenseSummaryStatusEnum = "limit_exceeded_admin" + LICENSESUMMARYSTATUSENUM_LIMIT_EXCEEDED_USER LicenseSummaryStatusEnum = "limit_exceeded_user" + LICENSESUMMARYSTATUSENUM_READ_ONLY LicenseSummaryStatusEnum = "read_only" +) + +// All allowed values of LicenseSummaryStatusEnum enum +var AllowedLicenseSummaryStatusEnumEnumValues = []LicenseSummaryStatusEnum{ + "unlicensed", + "valid", + "expired", + "expiry_soon", + "limit_exceeded_admin", + "limit_exceeded_user", + "read_only", +} + +func (v *LicenseSummaryStatusEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LicenseSummaryStatusEnum(value) + for _, existing := range AllowedLicenseSummaryStatusEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LicenseSummaryStatusEnum", value) +} + +// NewLicenseSummaryStatusEnumFromValue returns a pointer to a valid LicenseSummaryStatusEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLicenseSummaryStatusEnumFromValue(v string) (*LicenseSummaryStatusEnum, error) { + ev := LicenseSummaryStatusEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LicenseSummaryStatusEnum: valid values are %v", v, AllowedLicenseSummaryStatusEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LicenseSummaryStatusEnum) IsValid() bool { + for _, existing := range AllowedLicenseSummaryStatusEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LicenseSummaryStatusEnum value +func (v LicenseSummaryStatusEnum) Ptr() *LicenseSummaryStatusEnum { + return &v +} + +type NullableLicenseSummaryStatusEnum struct { + value *LicenseSummaryStatusEnum + isSet bool +} + +func (v NullableLicenseSummaryStatusEnum) Get() *LicenseSummaryStatusEnum { + return v.value +} + +func (v *NullableLicenseSummaryStatusEnum) Set(val *LicenseSummaryStatusEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLicenseSummaryStatusEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLicenseSummaryStatusEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLicenseSummaryStatusEnum(val *LicenseSummaryStatusEnum) *NullableLicenseSummaryStatusEnum { + return &NullableLicenseSummaryStatusEnum{value: val, isSet: true} +} + +func (v NullableLicenseSummaryStatusEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLicenseSummaryStatusEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_lifecycle_iteration.go b/packages/client-go/model_lifecycle_iteration.go new file mode 100644 index 0000000000..1c32c08684 --- /dev/null +++ b/packages/client-go/model_lifecycle_iteration.go @@ -0,0 +1,545 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the LifecycleIteration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LifecycleIteration{} + +// LifecycleIteration Mixin to validate that a valid enterprise license exists before allowing to save the object +type LifecycleIteration struct { + Id string `json:"id"` + ContentType ContentTypeEnum `json:"content_type"` + ObjectId string `json:"object_id"` + ObjectVerbose string `json:"object_verbose"` + ObjectAdminUrl string `json:"object_admin_url"` + State LifecycleIterationStateEnum `json:"state"` + OpenedOn time.Time `json:"opened_on"` + GracePeriodEnd time.Time `json:"grace_period_end"` + NextReviewDate time.Time `json:"next_review_date"` + Reviews []Review `json:"reviews"` + UserCanReview bool `json:"user_can_review"` + ReviewerGroups []ReviewerGroup `json:"reviewer_groups"` + MinReviewers int32 `json:"min_reviewers"` + Reviewers []ReviewerUser `json:"reviewers"` + AdditionalProperties map[string]interface{} +} + +type _LifecycleIteration LifecycleIteration + +// NewLifecycleIteration instantiates a new LifecycleIteration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLifecycleIteration(id string, contentType ContentTypeEnum, objectId string, objectVerbose string, objectAdminUrl string, state LifecycleIterationStateEnum, openedOn time.Time, gracePeriodEnd time.Time, nextReviewDate time.Time, reviews []Review, userCanReview bool, reviewerGroups []ReviewerGroup, minReviewers int32, reviewers []ReviewerUser) *LifecycleIteration { + this := LifecycleIteration{} + this.Id = id + this.ContentType = contentType + this.ObjectId = objectId + this.ObjectVerbose = objectVerbose + this.ObjectAdminUrl = objectAdminUrl + this.State = state + this.OpenedOn = openedOn + this.GracePeriodEnd = gracePeriodEnd + this.NextReviewDate = nextReviewDate + this.Reviews = reviews + this.UserCanReview = userCanReview + this.ReviewerGroups = reviewerGroups + this.MinReviewers = minReviewers + this.Reviewers = reviewers + return &this +} + +// NewLifecycleIterationWithDefaults instantiates a new LifecycleIteration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLifecycleIterationWithDefaults() *LifecycleIteration { + this := LifecycleIteration{} + return &this +} + +// GetId returns the Id field value +func (o *LifecycleIteration) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *LifecycleIteration) SetId(v string) { + o.Id = v +} + +// GetContentType returns the ContentType field value +func (o *LifecycleIteration) GetContentType() ContentTypeEnum { + if o == nil { + var ret ContentTypeEnum + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetContentTypeOk() (*ContentTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *LifecycleIteration) SetContentType(v ContentTypeEnum) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value +func (o *LifecycleIteration) GetObjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectId +} + +// GetObjectIdOk returns a tuple with the ObjectId field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetObjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectId, true +} + +// SetObjectId sets field value +func (o *LifecycleIteration) SetObjectId(v string) { + o.ObjectId = v +} + +// GetObjectVerbose returns the ObjectVerbose field value +func (o *LifecycleIteration) GetObjectVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectVerbose +} + +// GetObjectVerboseOk returns a tuple with the ObjectVerbose field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetObjectVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectVerbose, true +} + +// SetObjectVerbose sets field value +func (o *LifecycleIteration) SetObjectVerbose(v string) { + o.ObjectVerbose = v +} + +// GetObjectAdminUrl returns the ObjectAdminUrl field value +func (o *LifecycleIteration) GetObjectAdminUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectAdminUrl +} + +// GetObjectAdminUrlOk returns a tuple with the ObjectAdminUrl field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetObjectAdminUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectAdminUrl, true +} + +// SetObjectAdminUrl sets field value +func (o *LifecycleIteration) SetObjectAdminUrl(v string) { + o.ObjectAdminUrl = v +} + +// GetState returns the State field value +func (o *LifecycleIteration) GetState() LifecycleIterationStateEnum { + if o == nil { + var ret LifecycleIterationStateEnum + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetStateOk() (*LifecycleIterationStateEnum, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *LifecycleIteration) SetState(v LifecycleIterationStateEnum) { + o.State = v +} + +// GetOpenedOn returns the OpenedOn field value +func (o *LifecycleIteration) GetOpenedOn() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.OpenedOn +} + +// GetOpenedOnOk returns a tuple with the OpenedOn field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetOpenedOnOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.OpenedOn, true +} + +// SetOpenedOn sets field value +func (o *LifecycleIteration) SetOpenedOn(v time.Time) { + o.OpenedOn = v +} + +// GetGracePeriodEnd returns the GracePeriodEnd field value +func (o *LifecycleIteration) GetGracePeriodEnd() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.GracePeriodEnd +} + +// GetGracePeriodEndOk returns a tuple with the GracePeriodEnd field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetGracePeriodEndOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.GracePeriodEnd, true +} + +// SetGracePeriodEnd sets field value +func (o *LifecycleIteration) SetGracePeriodEnd(v time.Time) { + o.GracePeriodEnd = v +} + +// GetNextReviewDate returns the NextReviewDate field value +func (o *LifecycleIteration) GetNextReviewDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.NextReviewDate +} + +// GetNextReviewDateOk returns a tuple with the NextReviewDate field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetNextReviewDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.NextReviewDate, true +} + +// SetNextReviewDate sets field value +func (o *LifecycleIteration) SetNextReviewDate(v time.Time) { + o.NextReviewDate = v +} + +// GetReviews returns the Reviews field value +func (o *LifecycleIteration) GetReviews() []Review { + if o == nil { + var ret []Review + return ret + } + + return o.Reviews +} + +// GetReviewsOk returns a tuple with the Reviews field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetReviewsOk() ([]Review, bool) { + if o == nil { + return nil, false + } + return o.Reviews, true +} + +// SetReviews sets field value +func (o *LifecycleIteration) SetReviews(v []Review) { + o.Reviews = v +} + +// GetUserCanReview returns the UserCanReview field value +func (o *LifecycleIteration) GetUserCanReview() bool { + if o == nil { + var ret bool + return ret + } + + return o.UserCanReview +} + +// GetUserCanReviewOk returns a tuple with the UserCanReview field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetUserCanReviewOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.UserCanReview, true +} + +// SetUserCanReview sets field value +func (o *LifecycleIteration) SetUserCanReview(v bool) { + o.UserCanReview = v +} + +// GetReviewerGroups returns the ReviewerGroups field value +func (o *LifecycleIteration) GetReviewerGroups() []ReviewerGroup { + if o == nil { + var ret []ReviewerGroup + return ret + } + + return o.ReviewerGroups +} + +// GetReviewerGroupsOk returns a tuple with the ReviewerGroups field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetReviewerGroupsOk() ([]ReviewerGroup, bool) { + if o == nil { + return nil, false + } + return o.ReviewerGroups, true +} + +// SetReviewerGroups sets field value +func (o *LifecycleIteration) SetReviewerGroups(v []ReviewerGroup) { + o.ReviewerGroups = v +} + +// GetMinReviewers returns the MinReviewers field value +func (o *LifecycleIteration) GetMinReviewers() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.MinReviewers +} + +// GetMinReviewersOk returns a tuple with the MinReviewers field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetMinReviewersOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.MinReviewers, true +} + +// SetMinReviewers sets field value +func (o *LifecycleIteration) SetMinReviewers(v int32) { + o.MinReviewers = v +} + +// GetReviewers returns the Reviewers field value +func (o *LifecycleIteration) GetReviewers() []ReviewerUser { + if o == nil { + var ret []ReviewerUser + return ret + } + + return o.Reviewers +} + +// GetReviewersOk returns a tuple with the Reviewers field value +// and a boolean to check if the value has been set. +func (o *LifecycleIteration) GetReviewersOk() ([]ReviewerUser, bool) { + if o == nil { + return nil, false + } + return o.Reviewers, true +} + +// SetReviewers sets field value +func (o *LifecycleIteration) SetReviewers(v []ReviewerUser) { + o.Reviewers = v +} + +func (o LifecycleIteration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LifecycleIteration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["content_type"] = o.ContentType + toSerialize["object_id"] = o.ObjectId + toSerialize["object_verbose"] = o.ObjectVerbose + toSerialize["object_admin_url"] = o.ObjectAdminUrl + toSerialize["state"] = o.State + toSerialize["opened_on"] = o.OpenedOn + toSerialize["grace_period_end"] = o.GracePeriodEnd + toSerialize["next_review_date"] = o.NextReviewDate + toSerialize["reviews"] = o.Reviews + toSerialize["user_can_review"] = o.UserCanReview + toSerialize["reviewer_groups"] = o.ReviewerGroups + toSerialize["min_reviewers"] = o.MinReviewers + toSerialize["reviewers"] = o.Reviewers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LifecycleIteration) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "content_type", + "object_id", + "object_verbose", + "object_admin_url", + "state", + "opened_on", + "grace_period_end", + "next_review_date", + "reviews", + "user_can_review", + "reviewer_groups", + "min_reviewers", + "reviewers", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLifecycleIteration := _LifecycleIteration{} + + err = json.Unmarshal(data, &varLifecycleIteration) + + if err != nil { + return err + } + + *o = LifecycleIteration(varLifecycleIteration) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "object_verbose") + delete(additionalProperties, "object_admin_url") + delete(additionalProperties, "state") + delete(additionalProperties, "opened_on") + delete(additionalProperties, "grace_period_end") + delete(additionalProperties, "next_review_date") + delete(additionalProperties, "reviews") + delete(additionalProperties, "user_can_review") + delete(additionalProperties, "reviewer_groups") + delete(additionalProperties, "min_reviewers") + delete(additionalProperties, "reviewers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLifecycleIteration struct { + value *LifecycleIteration + isSet bool +} + +func (v NullableLifecycleIteration) Get() *LifecycleIteration { + return v.value +} + +func (v *NullableLifecycleIteration) Set(val *LifecycleIteration) { + v.value = val + v.isSet = true +} + +func (v NullableLifecycleIteration) IsSet() bool { + return v.isSet +} + +func (v *NullableLifecycleIteration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLifecycleIteration(val *LifecycleIteration) *NullableLifecycleIteration { + return &NullableLifecycleIteration{value: val, isSet: true} +} + +func (v NullableLifecycleIteration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLifecycleIteration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_lifecycle_iteration_request.go b/packages/client-go/model_lifecycle_iteration_request.go new file mode 100644 index 0000000000..484f8105e5 --- /dev/null +++ b/packages/client-go/model_lifecycle_iteration_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LifecycleIterationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LifecycleIterationRequest{} + +// LifecycleIterationRequest Mixin to validate that a valid enterprise license exists before allowing to save the object +type LifecycleIterationRequest struct { + ContentType ContentTypeEnum `json:"content_type"` + AdditionalProperties map[string]interface{} +} + +type _LifecycleIterationRequest LifecycleIterationRequest + +// NewLifecycleIterationRequest instantiates a new LifecycleIterationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLifecycleIterationRequest(contentType ContentTypeEnum) *LifecycleIterationRequest { + this := LifecycleIterationRequest{} + this.ContentType = contentType + return &this +} + +// NewLifecycleIterationRequestWithDefaults instantiates a new LifecycleIterationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLifecycleIterationRequestWithDefaults() *LifecycleIterationRequest { + this := LifecycleIterationRequest{} + return &this +} + +// GetContentType returns the ContentType field value +func (o *LifecycleIterationRequest) GetContentType() ContentTypeEnum { + if o == nil { + var ret ContentTypeEnum + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *LifecycleIterationRequest) GetContentTypeOk() (*ContentTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *LifecycleIterationRequest) SetContentType(v ContentTypeEnum) { + o.ContentType = v +} + +func (o LifecycleIterationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LifecycleIterationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["content_type"] = o.ContentType + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LifecycleIterationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "content_type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLifecycleIterationRequest := _LifecycleIterationRequest{} + + err = json.Unmarshal(data, &varLifecycleIterationRequest) + + if err != nil { + return err + } + + *o = LifecycleIterationRequest(varLifecycleIterationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "content_type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLifecycleIterationRequest struct { + value *LifecycleIterationRequest + isSet bool +} + +func (v NullableLifecycleIterationRequest) Get() *LifecycleIterationRequest { + return v.value +} + +func (v *NullableLifecycleIterationRequest) Set(val *LifecycleIterationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLifecycleIterationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLifecycleIterationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLifecycleIterationRequest(val *LifecycleIterationRequest) *NullableLifecycleIterationRequest { + return &NullableLifecycleIterationRequest{value: val, isSet: true} +} + +func (v NullableLifecycleIterationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLifecycleIterationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_lifecycle_iteration_state_enum.go b/packages/client-go/model_lifecycle_iteration_state_enum.go new file mode 100644 index 0000000000..11933760f8 --- /dev/null +++ b/packages/client-go/model_lifecycle_iteration_state_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LifecycleIterationStateEnum the model 'LifecycleIterationStateEnum' +type LifecycleIterationStateEnum string + +// List of LifecycleIterationStateEnum +const ( + LIFECYCLEITERATIONSTATEENUM_REVIEWED LifecycleIterationStateEnum = "REVIEWED" + LIFECYCLEITERATIONSTATEENUM_PENDING LifecycleIterationStateEnum = "PENDING" + LIFECYCLEITERATIONSTATEENUM_OVERDUE LifecycleIterationStateEnum = "OVERDUE" + LIFECYCLEITERATIONSTATEENUM_CANCELED LifecycleIterationStateEnum = "CANCELED" +) + +// All allowed values of LifecycleIterationStateEnum enum +var AllowedLifecycleIterationStateEnumEnumValues = []LifecycleIterationStateEnum{ + "REVIEWED", + "PENDING", + "OVERDUE", + "CANCELED", +} + +func (v *LifecycleIterationStateEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LifecycleIterationStateEnum(value) + for _, existing := range AllowedLifecycleIterationStateEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LifecycleIterationStateEnum", value) +} + +// NewLifecycleIterationStateEnumFromValue returns a pointer to a valid LifecycleIterationStateEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLifecycleIterationStateEnumFromValue(v string) (*LifecycleIterationStateEnum, error) { + ev := LifecycleIterationStateEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LifecycleIterationStateEnum: valid values are %v", v, AllowedLifecycleIterationStateEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LifecycleIterationStateEnum) IsValid() bool { + for _, existing := range AllowedLifecycleIterationStateEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LifecycleIterationStateEnum value +func (v LifecycleIterationStateEnum) Ptr() *LifecycleIterationStateEnum { + return &v +} + +type NullableLifecycleIterationStateEnum struct { + value *LifecycleIterationStateEnum + isSet bool +} + +func (v NullableLifecycleIterationStateEnum) Get() *LifecycleIterationStateEnum { + return v.value +} + +func (v *NullableLifecycleIterationStateEnum) Set(val *LifecycleIterationStateEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLifecycleIterationStateEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLifecycleIterationStateEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLifecycleIterationStateEnum(val *LifecycleIterationStateEnum) *NullableLifecycleIterationStateEnum { + return &NullableLifecycleIterationStateEnum{value: val, isSet: true} +} + +func (v NullableLifecycleIterationStateEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLifecycleIterationStateEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_lifecycle_rule.go b/packages/client-go/model_lifecycle_rule.go new file mode 100644 index 0000000000..ed031414e6 --- /dev/null +++ b/packages/client-go/model_lifecycle_rule.go @@ -0,0 +1,612 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LifecycleRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LifecycleRule{} + +// LifecycleRule Mixin to validate that a valid enterprise license exists before allowing to save the object +type LifecycleRule struct { + Id string `json:"id"` + Name string `json:"name"` + ContentType ContentTypeEnum `json:"content_type"` + ObjectId NullableString `json:"object_id,omitempty"` + Interval *string `json:"interval,omitempty"` + GracePeriod *string `json:"grace_period,omitempty"` + ReviewerGroups []string `json:"reviewer_groups,omitempty"` + ReviewerGroupsObj []ReviewerGroup `json:"reviewer_groups_obj"` + MinReviewers *int32 `json:"min_reviewers,omitempty"` + MinReviewersIsPerGroup *bool `json:"min_reviewers_is_per_group,omitempty"` + Reviewers []string `json:"reviewers"` + ReviewersObj []ReviewerUser `json:"reviewers_obj"` + // Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI. + NotificationTransports []string `json:"notification_transports,omitempty"` + TargetVerbose string `json:"target_verbose"` + AdditionalProperties map[string]interface{} +} + +type _LifecycleRule LifecycleRule + +// NewLifecycleRule instantiates a new LifecycleRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLifecycleRule(id string, name string, contentType ContentTypeEnum, reviewerGroupsObj []ReviewerGroup, reviewers []string, reviewersObj []ReviewerUser, targetVerbose string) *LifecycleRule { + this := LifecycleRule{} + this.Id = id + this.Name = name + this.ContentType = contentType + this.ReviewerGroupsObj = reviewerGroupsObj + this.Reviewers = reviewers + this.ReviewersObj = reviewersObj + this.TargetVerbose = targetVerbose + return &this +} + +// NewLifecycleRuleWithDefaults instantiates a new LifecycleRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLifecycleRuleWithDefaults() *LifecycleRule { + this := LifecycleRule{} + return &this +} + +// GetId returns the Id field value +func (o *LifecycleRule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *LifecycleRule) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *LifecycleRule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LifecycleRule) SetName(v string) { + o.Name = v +} + +// GetContentType returns the ContentType field value +func (o *LifecycleRule) GetContentType() ContentTypeEnum { + if o == nil { + var ret ContentTypeEnum + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetContentTypeOk() (*ContentTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *LifecycleRule) SetContentType(v ContentTypeEnum) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LifecycleRule) GetObjectId() string { + if o == nil || IsNil(o.ObjectId.Get()) { + var ret string + return ret + } + return *o.ObjectId.Get() +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LifecycleRule) GetObjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectId.Get(), o.ObjectId.IsSet() +} + +// HasObjectId returns a boolean if a field has been set. +func (o *LifecycleRule) HasObjectId() bool { + if o != nil && o.ObjectId.IsSet() { + return true + } + + return false +} + +// SetObjectId gets a reference to the given NullableString and assigns it to the ObjectId field. +func (o *LifecycleRule) SetObjectId(v string) { + o.ObjectId.Set(&v) +} + +// SetObjectIdNil sets the value for ObjectId to be an explicit nil +func (o *LifecycleRule) SetObjectIdNil() { + o.ObjectId.Set(nil) +} + +// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil +func (o *LifecycleRule) UnsetObjectId() { + o.ObjectId.Unset() +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *LifecycleRule) GetInterval() string { + if o == nil || IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *LifecycleRule) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *LifecycleRule) SetInterval(v string) { + o.Interval = &v +} + +// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise. +func (o *LifecycleRule) GetGracePeriod() string { + if o == nil || IsNil(o.GracePeriod) { + var ret string + return ret + } + return *o.GracePeriod +} + +// GetGracePeriodOk returns a tuple with the GracePeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetGracePeriodOk() (*string, bool) { + if o == nil || IsNil(o.GracePeriod) { + return nil, false + } + return o.GracePeriod, true +} + +// HasGracePeriod returns a boolean if a field has been set. +func (o *LifecycleRule) HasGracePeriod() bool { + if o != nil && !IsNil(o.GracePeriod) { + return true + } + + return false +} + +// SetGracePeriod gets a reference to the given string and assigns it to the GracePeriod field. +func (o *LifecycleRule) SetGracePeriod(v string) { + o.GracePeriod = &v +} + +// GetReviewerGroups returns the ReviewerGroups field value if set, zero value otherwise. +func (o *LifecycleRule) GetReviewerGroups() []string { + if o == nil || IsNil(o.ReviewerGroups) { + var ret []string + return ret + } + return o.ReviewerGroups +} + +// GetReviewerGroupsOk returns a tuple with the ReviewerGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetReviewerGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.ReviewerGroups) { + return nil, false + } + return o.ReviewerGroups, true +} + +// HasReviewerGroups returns a boolean if a field has been set. +func (o *LifecycleRule) HasReviewerGroups() bool { + if o != nil && !IsNil(o.ReviewerGroups) { + return true + } + + return false +} + +// SetReviewerGroups gets a reference to the given []string and assigns it to the ReviewerGroups field. +func (o *LifecycleRule) SetReviewerGroups(v []string) { + o.ReviewerGroups = v +} + +// GetReviewerGroupsObj returns the ReviewerGroupsObj field value +func (o *LifecycleRule) GetReviewerGroupsObj() []ReviewerGroup { + if o == nil { + var ret []ReviewerGroup + return ret + } + + return o.ReviewerGroupsObj +} + +// GetReviewerGroupsObjOk returns a tuple with the ReviewerGroupsObj field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetReviewerGroupsObjOk() ([]ReviewerGroup, bool) { + if o == nil { + return nil, false + } + return o.ReviewerGroupsObj, true +} + +// SetReviewerGroupsObj sets field value +func (o *LifecycleRule) SetReviewerGroupsObj(v []ReviewerGroup) { + o.ReviewerGroupsObj = v +} + +// GetMinReviewers returns the MinReviewers field value if set, zero value otherwise. +func (o *LifecycleRule) GetMinReviewers() int32 { + if o == nil || IsNil(o.MinReviewers) { + var ret int32 + return ret + } + return *o.MinReviewers +} + +// GetMinReviewersOk returns a tuple with the MinReviewers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetMinReviewersOk() (*int32, bool) { + if o == nil || IsNil(o.MinReviewers) { + return nil, false + } + return o.MinReviewers, true +} + +// HasMinReviewers returns a boolean if a field has been set. +func (o *LifecycleRule) HasMinReviewers() bool { + if o != nil && !IsNil(o.MinReviewers) { + return true + } + + return false +} + +// SetMinReviewers gets a reference to the given int32 and assigns it to the MinReviewers field. +func (o *LifecycleRule) SetMinReviewers(v int32) { + o.MinReviewers = &v +} + +// GetMinReviewersIsPerGroup returns the MinReviewersIsPerGroup field value if set, zero value otherwise. +func (o *LifecycleRule) GetMinReviewersIsPerGroup() bool { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + var ret bool + return ret + } + return *o.MinReviewersIsPerGroup +} + +// GetMinReviewersIsPerGroupOk returns a tuple with the MinReviewersIsPerGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetMinReviewersIsPerGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + return nil, false + } + return o.MinReviewersIsPerGroup, true +} + +// HasMinReviewersIsPerGroup returns a boolean if a field has been set. +func (o *LifecycleRule) HasMinReviewersIsPerGroup() bool { + if o != nil && !IsNil(o.MinReviewersIsPerGroup) { + return true + } + + return false +} + +// SetMinReviewersIsPerGroup gets a reference to the given bool and assigns it to the MinReviewersIsPerGroup field. +func (o *LifecycleRule) SetMinReviewersIsPerGroup(v bool) { + o.MinReviewersIsPerGroup = &v +} + +// GetReviewers returns the Reviewers field value +func (o *LifecycleRule) GetReviewers() []string { + if o == nil { + var ret []string + return ret + } + + return o.Reviewers +} + +// GetReviewersOk returns a tuple with the Reviewers field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetReviewersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Reviewers, true +} + +// SetReviewers sets field value +func (o *LifecycleRule) SetReviewers(v []string) { + o.Reviewers = v +} + +// GetReviewersObj returns the ReviewersObj field value +func (o *LifecycleRule) GetReviewersObj() []ReviewerUser { + if o == nil { + var ret []ReviewerUser + return ret + } + + return o.ReviewersObj +} + +// GetReviewersObjOk returns a tuple with the ReviewersObj field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetReviewersObjOk() ([]ReviewerUser, bool) { + if o == nil { + return nil, false + } + return o.ReviewersObj, true +} + +// SetReviewersObj sets field value +func (o *LifecycleRule) SetReviewersObj(v []ReviewerUser) { + o.ReviewersObj = v +} + +// GetNotificationTransports returns the NotificationTransports field value if set, zero value otherwise. +func (o *LifecycleRule) GetNotificationTransports() []string { + if o == nil || IsNil(o.NotificationTransports) { + var ret []string + return ret + } + return o.NotificationTransports +} + +// GetNotificationTransportsOk returns a tuple with the NotificationTransports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetNotificationTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.NotificationTransports) { + return nil, false + } + return o.NotificationTransports, true +} + +// HasNotificationTransports returns a boolean if a field has been set. +func (o *LifecycleRule) HasNotificationTransports() bool { + if o != nil && !IsNil(o.NotificationTransports) { + return true + } + + return false +} + +// SetNotificationTransports gets a reference to the given []string and assigns it to the NotificationTransports field. +func (o *LifecycleRule) SetNotificationTransports(v []string) { + o.NotificationTransports = v +} + +// GetTargetVerbose returns the TargetVerbose field value +func (o *LifecycleRule) GetTargetVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.TargetVerbose +} + +// GetTargetVerboseOk returns a tuple with the TargetVerbose field value +// and a boolean to check if the value has been set. +func (o *LifecycleRule) GetTargetVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TargetVerbose, true +} + +// SetTargetVerbose sets field value +func (o *LifecycleRule) SetTargetVerbose(v string) { + o.TargetVerbose = v +} + +func (o LifecycleRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LifecycleRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["content_type"] = o.ContentType + if o.ObjectId.IsSet() { + toSerialize["object_id"] = o.ObjectId.Get() + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.GracePeriod) { + toSerialize["grace_period"] = o.GracePeriod + } + if !IsNil(o.ReviewerGroups) { + toSerialize["reviewer_groups"] = o.ReviewerGroups + } + toSerialize["reviewer_groups_obj"] = o.ReviewerGroupsObj + if !IsNil(o.MinReviewers) { + toSerialize["min_reviewers"] = o.MinReviewers + } + if !IsNil(o.MinReviewersIsPerGroup) { + toSerialize["min_reviewers_is_per_group"] = o.MinReviewersIsPerGroup + } + toSerialize["reviewers"] = o.Reviewers + toSerialize["reviewers_obj"] = o.ReviewersObj + if !IsNil(o.NotificationTransports) { + toSerialize["notification_transports"] = o.NotificationTransports + } + toSerialize["target_verbose"] = o.TargetVerbose + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LifecycleRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "content_type", + "reviewer_groups_obj", + "reviewers", + "reviewers_obj", + "target_verbose", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLifecycleRule := _LifecycleRule{} + + err = json.Unmarshal(data, &varLifecycleRule) + + if err != nil { + return err + } + + *o = LifecycleRule(varLifecycleRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "interval") + delete(additionalProperties, "grace_period") + delete(additionalProperties, "reviewer_groups") + delete(additionalProperties, "reviewer_groups_obj") + delete(additionalProperties, "min_reviewers") + delete(additionalProperties, "min_reviewers_is_per_group") + delete(additionalProperties, "reviewers") + delete(additionalProperties, "reviewers_obj") + delete(additionalProperties, "notification_transports") + delete(additionalProperties, "target_verbose") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLifecycleRule struct { + value *LifecycleRule + isSet bool +} + +func (v NullableLifecycleRule) Get() *LifecycleRule { + return v.value +} + +func (v *NullableLifecycleRule) Set(val *LifecycleRule) { + v.value = val + v.isSet = true +} + +func (v NullableLifecycleRule) IsSet() bool { + return v.isSet +} + +func (v *NullableLifecycleRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLifecycleRule(val *LifecycleRule) *NullableLifecycleRule { + return &NullableLifecycleRule{value: val, isSet: true} +} + +func (v NullableLifecycleRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLifecycleRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_lifecycle_rule_request.go b/packages/client-go/model_lifecycle_rule_request.go new file mode 100644 index 0000000000..ece13168c2 --- /dev/null +++ b/packages/client-go/model_lifecycle_rule_request.go @@ -0,0 +1,496 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LifecycleRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LifecycleRuleRequest{} + +// LifecycleRuleRequest Mixin to validate that a valid enterprise license exists before allowing to save the object +type LifecycleRuleRequest struct { + Name string `json:"name"` + ContentType ContentTypeEnum `json:"content_type"` + ObjectId NullableString `json:"object_id,omitempty"` + Interval *string `json:"interval,omitempty"` + GracePeriod *string `json:"grace_period,omitempty"` + ReviewerGroups []string `json:"reviewer_groups,omitempty"` + MinReviewers *int32 `json:"min_reviewers,omitempty"` + MinReviewersIsPerGroup *bool `json:"min_reviewers_is_per_group,omitempty"` + Reviewers []string `json:"reviewers"` + // Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI. + NotificationTransports []string `json:"notification_transports,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LifecycleRuleRequest LifecycleRuleRequest + +// NewLifecycleRuleRequest instantiates a new LifecycleRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLifecycleRuleRequest(name string, contentType ContentTypeEnum, reviewers []string) *LifecycleRuleRequest { + this := LifecycleRuleRequest{} + this.Name = name + this.ContentType = contentType + this.Reviewers = reviewers + return &this +} + +// NewLifecycleRuleRequestWithDefaults instantiates a new LifecycleRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLifecycleRuleRequestWithDefaults() *LifecycleRuleRequest { + this := LifecycleRuleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *LifecycleRuleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LifecycleRuleRequest) SetName(v string) { + o.Name = v +} + +// GetContentType returns the ContentType field value +func (o *LifecycleRuleRequest) GetContentType() ContentTypeEnum { + if o == nil { + var ret ContentTypeEnum + return ret + } + + return o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetContentTypeOk() (*ContentTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ContentType, true +} + +// SetContentType sets field value +func (o *LifecycleRuleRequest) SetContentType(v ContentTypeEnum) { + o.ContentType = v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LifecycleRuleRequest) GetObjectId() string { + if o == nil || IsNil(o.ObjectId.Get()) { + var ret string + return ret + } + return *o.ObjectId.Get() +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LifecycleRuleRequest) GetObjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectId.Get(), o.ObjectId.IsSet() +} + +// HasObjectId returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasObjectId() bool { + if o != nil && o.ObjectId.IsSet() { + return true + } + + return false +} + +// SetObjectId gets a reference to the given NullableString and assigns it to the ObjectId field. +func (o *LifecycleRuleRequest) SetObjectId(v string) { + o.ObjectId.Set(&v) +} + +// SetObjectIdNil sets the value for ObjectId to be an explicit nil +func (o *LifecycleRuleRequest) SetObjectIdNil() { + o.ObjectId.Set(nil) +} + +// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil +func (o *LifecycleRuleRequest) UnsetObjectId() { + o.ObjectId.Unset() +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetInterval() string { + if o == nil || IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *LifecycleRuleRequest) SetInterval(v string) { + o.Interval = &v +} + +// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetGracePeriod() string { + if o == nil || IsNil(o.GracePeriod) { + var ret string + return ret + } + return *o.GracePeriod +} + +// GetGracePeriodOk returns a tuple with the GracePeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetGracePeriodOk() (*string, bool) { + if o == nil || IsNil(o.GracePeriod) { + return nil, false + } + return o.GracePeriod, true +} + +// HasGracePeriod returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasGracePeriod() bool { + if o != nil && !IsNil(o.GracePeriod) { + return true + } + + return false +} + +// SetGracePeriod gets a reference to the given string and assigns it to the GracePeriod field. +func (o *LifecycleRuleRequest) SetGracePeriod(v string) { + o.GracePeriod = &v +} + +// GetReviewerGroups returns the ReviewerGroups field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetReviewerGroups() []string { + if o == nil || IsNil(o.ReviewerGroups) { + var ret []string + return ret + } + return o.ReviewerGroups +} + +// GetReviewerGroupsOk returns a tuple with the ReviewerGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetReviewerGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.ReviewerGroups) { + return nil, false + } + return o.ReviewerGroups, true +} + +// HasReviewerGroups returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasReviewerGroups() bool { + if o != nil && !IsNil(o.ReviewerGroups) { + return true + } + + return false +} + +// SetReviewerGroups gets a reference to the given []string and assigns it to the ReviewerGroups field. +func (o *LifecycleRuleRequest) SetReviewerGroups(v []string) { + o.ReviewerGroups = v +} + +// GetMinReviewers returns the MinReviewers field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetMinReviewers() int32 { + if o == nil || IsNil(o.MinReviewers) { + var ret int32 + return ret + } + return *o.MinReviewers +} + +// GetMinReviewersOk returns a tuple with the MinReviewers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetMinReviewersOk() (*int32, bool) { + if o == nil || IsNil(o.MinReviewers) { + return nil, false + } + return o.MinReviewers, true +} + +// HasMinReviewers returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasMinReviewers() bool { + if o != nil && !IsNil(o.MinReviewers) { + return true + } + + return false +} + +// SetMinReviewers gets a reference to the given int32 and assigns it to the MinReviewers field. +func (o *LifecycleRuleRequest) SetMinReviewers(v int32) { + o.MinReviewers = &v +} + +// GetMinReviewersIsPerGroup returns the MinReviewersIsPerGroup field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetMinReviewersIsPerGroup() bool { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + var ret bool + return ret + } + return *o.MinReviewersIsPerGroup +} + +// GetMinReviewersIsPerGroupOk returns a tuple with the MinReviewersIsPerGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetMinReviewersIsPerGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + return nil, false + } + return o.MinReviewersIsPerGroup, true +} + +// HasMinReviewersIsPerGroup returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasMinReviewersIsPerGroup() bool { + if o != nil && !IsNil(o.MinReviewersIsPerGroup) { + return true + } + + return false +} + +// SetMinReviewersIsPerGroup gets a reference to the given bool and assigns it to the MinReviewersIsPerGroup field. +func (o *LifecycleRuleRequest) SetMinReviewersIsPerGroup(v bool) { + o.MinReviewersIsPerGroup = &v +} + +// GetReviewers returns the Reviewers field value +func (o *LifecycleRuleRequest) GetReviewers() []string { + if o == nil { + var ret []string + return ret + } + + return o.Reviewers +} + +// GetReviewersOk returns a tuple with the Reviewers field value +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetReviewersOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Reviewers, true +} + +// SetReviewers sets field value +func (o *LifecycleRuleRequest) SetReviewers(v []string) { + o.Reviewers = v +} + +// GetNotificationTransports returns the NotificationTransports field value if set, zero value otherwise. +func (o *LifecycleRuleRequest) GetNotificationTransports() []string { + if o == nil || IsNil(o.NotificationTransports) { + var ret []string + return ret + } + return o.NotificationTransports +} + +// GetNotificationTransportsOk returns a tuple with the NotificationTransports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LifecycleRuleRequest) GetNotificationTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.NotificationTransports) { + return nil, false + } + return o.NotificationTransports, true +} + +// HasNotificationTransports returns a boolean if a field has been set. +func (o *LifecycleRuleRequest) HasNotificationTransports() bool { + if o != nil && !IsNil(o.NotificationTransports) { + return true + } + + return false +} + +// SetNotificationTransports gets a reference to the given []string and assigns it to the NotificationTransports field. +func (o *LifecycleRuleRequest) SetNotificationTransports(v []string) { + o.NotificationTransports = v +} + +func (o LifecycleRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LifecycleRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["content_type"] = o.ContentType + if o.ObjectId.IsSet() { + toSerialize["object_id"] = o.ObjectId.Get() + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.GracePeriod) { + toSerialize["grace_period"] = o.GracePeriod + } + if !IsNil(o.ReviewerGroups) { + toSerialize["reviewer_groups"] = o.ReviewerGroups + } + if !IsNil(o.MinReviewers) { + toSerialize["min_reviewers"] = o.MinReviewers + } + if !IsNil(o.MinReviewersIsPerGroup) { + toSerialize["min_reviewers_is_per_group"] = o.MinReviewersIsPerGroup + } + toSerialize["reviewers"] = o.Reviewers + if !IsNil(o.NotificationTransports) { + toSerialize["notification_transports"] = o.NotificationTransports + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LifecycleRuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "content_type", + "reviewers", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLifecycleRuleRequest := _LifecycleRuleRequest{} + + err = json.Unmarshal(data, &varLifecycleRuleRequest) + + if err != nil { + return err + } + + *o = LifecycleRuleRequest(varLifecycleRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "interval") + delete(additionalProperties, "grace_period") + delete(additionalProperties, "reviewer_groups") + delete(additionalProperties, "min_reviewers") + delete(additionalProperties, "min_reviewers_is_per_group") + delete(additionalProperties, "reviewers") + delete(additionalProperties, "notification_transports") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLifecycleRuleRequest struct { + value *LifecycleRuleRequest + isSet bool +} + +func (v NullableLifecycleRuleRequest) Get() *LifecycleRuleRequest { + return v.value +} + +func (v *NullableLifecycleRuleRequest) Set(val *LifecycleRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableLifecycleRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableLifecycleRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLifecycleRuleRequest(val *LifecycleRuleRequest) *NullableLifecycleRuleRequest { + return &NullableLifecycleRuleRequest{value: val, isSet: true} +} + +func (v NullableLifecycleRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLifecycleRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_link.go b/packages/client-go/model_link.go new file mode 100644 index 0000000000..82038d6590 --- /dev/null +++ b/packages/client-go/model_link.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Link type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Link{} + +// Link Returns a single link +type Link struct { + Link string `json:"link"` + AdditionalProperties map[string]interface{} +} + +type _Link Link + +// NewLink instantiates a new Link object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLink(link string) *Link { + this := Link{} + this.Link = link + return &this +} + +// NewLinkWithDefaults instantiates a new Link object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLinkWithDefaults() *Link { + this := Link{} + return &this +} + +// GetLink returns the Link field value +func (o *Link) GetLink() string { + if o == nil { + var ret string + return ret + } + + return o.Link +} + +// GetLinkOk returns a tuple with the Link field value +// and a boolean to check if the value has been set. +func (o *Link) GetLinkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Link, true +} + +// SetLink sets field value +func (o *Link) SetLink(v string) { + o.Link = v +} + +func (o Link) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Link) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["link"] = o.Link + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Link) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "link", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLink := _Link{} + + err = json.Unmarshal(data, &varLink) + + if err != nil { + return err + } + + *o = Link(varLink) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "link") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLink struct { + value *Link + isSet bool +} + +func (v NullableLink) Get() *Link { + return v.value +} + +func (v *NullableLink) Set(val *Link) { + v.value = val + v.isSet = true +} + +func (v NullableLink) IsSet() bool { + return v.isSet +} + +func (v *NullableLink) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLink(val *Link) *NullableLink { + return &NullableLink{value: val, isSet: true} +} + +func (v NullableLink) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLink) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_log_event.go b/packages/client-go/model_log_event.go new file mode 100644 index 0000000000..9a58662142 --- /dev/null +++ b/packages/client-go/model_log_event.go @@ -0,0 +1,284 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the LogEvent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LogEvent{} + +// LogEvent Single log message with all context logged. +type LogEvent struct { + Timestamp time.Time `json:"timestamp"` + LogLevel LogLevelEnum `json:"log_level"` + Logger string `json:"logger"` + Event string `json:"event"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _LogEvent LogEvent + +// NewLogEvent instantiates a new LogEvent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLogEvent(timestamp time.Time, logLevel LogLevelEnum, logger string, event string, attributes map[string]interface{}) *LogEvent { + this := LogEvent{} + this.Timestamp = timestamp + this.LogLevel = logLevel + this.Logger = logger + this.Event = event + this.Attributes = attributes + return &this +} + +// NewLogEventWithDefaults instantiates a new LogEvent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLogEventWithDefaults() *LogEvent { + this := LogEvent{} + return &this +} + +// GetTimestamp returns the Timestamp field value +func (o *LogEvent) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *LogEvent) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *LogEvent) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetLogLevel returns the LogLevel field value +func (o *LogEvent) GetLogLevel() LogLevelEnum { + if o == nil { + var ret LogLevelEnum + return ret + } + + return o.LogLevel +} + +// GetLogLevelOk returns a tuple with the LogLevel field value +// and a boolean to check if the value has been set. +func (o *LogEvent) GetLogLevelOk() (*LogLevelEnum, bool) { + if o == nil { + return nil, false + } + return &o.LogLevel, true +} + +// SetLogLevel sets field value +func (o *LogEvent) SetLogLevel(v LogLevelEnum) { + o.LogLevel = v +} + +// GetLogger returns the Logger field value +func (o *LogEvent) GetLogger() string { + if o == nil { + var ret string + return ret + } + + return o.Logger +} + +// GetLoggerOk returns a tuple with the Logger field value +// and a boolean to check if the value has been set. +func (o *LogEvent) GetLoggerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Logger, true +} + +// SetLogger sets field value +func (o *LogEvent) SetLogger(v string) { + o.Logger = v +} + +// GetEvent returns the Event field value +func (o *LogEvent) GetEvent() string { + if o == nil { + var ret string + return ret + } + + return o.Event +} + +// GetEventOk returns a tuple with the Event field value +// and a boolean to check if the value has been set. +func (o *LogEvent) GetEventOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Event, true +} + +// SetEvent sets field value +func (o *LogEvent) SetEvent(v string) { + o.Event = v +} + +// GetAttributes returns the Attributes field value +func (o *LogEvent) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *LogEvent) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *LogEvent) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o LogEvent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LogEvent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["timestamp"] = o.Timestamp + toSerialize["log_level"] = o.LogLevel + toSerialize["logger"] = o.Logger + toSerialize["event"] = o.Event + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LogEvent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "timestamp", + "log_level", + "logger", + "event", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLogEvent := _LogEvent{} + + err = json.Unmarshal(data, &varLogEvent) + + if err != nil { + return err + } + + *o = LogEvent(varLogEvent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "timestamp") + delete(additionalProperties, "log_level") + delete(additionalProperties, "logger") + delete(additionalProperties, "event") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLogEvent struct { + value *LogEvent + isSet bool +} + +func (v NullableLogEvent) Get() *LogEvent { + return v.value +} + +func (v *NullableLogEvent) Set(val *LogEvent) { + v.value = val + v.isSet = true +} + +func (v NullableLogEvent) IsSet() bool { + return v.isSet +} + +func (v *NullableLogEvent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogEvent(val *LogEvent) *NullableLogEvent { + return &NullableLogEvent{value: val, isSet: true} +} + +func (v NullableLogEvent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogEvent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_log_level_enum.go b/packages/client-go/model_log_level_enum.go new file mode 100644 index 0000000000..88e194690b --- /dev/null +++ b/packages/client-go/model_log_level_enum.go @@ -0,0 +1,123 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LogLevelEnum the model 'LogLevelEnum' +type LogLevelEnum string + +// List of LogLevelEnum +const ( + LOGLEVELENUM_CRITICAL LogLevelEnum = "critical" + LOGLEVELENUM_EXCEPTION LogLevelEnum = "exception" + LOGLEVELENUM_ERROR LogLevelEnum = "error" + LOGLEVELENUM_WARN LogLevelEnum = "warn" + LOGLEVELENUM_WARNING LogLevelEnum = "warning" + LOGLEVELENUM_INFO LogLevelEnum = "info" + LOGLEVELENUM_DEBUG LogLevelEnum = "debug" + LOGLEVELENUM_NOTSET LogLevelEnum = "notset" +) + +// All allowed values of LogLevelEnum enum +var AllowedLogLevelEnumEnumValues = []LogLevelEnum{ + "critical", + "exception", + "error", + "warn", + "warning", + "info", + "debug", + "notset", +} + +func (v *LogLevelEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := LogLevelEnum(value) + for _, existing := range AllowedLogLevelEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid LogLevelEnum", value) +} + +// NewLogLevelEnumFromValue returns a pointer to a valid LogLevelEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewLogLevelEnumFromValue(v string) (*LogLevelEnum, error) { + ev := LogLevelEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for LogLevelEnum: valid values are %v", v, AllowedLogLevelEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v LogLevelEnum) IsValid() bool { + for _, existing := range AllowedLogLevelEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to LogLevelEnum value +func (v LogLevelEnum) Ptr() *LogLevelEnum { + return &v +} + +type NullableLogLevelEnum struct { + value *LogLevelEnum + isSet bool +} + +func (v NullableLogLevelEnum) Get() *LogLevelEnum { + return v.value +} + +func (v *NullableLogLevelEnum) Set(val *LogLevelEnum) { + v.value = val + v.isSet = true +} + +func (v NullableLogLevelEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableLogLevelEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogLevelEnum(val *LogLevelEnum) *NullableLogLevelEnum { + return &NullableLogLevelEnum{value: val, isSet: true} +} + +func (v NullableLogLevelEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogLevelEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_login_challenge_types.go b/packages/client-go/model_login_challenge_types.go new file mode 100644 index 0000000000..3ce381a2de --- /dev/null +++ b/packages/client-go/model_login_challenge_types.go @@ -0,0 +1,218 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// LoginChallengeTypes - struct for LoginChallengeTypes +type LoginChallengeTypes struct { + AppleLoginChallenge *AppleLoginChallenge + PlexAuthenticationChallenge *PlexAuthenticationChallenge + RedirectChallenge *RedirectChallenge + TelegramLoginChallenge *TelegramLoginChallenge +} + +// AppleLoginChallengeAsLoginChallengeTypes is a convenience function that returns AppleLoginChallenge wrapped in LoginChallengeTypes +func AppleLoginChallengeAsLoginChallengeTypes(v *AppleLoginChallenge) LoginChallengeTypes { + return LoginChallengeTypes{ + AppleLoginChallenge: v, + } +} + +// PlexAuthenticationChallengeAsLoginChallengeTypes is a convenience function that returns PlexAuthenticationChallenge wrapped in LoginChallengeTypes +func PlexAuthenticationChallengeAsLoginChallengeTypes(v *PlexAuthenticationChallenge) LoginChallengeTypes { + return LoginChallengeTypes{ + PlexAuthenticationChallenge: v, + } +} + +// RedirectChallengeAsLoginChallengeTypes is a convenience function that returns RedirectChallenge wrapped in LoginChallengeTypes +func RedirectChallengeAsLoginChallengeTypes(v *RedirectChallenge) LoginChallengeTypes { + return LoginChallengeTypes{ + RedirectChallenge: v, + } +} + +// TelegramLoginChallengeAsLoginChallengeTypes is a convenience function that returns TelegramLoginChallenge wrapped in LoginChallengeTypes +func TelegramLoginChallengeAsLoginChallengeTypes(v *TelegramLoginChallenge) LoginChallengeTypes { + return LoginChallengeTypes{ + TelegramLoginChallenge: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *LoginChallengeTypes) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'ak-source-oauth-apple' + if jsonDict["component"] == "ak-source-oauth-apple" { + // try to unmarshal JSON data into AppleLoginChallenge + err = json.Unmarshal(data, &dst.AppleLoginChallenge) + if err == nil { + return nil // data stored in dst.AppleLoginChallenge, return on the first match + } else { + dst.AppleLoginChallenge = nil + return fmt.Errorf("failed to unmarshal LoginChallengeTypes as AppleLoginChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-plex' + if jsonDict["component"] == "ak-source-plex" { + // try to unmarshal JSON data into PlexAuthenticationChallenge + err = json.Unmarshal(data, &dst.PlexAuthenticationChallenge) + if err == nil { + return nil // data stored in dst.PlexAuthenticationChallenge, return on the first match + } else { + dst.PlexAuthenticationChallenge = nil + return fmt.Errorf("failed to unmarshal LoginChallengeTypes as PlexAuthenticationChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'ak-source-telegram' + if jsonDict["component"] == "ak-source-telegram" { + // try to unmarshal JSON data into TelegramLoginChallenge + err = json.Unmarshal(data, &dst.TelegramLoginChallenge) + if err == nil { + return nil // data stored in dst.TelegramLoginChallenge, return on the first match + } else { + dst.TelegramLoginChallenge = nil + return fmt.Errorf("failed to unmarshal LoginChallengeTypes as TelegramLoginChallenge: %s", err.Error()) + } + } + + // check if the discriminator value is 'xak-flow-redirect' + if jsonDict["component"] == "xak-flow-redirect" { + // try to unmarshal JSON data into RedirectChallenge + err = json.Unmarshal(data, &dst.RedirectChallenge) + if err == nil { + return nil // data stored in dst.RedirectChallenge, return on the first match + } else { + dst.RedirectChallenge = nil + return fmt.Errorf("failed to unmarshal LoginChallengeTypes as RedirectChallenge: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src LoginChallengeTypes) MarshalJSON() ([]byte, error) { + if src.AppleLoginChallenge != nil { + return json.Marshal(&src.AppleLoginChallenge) + } + + if src.PlexAuthenticationChallenge != nil { + return json.Marshal(&src.PlexAuthenticationChallenge) + } + + if src.RedirectChallenge != nil { + return json.Marshal(&src.RedirectChallenge) + } + + if src.TelegramLoginChallenge != nil { + return json.Marshal(&src.TelegramLoginChallenge) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *LoginChallengeTypes) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.AppleLoginChallenge != nil { + return obj.AppleLoginChallenge + } + + if obj.PlexAuthenticationChallenge != nil { + return obj.PlexAuthenticationChallenge + } + + if obj.RedirectChallenge != nil { + return obj.RedirectChallenge + } + + if obj.TelegramLoginChallenge != nil { + return obj.TelegramLoginChallenge + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj LoginChallengeTypes) GetActualInstanceValue() interface{} { + if obj.AppleLoginChallenge != nil { + return *obj.AppleLoginChallenge + } + + if obj.PlexAuthenticationChallenge != nil { + return *obj.PlexAuthenticationChallenge + } + + if obj.RedirectChallenge != nil { + return *obj.RedirectChallenge + } + + if obj.TelegramLoginChallenge != nil { + return *obj.TelegramLoginChallenge + } + + // all schemas are nil + return nil +} + +type NullableLoginChallengeTypes struct { + value *LoginChallengeTypes + isSet bool +} + +func (v NullableLoginChallengeTypes) Get() *LoginChallengeTypes { + return v.value +} + +func (v *NullableLoginChallengeTypes) Set(val *LoginChallengeTypes) { + v.value = val + v.isSet = true +} + +func (v NullableLoginChallengeTypes) IsSet() bool { + return v.isSet +} + +func (v *NullableLoginChallengeTypes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoginChallengeTypes(val *LoginChallengeTypes) *NullableLoginChallengeTypes { + return &NullableLoginChallengeTypes{value: val, isSet: true} +} + +func (v NullableLoginChallengeTypes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoginChallengeTypes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_login_source.go b/packages/client-go/model_login_source.go new file mode 100644 index 0000000000..e5400d0b70 --- /dev/null +++ b/packages/client-go/model_login_source.go @@ -0,0 +1,285 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LoginSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LoginSource{} + +// LoginSource Serializer for Login buttons of sources +type LoginSource struct { + Name string `json:"name"` + IconUrl NullableString `json:"icon_url,omitempty"` + Promoted *bool `json:"promoted,omitempty"` + Challenge LoginChallengeTypes `json:"challenge"` + AdditionalProperties map[string]interface{} +} + +type _LoginSource LoginSource + +// NewLoginSource instantiates a new LoginSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLoginSource(name string, challenge LoginChallengeTypes) *LoginSource { + this := LoginSource{} + this.Name = name + var promoted bool = false + this.Promoted = &promoted + this.Challenge = challenge + return &this +} + +// NewLoginSourceWithDefaults instantiates a new LoginSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLoginSourceWithDefaults() *LoginSource { + this := LoginSource{} + var promoted bool = false + this.Promoted = &promoted + return &this +} + +// GetName returns the Name field value +func (o *LoginSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *LoginSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *LoginSource) SetName(v string) { + o.Name = v +} + +// GetIconUrl returns the IconUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LoginSource) GetIconUrl() string { + if o == nil || IsNil(o.IconUrl.Get()) { + var ret string + return ret + } + return *o.IconUrl.Get() +} + +// GetIconUrlOk returns a tuple with the IconUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LoginSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IconUrl.Get(), o.IconUrl.IsSet() +} + +// HasIconUrl returns a boolean if a field has been set. +func (o *LoginSource) HasIconUrl() bool { + if o != nil && o.IconUrl.IsSet() { + return true + } + + return false +} + +// SetIconUrl gets a reference to the given NullableString and assigns it to the IconUrl field. +func (o *LoginSource) SetIconUrl(v string) { + o.IconUrl.Set(&v) +} + +// SetIconUrlNil sets the value for IconUrl to be an explicit nil +func (o *LoginSource) SetIconUrlNil() { + o.IconUrl.Set(nil) +} + +// UnsetIconUrl ensures that no value is present for IconUrl, not even an explicit nil +func (o *LoginSource) UnsetIconUrl() { + o.IconUrl.Unset() +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *LoginSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *LoginSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *LoginSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *LoginSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetChallenge returns the Challenge field value +func (o *LoginSource) GetChallenge() LoginChallengeTypes { + if o == nil { + var ret LoginChallengeTypes + return ret + } + + return o.Challenge +} + +// GetChallengeOk returns a tuple with the Challenge field value +// and a boolean to check if the value has been set. +func (o *LoginSource) GetChallengeOk() (*LoginChallengeTypes, bool) { + if o == nil { + return nil, false + } + return &o.Challenge, true +} + +// SetChallenge sets field value +func (o *LoginSource) SetChallenge(v LoginChallengeTypes) { + o.Challenge = v +} + +func (o LoginSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LoginSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.IconUrl.IsSet() { + toSerialize["icon_url"] = o.IconUrl.Get() + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + toSerialize["challenge"] = o.Challenge + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LoginSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "challenge", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLoginSource := _LoginSource{} + + err = json.Unmarshal(data, &varLoginSource) + + if err != nil { + return err + } + + *o = LoginSource(varLoginSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "promoted") + delete(additionalProperties, "challenge") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLoginSource struct { + value *LoginSource + isSet bool +} + +func (v NullableLoginSource) Get() *LoginSource { + return v.value +} + +func (v *NullableLoginSource) Set(val *LoginSource) { + v.value = val + v.isSet = true +} + +func (v NullableLoginSource) IsSet() bool { + return v.isSet +} + +func (v *NullableLoginSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLoginSource(val *LoginSource) *NullableLoginSource { + return &NullableLoginSource{value: val, isSet: true} +} + +func (v NullableLoginSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLoginSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_logout_url.go b/packages/client-go/model_logout_url.go new file mode 100644 index 0000000000..6e67c605ff --- /dev/null +++ b/packages/client-go/model_logout_url.go @@ -0,0 +1,407 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the LogoutURL type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &LogoutURL{} + +// LogoutURL Data for a single logout URL +type LogoutURL struct { + Url string `json:"url"` + ProviderName NullableString `json:"provider_name,omitempty"` + Binding NullableString `json:"binding,omitempty"` + SamlRequest NullableString `json:"saml_request,omitempty"` + SamlResponse NullableString `json:"saml_response,omitempty"` + SamlRelayState NullableString `json:"saml_relay_state,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _LogoutURL LogoutURL + +// NewLogoutURL instantiates a new LogoutURL object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewLogoutURL(url string) *LogoutURL { + this := LogoutURL{} + this.Url = url + return &this +} + +// NewLogoutURLWithDefaults instantiates a new LogoutURL object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewLogoutURLWithDefaults() *LogoutURL { + this := LogoutURL{} + return &this +} + +// GetUrl returns the Url field value +func (o *LogoutURL) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *LogoutURL) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *LogoutURL) SetUrl(v string) { + o.Url = v +} + +// GetProviderName returns the ProviderName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LogoutURL) GetProviderName() string { + if o == nil || IsNil(o.ProviderName.Get()) { + var ret string + return ret + } + return *o.ProviderName.Get() +} + +// GetProviderNameOk returns a tuple with the ProviderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LogoutURL) GetProviderNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProviderName.Get(), o.ProviderName.IsSet() +} + +// HasProviderName returns a boolean if a field has been set. +func (o *LogoutURL) HasProviderName() bool { + if o != nil && o.ProviderName.IsSet() { + return true + } + + return false +} + +// SetProviderName gets a reference to the given NullableString and assigns it to the ProviderName field. +func (o *LogoutURL) SetProviderName(v string) { + o.ProviderName.Set(&v) +} + +// SetProviderNameNil sets the value for ProviderName to be an explicit nil +func (o *LogoutURL) SetProviderNameNil() { + o.ProviderName.Set(nil) +} + +// UnsetProviderName ensures that no value is present for ProviderName, not even an explicit nil +func (o *LogoutURL) UnsetProviderName() { + o.ProviderName.Unset() +} + +// GetBinding returns the Binding field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LogoutURL) GetBinding() string { + if o == nil || IsNil(o.Binding.Get()) { + var ret string + return ret + } + return *o.Binding.Get() +} + +// GetBindingOk returns a tuple with the Binding field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LogoutURL) GetBindingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Binding.Get(), o.Binding.IsSet() +} + +// HasBinding returns a boolean if a field has been set. +func (o *LogoutURL) HasBinding() bool { + if o != nil && o.Binding.IsSet() { + return true + } + + return false +} + +// SetBinding gets a reference to the given NullableString and assigns it to the Binding field. +func (o *LogoutURL) SetBinding(v string) { + o.Binding.Set(&v) +} + +// SetBindingNil sets the value for Binding to be an explicit nil +func (o *LogoutURL) SetBindingNil() { + o.Binding.Set(nil) +} + +// UnsetBinding ensures that no value is present for Binding, not even an explicit nil +func (o *LogoutURL) UnsetBinding() { + o.Binding.Unset() +} + +// GetSamlRequest returns the SamlRequest field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LogoutURL) GetSamlRequest() string { + if o == nil || IsNil(o.SamlRequest.Get()) { + var ret string + return ret + } + return *o.SamlRequest.Get() +} + +// GetSamlRequestOk returns a tuple with the SamlRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LogoutURL) GetSamlRequestOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SamlRequest.Get(), o.SamlRequest.IsSet() +} + +// HasSamlRequest returns a boolean if a field has been set. +func (o *LogoutURL) HasSamlRequest() bool { + if o != nil && o.SamlRequest.IsSet() { + return true + } + + return false +} + +// SetSamlRequest gets a reference to the given NullableString and assigns it to the SamlRequest field. +func (o *LogoutURL) SetSamlRequest(v string) { + o.SamlRequest.Set(&v) +} + +// SetSamlRequestNil sets the value for SamlRequest to be an explicit nil +func (o *LogoutURL) SetSamlRequestNil() { + o.SamlRequest.Set(nil) +} + +// UnsetSamlRequest ensures that no value is present for SamlRequest, not even an explicit nil +func (o *LogoutURL) UnsetSamlRequest() { + o.SamlRequest.Unset() +} + +// GetSamlResponse returns the SamlResponse field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LogoutURL) GetSamlResponse() string { + if o == nil || IsNil(o.SamlResponse.Get()) { + var ret string + return ret + } + return *o.SamlResponse.Get() +} + +// GetSamlResponseOk returns a tuple with the SamlResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LogoutURL) GetSamlResponseOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SamlResponse.Get(), o.SamlResponse.IsSet() +} + +// HasSamlResponse returns a boolean if a field has been set. +func (o *LogoutURL) HasSamlResponse() bool { + if o != nil && o.SamlResponse.IsSet() { + return true + } + + return false +} + +// SetSamlResponse gets a reference to the given NullableString and assigns it to the SamlResponse field. +func (o *LogoutURL) SetSamlResponse(v string) { + o.SamlResponse.Set(&v) +} + +// SetSamlResponseNil sets the value for SamlResponse to be an explicit nil +func (o *LogoutURL) SetSamlResponseNil() { + o.SamlResponse.Set(nil) +} + +// UnsetSamlResponse ensures that no value is present for SamlResponse, not even an explicit nil +func (o *LogoutURL) UnsetSamlResponse() { + o.SamlResponse.Unset() +} + +// GetSamlRelayState returns the SamlRelayState field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *LogoutURL) GetSamlRelayState() string { + if o == nil || IsNil(o.SamlRelayState.Get()) { + var ret string + return ret + } + return *o.SamlRelayState.Get() +} + +// GetSamlRelayStateOk returns a tuple with the SamlRelayState field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *LogoutURL) GetSamlRelayStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SamlRelayState.Get(), o.SamlRelayState.IsSet() +} + +// HasSamlRelayState returns a boolean if a field has been set. +func (o *LogoutURL) HasSamlRelayState() bool { + if o != nil && o.SamlRelayState.IsSet() { + return true + } + + return false +} + +// SetSamlRelayState gets a reference to the given NullableString and assigns it to the SamlRelayState field. +func (o *LogoutURL) SetSamlRelayState(v string) { + o.SamlRelayState.Set(&v) +} + +// SetSamlRelayStateNil sets the value for SamlRelayState to be an explicit nil +func (o *LogoutURL) SetSamlRelayStateNil() { + o.SamlRelayState.Set(nil) +} + +// UnsetSamlRelayState ensures that no value is present for SamlRelayState, not even an explicit nil +func (o *LogoutURL) UnsetSamlRelayState() { + o.SamlRelayState.Unset() +} + +func (o LogoutURL) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o LogoutURL) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + if o.ProviderName.IsSet() { + toSerialize["provider_name"] = o.ProviderName.Get() + } + if o.Binding.IsSet() { + toSerialize["binding"] = o.Binding.Get() + } + if o.SamlRequest.IsSet() { + toSerialize["saml_request"] = o.SamlRequest.Get() + } + if o.SamlResponse.IsSet() { + toSerialize["saml_response"] = o.SamlResponse.Get() + } + if o.SamlRelayState.IsSet() { + toSerialize["saml_relay_state"] = o.SamlRelayState.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *LogoutURL) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varLogoutURL := _LogoutURL{} + + err = json.Unmarshal(data, &varLogoutURL) + + if err != nil { + return err + } + + *o = LogoutURL(varLogoutURL) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "url") + delete(additionalProperties, "provider_name") + delete(additionalProperties, "binding") + delete(additionalProperties, "saml_request") + delete(additionalProperties, "saml_response") + delete(additionalProperties, "saml_relay_state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableLogoutURL struct { + value *LogoutURL + isSet bool +} + +func (v NullableLogoutURL) Get() *LogoutURL { + return v.value +} + +func (v *NullableLogoutURL) Set(val *LogoutURL) { + v.value = val + v.isSet = true +} + +func (v NullableLogoutURL) IsSet() bool { + return v.isSet +} + +func (v *NullableLogoutURL) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableLogoutURL(val *LogoutURL) *NullableLogoutURL { + return &NullableLogoutURL{value: val, isSet: true} +} + +func (v NullableLogoutURL) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableLogoutURL) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_matching_mode_enum.go b/packages/client-go/model_matching_mode_enum.go new file mode 100644 index 0000000000..a0007ce1b5 --- /dev/null +++ b/packages/client-go/model_matching_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// MatchingModeEnum the model 'MatchingModeEnum' +type MatchingModeEnum string + +// List of MatchingModeEnum +const ( + MATCHINGMODEENUM_STRICT MatchingModeEnum = "strict" + MATCHINGMODEENUM_REGEX MatchingModeEnum = "regex" +) + +// All allowed values of MatchingModeEnum enum +var AllowedMatchingModeEnumEnumValues = []MatchingModeEnum{ + "strict", + "regex", +} + +func (v *MatchingModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := MatchingModeEnum(value) + for _, existing := range AllowedMatchingModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid MatchingModeEnum", value) +} + +// NewMatchingModeEnumFromValue returns a pointer to a valid MatchingModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewMatchingModeEnumFromValue(v string) (*MatchingModeEnum, error) { + ev := MatchingModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for MatchingModeEnum: valid values are %v", v, AllowedMatchingModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v MatchingModeEnum) IsValid() bool { + for _, existing := range AllowedMatchingModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to MatchingModeEnum value +func (v MatchingModeEnum) Ptr() *MatchingModeEnum { + return &v +} + +type NullableMatchingModeEnum struct { + value *MatchingModeEnum + isSet bool +} + +func (v NullableMatchingModeEnum) Get() *MatchingModeEnum { + return v.value +} + +func (v *NullableMatchingModeEnum) Set(val *MatchingModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableMatchingModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableMatchingModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMatchingModeEnum(val *MatchingModeEnum) *NullableMatchingModeEnum { + return &NullableMatchingModeEnum{value: val, isSet: true} +} + +func (v NullableMatchingModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMatchingModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_mdm_config_request.go b/packages/client-go/model_mdm_config_request.go new file mode 100644 index 0000000000..1b53d10887 --- /dev/null +++ b/packages/client-go/model_mdm_config_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MDMConfigRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MDMConfigRequest{} + +// MDMConfigRequest Base serializer class which doesn't implement create/update methods +type MDMConfigRequest struct { + Platform DeviceFactsOSFamily `json:"platform"` + EnrollmentToken string `json:"enrollment_token"` + AdditionalProperties map[string]interface{} +} + +type _MDMConfigRequest MDMConfigRequest + +// NewMDMConfigRequest instantiates a new MDMConfigRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMDMConfigRequest(platform DeviceFactsOSFamily, enrollmentToken string) *MDMConfigRequest { + this := MDMConfigRequest{} + this.Platform = platform + this.EnrollmentToken = enrollmentToken + return &this +} + +// NewMDMConfigRequestWithDefaults instantiates a new MDMConfigRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMDMConfigRequestWithDefaults() *MDMConfigRequest { + this := MDMConfigRequest{} + return &this +} + +// GetPlatform returns the Platform field value +func (o *MDMConfigRequest) GetPlatform() DeviceFactsOSFamily { + if o == nil { + var ret DeviceFactsOSFamily + return ret + } + + return o.Platform +} + +// GetPlatformOk returns a tuple with the Platform field value +// and a boolean to check if the value has been set. +func (o *MDMConfigRequest) GetPlatformOk() (*DeviceFactsOSFamily, bool) { + if o == nil { + return nil, false + } + return &o.Platform, true +} + +// SetPlatform sets field value +func (o *MDMConfigRequest) SetPlatform(v DeviceFactsOSFamily) { + o.Platform = v +} + +// GetEnrollmentToken returns the EnrollmentToken field value +func (o *MDMConfigRequest) GetEnrollmentToken() string { + if o == nil { + var ret string + return ret + } + + return o.EnrollmentToken +} + +// GetEnrollmentTokenOk returns a tuple with the EnrollmentToken field value +// and a boolean to check if the value has been set. +func (o *MDMConfigRequest) GetEnrollmentTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EnrollmentToken, true +} + +// SetEnrollmentToken sets field value +func (o *MDMConfigRequest) SetEnrollmentToken(v string) { + o.EnrollmentToken = v +} + +func (o MDMConfigRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MDMConfigRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["platform"] = o.Platform + toSerialize["enrollment_token"] = o.EnrollmentToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MDMConfigRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "platform", + "enrollment_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMDMConfigRequest := _MDMConfigRequest{} + + err = json.Unmarshal(data, &varMDMConfigRequest) + + if err != nil { + return err + } + + *o = MDMConfigRequest(varMDMConfigRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "platform") + delete(additionalProperties, "enrollment_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMDMConfigRequest struct { + value *MDMConfigRequest + isSet bool +} + +func (v NullableMDMConfigRequest) Get() *MDMConfigRequest { + return v.value +} + +func (v *NullableMDMConfigRequest) Set(val *MDMConfigRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMDMConfigRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMDMConfigRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMDMConfigRequest(val *MDMConfigRequest) *NullableMDMConfigRequest { + return &NullableMDMConfigRequest{value: val, isSet: true} +} + +func (v NullableMDMConfigRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMDMConfigRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_mdm_config_response.go b/packages/client-go/model_mdm_config_response.go new file mode 100644 index 0000000000..1347a11c5c --- /dev/null +++ b/packages/client-go/model_mdm_config_response.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MDMConfigResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MDMConfigResponse{} + +// MDMConfigResponse Base serializer class which doesn't implement create/update methods +type MDMConfigResponse struct { + Config string `json:"config"` + MimeType string `json:"mime_type"` + Filename string `json:"filename"` + AdditionalProperties map[string]interface{} +} + +type _MDMConfigResponse MDMConfigResponse + +// NewMDMConfigResponse instantiates a new MDMConfigResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMDMConfigResponse(config string, mimeType string, filename string) *MDMConfigResponse { + this := MDMConfigResponse{} + this.Config = config + this.MimeType = mimeType + this.Filename = filename + return &this +} + +// NewMDMConfigResponseWithDefaults instantiates a new MDMConfigResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMDMConfigResponseWithDefaults() *MDMConfigResponse { + this := MDMConfigResponse{} + return &this +} + +// GetConfig returns the Config field value +func (o *MDMConfigResponse) GetConfig() string { + if o == nil { + var ret string + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *MDMConfigResponse) GetConfigOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Config, true +} + +// SetConfig sets field value +func (o *MDMConfigResponse) SetConfig(v string) { + o.Config = v +} + +// GetMimeType returns the MimeType field value +func (o *MDMConfigResponse) GetMimeType() string { + if o == nil { + var ret string + return ret + } + + return o.MimeType +} + +// GetMimeTypeOk returns a tuple with the MimeType field value +// and a boolean to check if the value has been set. +func (o *MDMConfigResponse) GetMimeTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MimeType, true +} + +// SetMimeType sets field value +func (o *MDMConfigResponse) SetMimeType(v string) { + o.MimeType = v +} + +// GetFilename returns the Filename field value +func (o *MDMConfigResponse) GetFilename() string { + if o == nil { + var ret string + return ret + } + + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *MDMConfigResponse) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value +func (o *MDMConfigResponse) SetFilename(v string) { + o.Filename = v +} + +func (o MDMConfigResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MDMConfigResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + toSerialize["mime_type"] = o.MimeType + toSerialize["filename"] = o.Filename + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MDMConfigResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + "mime_type", + "filename", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMDMConfigResponse := _MDMConfigResponse{} + + err = json.Unmarshal(data, &varMDMConfigResponse) + + if err != nil { + return err + } + + *o = MDMConfigResponse(varMDMConfigResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "config") + delete(additionalProperties, "mime_type") + delete(additionalProperties, "filename") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMDMConfigResponse struct { + value *MDMConfigResponse + isSet bool +} + +func (v NullableMDMConfigResponse) Get() *MDMConfigResponse { + return v.value +} + +func (v *NullableMDMConfigResponse) Set(val *MDMConfigResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMDMConfigResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMDMConfigResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMDMConfigResponse(val *MDMConfigResponse) *NullableMDMConfigResponse { + return &NullableMDMConfigResponse{value: val, isSet: true} +} + +func (v NullableMDMConfigResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMDMConfigResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_metadata.go b/packages/client-go/model_metadata.go new file mode 100644 index 0000000000..c879772785 --- /dev/null +++ b/packages/client-go/model_metadata.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Metadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Metadata{} + +// Metadata Serializer for blueprint metadata +type Metadata struct { + Name string `json:"name"` + Labels map[string]interface{} `json:"labels"` + AdditionalProperties map[string]interface{} +} + +type _Metadata Metadata + +// NewMetadata instantiates a new Metadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMetadata(name string, labels map[string]interface{}) *Metadata { + this := Metadata{} + this.Name = name + this.Labels = labels + return &this +} + +// NewMetadataWithDefaults instantiates a new Metadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMetadataWithDefaults() *Metadata { + this := Metadata{} + return &this +} + +// GetName returns the Name field value +func (o *Metadata) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Metadata) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Metadata) SetName(v string) { + o.Name = v +} + +// GetLabels returns the Labels field value +func (o *Metadata) GetLabels() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value +// and a boolean to check if the value has been set. +func (o *Metadata) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// SetLabels sets field value +func (o *Metadata) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o Metadata) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Metadata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["labels"] = o.Labels + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Metadata) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "labels", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMetadata := _Metadata{} + + err = json.Unmarshal(data, &varMetadata) + + if err != nil { + return err + } + + *o = Metadata(varMetadata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "labels") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMetadata struct { + value *Metadata + isSet bool +} + +func (v NullableMetadata) Get() *Metadata { + return v.value +} + +func (v *NullableMetadata) Set(val *Metadata) { + v.value = val + v.isSet = true +} + +func (v NullableMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMetadata(val *Metadata) *NullableMetadata { + return &NullableMetadata{value: val, isSet: true} +} + +func (v NullableMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider.go b/packages/client-go/model_microsoft_entra_provider.go new file mode 100644 index 0000000000..ec072237a5 --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider.go @@ -0,0 +1,815 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProvider{} + +// MicrosoftEntraProvider MicrosoftEntraProvider Serializer +type MicrosoftEntraProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + ClientId string `json:"client_id"` + ClientSecret string `json:"client_secret"` + TenantId string `json:"tenant_id"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProvider MicrosoftEntraProvider + +// NewMicrosoftEntraProvider instantiates a new MicrosoftEntraProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProvider(pk int32, name string, component string, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, clientId string, clientSecret string, tenantId string) *MicrosoftEntraProvider { + this := MicrosoftEntraProvider{} + this.Pk = pk + this.Name = name + this.Component = component + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.ClientId = clientId + this.ClientSecret = clientSecret + this.TenantId = tenantId + return &this +} + +// NewMicrosoftEntraProviderWithDefaults instantiates a new MicrosoftEntraProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderWithDefaults() *MicrosoftEntraProvider { + this := MicrosoftEntraProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *MicrosoftEntraProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *MicrosoftEntraProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *MicrosoftEntraProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MicrosoftEntraProvider) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *MicrosoftEntraProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *MicrosoftEntraProvider) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetComponent returns the Component field value +func (o *MicrosoftEntraProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *MicrosoftEntraProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *MicrosoftEntraProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *MicrosoftEntraProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *MicrosoftEntraProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *MicrosoftEntraProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *MicrosoftEntraProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *MicrosoftEntraProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *MicrosoftEntraProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *MicrosoftEntraProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *MicrosoftEntraProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *MicrosoftEntraProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetClientId returns the ClientId field value +func (o *MicrosoftEntraProvider) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *MicrosoftEntraProvider) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *MicrosoftEntraProvider) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *MicrosoftEntraProvider) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetTenantId returns the TenantId field value +func (o *MicrosoftEntraProvider) GetTenantId() string { + if o == nil { + var ret string + return ret + } + + return o.TenantId +} + +// GetTenantIdOk returns a tuple with the TenantId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetTenantIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TenantId, true +} + +// SetTenantId sets field value +func (o *MicrosoftEntraProvider) SetTenantId(v string) { + o.TenantId = v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *MicrosoftEntraProvider) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MicrosoftEntraProvider) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProvider) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *MicrosoftEntraProvider) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *MicrosoftEntraProvider) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *MicrosoftEntraProvider) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *MicrosoftEntraProvider) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *MicrosoftEntraProvider) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *MicrosoftEntraProvider) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *MicrosoftEntraProvider) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *MicrosoftEntraProvider) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProvider) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *MicrosoftEntraProvider) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *MicrosoftEntraProvider) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o MicrosoftEntraProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["component"] = o.Component + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["tenant_id"] = o.TenantId + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "client_id", + "client_secret", + "tenant_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProvider := _MicrosoftEntraProvider{} + + err = json.Unmarshal(data, &varMicrosoftEntraProvider) + + if err != nil { + return err + } + + *o = MicrosoftEntraProvider(varMicrosoftEntraProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "tenant_id") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProvider struct { + value *MicrosoftEntraProvider + isSet bool +} + +func (v NullableMicrosoftEntraProvider) Get() *MicrosoftEntraProvider { + return v.value +} + +func (v *NullableMicrosoftEntraProvider) Set(val *MicrosoftEntraProvider) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProvider(val *MicrosoftEntraProvider) *NullableMicrosoftEntraProvider { + return &NullableMicrosoftEntraProvider{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_group.go b/packages/client-go/model_microsoft_entra_provider_group.go new file mode 100644 index 0000000000..e616c0f25c --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_group.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderGroup{} + +// MicrosoftEntraProviderGroup MicrosoftEntraProviderGroup Serializer +type MicrosoftEntraProviderGroup struct { + Id string `json:"id"` + MicrosoftId string `json:"microsoft_id"` + Group string `json:"group"` + GroupObj PartialGroup `json:"group_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderGroup MicrosoftEntraProviderGroup + +// NewMicrosoftEntraProviderGroup instantiates a new MicrosoftEntraProviderGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderGroup(id string, microsoftId string, group string, groupObj PartialGroup, provider int32, attributes map[string]interface{}) *MicrosoftEntraProviderGroup { + this := MicrosoftEntraProviderGroup{} + this.Id = id + this.MicrosoftId = microsoftId + this.Group = group + this.GroupObj = groupObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewMicrosoftEntraProviderGroupWithDefaults instantiates a new MicrosoftEntraProviderGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderGroupWithDefaults() *MicrosoftEntraProviderGroup { + this := MicrosoftEntraProviderGroup{} + return &this +} + +// GetId returns the Id field value +func (o *MicrosoftEntraProviderGroup) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MicrosoftEntraProviderGroup) SetId(v string) { + o.Id = v +} + +// GetMicrosoftId returns the MicrosoftId field value +func (o *MicrosoftEntraProviderGroup) GetMicrosoftId() string { + if o == nil { + var ret string + return ret + } + + return o.MicrosoftId +} + +// GetMicrosoftIdOk returns a tuple with the MicrosoftId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetMicrosoftIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MicrosoftId, true +} + +// SetMicrosoftId sets field value +func (o *MicrosoftEntraProviderGroup) SetMicrosoftId(v string) { + o.MicrosoftId = v +} + +// GetGroup returns the Group field value +func (o *MicrosoftEntraProviderGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *MicrosoftEntraProviderGroup) SetGroup(v string) { + o.Group = v +} + +// GetGroupObj returns the GroupObj field value +func (o *MicrosoftEntraProviderGroup) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *MicrosoftEntraProviderGroup) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetProvider returns the Provider field value +func (o *MicrosoftEntraProviderGroup) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *MicrosoftEntraProviderGroup) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *MicrosoftEntraProviderGroup) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *MicrosoftEntraProviderGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o MicrosoftEntraProviderGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["microsoft_id"] = o.MicrosoftId + toSerialize["group"] = o.Group + toSerialize["group_obj"] = o.GroupObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "microsoft_id", + "group", + "group_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderGroup := _MicrosoftEntraProviderGroup{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderGroup) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderGroup(varMicrosoftEntraProviderGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "microsoft_id") + delete(additionalProperties, "group") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderGroup struct { + value *MicrosoftEntraProviderGroup + isSet bool +} + +func (v NullableMicrosoftEntraProviderGroup) Get() *MicrosoftEntraProviderGroup { + return v.value +} + +func (v *NullableMicrosoftEntraProviderGroup) Set(val *MicrosoftEntraProviderGroup) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderGroup(val *MicrosoftEntraProviderGroup) *NullableMicrosoftEntraProviderGroup { + return &NullableMicrosoftEntraProviderGroup{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_group_request.go b/packages/client-go/model_microsoft_entra_provider_group_request.go new file mode 100644 index 0000000000..5a3cc2017a --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_group_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderGroupRequest{} + +// MicrosoftEntraProviderGroupRequest MicrosoftEntraProviderGroup Serializer +type MicrosoftEntraProviderGroupRequest struct { + MicrosoftId string `json:"microsoft_id"` + Group string `json:"group"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderGroupRequest MicrosoftEntraProviderGroupRequest + +// NewMicrosoftEntraProviderGroupRequest instantiates a new MicrosoftEntraProviderGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderGroupRequest(microsoftId string, group string, provider int32) *MicrosoftEntraProviderGroupRequest { + this := MicrosoftEntraProviderGroupRequest{} + this.MicrosoftId = microsoftId + this.Group = group + this.Provider = provider + return &this +} + +// NewMicrosoftEntraProviderGroupRequestWithDefaults instantiates a new MicrosoftEntraProviderGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderGroupRequestWithDefaults() *MicrosoftEntraProviderGroupRequest { + this := MicrosoftEntraProviderGroupRequest{} + return &this +} + +// GetMicrosoftId returns the MicrosoftId field value +func (o *MicrosoftEntraProviderGroupRequest) GetMicrosoftId() string { + if o == nil { + var ret string + return ret + } + + return o.MicrosoftId +} + +// GetMicrosoftIdOk returns a tuple with the MicrosoftId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroupRequest) GetMicrosoftIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MicrosoftId, true +} + +// SetMicrosoftId sets field value +func (o *MicrosoftEntraProviderGroupRequest) SetMicrosoftId(v string) { + o.MicrosoftId = v +} + +// GetGroup returns the Group field value +func (o *MicrosoftEntraProviderGroupRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroupRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *MicrosoftEntraProviderGroupRequest) SetGroup(v string) { + o.Group = v +} + +// GetProvider returns the Provider field value +func (o *MicrosoftEntraProviderGroupRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderGroupRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *MicrosoftEntraProviderGroupRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o MicrosoftEntraProviderGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["microsoft_id"] = o.MicrosoftId + toSerialize["group"] = o.Group + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "microsoft_id", + "group", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderGroupRequest := _MicrosoftEntraProviderGroupRequest{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderGroupRequest) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderGroupRequest(varMicrosoftEntraProviderGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "microsoft_id") + delete(additionalProperties, "group") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderGroupRequest struct { + value *MicrosoftEntraProviderGroupRequest + isSet bool +} + +func (v NullableMicrosoftEntraProviderGroupRequest) Get() *MicrosoftEntraProviderGroupRequest { + return v.value +} + +func (v *NullableMicrosoftEntraProviderGroupRequest) Set(val *MicrosoftEntraProviderGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderGroupRequest(val *MicrosoftEntraProviderGroupRequest) *NullableMicrosoftEntraProviderGroupRequest { + return &NullableMicrosoftEntraProviderGroupRequest{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_mapping.go b/packages/client-go/model_microsoft_entra_provider_mapping.go new file mode 100644 index 0000000000..93c8b47f97 --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderMapping{} + +// MicrosoftEntraProviderMapping MicrosoftEntraProviderMapping Serializer +type MicrosoftEntraProviderMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderMapping MicrosoftEntraProviderMapping + +// NewMicrosoftEntraProviderMapping instantiates a new MicrosoftEntraProviderMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *MicrosoftEntraProviderMapping { + this := MicrosoftEntraProviderMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewMicrosoftEntraProviderMappingWithDefaults instantiates a new MicrosoftEntraProviderMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderMappingWithDefaults() *MicrosoftEntraProviderMapping { + this := MicrosoftEntraProviderMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *MicrosoftEntraProviderMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *MicrosoftEntraProviderMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MicrosoftEntraProviderMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProviderMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *MicrosoftEntraProviderMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *MicrosoftEntraProviderMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *MicrosoftEntraProviderMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *MicrosoftEntraProviderMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MicrosoftEntraProviderMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *MicrosoftEntraProviderMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *MicrosoftEntraProviderMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *MicrosoftEntraProviderMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *MicrosoftEntraProviderMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *MicrosoftEntraProviderMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *MicrosoftEntraProviderMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *MicrosoftEntraProviderMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *MicrosoftEntraProviderMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *MicrosoftEntraProviderMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *MicrosoftEntraProviderMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o MicrosoftEntraProviderMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderMapping := _MicrosoftEntraProviderMapping{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderMapping) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderMapping(varMicrosoftEntraProviderMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderMapping struct { + value *MicrosoftEntraProviderMapping + isSet bool +} + +func (v NullableMicrosoftEntraProviderMapping) Get() *MicrosoftEntraProviderMapping { + return v.value +} + +func (v *NullableMicrosoftEntraProviderMapping) Set(val *MicrosoftEntraProviderMapping) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderMapping(val *MicrosoftEntraProviderMapping) *NullableMicrosoftEntraProviderMapping { + return &NullableMicrosoftEntraProviderMapping{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_mapping_request.go b/packages/client-go/model_microsoft_entra_provider_mapping_request.go new file mode 100644 index 0000000000..338c47670b --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderMappingRequest{} + +// MicrosoftEntraProviderMappingRequest MicrosoftEntraProviderMapping Serializer +type MicrosoftEntraProviderMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderMappingRequest MicrosoftEntraProviderMappingRequest + +// NewMicrosoftEntraProviderMappingRequest instantiates a new MicrosoftEntraProviderMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderMappingRequest(name string, expression string) *MicrosoftEntraProviderMappingRequest { + this := MicrosoftEntraProviderMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewMicrosoftEntraProviderMappingRequestWithDefaults instantiates a new MicrosoftEntraProviderMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderMappingRequestWithDefaults() *MicrosoftEntraProviderMappingRequest { + this := MicrosoftEntraProviderMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MicrosoftEntraProviderMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProviderMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *MicrosoftEntraProviderMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *MicrosoftEntraProviderMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *MicrosoftEntraProviderMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *MicrosoftEntraProviderMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MicrosoftEntraProviderMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *MicrosoftEntraProviderMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *MicrosoftEntraProviderMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o MicrosoftEntraProviderMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderMappingRequest := _MicrosoftEntraProviderMappingRequest{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderMappingRequest) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderMappingRequest(varMicrosoftEntraProviderMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderMappingRequest struct { + value *MicrosoftEntraProviderMappingRequest + isSet bool +} + +func (v NullableMicrosoftEntraProviderMappingRequest) Get() *MicrosoftEntraProviderMappingRequest { + return v.value +} + +func (v *NullableMicrosoftEntraProviderMappingRequest) Set(val *MicrosoftEntraProviderMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderMappingRequest(val *MicrosoftEntraProviderMappingRequest) *NullableMicrosoftEntraProviderMappingRequest { + return &NullableMicrosoftEntraProviderMappingRequest{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_request.go b/packages/client-go/model_microsoft_entra_provider_request.go new file mode 100644 index 0000000000..5e43ce4987 --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_request.go @@ -0,0 +1,602 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderRequest{} + +// MicrosoftEntraProviderRequest MicrosoftEntraProvider Serializer +type MicrosoftEntraProviderRequest struct { + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + ClientId string `json:"client_id"` + ClientSecret string `json:"client_secret"` + TenantId string `json:"tenant_id"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderRequest MicrosoftEntraProviderRequest + +// NewMicrosoftEntraProviderRequest instantiates a new MicrosoftEntraProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderRequest(name string, clientId string, clientSecret string, tenantId string) *MicrosoftEntraProviderRequest { + this := MicrosoftEntraProviderRequest{} + this.Name = name + this.ClientId = clientId + this.ClientSecret = clientSecret + this.TenantId = tenantId + return &this +} + +// NewMicrosoftEntraProviderRequestWithDefaults instantiates a new MicrosoftEntraProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderRequestWithDefaults() *MicrosoftEntraProviderRequest { + this := MicrosoftEntraProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *MicrosoftEntraProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MicrosoftEntraProviderRequest) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *MicrosoftEntraProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *MicrosoftEntraProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetClientId returns the ClientId field value +func (o *MicrosoftEntraProviderRequest) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *MicrosoftEntraProviderRequest) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *MicrosoftEntraProviderRequest) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *MicrosoftEntraProviderRequest) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetTenantId returns the TenantId field value +func (o *MicrosoftEntraProviderRequest) GetTenantId() string { + if o == nil { + var ret string + return ret + } + + return o.TenantId +} + +// GetTenantIdOk returns a tuple with the TenantId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetTenantIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TenantId, true +} + +// SetTenantId sets field value +func (o *MicrosoftEntraProviderRequest) SetTenantId(v string) { + o.TenantId = v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *MicrosoftEntraProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *MicrosoftEntraProviderRequest) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *MicrosoftEntraProviderRequest) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *MicrosoftEntraProviderRequest) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *MicrosoftEntraProviderRequest) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *MicrosoftEntraProviderRequest) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *MicrosoftEntraProviderRequest) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *MicrosoftEntraProviderRequest) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *MicrosoftEntraProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *MicrosoftEntraProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *MicrosoftEntraProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *MicrosoftEntraProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *MicrosoftEntraProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o MicrosoftEntraProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + toSerialize["tenant_id"] = o.TenantId + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "client_id", + "client_secret", + "tenant_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderRequest := _MicrosoftEntraProviderRequest{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderRequest) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderRequest(varMicrosoftEntraProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "tenant_id") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderRequest struct { + value *MicrosoftEntraProviderRequest + isSet bool +} + +func (v NullableMicrosoftEntraProviderRequest) Get() *MicrosoftEntraProviderRequest { + return v.value +} + +func (v *NullableMicrosoftEntraProviderRequest) Set(val *MicrosoftEntraProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderRequest(val *MicrosoftEntraProviderRequest) *NullableMicrosoftEntraProviderRequest { + return &NullableMicrosoftEntraProviderRequest{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_user.go b/packages/client-go/model_microsoft_entra_provider_user.go new file mode 100644 index 0000000000..3dd633c99a --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_user.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderUser{} + +// MicrosoftEntraProviderUser MicrosoftEntraProviderUser Serializer +type MicrosoftEntraProviderUser struct { + Id string `json:"id"` + MicrosoftId string `json:"microsoft_id"` + User int32 `json:"user"` + UserObj PartialUser `json:"user_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderUser MicrosoftEntraProviderUser + +// NewMicrosoftEntraProviderUser instantiates a new MicrosoftEntraProviderUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderUser(id string, microsoftId string, user int32, userObj PartialUser, provider int32, attributes map[string]interface{}) *MicrosoftEntraProviderUser { + this := MicrosoftEntraProviderUser{} + this.Id = id + this.MicrosoftId = microsoftId + this.User = user + this.UserObj = userObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewMicrosoftEntraProviderUserWithDefaults instantiates a new MicrosoftEntraProviderUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderUserWithDefaults() *MicrosoftEntraProviderUser { + this := MicrosoftEntraProviderUser{} + return &this +} + +// GetId returns the Id field value +func (o *MicrosoftEntraProviderUser) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *MicrosoftEntraProviderUser) SetId(v string) { + o.Id = v +} + +// GetMicrosoftId returns the MicrosoftId field value +func (o *MicrosoftEntraProviderUser) GetMicrosoftId() string { + if o == nil { + var ret string + return ret + } + + return o.MicrosoftId +} + +// GetMicrosoftIdOk returns a tuple with the MicrosoftId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetMicrosoftIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MicrosoftId, true +} + +// SetMicrosoftId sets field value +func (o *MicrosoftEntraProviderUser) SetMicrosoftId(v string) { + o.MicrosoftId = v +} + +// GetUser returns the User field value +func (o *MicrosoftEntraProviderUser) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *MicrosoftEntraProviderUser) SetUser(v int32) { + o.User = v +} + +// GetUserObj returns the UserObj field value +func (o *MicrosoftEntraProviderUser) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *MicrosoftEntraProviderUser) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetProvider returns the Provider field value +func (o *MicrosoftEntraProviderUser) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *MicrosoftEntraProviderUser) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *MicrosoftEntraProviderUser) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUser) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *MicrosoftEntraProviderUser) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o MicrosoftEntraProviderUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["microsoft_id"] = o.MicrosoftId + toSerialize["user"] = o.User + toSerialize["user_obj"] = o.UserObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "microsoft_id", + "user", + "user_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderUser := _MicrosoftEntraProviderUser{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderUser) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderUser(varMicrosoftEntraProviderUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "microsoft_id") + delete(additionalProperties, "user") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderUser struct { + value *MicrosoftEntraProviderUser + isSet bool +} + +func (v NullableMicrosoftEntraProviderUser) Get() *MicrosoftEntraProviderUser { + return v.value +} + +func (v *NullableMicrosoftEntraProviderUser) Set(val *MicrosoftEntraProviderUser) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderUser) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderUser(val *MicrosoftEntraProviderUser) *NullableMicrosoftEntraProviderUser { + return &NullableMicrosoftEntraProviderUser{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_microsoft_entra_provider_user_request.go b/packages/client-go/model_microsoft_entra_provider_user_request.go new file mode 100644 index 0000000000..87ccc6bc0f --- /dev/null +++ b/packages/client-go/model_microsoft_entra_provider_user_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MicrosoftEntraProviderUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MicrosoftEntraProviderUserRequest{} + +// MicrosoftEntraProviderUserRequest MicrosoftEntraProviderUser Serializer +type MicrosoftEntraProviderUserRequest struct { + MicrosoftId string `json:"microsoft_id"` + User int32 `json:"user"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _MicrosoftEntraProviderUserRequest MicrosoftEntraProviderUserRequest + +// NewMicrosoftEntraProviderUserRequest instantiates a new MicrosoftEntraProviderUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMicrosoftEntraProviderUserRequest(microsoftId string, user int32, provider int32) *MicrosoftEntraProviderUserRequest { + this := MicrosoftEntraProviderUserRequest{} + this.MicrosoftId = microsoftId + this.User = user + this.Provider = provider + return &this +} + +// NewMicrosoftEntraProviderUserRequestWithDefaults instantiates a new MicrosoftEntraProviderUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMicrosoftEntraProviderUserRequestWithDefaults() *MicrosoftEntraProviderUserRequest { + this := MicrosoftEntraProviderUserRequest{} + return &this +} + +// GetMicrosoftId returns the MicrosoftId field value +func (o *MicrosoftEntraProviderUserRequest) GetMicrosoftId() string { + if o == nil { + var ret string + return ret + } + + return o.MicrosoftId +} + +// GetMicrosoftIdOk returns a tuple with the MicrosoftId field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUserRequest) GetMicrosoftIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MicrosoftId, true +} + +// SetMicrosoftId sets field value +func (o *MicrosoftEntraProviderUserRequest) SetMicrosoftId(v string) { + o.MicrosoftId = v +} + +// GetUser returns the User field value +func (o *MicrosoftEntraProviderUserRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUserRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *MicrosoftEntraProviderUserRequest) SetUser(v int32) { + o.User = v +} + +// GetProvider returns the Provider field value +func (o *MicrosoftEntraProviderUserRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *MicrosoftEntraProviderUserRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *MicrosoftEntraProviderUserRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o MicrosoftEntraProviderUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MicrosoftEntraProviderUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["microsoft_id"] = o.MicrosoftId + toSerialize["user"] = o.User + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MicrosoftEntraProviderUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "microsoft_id", + "user", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMicrosoftEntraProviderUserRequest := _MicrosoftEntraProviderUserRequest{} + + err = json.Unmarshal(data, &varMicrosoftEntraProviderUserRequest) + + if err != nil { + return err + } + + *o = MicrosoftEntraProviderUserRequest(varMicrosoftEntraProviderUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "microsoft_id") + delete(additionalProperties, "user") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMicrosoftEntraProviderUserRequest struct { + value *MicrosoftEntraProviderUserRequest + isSet bool +} + +func (v NullableMicrosoftEntraProviderUserRequest) Get() *MicrosoftEntraProviderUserRequest { + return v.value +} + +func (v *NullableMicrosoftEntraProviderUserRequest) Set(val *MicrosoftEntraProviderUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMicrosoftEntraProviderUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMicrosoftEntraProviderUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMicrosoftEntraProviderUserRequest(val *MicrosoftEntraProviderUserRequest) *NullableMicrosoftEntraProviderUserRequest { + return &NullableMicrosoftEntraProviderUserRequest{value: val, isSet: true} +} + +func (v NullableMicrosoftEntraProviderUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMicrosoftEntraProviderUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_model_enum.go b/packages/client-go/model_model_enum.go new file mode 100644 index 0000000000..1e6423e892 --- /dev/null +++ b/packages/client-go/model_model_enum.go @@ -0,0 +1,349 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ModelEnum the model 'ModelEnum' +type ModelEnum string + +// List of ModelEnum +const ( + MODELENUM_AUTHENTIK_TENANTS_DOMAIN ModelEnum = "authentik_tenants.domain" + MODELENUM_AUTHENTIK_CORE_GROUP ModelEnum = "authentik_core.group" + MODELENUM_AUTHENTIK_CORE_USER ModelEnum = "authentik_core.user" + MODELENUM_AUTHENTIK_CORE_APPLICATION ModelEnum = "authentik_core.application" + MODELENUM_AUTHENTIK_CORE_APPLICATIONENTITLEMENT ModelEnum = "authentik_core.applicationentitlement" + MODELENUM_AUTHENTIK_CORE_TOKEN ModelEnum = "authentik_core.token" + MODELENUM_AUTHENTIK_CRYPTO_CERTIFICATEKEYPAIR ModelEnum = "authentik_crypto.certificatekeypair" + MODELENUM_AUTHENTIK_ENDPOINTS_DEVICEUSERBINDING ModelEnum = "authentik_endpoints.deviceuserbinding" + MODELENUM_AUTHENTIK_ENDPOINTS_DEVICEACCESSGROUP ModelEnum = "authentik_endpoints.deviceaccessgroup" + MODELENUM_AUTHENTIK_ENDPOINTS_ENDPOINTSTAGE ModelEnum = "authentik_endpoints.endpointstage" + MODELENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_AGENT_AGENTCONNECTOR ModelEnum = "authentik_endpoints_connectors_agent.agentconnector" + MODELENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_AGENT_AGENTDEVICEUSERBINDING ModelEnum = "authentik_endpoints_connectors_agent.agentdeviceuserbinding" + MODELENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_AGENT_ENROLLMENTTOKEN ModelEnum = "authentik_endpoints_connectors_agent.enrollmenttoken" + MODELENUM_AUTHENTIK_ENTERPRISE_LICENSE ModelEnum = "authentik_enterprise.license" + MODELENUM_AUTHENTIK_EVENTS_EVENT ModelEnum = "authentik_events.event" + MODELENUM_AUTHENTIK_EVENTS_NOTIFICATIONTRANSPORT ModelEnum = "authentik_events.notificationtransport" + MODELENUM_AUTHENTIK_EVENTS_NOTIFICATION ModelEnum = "authentik_events.notification" + MODELENUM_AUTHENTIK_EVENTS_NOTIFICATIONRULE ModelEnum = "authentik_events.notificationrule" + MODELENUM_AUTHENTIK_EVENTS_NOTIFICATIONWEBHOOKMAPPING ModelEnum = "authentik_events.notificationwebhookmapping" + MODELENUM_AUTHENTIK_FLOWS_FLOW ModelEnum = "authentik_flows.flow" + MODELENUM_AUTHENTIK_FLOWS_FLOWSTAGEBINDING ModelEnum = "authentik_flows.flowstagebinding" + MODELENUM_AUTHENTIK_OUTPOSTS_DOCKERSERVICECONNECTION ModelEnum = "authentik_outposts.dockerserviceconnection" + MODELENUM_AUTHENTIK_OUTPOSTS_KUBERNETESSERVICECONNECTION ModelEnum = "authentik_outposts.kubernetesserviceconnection" + MODELENUM_AUTHENTIK_OUTPOSTS_OUTPOST ModelEnum = "authentik_outposts.outpost" + MODELENUM_AUTHENTIK_POLICIES_DUMMY_DUMMYPOLICY ModelEnum = "authentik_policies_dummy.dummypolicy" + MODELENUM_AUTHENTIK_POLICIES_EVENT_MATCHER_EVENTMATCHERPOLICY ModelEnum = "authentik_policies_event_matcher.eventmatcherpolicy" + MODELENUM_AUTHENTIK_POLICIES_EXPIRY_PASSWORDEXPIRYPOLICY ModelEnum = "authentik_policies_expiry.passwordexpirypolicy" + MODELENUM_AUTHENTIK_POLICIES_EXPRESSION_EXPRESSIONPOLICY ModelEnum = "authentik_policies_expression.expressionpolicy" + MODELENUM_AUTHENTIK_POLICIES_GEOIP_GEOIPPOLICY ModelEnum = "authentik_policies_geoip.geoippolicy" + MODELENUM_AUTHENTIK_POLICIES_PASSWORD_PASSWORDPOLICY ModelEnum = "authentik_policies_password.passwordpolicy" + MODELENUM_AUTHENTIK_POLICIES_REPUTATION_REPUTATIONPOLICY ModelEnum = "authentik_policies_reputation.reputationpolicy" + MODELENUM_AUTHENTIK_POLICIES_POLICYBINDING ModelEnum = "authentik_policies.policybinding" + MODELENUM_AUTHENTIK_PROVIDERS_LDAP_LDAPPROVIDER ModelEnum = "authentik_providers_ldap.ldapprovider" + MODELENUM_AUTHENTIK_PROVIDERS_OAUTH2_SCOPEMAPPING ModelEnum = "authentik_providers_oauth2.scopemapping" + MODELENUM_AUTHENTIK_PROVIDERS_OAUTH2_OAUTH2PROVIDER ModelEnum = "authentik_providers_oauth2.oauth2provider" + MODELENUM_AUTHENTIK_PROVIDERS_PROXY_PROXYPROVIDER ModelEnum = "authentik_providers_proxy.proxyprovider" + MODELENUM_AUTHENTIK_PROVIDERS_RAC_RACPROVIDER ModelEnum = "authentik_providers_rac.racprovider" + MODELENUM_AUTHENTIK_PROVIDERS_RAC_ENDPOINT ModelEnum = "authentik_providers_rac.endpoint" + MODELENUM_AUTHENTIK_PROVIDERS_RAC_RACPROPERTYMAPPING ModelEnum = "authentik_providers_rac.racpropertymapping" + MODELENUM_AUTHENTIK_PROVIDERS_RADIUS_RADIUSPROVIDER ModelEnum = "authentik_providers_radius.radiusprovider" + MODELENUM_AUTHENTIK_PROVIDERS_RADIUS_RADIUSPROVIDERPROPERTYMAPPING ModelEnum = "authentik_providers_radius.radiusproviderpropertymapping" + MODELENUM_AUTHENTIK_PROVIDERS_SAML_SAMLPROVIDER ModelEnum = "authentik_providers_saml.samlprovider" + MODELENUM_AUTHENTIK_PROVIDERS_SAML_SAMLPROPERTYMAPPING ModelEnum = "authentik_providers_saml.samlpropertymapping" + MODELENUM_AUTHENTIK_PROVIDERS_SCIM_SCIMPROVIDER ModelEnum = "authentik_providers_scim.scimprovider" + MODELENUM_AUTHENTIK_PROVIDERS_SCIM_SCIMMAPPING ModelEnum = "authentik_providers_scim.scimmapping" + MODELENUM_AUTHENTIK_RBAC_ROLE ModelEnum = "authentik_rbac.role" + MODELENUM_AUTHENTIK_RBAC_INITIALPERMISSIONS ModelEnum = "authentik_rbac.initialpermissions" + MODELENUM_AUTHENTIK_SOURCES_KERBEROS_KERBEROSSOURCE ModelEnum = "authentik_sources_kerberos.kerberossource" + MODELENUM_AUTHENTIK_SOURCES_KERBEROS_KERBEROSSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_kerberos.kerberossourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_KERBEROS_USERKERBEROSSOURCECONNECTION ModelEnum = "authentik_sources_kerberos.userkerberossourceconnection" + MODELENUM_AUTHENTIK_SOURCES_KERBEROS_GROUPKERBEROSSOURCECONNECTION ModelEnum = "authentik_sources_kerberos.groupkerberossourceconnection" + MODELENUM_AUTHENTIK_SOURCES_LDAP_LDAPSOURCE ModelEnum = "authentik_sources_ldap.ldapsource" + MODELENUM_AUTHENTIK_SOURCES_LDAP_LDAPSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_ldap.ldapsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_LDAP_USERLDAPSOURCECONNECTION ModelEnum = "authentik_sources_ldap.userldapsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_LDAP_GROUPLDAPSOURCECONNECTION ModelEnum = "authentik_sources_ldap.groupldapsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_OAUTH_OAUTHSOURCE ModelEnum = "authentik_sources_oauth.oauthsource" + MODELENUM_AUTHENTIK_SOURCES_OAUTH_OAUTHSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_oauth.oauthsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_OAUTH_USEROAUTHSOURCECONNECTION ModelEnum = "authentik_sources_oauth.useroauthsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_OAUTH_GROUPOAUTHSOURCECONNECTION ModelEnum = "authentik_sources_oauth.groupoauthsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_PLEX_PLEXSOURCE ModelEnum = "authentik_sources_plex.plexsource" + MODELENUM_AUTHENTIK_SOURCES_PLEX_PLEXSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_plex.plexsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_PLEX_USERPLEXSOURCECONNECTION ModelEnum = "authentik_sources_plex.userplexsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_PLEX_GROUPPLEXSOURCECONNECTION ModelEnum = "authentik_sources_plex.groupplexsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_SAML_SAMLSOURCE ModelEnum = "authentik_sources_saml.samlsource" + MODELENUM_AUTHENTIK_SOURCES_SAML_SAMLSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_saml.samlsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_SAML_USERSAMLSOURCECONNECTION ModelEnum = "authentik_sources_saml.usersamlsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_SAML_GROUPSAMLSOURCECONNECTION ModelEnum = "authentik_sources_saml.groupsamlsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_SCIM_SCIMSOURCE ModelEnum = "authentik_sources_scim.scimsource" + MODELENUM_AUTHENTIK_SOURCES_SCIM_SCIMSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_scim.scimsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_TELEGRAM_TELEGRAMSOURCE ModelEnum = "authentik_sources_telegram.telegramsource" + MODELENUM_AUTHENTIK_SOURCES_TELEGRAM_TELEGRAMSOURCEPROPERTYMAPPING ModelEnum = "authentik_sources_telegram.telegramsourcepropertymapping" + MODELENUM_AUTHENTIK_SOURCES_TELEGRAM_USERTELEGRAMSOURCECONNECTION ModelEnum = "authentik_sources_telegram.usertelegramsourceconnection" + MODELENUM_AUTHENTIK_SOURCES_TELEGRAM_GROUPTELEGRAMSOURCECONNECTION ModelEnum = "authentik_sources_telegram.grouptelegramsourceconnection" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_DUO_AUTHENTICATORDUOSTAGE ModelEnum = "authentik_stages_authenticator_duo.authenticatorduostage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_DUO_DUODEVICE ModelEnum = "authentik_stages_authenticator_duo.duodevice" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_EMAIL_AUTHENTICATOREMAILSTAGE ModelEnum = "authentik_stages_authenticator_email.authenticatoremailstage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_EMAIL_EMAILDEVICE ModelEnum = "authentik_stages_authenticator_email.emaildevice" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_SMS_AUTHENTICATORSMSSTAGE ModelEnum = "authentik_stages_authenticator_sms.authenticatorsmsstage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_SMS_SMSDEVICE ModelEnum = "authentik_stages_authenticator_sms.smsdevice" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_STATIC_AUTHENTICATORSTATICSTAGE ModelEnum = "authentik_stages_authenticator_static.authenticatorstaticstage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_STATIC_STATICDEVICE ModelEnum = "authentik_stages_authenticator_static.staticdevice" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_TOTP_AUTHENTICATORTOTPSTAGE ModelEnum = "authentik_stages_authenticator_totp.authenticatortotpstage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_TOTP_TOTPDEVICE ModelEnum = "authentik_stages_authenticator_totp.totpdevice" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_VALIDATE_AUTHENTICATORVALIDATESTAGE ModelEnum = "authentik_stages_authenticator_validate.authenticatorvalidatestage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_WEBAUTHN_AUTHENTICATORWEBAUTHNSTAGE ModelEnum = "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_WEBAUTHN_WEBAUTHNDEVICE ModelEnum = "authentik_stages_authenticator_webauthn.webauthndevice" + MODELENUM_AUTHENTIK_STAGES_CAPTCHA_CAPTCHASTAGE ModelEnum = "authentik_stages_captcha.captchastage" + MODELENUM_AUTHENTIK_STAGES_CONSENT_CONSENTSTAGE ModelEnum = "authentik_stages_consent.consentstage" + MODELENUM_AUTHENTIK_STAGES_DENY_DENYSTAGE ModelEnum = "authentik_stages_deny.denystage" + MODELENUM_AUTHENTIK_STAGES_DUMMY_DUMMYSTAGE ModelEnum = "authentik_stages_dummy.dummystage" + MODELENUM_AUTHENTIK_STAGES_EMAIL_EMAILSTAGE ModelEnum = "authentik_stages_email.emailstage" + MODELENUM_AUTHENTIK_STAGES_IDENTIFICATION_IDENTIFICATIONSTAGE ModelEnum = "authentik_stages_identification.identificationstage" + MODELENUM_AUTHENTIK_STAGES_INVITATION_INVITATIONSTAGE ModelEnum = "authentik_stages_invitation.invitationstage" + MODELENUM_AUTHENTIK_STAGES_INVITATION_INVITATION ModelEnum = "authentik_stages_invitation.invitation" + MODELENUM_AUTHENTIK_STAGES_PASSWORD_PASSWORDSTAGE ModelEnum = "authentik_stages_password.passwordstage" + MODELENUM_AUTHENTIK_STAGES_PROMPT_PROMPT ModelEnum = "authentik_stages_prompt.prompt" + MODELENUM_AUTHENTIK_STAGES_PROMPT_PROMPTSTAGE ModelEnum = "authentik_stages_prompt.promptstage" + MODELENUM_AUTHENTIK_STAGES_REDIRECT_REDIRECTSTAGE ModelEnum = "authentik_stages_redirect.redirectstage" + MODELENUM_AUTHENTIK_STAGES_USER_DELETE_USERDELETESTAGE ModelEnum = "authentik_stages_user_delete.userdeletestage" + MODELENUM_AUTHENTIK_STAGES_USER_LOGIN_USERLOGINSTAGE ModelEnum = "authentik_stages_user_login.userloginstage" + MODELENUM_AUTHENTIK_STAGES_USER_LOGOUT_USERLOGOUTSTAGE ModelEnum = "authentik_stages_user_logout.userlogoutstage" + MODELENUM_AUTHENTIK_STAGES_USER_WRITE_USERWRITESTAGE ModelEnum = "authentik_stages_user_write.userwritestage" + MODELENUM_AUTHENTIK_TASKS_SCHEDULES_SCHEDULE ModelEnum = "authentik_tasks_schedules.schedule" + MODELENUM_AUTHENTIK_BRANDS_BRAND ModelEnum = "authentik_brands.brand" + MODELENUM_AUTHENTIK_BLUEPRINTS_BLUEPRINTINSTANCE ModelEnum = "authentik_blueprints.blueprintinstance" + MODELENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_FLEET_FLEETCONNECTOR ModelEnum = "authentik_endpoints_connectors_fleet.fleetconnector" + MODELENUM_AUTHENTIK_ENDPOINTS_CONNECTORS_GOOGLE_CHROME_GOOGLECHROMECONNECTOR ModelEnum = "authentik_endpoints_connectors_google_chrome.googlechromeconnector" + MODELENUM_AUTHENTIK_LIFECYCLE_LIFECYCLERULE ModelEnum = "authentik_lifecycle.lifecyclerule" + MODELENUM_AUTHENTIK_LIFECYCLE_LIFECYCLEITERATION ModelEnum = "authentik_lifecycle.lifecycleiteration" + MODELENUM_AUTHENTIK_LIFECYCLE_REVIEW ModelEnum = "authentik_lifecycle.review" + MODELENUM_AUTHENTIK_POLICIES_UNIQUE_PASSWORD_UNIQUEPASSWORDPOLICY ModelEnum = "authentik_policies_unique_password.uniquepasswordpolicy" + MODELENUM_AUTHENTIK_PROVIDERS_GOOGLE_WORKSPACE_GOOGLEWORKSPACEPROVIDER ModelEnum = "authentik_providers_google_workspace.googleworkspaceprovider" + MODELENUM_AUTHENTIK_PROVIDERS_GOOGLE_WORKSPACE_GOOGLEWORKSPACEPROVIDERMAPPING ModelEnum = "authentik_providers_google_workspace.googleworkspaceprovidermapping" + MODELENUM_AUTHENTIK_PROVIDERS_MICROSOFT_ENTRA_MICROSOFTENTRAPROVIDER ModelEnum = "authentik_providers_microsoft_entra.microsoftentraprovider" + MODELENUM_AUTHENTIK_PROVIDERS_MICROSOFT_ENTRA_MICROSOFTENTRAPROVIDERMAPPING ModelEnum = "authentik_providers_microsoft_entra.microsoftentraprovidermapping" + MODELENUM_AUTHENTIK_PROVIDERS_SSF_SSFPROVIDER ModelEnum = "authentik_providers_ssf.ssfprovider" + MODELENUM_AUTHENTIK_PROVIDERS_WS_FEDERATION_WSFEDERATIONPROVIDER ModelEnum = "authentik_providers_ws_federation.wsfederationprovider" + MODELENUM_AUTHENTIK_REPORTS_DATAEXPORT ModelEnum = "authentik_reports.dataexport" + MODELENUM_AUTHENTIK_STAGES_AUTHENTICATOR_ENDPOINT_GDTC_AUTHENTICATORENDPOINTGDTCSTAGE ModelEnum = "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage" + MODELENUM_AUTHENTIK_STAGES_MTLS_MUTUALTLSSTAGE ModelEnum = "authentik_stages_mtls.mutualtlsstage" + MODELENUM_AUTHENTIK_STAGES_SOURCE_SOURCESTAGE ModelEnum = "authentik_stages_source.sourcestage" +) + +// All allowed values of ModelEnum enum +var AllowedModelEnumEnumValues = []ModelEnum{ + "authentik_tenants.domain", + "authentik_core.group", + "authentik_core.user", + "authentik_core.application", + "authentik_core.applicationentitlement", + "authentik_core.token", + "authentik_crypto.certificatekeypair", + "authentik_endpoints.deviceuserbinding", + "authentik_endpoints.deviceaccessgroup", + "authentik_endpoints.endpointstage", + "authentik_endpoints_connectors_agent.agentconnector", + "authentik_endpoints_connectors_agent.agentdeviceuserbinding", + "authentik_endpoints_connectors_agent.enrollmenttoken", + "authentik_enterprise.license", + "authentik_events.event", + "authentik_events.notificationtransport", + "authentik_events.notification", + "authentik_events.notificationrule", + "authentik_events.notificationwebhookmapping", + "authentik_flows.flow", + "authentik_flows.flowstagebinding", + "authentik_outposts.dockerserviceconnection", + "authentik_outposts.kubernetesserviceconnection", + "authentik_outposts.outpost", + "authentik_policies_dummy.dummypolicy", + "authentik_policies_event_matcher.eventmatcherpolicy", + "authentik_policies_expiry.passwordexpirypolicy", + "authentik_policies_expression.expressionpolicy", + "authentik_policies_geoip.geoippolicy", + "authentik_policies_password.passwordpolicy", + "authentik_policies_reputation.reputationpolicy", + "authentik_policies.policybinding", + "authentik_providers_ldap.ldapprovider", + "authentik_providers_oauth2.scopemapping", + "authentik_providers_oauth2.oauth2provider", + "authentik_providers_proxy.proxyprovider", + "authentik_providers_rac.racprovider", + "authentik_providers_rac.endpoint", + "authentik_providers_rac.racpropertymapping", + "authentik_providers_radius.radiusprovider", + "authentik_providers_radius.radiusproviderpropertymapping", + "authentik_providers_saml.samlprovider", + "authentik_providers_saml.samlpropertymapping", + "authentik_providers_scim.scimprovider", + "authentik_providers_scim.scimmapping", + "authentik_rbac.role", + "authentik_rbac.initialpermissions", + "authentik_sources_kerberos.kerberossource", + "authentik_sources_kerberos.kerberossourcepropertymapping", + "authentik_sources_kerberos.userkerberossourceconnection", + "authentik_sources_kerberos.groupkerberossourceconnection", + "authentik_sources_ldap.ldapsource", + "authentik_sources_ldap.ldapsourcepropertymapping", + "authentik_sources_ldap.userldapsourceconnection", + "authentik_sources_ldap.groupldapsourceconnection", + "authentik_sources_oauth.oauthsource", + "authentik_sources_oauth.oauthsourcepropertymapping", + "authentik_sources_oauth.useroauthsourceconnection", + "authentik_sources_oauth.groupoauthsourceconnection", + "authentik_sources_plex.plexsource", + "authentik_sources_plex.plexsourcepropertymapping", + "authentik_sources_plex.userplexsourceconnection", + "authentik_sources_plex.groupplexsourceconnection", + "authentik_sources_saml.samlsource", + "authentik_sources_saml.samlsourcepropertymapping", + "authentik_sources_saml.usersamlsourceconnection", + "authentik_sources_saml.groupsamlsourceconnection", + "authentik_sources_scim.scimsource", + "authentik_sources_scim.scimsourcepropertymapping", + "authentik_sources_telegram.telegramsource", + "authentik_sources_telegram.telegramsourcepropertymapping", + "authentik_sources_telegram.usertelegramsourceconnection", + "authentik_sources_telegram.grouptelegramsourceconnection", + "authentik_stages_authenticator_duo.authenticatorduostage", + "authentik_stages_authenticator_duo.duodevice", + "authentik_stages_authenticator_email.authenticatoremailstage", + "authentik_stages_authenticator_email.emaildevice", + "authentik_stages_authenticator_sms.authenticatorsmsstage", + "authentik_stages_authenticator_sms.smsdevice", + "authentik_stages_authenticator_static.authenticatorstaticstage", + "authentik_stages_authenticator_static.staticdevice", + "authentik_stages_authenticator_totp.authenticatortotpstage", + "authentik_stages_authenticator_totp.totpdevice", + "authentik_stages_authenticator_validate.authenticatorvalidatestage", + "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage", + "authentik_stages_authenticator_webauthn.webauthndevice", + "authentik_stages_captcha.captchastage", + "authentik_stages_consent.consentstage", + "authentik_stages_deny.denystage", + "authentik_stages_dummy.dummystage", + "authentik_stages_email.emailstage", + "authentik_stages_identification.identificationstage", + "authentik_stages_invitation.invitationstage", + "authentik_stages_invitation.invitation", + "authentik_stages_password.passwordstage", + "authentik_stages_prompt.prompt", + "authentik_stages_prompt.promptstage", + "authentik_stages_redirect.redirectstage", + "authentik_stages_user_delete.userdeletestage", + "authentik_stages_user_login.userloginstage", + "authentik_stages_user_logout.userlogoutstage", + "authentik_stages_user_write.userwritestage", + "authentik_tasks_schedules.schedule", + "authentik_brands.brand", + "authentik_blueprints.blueprintinstance", + "authentik_endpoints_connectors_fleet.fleetconnector", + "authentik_endpoints_connectors_google_chrome.googlechromeconnector", + "authentik_lifecycle.lifecyclerule", + "authentik_lifecycle.lifecycleiteration", + "authentik_lifecycle.review", + "authentik_policies_unique_password.uniquepasswordpolicy", + "authentik_providers_google_workspace.googleworkspaceprovider", + "authentik_providers_google_workspace.googleworkspaceprovidermapping", + "authentik_providers_microsoft_entra.microsoftentraprovider", + "authentik_providers_microsoft_entra.microsoftentraprovidermapping", + "authentik_providers_ssf.ssfprovider", + "authentik_providers_ws_federation.wsfederationprovider", + "authentik_reports.dataexport", + "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage", + "authentik_stages_mtls.mutualtlsstage", + "authentik_stages_source.sourcestage", +} + +func (v *ModelEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ModelEnum(value) + for _, existing := range AllowedModelEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ModelEnum", value) +} + +// NewModelEnumFromValue returns a pointer to a valid ModelEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewModelEnumFromValue(v string) (*ModelEnum, error) { + ev := ModelEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ModelEnum: valid values are %v", v, AllowedModelEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ModelEnum) IsValid() bool { + for _, existing := range AllowedModelEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ModelEnum value +func (v ModelEnum) Ptr() *ModelEnum { + return &v +} + +type NullableModelEnum struct { + value *ModelEnum + isSet bool +} + +func (v NullableModelEnum) Get() *ModelEnum { + return v.value +} + +func (v *NullableModelEnum) Set(val *ModelEnum) { + v.value = val + v.isSet = true +} + +func (v NullableModelEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableModelEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModelEnum(val *ModelEnum) *NullableModelEnum { + return &NullableModelEnum{value: val, isSet: true} +} + +func (v NullableModelEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModelEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_model_request.go b/packages/client-go/model_model_request.go new file mode 100644 index 0000000000..1bc7a83702 --- /dev/null +++ b/packages/client-go/model_model_request.go @@ -0,0 +1,442 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ModelRequest - struct for ModelRequest +type ModelRequest struct { + GoogleWorkspaceProviderRequest *GoogleWorkspaceProviderRequest + LDAPProviderRequest *LDAPProviderRequest + MicrosoftEntraProviderRequest *MicrosoftEntraProviderRequest + OAuth2ProviderRequest *OAuth2ProviderRequest + ProxyProviderRequest *ProxyProviderRequest + RACProviderRequest *RACProviderRequest + RadiusProviderRequest *RadiusProviderRequest + SAMLProviderRequest *SAMLProviderRequest + SCIMProviderRequest *SCIMProviderRequest + SSFProviderRequest *SSFProviderRequest + WSFederationProviderRequest *WSFederationProviderRequest +} + +// GoogleWorkspaceProviderRequestAsModelRequest is a convenience function that returns GoogleWorkspaceProviderRequest wrapped in ModelRequest +func GoogleWorkspaceProviderRequestAsModelRequest(v *GoogleWorkspaceProviderRequest) ModelRequest { + return ModelRequest{ + GoogleWorkspaceProviderRequest: v, + } +} + +// LDAPProviderRequestAsModelRequest is a convenience function that returns LDAPProviderRequest wrapped in ModelRequest +func LDAPProviderRequestAsModelRequest(v *LDAPProviderRequest) ModelRequest { + return ModelRequest{ + LDAPProviderRequest: v, + } +} + +// MicrosoftEntraProviderRequestAsModelRequest is a convenience function that returns MicrosoftEntraProviderRequest wrapped in ModelRequest +func MicrosoftEntraProviderRequestAsModelRequest(v *MicrosoftEntraProviderRequest) ModelRequest { + return ModelRequest{ + MicrosoftEntraProviderRequest: v, + } +} + +// OAuth2ProviderRequestAsModelRequest is a convenience function that returns OAuth2ProviderRequest wrapped in ModelRequest +func OAuth2ProviderRequestAsModelRequest(v *OAuth2ProviderRequest) ModelRequest { + return ModelRequest{ + OAuth2ProviderRequest: v, + } +} + +// ProxyProviderRequestAsModelRequest is a convenience function that returns ProxyProviderRequest wrapped in ModelRequest +func ProxyProviderRequestAsModelRequest(v *ProxyProviderRequest) ModelRequest { + return ModelRequest{ + ProxyProviderRequest: v, + } +} + +// RACProviderRequestAsModelRequest is a convenience function that returns RACProviderRequest wrapped in ModelRequest +func RACProviderRequestAsModelRequest(v *RACProviderRequest) ModelRequest { + return ModelRequest{ + RACProviderRequest: v, + } +} + +// RadiusProviderRequestAsModelRequest is a convenience function that returns RadiusProviderRequest wrapped in ModelRequest +func RadiusProviderRequestAsModelRequest(v *RadiusProviderRequest) ModelRequest { + return ModelRequest{ + RadiusProviderRequest: v, + } +} + +// SAMLProviderRequestAsModelRequest is a convenience function that returns SAMLProviderRequest wrapped in ModelRequest +func SAMLProviderRequestAsModelRequest(v *SAMLProviderRequest) ModelRequest { + return ModelRequest{ + SAMLProviderRequest: v, + } +} + +// SCIMProviderRequestAsModelRequest is a convenience function that returns SCIMProviderRequest wrapped in ModelRequest +func SCIMProviderRequestAsModelRequest(v *SCIMProviderRequest) ModelRequest { + return ModelRequest{ + SCIMProviderRequest: v, + } +} + +// SSFProviderRequestAsModelRequest is a convenience function that returns SSFProviderRequest wrapped in ModelRequest +func SSFProviderRequestAsModelRequest(v *SSFProviderRequest) ModelRequest { + return ModelRequest{ + SSFProviderRequest: v, + } +} + +// WSFederationProviderRequestAsModelRequest is a convenience function that returns WSFederationProviderRequest wrapped in ModelRequest +func WSFederationProviderRequestAsModelRequest(v *WSFederationProviderRequest) ModelRequest { + return ModelRequest{ + WSFederationProviderRequest: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ModelRequest) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'authentik_providers_google_workspace.googleworkspaceprovider' + if jsonDict["provider_model"] == "authentik_providers_google_workspace.googleworkspaceprovider" { + // try to unmarshal JSON data into GoogleWorkspaceProviderRequest + err = json.Unmarshal(data, &dst.GoogleWorkspaceProviderRequest) + if err == nil { + return nil // data stored in dst.GoogleWorkspaceProviderRequest, return on the first match + } else { + dst.GoogleWorkspaceProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as GoogleWorkspaceProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_ldap.ldapprovider' + if jsonDict["provider_model"] == "authentik_providers_ldap.ldapprovider" { + // try to unmarshal JSON data into LDAPProviderRequest + err = json.Unmarshal(data, &dst.LDAPProviderRequest) + if err == nil { + return nil // data stored in dst.LDAPProviderRequest, return on the first match + } else { + dst.LDAPProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as LDAPProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_microsoft_entra.microsoftentraprovider' + if jsonDict["provider_model"] == "authentik_providers_microsoft_entra.microsoftentraprovider" { + // try to unmarshal JSON data into MicrosoftEntraProviderRequest + err = json.Unmarshal(data, &dst.MicrosoftEntraProviderRequest) + if err == nil { + return nil // data stored in dst.MicrosoftEntraProviderRequest, return on the first match + } else { + dst.MicrosoftEntraProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as MicrosoftEntraProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_oauth2.oauth2provider' + if jsonDict["provider_model"] == "authentik_providers_oauth2.oauth2provider" { + // try to unmarshal JSON data into OAuth2ProviderRequest + err = json.Unmarshal(data, &dst.OAuth2ProviderRequest) + if err == nil { + return nil // data stored in dst.OAuth2ProviderRequest, return on the first match + } else { + dst.OAuth2ProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as OAuth2ProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_proxy.proxyprovider' + if jsonDict["provider_model"] == "authentik_providers_proxy.proxyprovider" { + // try to unmarshal JSON data into ProxyProviderRequest + err = json.Unmarshal(data, &dst.ProxyProviderRequest) + if err == nil { + return nil // data stored in dst.ProxyProviderRequest, return on the first match + } else { + dst.ProxyProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as ProxyProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_rac.racprovider' + if jsonDict["provider_model"] == "authentik_providers_rac.racprovider" { + // try to unmarshal JSON data into RACProviderRequest + err = json.Unmarshal(data, &dst.RACProviderRequest) + if err == nil { + return nil // data stored in dst.RACProviderRequest, return on the first match + } else { + dst.RACProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as RACProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_radius.radiusprovider' + if jsonDict["provider_model"] == "authentik_providers_radius.radiusprovider" { + // try to unmarshal JSON data into RadiusProviderRequest + err = json.Unmarshal(data, &dst.RadiusProviderRequest) + if err == nil { + return nil // data stored in dst.RadiusProviderRequest, return on the first match + } else { + dst.RadiusProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as RadiusProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_saml.samlprovider' + if jsonDict["provider_model"] == "authentik_providers_saml.samlprovider" { + // try to unmarshal JSON data into SAMLProviderRequest + err = json.Unmarshal(data, &dst.SAMLProviderRequest) + if err == nil { + return nil // data stored in dst.SAMLProviderRequest, return on the first match + } else { + dst.SAMLProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as SAMLProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_scim.scimprovider' + if jsonDict["provider_model"] == "authentik_providers_scim.scimprovider" { + // try to unmarshal JSON data into SCIMProviderRequest + err = json.Unmarshal(data, &dst.SCIMProviderRequest) + if err == nil { + return nil // data stored in dst.SCIMProviderRequest, return on the first match + } else { + dst.SCIMProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as SCIMProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_ssf.ssfprovider' + if jsonDict["provider_model"] == "authentik_providers_ssf.ssfprovider" { + // try to unmarshal JSON data into SSFProviderRequest + err = json.Unmarshal(data, &dst.SSFProviderRequest) + if err == nil { + return nil // data stored in dst.SSFProviderRequest, return on the first match + } else { + dst.SSFProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as SSFProviderRequest: %s", err.Error()) + } + } + + // check if the discriminator value is 'authentik_providers_ws_federation.wsfederationprovider' + if jsonDict["provider_model"] == "authentik_providers_ws_federation.wsfederationprovider" { + // try to unmarshal JSON data into WSFederationProviderRequest + err = json.Unmarshal(data, &dst.WSFederationProviderRequest) + if err == nil { + return nil // data stored in dst.WSFederationProviderRequest, return on the first match + } else { + dst.WSFederationProviderRequest = nil + return fmt.Errorf("failed to unmarshal ModelRequest as WSFederationProviderRequest: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ModelRequest) MarshalJSON() ([]byte, error) { + if src.GoogleWorkspaceProviderRequest != nil { + return json.Marshal(&src.GoogleWorkspaceProviderRequest) + } + + if src.LDAPProviderRequest != nil { + return json.Marshal(&src.LDAPProviderRequest) + } + + if src.MicrosoftEntraProviderRequest != nil { + return json.Marshal(&src.MicrosoftEntraProviderRequest) + } + + if src.OAuth2ProviderRequest != nil { + return json.Marshal(&src.OAuth2ProviderRequest) + } + + if src.ProxyProviderRequest != nil { + return json.Marshal(&src.ProxyProviderRequest) + } + + if src.RACProviderRequest != nil { + return json.Marshal(&src.RACProviderRequest) + } + + if src.RadiusProviderRequest != nil { + return json.Marshal(&src.RadiusProviderRequest) + } + + if src.SAMLProviderRequest != nil { + return json.Marshal(&src.SAMLProviderRequest) + } + + if src.SCIMProviderRequest != nil { + return json.Marshal(&src.SCIMProviderRequest) + } + + if src.SSFProviderRequest != nil { + return json.Marshal(&src.SSFProviderRequest) + } + + if src.WSFederationProviderRequest != nil { + return json.Marshal(&src.WSFederationProviderRequest) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ModelRequest) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.GoogleWorkspaceProviderRequest != nil { + return obj.GoogleWorkspaceProviderRequest + } + + if obj.LDAPProviderRequest != nil { + return obj.LDAPProviderRequest + } + + if obj.MicrosoftEntraProviderRequest != nil { + return obj.MicrosoftEntraProviderRequest + } + + if obj.OAuth2ProviderRequest != nil { + return obj.OAuth2ProviderRequest + } + + if obj.ProxyProviderRequest != nil { + return obj.ProxyProviderRequest + } + + if obj.RACProviderRequest != nil { + return obj.RACProviderRequest + } + + if obj.RadiusProviderRequest != nil { + return obj.RadiusProviderRequest + } + + if obj.SAMLProviderRequest != nil { + return obj.SAMLProviderRequest + } + + if obj.SCIMProviderRequest != nil { + return obj.SCIMProviderRequest + } + + if obj.SSFProviderRequest != nil { + return obj.SSFProviderRequest + } + + if obj.WSFederationProviderRequest != nil { + return obj.WSFederationProviderRequest + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ModelRequest) GetActualInstanceValue() interface{} { + if obj.GoogleWorkspaceProviderRequest != nil { + return *obj.GoogleWorkspaceProviderRequest + } + + if obj.LDAPProviderRequest != nil { + return *obj.LDAPProviderRequest + } + + if obj.MicrosoftEntraProviderRequest != nil { + return *obj.MicrosoftEntraProviderRequest + } + + if obj.OAuth2ProviderRequest != nil { + return *obj.OAuth2ProviderRequest + } + + if obj.ProxyProviderRequest != nil { + return *obj.ProxyProviderRequest + } + + if obj.RACProviderRequest != nil { + return *obj.RACProviderRequest + } + + if obj.RadiusProviderRequest != nil { + return *obj.RadiusProviderRequest + } + + if obj.SAMLProviderRequest != nil { + return *obj.SAMLProviderRequest + } + + if obj.SCIMProviderRequest != nil { + return *obj.SCIMProviderRequest + } + + if obj.SSFProviderRequest != nil { + return *obj.SSFProviderRequest + } + + if obj.WSFederationProviderRequest != nil { + return *obj.WSFederationProviderRequest + } + + // all schemas are nil + return nil +} + +type NullableModelRequest struct { + value *ModelRequest + isSet bool +} + +func (v NullableModelRequest) Get() *ModelRequest { + return v.value +} + +func (v *NullableModelRequest) Set(val *ModelRequest) { + v.value = val + v.isSet = true +} + +func (v NullableModelRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableModelRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableModelRequest(val *ModelRequest) *NullableModelRequest { + return &NullableModelRequest{value: val, isSet: true} +} + +func (v NullableModelRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableModelRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_mutual_tls_stage.go b/packages/client-go/model_mutual_tls_stage.go new file mode 100644 index 0000000000..0102e7f140 --- /dev/null +++ b/packages/client-go/model_mutual_tls_stage.go @@ -0,0 +1,470 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MutualTLSStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MutualTLSStage{} + +// MutualTLSStage MutualTLSStage Serializer +type MutualTLSStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + Mode StageModeEnum `json:"mode"` + // Configure certificate authorities to validate the certificate against. This option has a higher priority than the `client_certificate` option on `Brand`. + CertificateAuthorities []string `json:"certificate_authorities,omitempty"` + CertAttribute CertAttributeEnum `json:"cert_attribute"` + UserAttribute UserAttributeEnum `json:"user_attribute"` + AdditionalProperties map[string]interface{} +} + +type _MutualTLSStage MutualTLSStage + +// NewMutualTLSStage instantiates a new MutualTLSStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMutualTLSStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, mode StageModeEnum, certAttribute CertAttributeEnum, userAttribute UserAttributeEnum) *MutualTLSStage { + this := MutualTLSStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Mode = mode + this.CertAttribute = certAttribute + this.UserAttribute = userAttribute + return &this +} + +// NewMutualTLSStageWithDefaults instantiates a new MutualTLSStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMutualTLSStageWithDefaults() *MutualTLSStage { + this := MutualTLSStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *MutualTLSStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *MutualTLSStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *MutualTLSStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MutualTLSStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *MutualTLSStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *MutualTLSStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *MutualTLSStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *MutualTLSStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *MutualTLSStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *MutualTLSStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *MutualTLSStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *MutualTLSStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *MutualTLSStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *MutualTLSStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetMode returns the Mode field value +func (o *MutualTLSStage) GetMode() StageModeEnum { + if o == nil { + var ret StageModeEnum + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetModeOk() (*StageModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *MutualTLSStage) SetMode(v StageModeEnum) { + o.Mode = v +} + +// GetCertificateAuthorities returns the CertificateAuthorities field value if set, zero value otherwise. +func (o *MutualTLSStage) GetCertificateAuthorities() []string { + if o == nil || IsNil(o.CertificateAuthorities) { + var ret []string + return ret + } + return o.CertificateAuthorities +} + +// GetCertificateAuthoritiesOk returns a tuple with the CertificateAuthorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetCertificateAuthoritiesOk() ([]string, bool) { + if o == nil || IsNil(o.CertificateAuthorities) { + return nil, false + } + return o.CertificateAuthorities, true +} + +// HasCertificateAuthorities returns a boolean if a field has been set. +func (o *MutualTLSStage) HasCertificateAuthorities() bool { + if o != nil && !IsNil(o.CertificateAuthorities) { + return true + } + + return false +} + +// SetCertificateAuthorities gets a reference to the given []string and assigns it to the CertificateAuthorities field. +func (o *MutualTLSStage) SetCertificateAuthorities(v []string) { + o.CertificateAuthorities = v +} + +// GetCertAttribute returns the CertAttribute field value +func (o *MutualTLSStage) GetCertAttribute() CertAttributeEnum { + if o == nil { + var ret CertAttributeEnum + return ret + } + + return o.CertAttribute +} + +// GetCertAttributeOk returns a tuple with the CertAttribute field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetCertAttributeOk() (*CertAttributeEnum, bool) { + if o == nil { + return nil, false + } + return &o.CertAttribute, true +} + +// SetCertAttribute sets field value +func (o *MutualTLSStage) SetCertAttribute(v CertAttributeEnum) { + o.CertAttribute = v +} + +// GetUserAttribute returns the UserAttribute field value +func (o *MutualTLSStage) GetUserAttribute() UserAttributeEnum { + if o == nil { + var ret UserAttributeEnum + return ret + } + + return o.UserAttribute +} + +// GetUserAttributeOk returns a tuple with the UserAttribute field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStage) GetUserAttributeOk() (*UserAttributeEnum, bool) { + if o == nil { + return nil, false + } + return &o.UserAttribute, true +} + +// SetUserAttribute sets field value +func (o *MutualTLSStage) SetUserAttribute(v UserAttributeEnum) { + o.UserAttribute = v +} + +func (o MutualTLSStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MutualTLSStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["mode"] = o.Mode + if !IsNil(o.CertificateAuthorities) { + toSerialize["certificate_authorities"] = o.CertificateAuthorities + } + toSerialize["cert_attribute"] = o.CertAttribute + toSerialize["user_attribute"] = o.UserAttribute + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MutualTLSStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "mode", + "cert_attribute", + "user_attribute", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMutualTLSStage := _MutualTLSStage{} + + err = json.Unmarshal(data, &varMutualTLSStage) + + if err != nil { + return err + } + + *o = MutualTLSStage(varMutualTLSStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "mode") + delete(additionalProperties, "certificate_authorities") + delete(additionalProperties, "cert_attribute") + delete(additionalProperties, "user_attribute") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMutualTLSStage struct { + value *MutualTLSStage + isSet bool +} + +func (v NullableMutualTLSStage) Get() *MutualTLSStage { + return v.value +} + +func (v *NullableMutualTLSStage) Set(val *MutualTLSStage) { + v.value = val + v.isSet = true +} + +func (v NullableMutualTLSStage) IsSet() bool { + return v.isSet +} + +func (v *NullableMutualTLSStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMutualTLSStage(val *MutualTLSStage) *NullableMutualTLSStage { + return &NullableMutualTLSStage{value: val, isSet: true} +} + +func (v NullableMutualTLSStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMutualTLSStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_mutual_tls_stage_request.go b/packages/client-go/model_mutual_tls_stage_request.go new file mode 100644 index 0000000000..75c1501f6f --- /dev/null +++ b/packages/client-go/model_mutual_tls_stage_request.go @@ -0,0 +1,292 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the MutualTLSStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MutualTLSStageRequest{} + +// MutualTLSStageRequest MutualTLSStage Serializer +type MutualTLSStageRequest struct { + Name string `json:"name"` + Mode StageModeEnum `json:"mode"` + // Configure certificate authorities to validate the certificate against. This option has a higher priority than the `client_certificate` option on `Brand`. + CertificateAuthorities []string `json:"certificate_authorities,omitempty"` + CertAttribute CertAttributeEnum `json:"cert_attribute"` + UserAttribute UserAttributeEnum `json:"user_attribute"` + AdditionalProperties map[string]interface{} +} + +type _MutualTLSStageRequest MutualTLSStageRequest + +// NewMutualTLSStageRequest instantiates a new MutualTLSStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMutualTLSStageRequest(name string, mode StageModeEnum, certAttribute CertAttributeEnum, userAttribute UserAttributeEnum) *MutualTLSStageRequest { + this := MutualTLSStageRequest{} + this.Name = name + this.Mode = mode + this.CertAttribute = certAttribute + this.UserAttribute = userAttribute + return &this +} + +// NewMutualTLSStageRequestWithDefaults instantiates a new MutualTLSStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMutualTLSStageRequestWithDefaults() *MutualTLSStageRequest { + this := MutualTLSStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *MutualTLSStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MutualTLSStageRequest) SetName(v string) { + o.Name = v +} + +// GetMode returns the Mode field value +func (o *MutualTLSStageRequest) GetMode() StageModeEnum { + if o == nil { + var ret StageModeEnum + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStageRequest) GetModeOk() (*StageModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *MutualTLSStageRequest) SetMode(v StageModeEnum) { + o.Mode = v +} + +// GetCertificateAuthorities returns the CertificateAuthorities field value if set, zero value otherwise. +func (o *MutualTLSStageRequest) GetCertificateAuthorities() []string { + if o == nil || IsNil(o.CertificateAuthorities) { + var ret []string + return ret + } + return o.CertificateAuthorities +} + +// GetCertificateAuthoritiesOk returns a tuple with the CertificateAuthorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MutualTLSStageRequest) GetCertificateAuthoritiesOk() ([]string, bool) { + if o == nil || IsNil(o.CertificateAuthorities) { + return nil, false + } + return o.CertificateAuthorities, true +} + +// HasCertificateAuthorities returns a boolean if a field has been set. +func (o *MutualTLSStageRequest) HasCertificateAuthorities() bool { + if o != nil && !IsNil(o.CertificateAuthorities) { + return true + } + + return false +} + +// SetCertificateAuthorities gets a reference to the given []string and assigns it to the CertificateAuthorities field. +func (o *MutualTLSStageRequest) SetCertificateAuthorities(v []string) { + o.CertificateAuthorities = v +} + +// GetCertAttribute returns the CertAttribute field value +func (o *MutualTLSStageRequest) GetCertAttribute() CertAttributeEnum { + if o == nil { + var ret CertAttributeEnum + return ret + } + + return o.CertAttribute +} + +// GetCertAttributeOk returns a tuple with the CertAttribute field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStageRequest) GetCertAttributeOk() (*CertAttributeEnum, bool) { + if o == nil { + return nil, false + } + return &o.CertAttribute, true +} + +// SetCertAttribute sets field value +func (o *MutualTLSStageRequest) SetCertAttribute(v CertAttributeEnum) { + o.CertAttribute = v +} + +// GetUserAttribute returns the UserAttribute field value +func (o *MutualTLSStageRequest) GetUserAttribute() UserAttributeEnum { + if o == nil { + var ret UserAttributeEnum + return ret + } + + return o.UserAttribute +} + +// GetUserAttributeOk returns a tuple with the UserAttribute field value +// and a boolean to check if the value has been set. +func (o *MutualTLSStageRequest) GetUserAttributeOk() (*UserAttributeEnum, bool) { + if o == nil { + return nil, false + } + return &o.UserAttribute, true +} + +// SetUserAttribute sets field value +func (o *MutualTLSStageRequest) SetUserAttribute(v UserAttributeEnum) { + o.UserAttribute = v +} + +func (o MutualTLSStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MutualTLSStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["mode"] = o.Mode + if !IsNil(o.CertificateAuthorities) { + toSerialize["certificate_authorities"] = o.CertificateAuthorities + } + toSerialize["cert_attribute"] = o.CertAttribute + toSerialize["user_attribute"] = o.UserAttribute + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *MutualTLSStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mode", + "cert_attribute", + "user_attribute", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMutualTLSStageRequest := _MutualTLSStageRequest{} + + err = json.Unmarshal(data, &varMutualTLSStageRequest) + + if err != nil { + return err + } + + *o = MutualTLSStageRequest(varMutualTLSStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "certificate_authorities") + delete(additionalProperties, "cert_attribute") + delete(additionalProperties, "user_attribute") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableMutualTLSStageRequest struct { + value *MutualTLSStageRequest + isSet bool +} + +func (v NullableMutualTLSStageRequest) Get() *MutualTLSStageRequest { + return v.value +} + +func (v *NullableMutualTLSStageRequest) Set(val *MutualTLSStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableMutualTLSStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableMutualTLSStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMutualTLSStageRequest(val *MutualTLSStageRequest) *NullableMutualTLSStageRequest { + return &NullableMutualTLSStageRequest{value: val, isSet: true} +} + +func (v NullableMutualTLSStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMutualTLSStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_native_logout_challenge.go b/packages/client-go/model_native_logout_challenge.go new file mode 100644 index 0000000000..0117ea4a45 --- /dev/null +++ b/packages/client-go/model_native_logout_challenge.go @@ -0,0 +1,532 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the NativeLogoutChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NativeLogoutChallenge{} + +// NativeLogoutChallenge Challenge for native browser logout +type NativeLogoutChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + ProviderName *string `json:"provider_name,omitempty"` + IsComplete *bool `json:"is_complete,omitempty"` + PostUrl *string `json:"post_url,omitempty"` + RedirectUrl *string `json:"redirect_url,omitempty"` + SamlBinding *SAMLBindingsEnum `json:"saml_binding,omitempty"` + SamlRequest *string `json:"saml_request,omitempty"` + SamlResponse *string `json:"saml_response,omitempty"` + SamlRelayState *string `json:"saml_relay_state,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NativeLogoutChallenge NativeLogoutChallenge + +// NewNativeLogoutChallenge instantiates a new NativeLogoutChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNativeLogoutChallenge() *NativeLogoutChallenge { + this := NativeLogoutChallenge{} + var component string = "ak-provider-saml-native-logout" + this.Component = &component + var isComplete bool = false + this.IsComplete = &isComplete + return &this +} + +// NewNativeLogoutChallengeWithDefaults instantiates a new NativeLogoutChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNativeLogoutChallengeWithDefaults() *NativeLogoutChallenge { + this := NativeLogoutChallenge{} + var component string = "ak-provider-saml-native-logout" + this.Component = &component + var isComplete bool = false + this.IsComplete = &isComplete + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *NativeLogoutChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *NativeLogoutChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *NativeLogoutChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetProviderName returns the ProviderName field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetProviderName() string { + if o == nil || IsNil(o.ProviderName) { + var ret string + return ret + } + return *o.ProviderName +} + +// GetProviderNameOk returns a tuple with the ProviderName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetProviderNameOk() (*string, bool) { + if o == nil || IsNil(o.ProviderName) { + return nil, false + } + return o.ProviderName, true +} + +// HasProviderName returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasProviderName() bool { + if o != nil && !IsNil(o.ProviderName) { + return true + } + + return false +} + +// SetProviderName gets a reference to the given string and assigns it to the ProviderName field. +func (o *NativeLogoutChallenge) SetProviderName(v string) { + o.ProviderName = &v +} + +// GetIsComplete returns the IsComplete field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetIsComplete() bool { + if o == nil || IsNil(o.IsComplete) { + var ret bool + return ret + } + return *o.IsComplete +} + +// GetIsCompleteOk returns a tuple with the IsComplete field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetIsCompleteOk() (*bool, bool) { + if o == nil || IsNil(o.IsComplete) { + return nil, false + } + return o.IsComplete, true +} + +// HasIsComplete returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasIsComplete() bool { + if o != nil && !IsNil(o.IsComplete) { + return true + } + + return false +} + +// SetIsComplete gets a reference to the given bool and assigns it to the IsComplete field. +func (o *NativeLogoutChallenge) SetIsComplete(v bool) { + o.IsComplete = &v +} + +// GetPostUrl returns the PostUrl field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetPostUrl() string { + if o == nil || IsNil(o.PostUrl) { + var ret string + return ret + } + return *o.PostUrl +} + +// GetPostUrlOk returns a tuple with the PostUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetPostUrlOk() (*string, bool) { + if o == nil || IsNil(o.PostUrl) { + return nil, false + } + return o.PostUrl, true +} + +// HasPostUrl returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasPostUrl() bool { + if o != nil && !IsNil(o.PostUrl) { + return true + } + + return false +} + +// SetPostUrl gets a reference to the given string and assigns it to the PostUrl field. +func (o *NativeLogoutChallenge) SetPostUrl(v string) { + o.PostUrl = &v +} + +// GetRedirectUrl returns the RedirectUrl field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetRedirectUrl() string { + if o == nil || IsNil(o.RedirectUrl) { + var ret string + return ret + } + return *o.RedirectUrl +} + +// GetRedirectUrlOk returns a tuple with the RedirectUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetRedirectUrlOk() (*string, bool) { + if o == nil || IsNil(o.RedirectUrl) { + return nil, false + } + return o.RedirectUrl, true +} + +// HasRedirectUrl returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasRedirectUrl() bool { + if o != nil && !IsNil(o.RedirectUrl) { + return true + } + + return false +} + +// SetRedirectUrl gets a reference to the given string and assigns it to the RedirectUrl field. +func (o *NativeLogoutChallenge) SetRedirectUrl(v string) { + o.RedirectUrl = &v +} + +// GetSamlBinding returns the SamlBinding field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetSamlBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SamlBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SamlBinding +} + +// GetSamlBindingOk returns a tuple with the SamlBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetSamlBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SamlBinding) { + return nil, false + } + return o.SamlBinding, true +} + +// HasSamlBinding returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasSamlBinding() bool { + if o != nil && !IsNil(o.SamlBinding) { + return true + } + + return false +} + +// SetSamlBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SamlBinding field. +func (o *NativeLogoutChallenge) SetSamlBinding(v SAMLBindingsEnum) { + o.SamlBinding = &v +} + +// GetSamlRequest returns the SamlRequest field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetSamlRequest() string { + if o == nil || IsNil(o.SamlRequest) { + var ret string + return ret + } + return *o.SamlRequest +} + +// GetSamlRequestOk returns a tuple with the SamlRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetSamlRequestOk() (*string, bool) { + if o == nil || IsNil(o.SamlRequest) { + return nil, false + } + return o.SamlRequest, true +} + +// HasSamlRequest returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasSamlRequest() bool { + if o != nil && !IsNil(o.SamlRequest) { + return true + } + + return false +} + +// SetSamlRequest gets a reference to the given string and assigns it to the SamlRequest field. +func (o *NativeLogoutChallenge) SetSamlRequest(v string) { + o.SamlRequest = &v +} + +// GetSamlResponse returns the SamlResponse field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetSamlResponse() string { + if o == nil || IsNil(o.SamlResponse) { + var ret string + return ret + } + return *o.SamlResponse +} + +// GetSamlResponseOk returns a tuple with the SamlResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetSamlResponseOk() (*string, bool) { + if o == nil || IsNil(o.SamlResponse) { + return nil, false + } + return o.SamlResponse, true +} + +// HasSamlResponse returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasSamlResponse() bool { + if o != nil && !IsNil(o.SamlResponse) { + return true + } + + return false +} + +// SetSamlResponse gets a reference to the given string and assigns it to the SamlResponse field. +func (o *NativeLogoutChallenge) SetSamlResponse(v string) { + o.SamlResponse = &v +} + +// GetSamlRelayState returns the SamlRelayState field value if set, zero value otherwise. +func (o *NativeLogoutChallenge) GetSamlRelayState() string { + if o == nil || IsNil(o.SamlRelayState) { + var ret string + return ret + } + return *o.SamlRelayState +} + +// GetSamlRelayStateOk returns a tuple with the SamlRelayState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallenge) GetSamlRelayStateOk() (*string, bool) { + if o == nil || IsNil(o.SamlRelayState) { + return nil, false + } + return o.SamlRelayState, true +} + +// HasSamlRelayState returns a boolean if a field has been set. +func (o *NativeLogoutChallenge) HasSamlRelayState() bool { + if o != nil && !IsNil(o.SamlRelayState) { + return true + } + + return false +} + +// SetSamlRelayState gets a reference to the given string and assigns it to the SamlRelayState field. +func (o *NativeLogoutChallenge) SetSamlRelayState(v string) { + o.SamlRelayState = &v +} + +func (o NativeLogoutChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NativeLogoutChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + if !IsNil(o.ProviderName) { + toSerialize["provider_name"] = o.ProviderName + } + if !IsNil(o.IsComplete) { + toSerialize["is_complete"] = o.IsComplete + } + if !IsNil(o.PostUrl) { + toSerialize["post_url"] = o.PostUrl + } + if !IsNil(o.RedirectUrl) { + toSerialize["redirect_url"] = o.RedirectUrl + } + if !IsNil(o.SamlBinding) { + toSerialize["saml_binding"] = o.SamlBinding + } + if !IsNil(o.SamlRequest) { + toSerialize["saml_request"] = o.SamlRequest + } + if !IsNil(o.SamlResponse) { + toSerialize["saml_response"] = o.SamlResponse + } + if !IsNil(o.SamlRelayState) { + toSerialize["saml_relay_state"] = o.SamlRelayState + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NativeLogoutChallenge) UnmarshalJSON(data []byte) (err error) { + varNativeLogoutChallenge := _NativeLogoutChallenge{} + + err = json.Unmarshal(data, &varNativeLogoutChallenge) + + if err != nil { + return err + } + + *o = NativeLogoutChallenge(varNativeLogoutChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "provider_name") + delete(additionalProperties, "is_complete") + delete(additionalProperties, "post_url") + delete(additionalProperties, "redirect_url") + delete(additionalProperties, "saml_binding") + delete(additionalProperties, "saml_request") + delete(additionalProperties, "saml_response") + delete(additionalProperties, "saml_relay_state") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNativeLogoutChallenge struct { + value *NativeLogoutChallenge + isSet bool +} + +func (v NullableNativeLogoutChallenge) Get() *NativeLogoutChallenge { + return v.value +} + +func (v *NullableNativeLogoutChallenge) Set(val *NativeLogoutChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableNativeLogoutChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableNativeLogoutChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNativeLogoutChallenge(val *NativeLogoutChallenge) *NullableNativeLogoutChallenge { + return &NullableNativeLogoutChallenge{value: val, isSet: true} +} + +func (v NullableNativeLogoutChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNativeLogoutChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_native_logout_challenge_response_request.go b/packages/client-go/model_native_logout_challenge_response_request.go new file mode 100644 index 0000000000..2c4179dcbf --- /dev/null +++ b/packages/client-go/model_native_logout_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the NativeLogoutChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NativeLogoutChallengeResponseRequest{} + +// NativeLogoutChallengeResponseRequest Response for native browser logout +type NativeLogoutChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NativeLogoutChallengeResponseRequest NativeLogoutChallengeResponseRequest + +// NewNativeLogoutChallengeResponseRequest instantiates a new NativeLogoutChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNativeLogoutChallengeResponseRequest() *NativeLogoutChallengeResponseRequest { + this := NativeLogoutChallengeResponseRequest{} + var component string = "ak-provider-saml-native-logout" + this.Component = &component + return &this +} + +// NewNativeLogoutChallengeResponseRequestWithDefaults instantiates a new NativeLogoutChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNativeLogoutChallengeResponseRequestWithDefaults() *NativeLogoutChallengeResponseRequest { + this := NativeLogoutChallengeResponseRequest{} + var component string = "ak-provider-saml-native-logout" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *NativeLogoutChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NativeLogoutChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *NativeLogoutChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *NativeLogoutChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o NativeLogoutChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NativeLogoutChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NativeLogoutChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varNativeLogoutChallengeResponseRequest := _NativeLogoutChallengeResponseRequest{} + + err = json.Unmarshal(data, &varNativeLogoutChallengeResponseRequest) + + if err != nil { + return err + } + + *o = NativeLogoutChallengeResponseRequest(varNativeLogoutChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNativeLogoutChallengeResponseRequest struct { + value *NativeLogoutChallengeResponseRequest + isSet bool +} + +func (v NullableNativeLogoutChallengeResponseRequest) Get() *NativeLogoutChallengeResponseRequest { + return v.value +} + +func (v *NullableNativeLogoutChallengeResponseRequest) Set(val *NativeLogoutChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNativeLogoutChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNativeLogoutChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNativeLogoutChallengeResponseRequest(val *NativeLogoutChallengeResponseRequest) *NullableNativeLogoutChallengeResponseRequest { + return &NullableNativeLogoutChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableNativeLogoutChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNativeLogoutChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_network.go b/packages/client-go/model_network.go new file mode 100644 index 0000000000..69244c314e --- /dev/null +++ b/packages/client-go/model_network.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network struct for Network +type Network struct { + Hostname string `json:"hostname"` + FirewallEnabled *bool `json:"firewall_enabled,omitempty"` + Interfaces []NetworkInterface `json:"interfaces"` + Gateway *string `json:"gateway,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Network Network + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork(hostname string, interfaces []NetworkInterface) *Network { + this := Network{} + this.Hostname = hostname + this.Interfaces = interfaces + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetHostname returns the Hostname field value +func (o *Network) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *Network) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *Network) SetHostname(v string) { + o.Hostname = v +} + +// GetFirewallEnabled returns the FirewallEnabled field value if set, zero value otherwise. +func (o *Network) GetFirewallEnabled() bool { + if o == nil || IsNil(o.FirewallEnabled) { + var ret bool + return ret + } + return *o.FirewallEnabled +} + +// GetFirewallEnabledOk returns a tuple with the FirewallEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetFirewallEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.FirewallEnabled) { + return nil, false + } + return o.FirewallEnabled, true +} + +// HasFirewallEnabled returns a boolean if a field has been set. +func (o *Network) HasFirewallEnabled() bool { + if o != nil && !IsNil(o.FirewallEnabled) { + return true + } + + return false +} + +// SetFirewallEnabled gets a reference to the given bool and assigns it to the FirewallEnabled field. +func (o *Network) SetFirewallEnabled(v bool) { + o.FirewallEnabled = &v +} + +// GetInterfaces returns the Interfaces field value +func (o *Network) GetInterfaces() []NetworkInterface { + if o == nil { + var ret []NetworkInterface + return ret + } + + return o.Interfaces +} + +// GetInterfacesOk returns a tuple with the Interfaces field value +// and a boolean to check if the value has been set. +func (o *Network) GetInterfacesOk() ([]NetworkInterface, bool) { + if o == nil { + return nil, false + } + return o.Interfaces, true +} + +// SetInterfaces sets field value +func (o *Network) SetInterfaces(v []NetworkInterface) { + o.Interfaces = v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise. +func (o *Network) GetGateway() string { + if o == nil || IsNil(o.Gateway) { + var ret string + return ret + } + return *o.Gateway +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway, true +} + +// HasGateway returns a boolean if a field has been set. +func (o *Network) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *Network) SetGateway(v string) { + o.Gateway = &v +} + +func (o Network) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostname"] = o.Hostname + if !IsNil(o.FirewallEnabled) { + toSerialize["firewall_enabled"] = o.FirewallEnabled + } + toSerialize["interfaces"] = o.Interfaces + if !IsNil(o.Gateway) { + toSerialize["gateway"] = o.Gateway + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Network) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "hostname", + "interfaces", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetwork := _Network{} + + err = json.Unmarshal(data, &varNetwork) + + if err != nil { + return err + } + + *o = Network(varNetwork) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "hostname") + delete(additionalProperties, "firewall_enabled") + delete(additionalProperties, "interfaces") + delete(additionalProperties, "gateway") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_network_binding_enum.go b/packages/client-go/model_network_binding_enum.go new file mode 100644 index 0000000000..ec31984057 --- /dev/null +++ b/packages/client-go/model_network_binding_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// NetworkBindingEnum the model 'NetworkBindingEnum' +type NetworkBindingEnum string + +// List of NetworkBindingEnum +const ( + NETWORKBINDINGENUM_NO_BINDING NetworkBindingEnum = "no_binding" + NETWORKBINDINGENUM_BIND_ASN NetworkBindingEnum = "bind_asn" + NETWORKBINDINGENUM_BIND_ASN_NETWORK NetworkBindingEnum = "bind_asn_network" + NETWORKBINDINGENUM_BIND_ASN_NETWORK_IP NetworkBindingEnum = "bind_asn_network_ip" +) + +// All allowed values of NetworkBindingEnum enum +var AllowedNetworkBindingEnumEnumValues = []NetworkBindingEnum{ + "no_binding", + "bind_asn", + "bind_asn_network", + "bind_asn_network_ip", +} + +func (v *NetworkBindingEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NetworkBindingEnum(value) + for _, existing := range AllowedNetworkBindingEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NetworkBindingEnum", value) +} + +// NewNetworkBindingEnumFromValue returns a pointer to a valid NetworkBindingEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNetworkBindingEnumFromValue(v string) (*NetworkBindingEnum, error) { + ev := NetworkBindingEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NetworkBindingEnum: valid values are %v", v, AllowedNetworkBindingEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NetworkBindingEnum) IsValid() bool { + for _, existing := range AllowedNetworkBindingEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to NetworkBindingEnum value +func (v NetworkBindingEnum) Ptr() *NetworkBindingEnum { + return &v +} + +type NullableNetworkBindingEnum struct { + value *NetworkBindingEnum + isSet bool +} + +func (v NullableNetworkBindingEnum) Get() *NetworkBindingEnum { + return v.value +} + +func (v *NullableNetworkBindingEnum) Set(val *NetworkBindingEnum) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkBindingEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkBindingEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkBindingEnum(val *NetworkBindingEnum) *NullableNetworkBindingEnum { + return &NullableNetworkBindingEnum{value: val, isSet: true} +} + +func (v NullableNetworkBindingEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkBindingEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_network_interface.go b/packages/client-go/model_network_interface.go new file mode 100644 index 0000000000..0d5e1d395a --- /dev/null +++ b/packages/client-go/model_network_interface.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NetworkInterface type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkInterface{} + +// NetworkInterface struct for NetworkInterface +type NetworkInterface struct { + Name string `json:"name"` + HardwareAddress string `json:"hardware_address"` + IpAddresses []string `json:"ip_addresses,omitempty"` + DnsServers []string `json:"dns_servers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NetworkInterface NetworkInterface + +// NewNetworkInterface instantiates a new NetworkInterface object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkInterface(name string, hardwareAddress string) *NetworkInterface { + this := NetworkInterface{} + this.Name = name + this.HardwareAddress = hardwareAddress + return &this +} + +// NewNetworkInterfaceWithDefaults instantiates a new NetworkInterface object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkInterfaceWithDefaults() *NetworkInterface { + this := NetworkInterface{} + return &this +} + +// GetName returns the Name field value +func (o *NetworkInterface) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NetworkInterface) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NetworkInterface) SetName(v string) { + o.Name = v +} + +// GetHardwareAddress returns the HardwareAddress field value +func (o *NetworkInterface) GetHardwareAddress() string { + if o == nil { + var ret string + return ret + } + + return o.HardwareAddress +} + +// GetHardwareAddressOk returns a tuple with the HardwareAddress field value +// and a boolean to check if the value has been set. +func (o *NetworkInterface) GetHardwareAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HardwareAddress, true +} + +// SetHardwareAddress sets field value +func (o *NetworkInterface) SetHardwareAddress(v string) { + o.HardwareAddress = v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *NetworkInterface) GetIpAddresses() []string { + if o == nil || IsNil(o.IpAddresses) { + var ret []string + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkInterface) GetIpAddressesOk() ([]string, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *NetworkInterface) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []string and assigns it to the IpAddresses field. +func (o *NetworkInterface) SetIpAddresses(v []string) { + o.IpAddresses = v +} + +// GetDnsServers returns the DnsServers field value if set, zero value otherwise. +func (o *NetworkInterface) GetDnsServers() []string { + if o == nil || IsNil(o.DnsServers) { + var ret []string + return ret + } + return o.DnsServers +} + +// GetDnsServersOk returns a tuple with the DnsServers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkInterface) GetDnsServersOk() ([]string, bool) { + if o == nil || IsNil(o.DnsServers) { + return nil, false + } + return o.DnsServers, true +} + +// HasDnsServers returns a boolean if a field has been set. +func (o *NetworkInterface) HasDnsServers() bool { + if o != nil && !IsNil(o.DnsServers) { + return true + } + + return false +} + +// SetDnsServers gets a reference to the given []string and assigns it to the DnsServers field. +func (o *NetworkInterface) SetDnsServers(v []string) { + o.DnsServers = v +} + +func (o NetworkInterface) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkInterface) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["hardware_address"] = o.HardwareAddress + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.DnsServers) { + toSerialize["dns_servers"] = o.DnsServers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NetworkInterface) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "hardware_address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkInterface := _NetworkInterface{} + + err = json.Unmarshal(data, &varNetworkInterface) + + if err != nil { + return err + } + + *o = NetworkInterface(varNetworkInterface) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "hardware_address") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "dns_servers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetworkInterface struct { + value *NetworkInterface + isSet bool +} + +func (v NullableNetworkInterface) Get() *NetworkInterface { + return v.value +} + +func (v *NullableNetworkInterface) Set(val *NetworkInterface) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkInterface) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkInterface) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkInterface(val *NetworkInterface) *NullableNetworkInterface { + return &NullableNetworkInterface{value: val, isSet: true} +} + +func (v NullableNetworkInterface) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkInterface) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_network_interface_request.go b/packages/client-go/model_network_interface_request.go new file mode 100644 index 0000000000..a9152dbd7f --- /dev/null +++ b/packages/client-go/model_network_interface_request.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NetworkInterfaceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkInterfaceRequest{} + +// NetworkInterfaceRequest struct for NetworkInterfaceRequest +type NetworkInterfaceRequest struct { + Name string `json:"name"` + HardwareAddress string `json:"hardware_address"` + IpAddresses []string `json:"ip_addresses,omitempty"` + DnsServers []string `json:"dns_servers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NetworkInterfaceRequest NetworkInterfaceRequest + +// NewNetworkInterfaceRequest instantiates a new NetworkInterfaceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkInterfaceRequest(name string, hardwareAddress string) *NetworkInterfaceRequest { + this := NetworkInterfaceRequest{} + this.Name = name + this.HardwareAddress = hardwareAddress + return &this +} + +// NewNetworkInterfaceRequestWithDefaults instantiates a new NetworkInterfaceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkInterfaceRequestWithDefaults() *NetworkInterfaceRequest { + this := NetworkInterfaceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NetworkInterfaceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NetworkInterfaceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NetworkInterfaceRequest) SetName(v string) { + o.Name = v +} + +// GetHardwareAddress returns the HardwareAddress field value +func (o *NetworkInterfaceRequest) GetHardwareAddress() string { + if o == nil { + var ret string + return ret + } + + return o.HardwareAddress +} + +// GetHardwareAddressOk returns a tuple with the HardwareAddress field value +// and a boolean to check if the value has been set. +func (o *NetworkInterfaceRequest) GetHardwareAddressOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HardwareAddress, true +} + +// SetHardwareAddress sets field value +func (o *NetworkInterfaceRequest) SetHardwareAddress(v string) { + o.HardwareAddress = v +} + +// GetIpAddresses returns the IpAddresses field value if set, zero value otherwise. +func (o *NetworkInterfaceRequest) GetIpAddresses() []string { + if o == nil || IsNil(o.IpAddresses) { + var ret []string + return ret + } + return o.IpAddresses +} + +// GetIpAddressesOk returns a tuple with the IpAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkInterfaceRequest) GetIpAddressesOk() ([]string, bool) { + if o == nil || IsNil(o.IpAddresses) { + return nil, false + } + return o.IpAddresses, true +} + +// HasIpAddresses returns a boolean if a field has been set. +func (o *NetworkInterfaceRequest) HasIpAddresses() bool { + if o != nil && !IsNil(o.IpAddresses) { + return true + } + + return false +} + +// SetIpAddresses gets a reference to the given []string and assigns it to the IpAddresses field. +func (o *NetworkInterfaceRequest) SetIpAddresses(v []string) { + o.IpAddresses = v +} + +// GetDnsServers returns the DnsServers field value if set, zero value otherwise. +func (o *NetworkInterfaceRequest) GetDnsServers() []string { + if o == nil || IsNil(o.DnsServers) { + var ret []string + return ret + } + return o.DnsServers +} + +// GetDnsServersOk returns a tuple with the DnsServers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkInterfaceRequest) GetDnsServersOk() ([]string, bool) { + if o == nil || IsNil(o.DnsServers) { + return nil, false + } + return o.DnsServers, true +} + +// HasDnsServers returns a boolean if a field has been set. +func (o *NetworkInterfaceRequest) HasDnsServers() bool { + if o != nil && !IsNil(o.DnsServers) { + return true + } + + return false +} + +// SetDnsServers gets a reference to the given []string and assigns it to the DnsServers field. +func (o *NetworkInterfaceRequest) SetDnsServers(v []string) { + o.DnsServers = v +} + +func (o NetworkInterfaceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkInterfaceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["hardware_address"] = o.HardwareAddress + if !IsNil(o.IpAddresses) { + toSerialize["ip_addresses"] = o.IpAddresses + } + if !IsNil(o.DnsServers) { + toSerialize["dns_servers"] = o.DnsServers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NetworkInterfaceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "hardware_address", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkInterfaceRequest := _NetworkInterfaceRequest{} + + err = json.Unmarshal(data, &varNetworkInterfaceRequest) + + if err != nil { + return err + } + + *o = NetworkInterfaceRequest(varNetworkInterfaceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "hardware_address") + delete(additionalProperties, "ip_addresses") + delete(additionalProperties, "dns_servers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetworkInterfaceRequest struct { + value *NetworkInterfaceRequest + isSet bool +} + +func (v NullableNetworkInterfaceRequest) Get() *NetworkInterfaceRequest { + return v.value +} + +func (v *NullableNetworkInterfaceRequest) Set(val *NetworkInterfaceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkInterfaceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkInterfaceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkInterfaceRequest(val *NetworkInterfaceRequest) *NullableNetworkInterfaceRequest { + return &NullableNetworkInterfaceRequest{value: val, isSet: true} +} + +func (v NullableNetworkInterfaceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkInterfaceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_network_request.go b/packages/client-go/model_network_request.go new file mode 100644 index 0000000000..3f01a558c7 --- /dev/null +++ b/packages/client-go/model_network_request.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NetworkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRequest{} + +// NetworkRequest struct for NetworkRequest +type NetworkRequest struct { + Hostname string `json:"hostname"` + FirewallEnabled *bool `json:"firewall_enabled,omitempty"` + Interfaces []NetworkInterfaceRequest `json:"interfaces"` + Gateway *string `json:"gateway,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NetworkRequest NetworkRequest + +// NewNetworkRequest instantiates a new NetworkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRequest(hostname string, interfaces []NetworkInterfaceRequest) *NetworkRequest { + this := NetworkRequest{} + this.Hostname = hostname + this.Interfaces = interfaces + return &this +} + +// NewNetworkRequestWithDefaults instantiates a new NetworkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRequestWithDefaults() *NetworkRequest { + this := NetworkRequest{} + return &this +} + +// GetHostname returns the Hostname field value +func (o *NetworkRequest) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *NetworkRequest) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *NetworkRequest) SetHostname(v string) { + o.Hostname = v +} + +// GetFirewallEnabled returns the FirewallEnabled field value if set, zero value otherwise. +func (o *NetworkRequest) GetFirewallEnabled() bool { + if o == nil || IsNil(o.FirewallEnabled) { + var ret bool + return ret + } + return *o.FirewallEnabled +} + +// GetFirewallEnabledOk returns a tuple with the FirewallEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRequest) GetFirewallEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.FirewallEnabled) { + return nil, false + } + return o.FirewallEnabled, true +} + +// HasFirewallEnabled returns a boolean if a field has been set. +func (o *NetworkRequest) HasFirewallEnabled() bool { + if o != nil && !IsNil(o.FirewallEnabled) { + return true + } + + return false +} + +// SetFirewallEnabled gets a reference to the given bool and assigns it to the FirewallEnabled field. +func (o *NetworkRequest) SetFirewallEnabled(v bool) { + o.FirewallEnabled = &v +} + +// GetInterfaces returns the Interfaces field value +func (o *NetworkRequest) GetInterfaces() []NetworkInterfaceRequest { + if o == nil { + var ret []NetworkInterfaceRequest + return ret + } + + return o.Interfaces +} + +// GetInterfacesOk returns a tuple with the Interfaces field value +// and a boolean to check if the value has been set. +func (o *NetworkRequest) GetInterfacesOk() ([]NetworkInterfaceRequest, bool) { + if o == nil { + return nil, false + } + return o.Interfaces, true +} + +// SetInterfaces sets field value +func (o *NetworkRequest) SetInterfaces(v []NetworkInterfaceRequest) { + o.Interfaces = v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise. +func (o *NetworkRequest) GetGateway() string { + if o == nil || IsNil(o.Gateway) { + var ret string + return ret + } + return *o.Gateway +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRequest) GetGatewayOk() (*string, bool) { + if o == nil || IsNil(o.Gateway) { + return nil, false + } + return o.Gateway, true +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkRequest) HasGateway() bool { + if o != nil && !IsNil(o.Gateway) { + return true + } + + return false +} + +// SetGateway gets a reference to the given string and assigns it to the Gateway field. +func (o *NetworkRequest) SetGateway(v string) { + o.Gateway = &v +} + +func (o NetworkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["hostname"] = o.Hostname + if !IsNil(o.FirewallEnabled) { + toSerialize["firewall_enabled"] = o.FirewallEnabled + } + toSerialize["interfaces"] = o.Interfaces + if !IsNil(o.Gateway) { + toSerialize["gateway"] = o.Gateway + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NetworkRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "hostname", + "interfaces", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRequest := _NetworkRequest{} + + err = json.Unmarshal(data, &varNetworkRequest) + + if err != nil { + return err + } + + *o = NetworkRequest(varNetworkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "hostname") + delete(additionalProperties, "firewall_enabled") + delete(additionalProperties, "interfaces") + delete(additionalProperties, "gateway") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNetworkRequest struct { + value *NetworkRequest + isSet bool +} + +func (v NullableNetworkRequest) Get() *NetworkRequest { + return v.value +} + +func (v *NullableNetworkRequest) Set(val *NetworkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRequest(val *NetworkRequest) *NullableNetworkRequest { + return &NullableNetworkRequest{value: val, isSet: true} +} + +func (v NullableNetworkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_not_configured_action_enum.go b/packages/client-go/model_not_configured_action_enum.go new file mode 100644 index 0000000000..83c7aced28 --- /dev/null +++ b/packages/client-go/model_not_configured_action_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// NotConfiguredActionEnum the model 'NotConfiguredActionEnum' +type NotConfiguredActionEnum string + +// List of NotConfiguredActionEnum +const ( + NOTCONFIGUREDACTIONENUM_SKIP NotConfiguredActionEnum = "skip" + NOTCONFIGUREDACTIONENUM_DENY NotConfiguredActionEnum = "deny" + NOTCONFIGUREDACTIONENUM_CONFIGURE NotConfiguredActionEnum = "configure" +) + +// All allowed values of NotConfiguredActionEnum enum +var AllowedNotConfiguredActionEnumEnumValues = []NotConfiguredActionEnum{ + "skip", + "deny", + "configure", +} + +func (v *NotConfiguredActionEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NotConfiguredActionEnum(value) + for _, existing := range AllowedNotConfiguredActionEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NotConfiguredActionEnum", value) +} + +// NewNotConfiguredActionEnumFromValue returns a pointer to a valid NotConfiguredActionEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNotConfiguredActionEnumFromValue(v string) (*NotConfiguredActionEnum, error) { + ev := NotConfiguredActionEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NotConfiguredActionEnum: valid values are %v", v, AllowedNotConfiguredActionEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NotConfiguredActionEnum) IsValid() bool { + for _, existing := range AllowedNotConfiguredActionEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to NotConfiguredActionEnum value +func (v NotConfiguredActionEnum) Ptr() *NotConfiguredActionEnum { + return &v +} + +type NullableNotConfiguredActionEnum struct { + value *NotConfiguredActionEnum + isSet bool +} + +func (v NullableNotConfiguredActionEnum) Get() *NotConfiguredActionEnum { + return v.value +} + +func (v *NullableNotConfiguredActionEnum) Set(val *NotConfiguredActionEnum) { + v.value = val + v.isSet = true +} + +func (v NullableNotConfiguredActionEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableNotConfiguredActionEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotConfiguredActionEnum(val *NotConfiguredActionEnum) *NullableNotConfiguredActionEnum { + return &NullableNotConfiguredActionEnum{value: val, isSet: true} +} + +func (v NullableNotConfiguredActionEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotConfiguredActionEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification.go b/packages/client-go/model_notification.go new file mode 100644 index 0000000000..3bfdcbd138 --- /dev/null +++ b/packages/client-go/model_notification.go @@ -0,0 +1,425 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Notification type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Notification{} + +// Notification Notification Serializer +type Notification struct { + Pk string `json:"pk"` + Severity SeverityEnum `json:"severity"` + Body string `json:"body"` + Hyperlink NullableString `json:"hyperlink,omitempty"` + HyperlinkLabel NullableString `json:"hyperlink_label,omitempty"` + Created time.Time `json:"created"` + Event *Event `json:"event,omitempty"` + Seen *bool `json:"seen,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Notification Notification + +// NewNotification instantiates a new Notification object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotification(pk string, severity SeverityEnum, body string, created time.Time) *Notification { + this := Notification{} + this.Pk = pk + this.Severity = severity + this.Body = body + this.Created = created + return &this +} + +// NewNotificationWithDefaults instantiates a new Notification object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationWithDefaults() *Notification { + this := Notification{} + return &this +} + +// GetPk returns the Pk field value +func (o *Notification) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Notification) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Notification) SetPk(v string) { + o.Pk = v +} + +// GetSeverity returns the Severity field value +func (o *Notification) GetSeverity() SeverityEnum { + if o == nil { + var ret SeverityEnum + return ret + } + + return o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value +// and a boolean to check if the value has been set. +func (o *Notification) GetSeverityOk() (*SeverityEnum, bool) { + if o == nil { + return nil, false + } + return &o.Severity, true +} + +// SetSeverity sets field value +func (o *Notification) SetSeverity(v SeverityEnum) { + o.Severity = v +} + +// GetBody returns the Body field value +func (o *Notification) GetBody() string { + if o == nil { + var ret string + return ret + } + + return o.Body +} + +// GetBodyOk returns a tuple with the Body field value +// and a boolean to check if the value has been set. +func (o *Notification) GetBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Body, true +} + +// SetBody sets field value +func (o *Notification) SetBody(v string) { + o.Body = v +} + +// GetHyperlink returns the Hyperlink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Notification) GetHyperlink() string { + if o == nil || IsNil(o.Hyperlink.Get()) { + var ret string + return ret + } + return *o.Hyperlink.Get() +} + +// GetHyperlinkOk returns a tuple with the Hyperlink field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Notification) GetHyperlinkOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Hyperlink.Get(), o.Hyperlink.IsSet() +} + +// HasHyperlink returns a boolean if a field has been set. +func (o *Notification) HasHyperlink() bool { + if o != nil && o.Hyperlink.IsSet() { + return true + } + + return false +} + +// SetHyperlink gets a reference to the given NullableString and assigns it to the Hyperlink field. +func (o *Notification) SetHyperlink(v string) { + o.Hyperlink.Set(&v) +} + +// SetHyperlinkNil sets the value for Hyperlink to be an explicit nil +func (o *Notification) SetHyperlinkNil() { + o.Hyperlink.Set(nil) +} + +// UnsetHyperlink ensures that no value is present for Hyperlink, not even an explicit nil +func (o *Notification) UnsetHyperlink() { + o.Hyperlink.Unset() +} + +// GetHyperlinkLabel returns the HyperlinkLabel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Notification) GetHyperlinkLabel() string { + if o == nil || IsNil(o.HyperlinkLabel.Get()) { + var ret string + return ret + } + return *o.HyperlinkLabel.Get() +} + +// GetHyperlinkLabelOk returns a tuple with the HyperlinkLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Notification) GetHyperlinkLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HyperlinkLabel.Get(), o.HyperlinkLabel.IsSet() +} + +// HasHyperlinkLabel returns a boolean if a field has been set. +func (o *Notification) HasHyperlinkLabel() bool { + if o != nil && o.HyperlinkLabel.IsSet() { + return true + } + + return false +} + +// SetHyperlinkLabel gets a reference to the given NullableString and assigns it to the HyperlinkLabel field. +func (o *Notification) SetHyperlinkLabel(v string) { + o.HyperlinkLabel.Set(&v) +} + +// SetHyperlinkLabelNil sets the value for HyperlinkLabel to be an explicit nil +func (o *Notification) SetHyperlinkLabelNil() { + o.HyperlinkLabel.Set(nil) +} + +// UnsetHyperlinkLabel ensures that no value is present for HyperlinkLabel, not even an explicit nil +func (o *Notification) UnsetHyperlinkLabel() { + o.HyperlinkLabel.Unset() +} + +// GetCreated returns the Created field value +func (o *Notification) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Notification) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Notification) SetCreated(v time.Time) { + o.Created = v +} + +// GetEvent returns the Event field value if set, zero value otherwise. +func (o *Notification) GetEvent() Event { + if o == nil || IsNil(o.Event) { + var ret Event + return ret + } + return *o.Event +} + +// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Notification) GetEventOk() (*Event, bool) { + if o == nil || IsNil(o.Event) { + return nil, false + } + return o.Event, true +} + +// HasEvent returns a boolean if a field has been set. +func (o *Notification) HasEvent() bool { + if o != nil && !IsNil(o.Event) { + return true + } + + return false +} + +// SetEvent gets a reference to the given Event and assigns it to the Event field. +func (o *Notification) SetEvent(v Event) { + o.Event = &v +} + +// GetSeen returns the Seen field value if set, zero value otherwise. +func (o *Notification) GetSeen() bool { + if o == nil || IsNil(o.Seen) { + var ret bool + return ret + } + return *o.Seen +} + +// GetSeenOk returns a tuple with the Seen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Notification) GetSeenOk() (*bool, bool) { + if o == nil || IsNil(o.Seen) { + return nil, false + } + return o.Seen, true +} + +// HasSeen returns a boolean if a field has been set. +func (o *Notification) HasSeen() bool { + if o != nil && !IsNil(o.Seen) { + return true + } + + return false +} + +// SetSeen gets a reference to the given bool and assigns it to the Seen field. +func (o *Notification) SetSeen(v bool) { + o.Seen = &v +} + +func (o Notification) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Notification) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["severity"] = o.Severity + toSerialize["body"] = o.Body + if o.Hyperlink.IsSet() { + toSerialize["hyperlink"] = o.Hyperlink.Get() + } + if o.HyperlinkLabel.IsSet() { + toSerialize["hyperlink_label"] = o.HyperlinkLabel.Get() + } + toSerialize["created"] = o.Created + if !IsNil(o.Event) { + toSerialize["event"] = o.Event + } + if !IsNil(o.Seen) { + toSerialize["seen"] = o.Seen + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Notification) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "severity", + "body", + "created", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotification := _Notification{} + + err = json.Unmarshal(data, &varNotification) + + if err != nil { + return err + } + + *o = Notification(varNotification) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "severity") + delete(additionalProperties, "body") + delete(additionalProperties, "hyperlink") + delete(additionalProperties, "hyperlink_label") + delete(additionalProperties, "created") + delete(additionalProperties, "event") + delete(additionalProperties, "seen") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotification struct { + value *Notification + isSet bool +} + +func (v NullableNotification) Get() *Notification { + return v.value +} + +func (v *NullableNotification) Set(val *Notification) { + v.value = val + v.isSet = true +} + +func (v NullableNotification) IsSet() bool { + return v.isSet +} + +func (v *NullableNotification) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotification(val *Notification) *NullableNotification { + return &NullableNotification{value: val, isSet: true} +} + +func (v NullableNotification) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotification) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_request.go b/packages/client-go/model_notification_request.go new file mode 100644 index 0000000000..75251f47cd --- /dev/null +++ b/packages/client-go/model_notification_request.go @@ -0,0 +1,287 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the NotificationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationRequest{} + +// NotificationRequest Notification Serializer +type NotificationRequest struct { + Hyperlink NullableString `json:"hyperlink,omitempty"` + HyperlinkLabel NullableString `json:"hyperlink_label,omitempty"` + Event *EventRequest `json:"event,omitempty"` + Seen *bool `json:"seen,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotificationRequest NotificationRequest + +// NewNotificationRequest instantiates a new NotificationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationRequest() *NotificationRequest { + this := NotificationRequest{} + return &this +} + +// NewNotificationRequestWithDefaults instantiates a new NotificationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationRequestWithDefaults() *NotificationRequest { + this := NotificationRequest{} + return &this +} + +// GetHyperlink returns the Hyperlink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationRequest) GetHyperlink() string { + if o == nil || IsNil(o.Hyperlink.Get()) { + var ret string + return ret + } + return *o.Hyperlink.Get() +} + +// GetHyperlinkOk returns a tuple with the Hyperlink field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationRequest) GetHyperlinkOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Hyperlink.Get(), o.Hyperlink.IsSet() +} + +// HasHyperlink returns a boolean if a field has been set. +func (o *NotificationRequest) HasHyperlink() bool { + if o != nil && o.Hyperlink.IsSet() { + return true + } + + return false +} + +// SetHyperlink gets a reference to the given NullableString and assigns it to the Hyperlink field. +func (o *NotificationRequest) SetHyperlink(v string) { + o.Hyperlink.Set(&v) +} + +// SetHyperlinkNil sets the value for Hyperlink to be an explicit nil +func (o *NotificationRequest) SetHyperlinkNil() { + o.Hyperlink.Set(nil) +} + +// UnsetHyperlink ensures that no value is present for Hyperlink, not even an explicit nil +func (o *NotificationRequest) UnsetHyperlink() { + o.Hyperlink.Unset() +} + +// GetHyperlinkLabel returns the HyperlinkLabel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationRequest) GetHyperlinkLabel() string { + if o == nil || IsNil(o.HyperlinkLabel.Get()) { + var ret string + return ret + } + return *o.HyperlinkLabel.Get() +} + +// GetHyperlinkLabelOk returns a tuple with the HyperlinkLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationRequest) GetHyperlinkLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HyperlinkLabel.Get(), o.HyperlinkLabel.IsSet() +} + +// HasHyperlinkLabel returns a boolean if a field has been set. +func (o *NotificationRequest) HasHyperlinkLabel() bool { + if o != nil && o.HyperlinkLabel.IsSet() { + return true + } + + return false +} + +// SetHyperlinkLabel gets a reference to the given NullableString and assigns it to the HyperlinkLabel field. +func (o *NotificationRequest) SetHyperlinkLabel(v string) { + o.HyperlinkLabel.Set(&v) +} + +// SetHyperlinkLabelNil sets the value for HyperlinkLabel to be an explicit nil +func (o *NotificationRequest) SetHyperlinkLabelNil() { + o.HyperlinkLabel.Set(nil) +} + +// UnsetHyperlinkLabel ensures that no value is present for HyperlinkLabel, not even an explicit nil +func (o *NotificationRequest) UnsetHyperlinkLabel() { + o.HyperlinkLabel.Unset() +} + +// GetEvent returns the Event field value if set, zero value otherwise. +func (o *NotificationRequest) GetEvent() EventRequest { + if o == nil || IsNil(o.Event) { + var ret EventRequest + return ret + } + return *o.Event +} + +// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRequest) GetEventOk() (*EventRequest, bool) { + if o == nil || IsNil(o.Event) { + return nil, false + } + return o.Event, true +} + +// HasEvent returns a boolean if a field has been set. +func (o *NotificationRequest) HasEvent() bool { + if o != nil && !IsNil(o.Event) { + return true + } + + return false +} + +// SetEvent gets a reference to the given EventRequest and assigns it to the Event field. +func (o *NotificationRequest) SetEvent(v EventRequest) { + o.Event = &v +} + +// GetSeen returns the Seen field value if set, zero value otherwise. +func (o *NotificationRequest) GetSeen() bool { + if o == nil || IsNil(o.Seen) { + var ret bool + return ret + } + return *o.Seen +} + +// GetSeenOk returns a tuple with the Seen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRequest) GetSeenOk() (*bool, bool) { + if o == nil || IsNil(o.Seen) { + return nil, false + } + return o.Seen, true +} + +// HasSeen returns a boolean if a field has been set. +func (o *NotificationRequest) HasSeen() bool { + if o != nil && !IsNil(o.Seen) { + return true + } + + return false +} + +// SetSeen gets a reference to the given bool and assigns it to the Seen field. +func (o *NotificationRequest) SetSeen(v bool) { + o.Seen = &v +} + +func (o NotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Hyperlink.IsSet() { + toSerialize["hyperlink"] = o.Hyperlink.Get() + } + if o.HyperlinkLabel.IsSet() { + toSerialize["hyperlink_label"] = o.HyperlinkLabel.Get() + } + if !IsNil(o.Event) { + toSerialize["event"] = o.Event + } + if !IsNil(o.Seen) { + toSerialize["seen"] = o.Seen + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationRequest) UnmarshalJSON(data []byte) (err error) { + varNotificationRequest := _NotificationRequest{} + + err = json.Unmarshal(data, &varNotificationRequest) + + if err != nil { + return err + } + + *o = NotificationRequest(varNotificationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "hyperlink") + delete(additionalProperties, "hyperlink_label") + delete(additionalProperties, "event") + delete(additionalProperties, "seen") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationRequest struct { + value *NotificationRequest + isSet bool +} + +func (v NullableNotificationRequest) Get() *NotificationRequest { + return v.value +} + +func (v *NullableNotificationRequest) Set(val *NotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationRequest(val *NotificationRequest) *NullableNotificationRequest { + return &NullableNotificationRequest{value: val, isSet: true} +} + +func (v NullableNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_rule.go b/packages/client-go/model_notification_rule.go new file mode 100644 index 0000000000..7430363d7f --- /dev/null +++ b/packages/client-go/model_notification_rule.go @@ -0,0 +1,388 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationRule{} + +// NotificationRule NotificationRule Serializer +type NotificationRule struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI. + Transports []string `json:"transports,omitempty"` + // Controls which severity level the created notifications will have. + Severity *SeverityEnum `json:"severity,omitempty"` + // Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent. + DestinationGroup NullableString `json:"destination_group,omitempty"` + DestinationGroupObj Group `json:"destination_group_obj"` + // When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both. + DestinationEventUser *bool `json:"destination_event_user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotificationRule NotificationRule + +// NewNotificationRule instantiates a new NotificationRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationRule(pk string, name string, destinationGroupObj Group) *NotificationRule { + this := NotificationRule{} + this.Pk = pk + this.Name = name + this.DestinationGroupObj = destinationGroupObj + return &this +} + +// NewNotificationRuleWithDefaults instantiates a new NotificationRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationRuleWithDefaults() *NotificationRule { + this := NotificationRule{} + return &this +} + +// GetPk returns the Pk field value +func (o *NotificationRule) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *NotificationRule) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *NotificationRule) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationRule) SetName(v string) { + o.Name = v +} + +// GetTransports returns the Transports field value if set, zero value otherwise. +func (o *NotificationRule) GetTransports() []string { + if o == nil || IsNil(o.Transports) { + var ret []string + return ret + } + return o.Transports +} + +// GetTransportsOk returns a tuple with the Transports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.Transports) { + return nil, false + } + return o.Transports, true +} + +// HasTransports returns a boolean if a field has been set. +func (o *NotificationRule) HasTransports() bool { + if o != nil && !IsNil(o.Transports) { + return true + } + + return false +} + +// SetTransports gets a reference to the given []string and assigns it to the Transports field. +func (o *NotificationRule) SetTransports(v []string) { + o.Transports = v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *NotificationRule) GetSeverity() SeverityEnum { + if o == nil || IsNil(o.Severity) { + var ret SeverityEnum + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetSeverityOk() (*SeverityEnum, bool) { + if o == nil || IsNil(o.Severity) { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *NotificationRule) HasSeverity() bool { + if o != nil && !IsNil(o.Severity) { + return true + } + + return false +} + +// SetSeverity gets a reference to the given SeverityEnum and assigns it to the Severity field. +func (o *NotificationRule) SetSeverity(v SeverityEnum) { + o.Severity = &v +} + +// GetDestinationGroup returns the DestinationGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationRule) GetDestinationGroup() string { + if o == nil || IsNil(o.DestinationGroup.Get()) { + var ret string + return ret + } + return *o.DestinationGroup.Get() +} + +// GetDestinationGroupOk returns a tuple with the DestinationGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationRule) GetDestinationGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DestinationGroup.Get(), o.DestinationGroup.IsSet() +} + +// HasDestinationGroup returns a boolean if a field has been set. +func (o *NotificationRule) HasDestinationGroup() bool { + if o != nil && o.DestinationGroup.IsSet() { + return true + } + + return false +} + +// SetDestinationGroup gets a reference to the given NullableString and assigns it to the DestinationGroup field. +func (o *NotificationRule) SetDestinationGroup(v string) { + o.DestinationGroup.Set(&v) +} + +// SetDestinationGroupNil sets the value for DestinationGroup to be an explicit nil +func (o *NotificationRule) SetDestinationGroupNil() { + o.DestinationGroup.Set(nil) +} + +// UnsetDestinationGroup ensures that no value is present for DestinationGroup, not even an explicit nil +func (o *NotificationRule) UnsetDestinationGroup() { + o.DestinationGroup.Unset() +} + +// GetDestinationGroupObj returns the DestinationGroupObj field value +func (o *NotificationRule) GetDestinationGroupObj() Group { + if o == nil { + var ret Group + return ret + } + + return o.DestinationGroupObj +} + +// GetDestinationGroupObjOk returns a tuple with the DestinationGroupObj field value +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetDestinationGroupObjOk() (*Group, bool) { + if o == nil { + return nil, false + } + return &o.DestinationGroupObj, true +} + +// SetDestinationGroupObj sets field value +func (o *NotificationRule) SetDestinationGroupObj(v Group) { + o.DestinationGroupObj = v +} + +// GetDestinationEventUser returns the DestinationEventUser field value if set, zero value otherwise. +func (o *NotificationRule) GetDestinationEventUser() bool { + if o == nil || IsNil(o.DestinationEventUser) { + var ret bool + return ret + } + return *o.DestinationEventUser +} + +// GetDestinationEventUserOk returns a tuple with the DestinationEventUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRule) GetDestinationEventUserOk() (*bool, bool) { + if o == nil || IsNil(o.DestinationEventUser) { + return nil, false + } + return o.DestinationEventUser, true +} + +// HasDestinationEventUser returns a boolean if a field has been set. +func (o *NotificationRule) HasDestinationEventUser() bool { + if o != nil && !IsNil(o.DestinationEventUser) { + return true + } + + return false +} + +// SetDestinationEventUser gets a reference to the given bool and assigns it to the DestinationEventUser field. +func (o *NotificationRule) SetDestinationEventUser(v bool) { + o.DestinationEventUser = &v +} + +func (o NotificationRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Transports) { + toSerialize["transports"] = o.Transports + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + if o.DestinationGroup.IsSet() { + toSerialize["destination_group"] = o.DestinationGroup.Get() + } + toSerialize["destination_group_obj"] = o.DestinationGroupObj + if !IsNil(o.DestinationEventUser) { + toSerialize["destination_event_user"] = o.DestinationEventUser + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "destination_group_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationRule := _NotificationRule{} + + err = json.Unmarshal(data, &varNotificationRule) + + if err != nil { + return err + } + + *o = NotificationRule(varNotificationRule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "transports") + delete(additionalProperties, "severity") + delete(additionalProperties, "destination_group") + delete(additionalProperties, "destination_group_obj") + delete(additionalProperties, "destination_event_user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationRule struct { + value *NotificationRule + isSet bool +} + +func (v NullableNotificationRule) Get() *NotificationRule { + return v.value +} + +func (v *NullableNotificationRule) Set(val *NotificationRule) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationRule) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationRule(val *NotificationRule) *NullableNotificationRule { + return &NullableNotificationRule{value: val, isSet: true} +} + +func (v NullableNotificationRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_rule_request.go b/packages/client-go/model_notification_rule_request.go new file mode 100644 index 0000000000..47c6c37e4b --- /dev/null +++ b/packages/client-go/model_notification_rule_request.go @@ -0,0 +1,330 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationRuleRequest{} + +// NotificationRuleRequest NotificationRule Serializer +type NotificationRuleRequest struct { + Name string `json:"name"` + // Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI. + Transports []string `json:"transports,omitempty"` + // Controls which severity level the created notifications will have. + Severity *SeverityEnum `json:"severity,omitempty"` + // Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent. + DestinationGroup NullableString `json:"destination_group,omitempty"` + // When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both. + DestinationEventUser *bool `json:"destination_event_user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotificationRuleRequest NotificationRuleRequest + +// NewNotificationRuleRequest instantiates a new NotificationRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationRuleRequest(name string) *NotificationRuleRequest { + this := NotificationRuleRequest{} + this.Name = name + return &this +} + +// NewNotificationRuleRequestWithDefaults instantiates a new NotificationRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationRuleRequestWithDefaults() *NotificationRuleRequest { + this := NotificationRuleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NotificationRuleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationRuleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationRuleRequest) SetName(v string) { + o.Name = v +} + +// GetTransports returns the Transports field value if set, zero value otherwise. +func (o *NotificationRuleRequest) GetTransports() []string { + if o == nil || IsNil(o.Transports) { + var ret []string + return ret + } + return o.Transports +} + +// GetTransportsOk returns a tuple with the Transports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRuleRequest) GetTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.Transports) { + return nil, false + } + return o.Transports, true +} + +// HasTransports returns a boolean if a field has been set. +func (o *NotificationRuleRequest) HasTransports() bool { + if o != nil && !IsNil(o.Transports) { + return true + } + + return false +} + +// SetTransports gets a reference to the given []string and assigns it to the Transports field. +func (o *NotificationRuleRequest) SetTransports(v []string) { + o.Transports = v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *NotificationRuleRequest) GetSeverity() SeverityEnum { + if o == nil || IsNil(o.Severity) { + var ret SeverityEnum + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRuleRequest) GetSeverityOk() (*SeverityEnum, bool) { + if o == nil || IsNil(o.Severity) { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *NotificationRuleRequest) HasSeverity() bool { + if o != nil && !IsNil(o.Severity) { + return true + } + + return false +} + +// SetSeverity gets a reference to the given SeverityEnum and assigns it to the Severity field. +func (o *NotificationRuleRequest) SetSeverity(v SeverityEnum) { + o.Severity = &v +} + +// GetDestinationGroup returns the DestinationGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationRuleRequest) GetDestinationGroup() string { + if o == nil || IsNil(o.DestinationGroup.Get()) { + var ret string + return ret + } + return *o.DestinationGroup.Get() +} + +// GetDestinationGroupOk returns a tuple with the DestinationGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationRuleRequest) GetDestinationGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DestinationGroup.Get(), o.DestinationGroup.IsSet() +} + +// HasDestinationGroup returns a boolean if a field has been set. +func (o *NotificationRuleRequest) HasDestinationGroup() bool { + if o != nil && o.DestinationGroup.IsSet() { + return true + } + + return false +} + +// SetDestinationGroup gets a reference to the given NullableString and assigns it to the DestinationGroup field. +func (o *NotificationRuleRequest) SetDestinationGroup(v string) { + o.DestinationGroup.Set(&v) +} + +// SetDestinationGroupNil sets the value for DestinationGroup to be an explicit nil +func (o *NotificationRuleRequest) SetDestinationGroupNil() { + o.DestinationGroup.Set(nil) +} + +// UnsetDestinationGroup ensures that no value is present for DestinationGroup, not even an explicit nil +func (o *NotificationRuleRequest) UnsetDestinationGroup() { + o.DestinationGroup.Unset() +} + +// GetDestinationEventUser returns the DestinationEventUser field value if set, zero value otherwise. +func (o *NotificationRuleRequest) GetDestinationEventUser() bool { + if o == nil || IsNil(o.DestinationEventUser) { + var ret bool + return ret + } + return *o.DestinationEventUser +} + +// GetDestinationEventUserOk returns a tuple with the DestinationEventUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationRuleRequest) GetDestinationEventUserOk() (*bool, bool) { + if o == nil || IsNil(o.DestinationEventUser) { + return nil, false + } + return o.DestinationEventUser, true +} + +// HasDestinationEventUser returns a boolean if a field has been set. +func (o *NotificationRuleRequest) HasDestinationEventUser() bool { + if o != nil && !IsNil(o.DestinationEventUser) { + return true + } + + return false +} + +// SetDestinationEventUser gets a reference to the given bool and assigns it to the DestinationEventUser field. +func (o *NotificationRuleRequest) SetDestinationEventUser(v bool) { + o.DestinationEventUser = &v +} + +func (o NotificationRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Transports) { + toSerialize["transports"] = o.Transports + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + if o.DestinationGroup.IsSet() { + toSerialize["destination_group"] = o.DestinationGroup.Get() + } + if !IsNil(o.DestinationEventUser) { + toSerialize["destination_event_user"] = o.DestinationEventUser + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationRuleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationRuleRequest := _NotificationRuleRequest{} + + err = json.Unmarshal(data, &varNotificationRuleRequest) + + if err != nil { + return err + } + + *o = NotificationRuleRequest(varNotificationRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "transports") + delete(additionalProperties, "severity") + delete(additionalProperties, "destination_group") + delete(additionalProperties, "destination_event_user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationRuleRequest struct { + value *NotificationRuleRequest + isSet bool +} + +func (v NullableNotificationRuleRequest) Get() *NotificationRuleRequest { + return v.value +} + +func (v *NullableNotificationRuleRequest) Set(val *NotificationRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationRuleRequest(val *NotificationRuleRequest) *NullableNotificationRuleRequest { + return &NullableNotificationRuleRequest{value: val, isSet: true} +} + +func (v NullableNotificationRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_transport.go b/packages/client-go/model_notification_transport.go new file mode 100644 index 0000000000..cadd5a9067 --- /dev/null +++ b/packages/client-go/model_notification_transport.go @@ -0,0 +1,559 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationTransport type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationTransport{} + +// NotificationTransport NotificationTransport Serializer +type NotificationTransport struct { + Pk string `json:"pk"` + Name string `json:"name"` + Mode *NotificationTransportModeEnum `json:"mode,omitempty"` + // Return selected mode with a UI Label + ModeVerbose string `json:"mode_verbose"` + WebhookUrl *string `json:"webhook_url,omitempty"` + // When set, the selected ceritifcate is used to validate the certificate of the webhook server. + WebhookCa NullableString `json:"webhook_ca,omitempty"` + // Customize the body of the request. Mapping should return data that is JSON-serializable. + WebhookMappingBody NullableString `json:"webhook_mapping_body,omitempty"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + WebhookMappingHeaders NullableString `json:"webhook_mapping_headers,omitempty"` + EmailSubjectPrefix *string `json:"email_subject_prefix,omitempty"` + EmailTemplate *string `json:"email_template,omitempty"` + // Only send notification once, for example when sending a webhook into a chat channel. + SendOnce *bool `json:"send_once,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotificationTransport NotificationTransport + +// NewNotificationTransport instantiates a new NotificationTransport object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationTransport(pk string, name string, modeVerbose string) *NotificationTransport { + this := NotificationTransport{} + this.Pk = pk + this.Name = name + this.ModeVerbose = modeVerbose + return &this +} + +// NewNotificationTransportWithDefaults instantiates a new NotificationTransport object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationTransportWithDefaults() *NotificationTransport { + this := NotificationTransport{} + return &this +} + +// GetPk returns the Pk field value +func (o *NotificationTransport) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *NotificationTransport) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *NotificationTransport) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationTransport) SetName(v string) { + o.Name = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *NotificationTransport) GetMode() NotificationTransportModeEnum { + if o == nil || IsNil(o.Mode) { + var ret NotificationTransportModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetModeOk() (*NotificationTransportModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *NotificationTransport) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given NotificationTransportModeEnum and assigns it to the Mode field. +func (o *NotificationTransport) SetMode(v NotificationTransportModeEnum) { + o.Mode = &v +} + +// GetModeVerbose returns the ModeVerbose field value +func (o *NotificationTransport) GetModeVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.ModeVerbose +} + +// GetModeVerboseOk returns a tuple with the ModeVerbose field value +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetModeVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModeVerbose, true +} + +// SetModeVerbose sets field value +func (o *NotificationTransport) SetModeVerbose(v string) { + o.ModeVerbose = v +} + +// GetWebhookUrl returns the WebhookUrl field value if set, zero value otherwise. +func (o *NotificationTransport) GetWebhookUrl() string { + if o == nil || IsNil(o.WebhookUrl) { + var ret string + return ret + } + return *o.WebhookUrl +} + +// GetWebhookUrlOk returns a tuple with the WebhookUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetWebhookUrlOk() (*string, bool) { + if o == nil || IsNil(o.WebhookUrl) { + return nil, false + } + return o.WebhookUrl, true +} + +// HasWebhookUrl returns a boolean if a field has been set. +func (o *NotificationTransport) HasWebhookUrl() bool { + if o != nil && !IsNil(o.WebhookUrl) { + return true + } + + return false +} + +// SetWebhookUrl gets a reference to the given string and assigns it to the WebhookUrl field. +func (o *NotificationTransport) SetWebhookUrl(v string) { + o.WebhookUrl = &v +} + +// GetWebhookCa returns the WebhookCa field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransport) GetWebhookCa() string { + if o == nil || IsNil(o.WebhookCa.Get()) { + var ret string + return ret + } + return *o.WebhookCa.Get() +} + +// GetWebhookCaOk returns a tuple with the WebhookCa field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransport) GetWebhookCaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookCa.Get(), o.WebhookCa.IsSet() +} + +// HasWebhookCa returns a boolean if a field has been set. +func (o *NotificationTransport) HasWebhookCa() bool { + if o != nil && o.WebhookCa.IsSet() { + return true + } + + return false +} + +// SetWebhookCa gets a reference to the given NullableString and assigns it to the WebhookCa field. +func (o *NotificationTransport) SetWebhookCa(v string) { + o.WebhookCa.Set(&v) +} + +// SetWebhookCaNil sets the value for WebhookCa to be an explicit nil +func (o *NotificationTransport) SetWebhookCaNil() { + o.WebhookCa.Set(nil) +} + +// UnsetWebhookCa ensures that no value is present for WebhookCa, not even an explicit nil +func (o *NotificationTransport) UnsetWebhookCa() { + o.WebhookCa.Unset() +} + +// GetWebhookMappingBody returns the WebhookMappingBody field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransport) GetWebhookMappingBody() string { + if o == nil || IsNil(o.WebhookMappingBody.Get()) { + var ret string + return ret + } + return *o.WebhookMappingBody.Get() +} + +// GetWebhookMappingBodyOk returns a tuple with the WebhookMappingBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransport) GetWebhookMappingBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingBody.Get(), o.WebhookMappingBody.IsSet() +} + +// HasWebhookMappingBody returns a boolean if a field has been set. +func (o *NotificationTransport) HasWebhookMappingBody() bool { + if o != nil && o.WebhookMappingBody.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingBody gets a reference to the given NullableString and assigns it to the WebhookMappingBody field. +func (o *NotificationTransport) SetWebhookMappingBody(v string) { + o.WebhookMappingBody.Set(&v) +} + +// SetWebhookMappingBodyNil sets the value for WebhookMappingBody to be an explicit nil +func (o *NotificationTransport) SetWebhookMappingBodyNil() { + o.WebhookMappingBody.Set(nil) +} + +// UnsetWebhookMappingBody ensures that no value is present for WebhookMappingBody, not even an explicit nil +func (o *NotificationTransport) UnsetWebhookMappingBody() { + o.WebhookMappingBody.Unset() +} + +// GetWebhookMappingHeaders returns the WebhookMappingHeaders field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransport) GetWebhookMappingHeaders() string { + if o == nil || IsNil(o.WebhookMappingHeaders.Get()) { + var ret string + return ret + } + return *o.WebhookMappingHeaders.Get() +} + +// GetWebhookMappingHeadersOk returns a tuple with the WebhookMappingHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransport) GetWebhookMappingHeadersOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingHeaders.Get(), o.WebhookMappingHeaders.IsSet() +} + +// HasWebhookMappingHeaders returns a boolean if a field has been set. +func (o *NotificationTransport) HasWebhookMappingHeaders() bool { + if o != nil && o.WebhookMappingHeaders.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingHeaders gets a reference to the given NullableString and assigns it to the WebhookMappingHeaders field. +func (o *NotificationTransport) SetWebhookMappingHeaders(v string) { + o.WebhookMappingHeaders.Set(&v) +} + +// SetWebhookMappingHeadersNil sets the value for WebhookMappingHeaders to be an explicit nil +func (o *NotificationTransport) SetWebhookMappingHeadersNil() { + o.WebhookMappingHeaders.Set(nil) +} + +// UnsetWebhookMappingHeaders ensures that no value is present for WebhookMappingHeaders, not even an explicit nil +func (o *NotificationTransport) UnsetWebhookMappingHeaders() { + o.WebhookMappingHeaders.Unset() +} + +// GetEmailSubjectPrefix returns the EmailSubjectPrefix field value if set, zero value otherwise. +func (o *NotificationTransport) GetEmailSubjectPrefix() string { + if o == nil || IsNil(o.EmailSubjectPrefix) { + var ret string + return ret + } + return *o.EmailSubjectPrefix +} + +// GetEmailSubjectPrefixOk returns a tuple with the EmailSubjectPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetEmailSubjectPrefixOk() (*string, bool) { + if o == nil || IsNil(o.EmailSubjectPrefix) { + return nil, false + } + return o.EmailSubjectPrefix, true +} + +// HasEmailSubjectPrefix returns a boolean if a field has been set. +func (o *NotificationTransport) HasEmailSubjectPrefix() bool { + if o != nil && !IsNil(o.EmailSubjectPrefix) { + return true + } + + return false +} + +// SetEmailSubjectPrefix gets a reference to the given string and assigns it to the EmailSubjectPrefix field. +func (o *NotificationTransport) SetEmailSubjectPrefix(v string) { + o.EmailSubjectPrefix = &v +} + +// GetEmailTemplate returns the EmailTemplate field value if set, zero value otherwise. +func (o *NotificationTransport) GetEmailTemplate() string { + if o == nil || IsNil(o.EmailTemplate) { + var ret string + return ret + } + return *o.EmailTemplate +} + +// GetEmailTemplateOk returns a tuple with the EmailTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetEmailTemplateOk() (*string, bool) { + if o == nil || IsNil(o.EmailTemplate) { + return nil, false + } + return o.EmailTemplate, true +} + +// HasEmailTemplate returns a boolean if a field has been set. +func (o *NotificationTransport) HasEmailTemplate() bool { + if o != nil && !IsNil(o.EmailTemplate) { + return true + } + + return false +} + +// SetEmailTemplate gets a reference to the given string and assigns it to the EmailTemplate field. +func (o *NotificationTransport) SetEmailTemplate(v string) { + o.EmailTemplate = &v +} + +// GetSendOnce returns the SendOnce field value if set, zero value otherwise. +func (o *NotificationTransport) GetSendOnce() bool { + if o == nil || IsNil(o.SendOnce) { + var ret bool + return ret + } + return *o.SendOnce +} + +// GetSendOnceOk returns a tuple with the SendOnce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransport) GetSendOnceOk() (*bool, bool) { + if o == nil || IsNil(o.SendOnce) { + return nil, false + } + return o.SendOnce, true +} + +// HasSendOnce returns a boolean if a field has been set. +func (o *NotificationTransport) HasSendOnce() bool { + if o != nil && !IsNil(o.SendOnce) { + return true + } + + return false +} + +// SetSendOnce gets a reference to the given bool and assigns it to the SendOnce field. +func (o *NotificationTransport) SetSendOnce(v bool) { + o.SendOnce = &v +} + +func (o NotificationTransport) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationTransport) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + toSerialize["mode_verbose"] = o.ModeVerbose + if !IsNil(o.WebhookUrl) { + toSerialize["webhook_url"] = o.WebhookUrl + } + if o.WebhookCa.IsSet() { + toSerialize["webhook_ca"] = o.WebhookCa.Get() + } + if o.WebhookMappingBody.IsSet() { + toSerialize["webhook_mapping_body"] = o.WebhookMappingBody.Get() + } + if o.WebhookMappingHeaders.IsSet() { + toSerialize["webhook_mapping_headers"] = o.WebhookMappingHeaders.Get() + } + if !IsNil(o.EmailSubjectPrefix) { + toSerialize["email_subject_prefix"] = o.EmailSubjectPrefix + } + if !IsNil(o.EmailTemplate) { + toSerialize["email_template"] = o.EmailTemplate + } + if !IsNil(o.SendOnce) { + toSerialize["send_once"] = o.SendOnce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationTransport) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "mode_verbose", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationTransport := _NotificationTransport{} + + err = json.Unmarshal(data, &varNotificationTransport) + + if err != nil { + return err + } + + *o = NotificationTransport(varNotificationTransport) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "mode_verbose") + delete(additionalProperties, "webhook_url") + delete(additionalProperties, "webhook_ca") + delete(additionalProperties, "webhook_mapping_body") + delete(additionalProperties, "webhook_mapping_headers") + delete(additionalProperties, "email_subject_prefix") + delete(additionalProperties, "email_template") + delete(additionalProperties, "send_once") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationTransport struct { + value *NotificationTransport + isSet bool +} + +func (v NullableNotificationTransport) Get() *NotificationTransport { + return v.value +} + +func (v *NullableNotificationTransport) Set(val *NotificationTransport) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationTransport) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationTransport) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationTransport(val *NotificationTransport) *NullableNotificationTransport { + return &NullableNotificationTransport{value: val, isSet: true} +} + +func (v NullableNotificationTransport) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationTransport) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_transport_mode_enum.go b/packages/client-go/model_notification_transport_mode_enum.go new file mode 100644 index 0000000000..051317cc92 --- /dev/null +++ b/packages/client-go/model_notification_transport_mode_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// NotificationTransportModeEnum the model 'NotificationTransportModeEnum' +type NotificationTransportModeEnum string + +// List of NotificationTransportModeEnum +const ( + NOTIFICATIONTRANSPORTMODEENUM_LOCAL NotificationTransportModeEnum = "local" + NOTIFICATIONTRANSPORTMODEENUM_WEBHOOK NotificationTransportModeEnum = "webhook" + NOTIFICATIONTRANSPORTMODEENUM_WEBHOOK_SLACK NotificationTransportModeEnum = "webhook_slack" + NOTIFICATIONTRANSPORTMODEENUM_EMAIL NotificationTransportModeEnum = "email" +) + +// All allowed values of NotificationTransportModeEnum enum +var AllowedNotificationTransportModeEnumEnumValues = []NotificationTransportModeEnum{ + "local", + "webhook", + "webhook_slack", + "email", +} + +func (v *NotificationTransportModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := NotificationTransportModeEnum(value) + for _, existing := range AllowedNotificationTransportModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid NotificationTransportModeEnum", value) +} + +// NewNotificationTransportModeEnumFromValue returns a pointer to a valid NotificationTransportModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewNotificationTransportModeEnumFromValue(v string) (*NotificationTransportModeEnum, error) { + ev := NotificationTransportModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for NotificationTransportModeEnum: valid values are %v", v, AllowedNotificationTransportModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v NotificationTransportModeEnum) IsValid() bool { + for _, existing := range AllowedNotificationTransportModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to NotificationTransportModeEnum value +func (v NotificationTransportModeEnum) Ptr() *NotificationTransportModeEnum { + return &v +} + +type NullableNotificationTransportModeEnum struct { + value *NotificationTransportModeEnum + isSet bool +} + +func (v NullableNotificationTransportModeEnum) Get() *NotificationTransportModeEnum { + return v.value +} + +func (v *NullableNotificationTransportModeEnum) Set(val *NotificationTransportModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationTransportModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationTransportModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationTransportModeEnum(val *NotificationTransportModeEnum) *NullableNotificationTransportModeEnum { + return &NullableNotificationTransportModeEnum{value: val, isSet: true} +} + +func (v NullableNotificationTransportModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationTransportModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_transport_request.go b/packages/client-go/model_notification_transport_request.go new file mode 100644 index 0000000000..5511310a96 --- /dev/null +++ b/packages/client-go/model_notification_transport_request.go @@ -0,0 +1,500 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationTransportRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationTransportRequest{} + +// NotificationTransportRequest NotificationTransport Serializer +type NotificationTransportRequest struct { + Name string `json:"name"` + Mode *NotificationTransportModeEnum `json:"mode,omitempty"` + WebhookUrl *string `json:"webhook_url,omitempty"` + // When set, the selected ceritifcate is used to validate the certificate of the webhook server. + WebhookCa NullableString `json:"webhook_ca,omitempty"` + // Customize the body of the request. Mapping should return data that is JSON-serializable. + WebhookMappingBody NullableString `json:"webhook_mapping_body,omitempty"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + WebhookMappingHeaders NullableString `json:"webhook_mapping_headers,omitempty"` + EmailSubjectPrefix *string `json:"email_subject_prefix,omitempty"` + EmailTemplate *string `json:"email_template,omitempty"` + // Only send notification once, for example when sending a webhook into a chat channel. + SendOnce *bool `json:"send_once,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _NotificationTransportRequest NotificationTransportRequest + +// NewNotificationTransportRequest instantiates a new NotificationTransportRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationTransportRequest(name string) *NotificationTransportRequest { + this := NotificationTransportRequest{} + this.Name = name + return &this +} + +// NewNotificationTransportRequestWithDefaults instantiates a new NotificationTransportRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationTransportRequestWithDefaults() *NotificationTransportRequest { + this := NotificationTransportRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NotificationTransportRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationTransportRequest) SetName(v string) { + o.Name = v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *NotificationTransportRequest) GetMode() NotificationTransportModeEnum { + if o == nil || IsNil(o.Mode) { + var ret NotificationTransportModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetModeOk() (*NotificationTransportModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given NotificationTransportModeEnum and assigns it to the Mode field. +func (o *NotificationTransportRequest) SetMode(v NotificationTransportModeEnum) { + o.Mode = &v +} + +// GetWebhookUrl returns the WebhookUrl field value if set, zero value otherwise. +func (o *NotificationTransportRequest) GetWebhookUrl() string { + if o == nil || IsNil(o.WebhookUrl) { + var ret string + return ret + } + return *o.WebhookUrl +} + +// GetWebhookUrlOk returns a tuple with the WebhookUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetWebhookUrlOk() (*string, bool) { + if o == nil || IsNil(o.WebhookUrl) { + return nil, false + } + return o.WebhookUrl, true +} + +// HasWebhookUrl returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasWebhookUrl() bool { + if o != nil && !IsNil(o.WebhookUrl) { + return true + } + + return false +} + +// SetWebhookUrl gets a reference to the given string and assigns it to the WebhookUrl field. +func (o *NotificationTransportRequest) SetWebhookUrl(v string) { + o.WebhookUrl = &v +} + +// GetWebhookCa returns the WebhookCa field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransportRequest) GetWebhookCa() string { + if o == nil || IsNil(o.WebhookCa.Get()) { + var ret string + return ret + } + return *o.WebhookCa.Get() +} + +// GetWebhookCaOk returns a tuple with the WebhookCa field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransportRequest) GetWebhookCaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookCa.Get(), o.WebhookCa.IsSet() +} + +// HasWebhookCa returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasWebhookCa() bool { + if o != nil && o.WebhookCa.IsSet() { + return true + } + + return false +} + +// SetWebhookCa gets a reference to the given NullableString and assigns it to the WebhookCa field. +func (o *NotificationTransportRequest) SetWebhookCa(v string) { + o.WebhookCa.Set(&v) +} + +// SetWebhookCaNil sets the value for WebhookCa to be an explicit nil +func (o *NotificationTransportRequest) SetWebhookCaNil() { + o.WebhookCa.Set(nil) +} + +// UnsetWebhookCa ensures that no value is present for WebhookCa, not even an explicit nil +func (o *NotificationTransportRequest) UnsetWebhookCa() { + o.WebhookCa.Unset() +} + +// GetWebhookMappingBody returns the WebhookMappingBody field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransportRequest) GetWebhookMappingBody() string { + if o == nil || IsNil(o.WebhookMappingBody.Get()) { + var ret string + return ret + } + return *o.WebhookMappingBody.Get() +} + +// GetWebhookMappingBodyOk returns a tuple with the WebhookMappingBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransportRequest) GetWebhookMappingBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingBody.Get(), o.WebhookMappingBody.IsSet() +} + +// HasWebhookMappingBody returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasWebhookMappingBody() bool { + if o != nil && o.WebhookMappingBody.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingBody gets a reference to the given NullableString and assigns it to the WebhookMappingBody field. +func (o *NotificationTransportRequest) SetWebhookMappingBody(v string) { + o.WebhookMappingBody.Set(&v) +} + +// SetWebhookMappingBodyNil sets the value for WebhookMappingBody to be an explicit nil +func (o *NotificationTransportRequest) SetWebhookMappingBodyNil() { + o.WebhookMappingBody.Set(nil) +} + +// UnsetWebhookMappingBody ensures that no value is present for WebhookMappingBody, not even an explicit nil +func (o *NotificationTransportRequest) UnsetWebhookMappingBody() { + o.WebhookMappingBody.Unset() +} + +// GetWebhookMappingHeaders returns the WebhookMappingHeaders field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NotificationTransportRequest) GetWebhookMappingHeaders() string { + if o == nil || IsNil(o.WebhookMappingHeaders.Get()) { + var ret string + return ret + } + return *o.WebhookMappingHeaders.Get() +} + +// GetWebhookMappingHeadersOk returns a tuple with the WebhookMappingHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NotificationTransportRequest) GetWebhookMappingHeadersOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingHeaders.Get(), o.WebhookMappingHeaders.IsSet() +} + +// HasWebhookMappingHeaders returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasWebhookMappingHeaders() bool { + if o != nil && o.WebhookMappingHeaders.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingHeaders gets a reference to the given NullableString and assigns it to the WebhookMappingHeaders field. +func (o *NotificationTransportRequest) SetWebhookMappingHeaders(v string) { + o.WebhookMappingHeaders.Set(&v) +} + +// SetWebhookMappingHeadersNil sets the value for WebhookMappingHeaders to be an explicit nil +func (o *NotificationTransportRequest) SetWebhookMappingHeadersNil() { + o.WebhookMappingHeaders.Set(nil) +} + +// UnsetWebhookMappingHeaders ensures that no value is present for WebhookMappingHeaders, not even an explicit nil +func (o *NotificationTransportRequest) UnsetWebhookMappingHeaders() { + o.WebhookMappingHeaders.Unset() +} + +// GetEmailSubjectPrefix returns the EmailSubjectPrefix field value if set, zero value otherwise. +func (o *NotificationTransportRequest) GetEmailSubjectPrefix() string { + if o == nil || IsNil(o.EmailSubjectPrefix) { + var ret string + return ret + } + return *o.EmailSubjectPrefix +} + +// GetEmailSubjectPrefixOk returns a tuple with the EmailSubjectPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetEmailSubjectPrefixOk() (*string, bool) { + if o == nil || IsNil(o.EmailSubjectPrefix) { + return nil, false + } + return o.EmailSubjectPrefix, true +} + +// HasEmailSubjectPrefix returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasEmailSubjectPrefix() bool { + if o != nil && !IsNil(o.EmailSubjectPrefix) { + return true + } + + return false +} + +// SetEmailSubjectPrefix gets a reference to the given string and assigns it to the EmailSubjectPrefix field. +func (o *NotificationTransportRequest) SetEmailSubjectPrefix(v string) { + o.EmailSubjectPrefix = &v +} + +// GetEmailTemplate returns the EmailTemplate field value if set, zero value otherwise. +func (o *NotificationTransportRequest) GetEmailTemplate() string { + if o == nil || IsNil(o.EmailTemplate) { + var ret string + return ret + } + return *o.EmailTemplate +} + +// GetEmailTemplateOk returns a tuple with the EmailTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetEmailTemplateOk() (*string, bool) { + if o == nil || IsNil(o.EmailTemplate) { + return nil, false + } + return o.EmailTemplate, true +} + +// HasEmailTemplate returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasEmailTemplate() bool { + if o != nil && !IsNil(o.EmailTemplate) { + return true + } + + return false +} + +// SetEmailTemplate gets a reference to the given string and assigns it to the EmailTemplate field. +func (o *NotificationTransportRequest) SetEmailTemplate(v string) { + o.EmailTemplate = &v +} + +// GetSendOnce returns the SendOnce field value if set, zero value otherwise. +func (o *NotificationTransportRequest) GetSendOnce() bool { + if o == nil || IsNil(o.SendOnce) { + var ret bool + return ret + } + return *o.SendOnce +} + +// GetSendOnceOk returns a tuple with the SendOnce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotificationTransportRequest) GetSendOnceOk() (*bool, bool) { + if o == nil || IsNil(o.SendOnce) { + return nil, false + } + return o.SendOnce, true +} + +// HasSendOnce returns a boolean if a field has been set. +func (o *NotificationTransportRequest) HasSendOnce() bool { + if o != nil && !IsNil(o.SendOnce) { + return true + } + + return false +} + +// SetSendOnce gets a reference to the given bool and assigns it to the SendOnce field. +func (o *NotificationTransportRequest) SetSendOnce(v bool) { + o.SendOnce = &v +} + +func (o NotificationTransportRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationTransportRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.WebhookUrl) { + toSerialize["webhook_url"] = o.WebhookUrl + } + if o.WebhookCa.IsSet() { + toSerialize["webhook_ca"] = o.WebhookCa.Get() + } + if o.WebhookMappingBody.IsSet() { + toSerialize["webhook_mapping_body"] = o.WebhookMappingBody.Get() + } + if o.WebhookMappingHeaders.IsSet() { + toSerialize["webhook_mapping_headers"] = o.WebhookMappingHeaders.Get() + } + if !IsNil(o.EmailSubjectPrefix) { + toSerialize["email_subject_prefix"] = o.EmailSubjectPrefix + } + if !IsNil(o.EmailTemplate) { + toSerialize["email_template"] = o.EmailTemplate + } + if !IsNil(o.SendOnce) { + toSerialize["send_once"] = o.SendOnce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationTransportRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationTransportRequest := _NotificationTransportRequest{} + + err = json.Unmarshal(data, &varNotificationTransportRequest) + + if err != nil { + return err + } + + *o = NotificationTransportRequest(varNotificationTransportRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "webhook_url") + delete(additionalProperties, "webhook_ca") + delete(additionalProperties, "webhook_mapping_body") + delete(additionalProperties, "webhook_mapping_headers") + delete(additionalProperties, "email_subject_prefix") + delete(additionalProperties, "email_template") + delete(additionalProperties, "send_once") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationTransportRequest struct { + value *NotificationTransportRequest + isSet bool +} + +func (v NullableNotificationTransportRequest) Get() *NotificationTransportRequest { + return v.value +} + +func (v *NullableNotificationTransportRequest) Set(val *NotificationTransportRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationTransportRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationTransportRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationTransportRequest(val *NotificationTransportRequest) *NullableNotificationTransportRequest { + return &NullableNotificationTransportRequest{value: val, isSet: true} +} + +func (v NullableNotificationTransportRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationTransportRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_transport_test_.go b/packages/client-go/model_notification_transport_test_.go new file mode 100644 index 0000000000..c533d26a73 --- /dev/null +++ b/packages/client-go/model_notification_transport_test_.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationTransportTest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationTransportTest{} + +// NotificationTransportTest Notification test serializer +type NotificationTransportTest struct { + Messages []string `json:"messages"` + AdditionalProperties map[string]interface{} +} + +type _NotificationTransportTest NotificationTransportTest + +// NewNotificationTransportTest instantiates a new NotificationTransportTest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationTransportTest(messages []string) *NotificationTransportTest { + this := NotificationTransportTest{} + this.Messages = messages + return &this +} + +// NewNotificationTransportTestWithDefaults instantiates a new NotificationTransportTest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationTransportTestWithDefaults() *NotificationTransportTest { + this := NotificationTransportTest{} + return &this +} + +// GetMessages returns the Messages field value +func (o *NotificationTransportTest) GetMessages() []string { + if o == nil { + var ret []string + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *NotificationTransportTest) GetMessagesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Messages, true +} + +// SetMessages sets field value +func (o *NotificationTransportTest) SetMessages(v []string) { + o.Messages = v +} + +func (o NotificationTransportTest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationTransportTest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messages"] = o.Messages + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationTransportTest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "messages", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationTransportTest := _NotificationTransportTest{} + + err = json.Unmarshal(data, &varNotificationTransportTest) + + if err != nil { + return err + } + + *o = NotificationTransportTest(varNotificationTransportTest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "messages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationTransportTest struct { + value *NotificationTransportTest + isSet bool +} + +func (v NullableNotificationTransportTest) Get() *NotificationTransportTest { + return v.value +} + +func (v *NullableNotificationTransportTest) Set(val *NotificationTransportTest) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationTransportTest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationTransportTest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationTransportTest(val *NotificationTransportTest) *NullableNotificationTransportTest { + return &NullableNotificationTransportTest{value: val, isSet: true} +} + +func (v NullableNotificationTransportTest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationTransportTest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_webhook_mapping.go b/packages/client-go/model_notification_webhook_mapping.go new file mode 100644 index 0000000000..d96593fb82 --- /dev/null +++ b/packages/client-go/model_notification_webhook_mapping.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationWebhookMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationWebhookMapping{} + +// NotificationWebhookMapping NotificationWebhookMapping Serializer +type NotificationWebhookMapping struct { + Pk string `json:"pk"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _NotificationWebhookMapping NotificationWebhookMapping + +// NewNotificationWebhookMapping instantiates a new NotificationWebhookMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationWebhookMapping(pk string, name string, expression string) *NotificationWebhookMapping { + this := NotificationWebhookMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + return &this +} + +// NewNotificationWebhookMappingWithDefaults instantiates a new NotificationWebhookMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationWebhookMappingWithDefaults() *NotificationWebhookMapping { + this := NotificationWebhookMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *NotificationWebhookMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *NotificationWebhookMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *NotificationWebhookMapping) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *NotificationWebhookMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationWebhookMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationWebhookMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *NotificationWebhookMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *NotificationWebhookMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *NotificationWebhookMapping) SetExpression(v string) { + o.Expression = v +} + +func (o NotificationWebhookMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationWebhookMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationWebhookMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationWebhookMapping := _NotificationWebhookMapping{} + + err = json.Unmarshal(data, &varNotificationWebhookMapping) + + if err != nil { + return err + } + + *o = NotificationWebhookMapping(varNotificationWebhookMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationWebhookMapping struct { + value *NotificationWebhookMapping + isSet bool +} + +func (v NullableNotificationWebhookMapping) Get() *NotificationWebhookMapping { + return v.value +} + +func (v *NullableNotificationWebhookMapping) Set(val *NotificationWebhookMapping) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationWebhookMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationWebhookMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationWebhookMapping(val *NotificationWebhookMapping) *NullableNotificationWebhookMapping { + return &NullableNotificationWebhookMapping{value: val, isSet: true} +} + +func (v NullableNotificationWebhookMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationWebhookMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_notification_webhook_mapping_request.go b/packages/client-go/model_notification_webhook_mapping_request.go new file mode 100644 index 0000000000..f7b64af6ee --- /dev/null +++ b/packages/client-go/model_notification_webhook_mapping_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the NotificationWebhookMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotificationWebhookMappingRequest{} + +// NotificationWebhookMappingRequest NotificationWebhookMapping Serializer +type NotificationWebhookMappingRequest struct { + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _NotificationWebhookMappingRequest NotificationWebhookMappingRequest + +// NewNotificationWebhookMappingRequest instantiates a new NotificationWebhookMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotificationWebhookMappingRequest(name string, expression string) *NotificationWebhookMappingRequest { + this := NotificationWebhookMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewNotificationWebhookMappingRequestWithDefaults instantiates a new NotificationWebhookMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotificationWebhookMappingRequestWithDefaults() *NotificationWebhookMappingRequest { + this := NotificationWebhookMappingRequest{} + return &this +} + +// GetName returns the Name field value +func (o *NotificationWebhookMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NotificationWebhookMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NotificationWebhookMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *NotificationWebhookMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *NotificationWebhookMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *NotificationWebhookMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o NotificationWebhookMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotificationWebhookMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *NotificationWebhookMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNotificationWebhookMappingRequest := _NotificationWebhookMappingRequest{} + + err = json.Unmarshal(data, &varNotificationWebhookMappingRequest) + + if err != nil { + return err + } + + *o = NotificationWebhookMappingRequest(varNotificationWebhookMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableNotificationWebhookMappingRequest struct { + value *NotificationWebhookMappingRequest + isSet bool +} + +func (v NullableNotificationWebhookMappingRequest) Get() *NotificationWebhookMappingRequest { + return v.value +} + +func (v *NullableNotificationWebhookMappingRequest) Set(val *NotificationWebhookMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableNotificationWebhookMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableNotificationWebhookMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotificationWebhookMappingRequest(val *NotificationWebhookMappingRequest) *NullableNotificationWebhookMappingRequest { + return &NullableNotificationWebhookMappingRequest{value: val, isSet: true} +} + +func (v NullableNotificationWebhookMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotificationWebhookMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth2_provider.go b/packages/client-go/model_o_auth2_provider.go new file mode 100644 index 0000000000..ea5612ae3b --- /dev/null +++ b/packages/client-go/model_o_auth2_provider.go @@ -0,0 +1,1244 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuth2Provider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2Provider{} + +// OAuth2Provider OAuth2Provider Serializer +type OAuth2Provider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable + ClientType *ClientTypeEnum `json:"client_type,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + // Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessCodeValidity *string `json:"access_code_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + // When refreshing a token, if the refresh token is valid for less than this duration, it will be renewed. When set to seconds=0, token will always be renewed. (Format: hours=1;minutes=2;seconds=3). + RefreshTokenThreshold *string `json:"refresh_token_threshold,omitempty"` + // Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint. + IncludeClaimsInIdToken *bool `json:"include_claims_in_id_token,omitempty"` + // Key used to sign the tokens. + SigningKey NullableString `json:"signing_key,omitempty"` + // Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + EncryptionKey NullableString `json:"encryption_key,omitempty"` + RedirectUris []RedirectURI `json:"redirect_uris"` + LogoutUri *string `json:"logout_uri,omitempty"` + // Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + LogoutMethod *OAuth2ProviderLogoutMethodEnum `json:"logout_method,omitempty"` + // Configure what data should be used as unique User Identifier. For most cases, the default should be fine. + SubMode *SubModeEnum `json:"sub_mode,omitempty"` + // Configure how the issuer field of the ID Token should be filled. + IssuerMode *IssuerModeEnum `json:"issuer_mode,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuth2Provider OAuth2Provider + +// NewOAuth2Provider instantiates a new OAuth2Provider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuth2Provider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, redirectUris []RedirectURI) *OAuth2Provider { + this := OAuth2Provider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.RedirectUris = redirectUris + return &this +} + +// NewOAuth2ProviderWithDefaults instantiates a new OAuth2Provider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuth2ProviderWithDefaults() *OAuth2Provider { + this := OAuth2Provider{} + return &this +} + +// GetPk returns the Pk field value +func (o *OAuth2Provider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *OAuth2Provider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *OAuth2Provider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuth2Provider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2Provider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *OAuth2Provider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *OAuth2Provider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *OAuth2Provider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *OAuth2Provider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *OAuth2Provider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *OAuth2Provider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *OAuth2Provider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *OAuth2Provider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *OAuth2Provider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *OAuth2Provider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *OAuth2Provider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *OAuth2Provider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *OAuth2Provider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuth2Provider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *OAuth2Provider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuth2Provider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *OAuth2Provider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuth2Provider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *OAuth2Provider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuth2Provider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *OAuth2Provider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *OAuth2Provider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *OAuth2Provider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *OAuth2Provider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *OAuth2Provider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *OAuth2Provider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *OAuth2Provider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetClientType returns the ClientType field value if set, zero value otherwise. +func (o *OAuth2Provider) GetClientType() ClientTypeEnum { + if o == nil || IsNil(o.ClientType) { + var ret ClientTypeEnum + return ret + } + return *o.ClientType +} + +// GetClientTypeOk returns a tuple with the ClientType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetClientTypeOk() (*ClientTypeEnum, bool) { + if o == nil || IsNil(o.ClientType) { + return nil, false + } + return o.ClientType, true +} + +// HasClientType returns a boolean if a field has been set. +func (o *OAuth2Provider) HasClientType() bool { + if o != nil && !IsNil(o.ClientType) { + return true + } + + return false +} + +// SetClientType gets a reference to the given ClientTypeEnum and assigns it to the ClientType field. +func (o *OAuth2Provider) SetClientType(v ClientTypeEnum) { + o.ClientType = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *OAuth2Provider) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *OAuth2Provider) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *OAuth2Provider) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *OAuth2Provider) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *OAuth2Provider) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *OAuth2Provider) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetAccessCodeValidity returns the AccessCodeValidity field value if set, zero value otherwise. +func (o *OAuth2Provider) GetAccessCodeValidity() string { + if o == nil || IsNil(o.AccessCodeValidity) { + var ret string + return ret + } + return *o.AccessCodeValidity +} + +// GetAccessCodeValidityOk returns a tuple with the AccessCodeValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetAccessCodeValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessCodeValidity) { + return nil, false + } + return o.AccessCodeValidity, true +} + +// HasAccessCodeValidity returns a boolean if a field has been set. +func (o *OAuth2Provider) HasAccessCodeValidity() bool { + if o != nil && !IsNil(o.AccessCodeValidity) { + return true + } + + return false +} + +// SetAccessCodeValidity gets a reference to the given string and assigns it to the AccessCodeValidity field. +func (o *OAuth2Provider) SetAccessCodeValidity(v string) { + o.AccessCodeValidity = &v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *OAuth2Provider) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *OAuth2Provider) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *OAuth2Provider) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *OAuth2Provider) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *OAuth2Provider) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *OAuth2Provider) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +// GetRefreshTokenThreshold returns the RefreshTokenThreshold field value if set, zero value otherwise. +func (o *OAuth2Provider) GetRefreshTokenThreshold() string { + if o == nil || IsNil(o.RefreshTokenThreshold) { + var ret string + return ret + } + return *o.RefreshTokenThreshold +} + +// GetRefreshTokenThresholdOk returns a tuple with the RefreshTokenThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetRefreshTokenThresholdOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenThreshold) { + return nil, false + } + return o.RefreshTokenThreshold, true +} + +// HasRefreshTokenThreshold returns a boolean if a field has been set. +func (o *OAuth2Provider) HasRefreshTokenThreshold() bool { + if o != nil && !IsNil(o.RefreshTokenThreshold) { + return true + } + + return false +} + +// SetRefreshTokenThreshold gets a reference to the given string and assigns it to the RefreshTokenThreshold field. +func (o *OAuth2Provider) SetRefreshTokenThreshold(v string) { + o.RefreshTokenThreshold = &v +} + +// GetIncludeClaimsInIdToken returns the IncludeClaimsInIdToken field value if set, zero value otherwise. +func (o *OAuth2Provider) GetIncludeClaimsInIdToken() bool { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + var ret bool + return ret + } + return *o.IncludeClaimsInIdToken +} + +// GetIncludeClaimsInIdTokenOk returns a tuple with the IncludeClaimsInIdToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetIncludeClaimsInIdTokenOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + return nil, false + } + return o.IncludeClaimsInIdToken, true +} + +// HasIncludeClaimsInIdToken returns a boolean if a field has been set. +func (o *OAuth2Provider) HasIncludeClaimsInIdToken() bool { + if o != nil && !IsNil(o.IncludeClaimsInIdToken) { + return true + } + + return false +} + +// SetIncludeClaimsInIdToken gets a reference to the given bool and assigns it to the IncludeClaimsInIdToken field. +func (o *OAuth2Provider) SetIncludeClaimsInIdToken(v bool) { + o.IncludeClaimsInIdToken = &v +} + +// GetSigningKey returns the SigningKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2Provider) GetSigningKey() string { + if o == nil || IsNil(o.SigningKey.Get()) { + var ret string + return ret + } + return *o.SigningKey.Get() +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKey.Get(), o.SigningKey.IsSet() +} + +// HasSigningKey returns a boolean if a field has been set. +func (o *OAuth2Provider) HasSigningKey() bool { + if o != nil && o.SigningKey.IsSet() { + return true + } + + return false +} + +// SetSigningKey gets a reference to the given NullableString and assigns it to the SigningKey field. +func (o *OAuth2Provider) SetSigningKey(v string) { + o.SigningKey.Set(&v) +} + +// SetSigningKeyNil sets the value for SigningKey to be an explicit nil +func (o *OAuth2Provider) SetSigningKeyNil() { + o.SigningKey.Set(nil) +} + +// UnsetSigningKey ensures that no value is present for SigningKey, not even an explicit nil +func (o *OAuth2Provider) UnsetSigningKey() { + o.SigningKey.Unset() +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2Provider) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey.Get()) { + var ret string + return ret + } + return *o.EncryptionKey.Get() +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2Provider) GetEncryptionKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKey.Get(), o.EncryptionKey.IsSet() +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *OAuth2Provider) HasEncryptionKey() bool { + if o != nil && o.EncryptionKey.IsSet() { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given NullableString and assigns it to the EncryptionKey field. +func (o *OAuth2Provider) SetEncryptionKey(v string) { + o.EncryptionKey.Set(&v) +} + +// SetEncryptionKeyNil sets the value for EncryptionKey to be an explicit nil +func (o *OAuth2Provider) SetEncryptionKeyNil() { + o.EncryptionKey.Set(nil) +} + +// UnsetEncryptionKey ensures that no value is present for EncryptionKey, not even an explicit nil +func (o *OAuth2Provider) UnsetEncryptionKey() { + o.EncryptionKey.Unset() +} + +// GetRedirectUris returns the RedirectUris field value +func (o *OAuth2Provider) GetRedirectUris() []RedirectURI { + if o == nil { + var ret []RedirectURI + return ret + } + + return o.RedirectUris +} + +// GetRedirectUrisOk returns a tuple with the RedirectUris field value +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetRedirectUrisOk() ([]RedirectURI, bool) { + if o == nil { + return nil, false + } + return o.RedirectUris, true +} + +// SetRedirectUris sets field value +func (o *OAuth2Provider) SetRedirectUris(v []RedirectURI) { + o.RedirectUris = v +} + +// GetLogoutUri returns the LogoutUri field value if set, zero value otherwise. +func (o *OAuth2Provider) GetLogoutUri() string { + if o == nil || IsNil(o.LogoutUri) { + var ret string + return ret + } + return *o.LogoutUri +} + +// GetLogoutUriOk returns a tuple with the LogoutUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetLogoutUriOk() (*string, bool) { + if o == nil || IsNil(o.LogoutUri) { + return nil, false + } + return o.LogoutUri, true +} + +// HasLogoutUri returns a boolean if a field has been set. +func (o *OAuth2Provider) HasLogoutUri() bool { + if o != nil && !IsNil(o.LogoutUri) { + return true + } + + return false +} + +// SetLogoutUri gets a reference to the given string and assigns it to the LogoutUri field. +func (o *OAuth2Provider) SetLogoutUri(v string) { + o.LogoutUri = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *OAuth2Provider) GetLogoutMethod() OAuth2ProviderLogoutMethodEnum { + if o == nil || IsNil(o.LogoutMethod) { + var ret OAuth2ProviderLogoutMethodEnum + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetLogoutMethodOk() (*OAuth2ProviderLogoutMethodEnum, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *OAuth2Provider) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given OAuth2ProviderLogoutMethodEnum and assigns it to the LogoutMethod field. +func (o *OAuth2Provider) SetLogoutMethod(v OAuth2ProviderLogoutMethodEnum) { + o.LogoutMethod = &v +} + +// GetSubMode returns the SubMode field value if set, zero value otherwise. +func (o *OAuth2Provider) GetSubMode() SubModeEnum { + if o == nil || IsNil(o.SubMode) { + var ret SubModeEnum + return ret + } + return *o.SubMode +} + +// GetSubModeOk returns a tuple with the SubMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetSubModeOk() (*SubModeEnum, bool) { + if o == nil || IsNil(o.SubMode) { + return nil, false + } + return o.SubMode, true +} + +// HasSubMode returns a boolean if a field has been set. +func (o *OAuth2Provider) HasSubMode() bool { + if o != nil && !IsNil(o.SubMode) { + return true + } + + return false +} + +// SetSubMode gets a reference to the given SubModeEnum and assigns it to the SubMode field. +func (o *OAuth2Provider) SetSubMode(v SubModeEnum) { + o.SubMode = &v +} + +// GetIssuerMode returns the IssuerMode field value if set, zero value otherwise. +func (o *OAuth2Provider) GetIssuerMode() IssuerModeEnum { + if o == nil || IsNil(o.IssuerMode) { + var ret IssuerModeEnum + return ret + } + return *o.IssuerMode +} + +// GetIssuerModeOk returns a tuple with the IssuerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetIssuerModeOk() (*IssuerModeEnum, bool) { + if o == nil || IsNil(o.IssuerMode) { + return nil, false + } + return o.IssuerMode, true +} + +// HasIssuerMode returns a boolean if a field has been set. +func (o *OAuth2Provider) HasIssuerMode() bool { + if o != nil && !IsNil(o.IssuerMode) { + return true + } + + return false +} + +// SetIssuerMode gets a reference to the given IssuerModeEnum and assigns it to the IssuerMode field. +func (o *OAuth2Provider) SetIssuerMode(v IssuerModeEnum) { + o.IssuerMode = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *OAuth2Provider) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *OAuth2Provider) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *OAuth2Provider) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *OAuth2Provider) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2Provider) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *OAuth2Provider) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *OAuth2Provider) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o OAuth2Provider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2Provider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.ClientType) { + toSerialize["client_type"] = o.ClientType + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.AccessCodeValidity) { + toSerialize["access_code_validity"] = o.AccessCodeValidity + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + if !IsNil(o.RefreshTokenThreshold) { + toSerialize["refresh_token_threshold"] = o.RefreshTokenThreshold + } + if !IsNil(o.IncludeClaimsInIdToken) { + toSerialize["include_claims_in_id_token"] = o.IncludeClaimsInIdToken + } + if o.SigningKey.IsSet() { + toSerialize["signing_key"] = o.SigningKey.Get() + } + if o.EncryptionKey.IsSet() { + toSerialize["encryption_key"] = o.EncryptionKey.Get() + } + toSerialize["redirect_uris"] = o.RedirectUris + if !IsNil(o.LogoutUri) { + toSerialize["logout_uri"] = o.LogoutUri + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.SubMode) { + toSerialize["sub_mode"] = o.SubMode + } + if !IsNil(o.IssuerMode) { + toSerialize["issuer_mode"] = o.IssuerMode + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuth2Provider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "redirect_uris", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuth2Provider := _OAuth2Provider{} + + err = json.Unmarshal(data, &varOAuth2Provider) + + if err != nil { + return err + } + + *o = OAuth2Provider(varOAuth2Provider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "client_type") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "access_code_validity") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + delete(additionalProperties, "refresh_token_threshold") + delete(additionalProperties, "include_claims_in_id_token") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "encryption_key") + delete(additionalProperties, "redirect_uris") + delete(additionalProperties, "logout_uri") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "sub_mode") + delete(additionalProperties, "issuer_mode") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuth2Provider struct { + value *OAuth2Provider + isSet bool +} + +func (v NullableOAuth2Provider) Get() *OAuth2Provider { + return v.value +} + +func (v *NullableOAuth2Provider) Set(val *OAuth2Provider) { + v.value = val + v.isSet = true +} + +func (v NullableOAuth2Provider) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuth2Provider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuth2Provider(val *OAuth2Provider) *NullableOAuth2Provider { + return &NullableOAuth2Provider{value: val, isSet: true} +} + +func (v NullableOAuth2Provider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuth2Provider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth2_provider_logout_method_enum.go b/packages/client-go/model_o_auth2_provider_logout_method_enum.go new file mode 100644 index 0000000000..7ec8c85a52 --- /dev/null +++ b/packages/client-go/model_o_auth2_provider_logout_method_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// OAuth2ProviderLogoutMethodEnum the model 'OAuth2ProviderLogoutMethodEnum' +type OAuth2ProviderLogoutMethodEnum string + +// List of OAuth2ProviderLogoutMethodEnum +const ( + OAUTH2PROVIDERLOGOUTMETHODENUM_BACKCHANNEL OAuth2ProviderLogoutMethodEnum = "backchannel" + OAUTH2PROVIDERLOGOUTMETHODENUM_FRONTCHANNEL OAuth2ProviderLogoutMethodEnum = "frontchannel" +) + +// All allowed values of OAuth2ProviderLogoutMethodEnum enum +var AllowedOAuth2ProviderLogoutMethodEnumEnumValues = []OAuth2ProviderLogoutMethodEnum{ + "backchannel", + "frontchannel", +} + +func (v *OAuth2ProviderLogoutMethodEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OAuth2ProviderLogoutMethodEnum(value) + for _, existing := range AllowedOAuth2ProviderLogoutMethodEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OAuth2ProviderLogoutMethodEnum", value) +} + +// NewOAuth2ProviderLogoutMethodEnumFromValue returns a pointer to a valid OAuth2ProviderLogoutMethodEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOAuth2ProviderLogoutMethodEnumFromValue(v string) (*OAuth2ProviderLogoutMethodEnum, error) { + ev := OAuth2ProviderLogoutMethodEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OAuth2ProviderLogoutMethodEnum: valid values are %v", v, AllowedOAuth2ProviderLogoutMethodEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OAuth2ProviderLogoutMethodEnum) IsValid() bool { + for _, existing := range AllowedOAuth2ProviderLogoutMethodEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OAuth2ProviderLogoutMethodEnum value +func (v OAuth2ProviderLogoutMethodEnum) Ptr() *OAuth2ProviderLogoutMethodEnum { + return &v +} + +type NullableOAuth2ProviderLogoutMethodEnum struct { + value *OAuth2ProviderLogoutMethodEnum + isSet bool +} + +func (v NullableOAuth2ProviderLogoutMethodEnum) Get() *OAuth2ProviderLogoutMethodEnum { + return v.value +} + +func (v *NullableOAuth2ProviderLogoutMethodEnum) Set(val *OAuth2ProviderLogoutMethodEnum) { + v.value = val + v.isSet = true +} + +func (v NullableOAuth2ProviderLogoutMethodEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuth2ProviderLogoutMethodEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuth2ProviderLogoutMethodEnum(val *OAuth2ProviderLogoutMethodEnum) *NullableOAuth2ProviderLogoutMethodEnum { + return &NullableOAuth2ProviderLogoutMethodEnum{value: val, isSet: true} +} + +func (v NullableOAuth2ProviderLogoutMethodEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuth2ProviderLogoutMethodEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth2_provider_request.go b/packages/client-go/model_o_auth2_provider_request.go new file mode 100644 index 0000000000..00d483ba4d --- /dev/null +++ b/packages/client-go/model_o_auth2_provider_request.go @@ -0,0 +1,967 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuth2ProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ProviderRequest{} + +// OAuth2ProviderRequest OAuth2Provider Serializer +type OAuth2ProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable + ClientType *ClientTypeEnum `json:"client_type,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + // Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessCodeValidity *string `json:"access_code_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + // When refreshing a token, if the refresh token is valid for less than this duration, it will be renewed. When set to seconds=0, token will always be renewed. (Format: hours=1;minutes=2;seconds=3). + RefreshTokenThreshold *string `json:"refresh_token_threshold,omitempty"` + // Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint. + IncludeClaimsInIdToken *bool `json:"include_claims_in_id_token,omitempty"` + // Key used to sign the tokens. + SigningKey NullableString `json:"signing_key,omitempty"` + // Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + EncryptionKey NullableString `json:"encryption_key,omitempty"` + RedirectUris []RedirectURIRequest `json:"redirect_uris"` + LogoutUri *string `json:"logout_uri,omitempty"` + // Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + LogoutMethod *OAuth2ProviderLogoutMethodEnum `json:"logout_method,omitempty"` + // Configure what data should be used as unique User Identifier. For most cases, the default should be fine. + SubMode *SubModeEnum `json:"sub_mode,omitempty"` + // Configure how the issuer field of the ID Token should be filled. + IssuerMode *IssuerModeEnum `json:"issuer_mode,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuth2ProviderRequest OAuth2ProviderRequest + +// NewOAuth2ProviderRequest instantiates a new OAuth2ProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuth2ProviderRequest(name string, authorizationFlow string, invalidationFlow string, redirectUris []RedirectURIRequest) *OAuth2ProviderRequest { + this := OAuth2ProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.RedirectUris = redirectUris + return &this +} + +// NewOAuth2ProviderRequestWithDefaults instantiates a new OAuth2ProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuth2ProviderRequestWithDefaults() *OAuth2ProviderRequest { + this := OAuth2ProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *OAuth2ProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuth2ProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2ProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2ProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *OAuth2ProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *OAuth2ProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *OAuth2ProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *OAuth2ProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *OAuth2ProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *OAuth2ProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *OAuth2ProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *OAuth2ProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetClientType returns the ClientType field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetClientType() ClientTypeEnum { + if o == nil || IsNil(o.ClientType) { + var ret ClientTypeEnum + return ret + } + return *o.ClientType +} + +// GetClientTypeOk returns a tuple with the ClientType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetClientTypeOk() (*ClientTypeEnum, bool) { + if o == nil || IsNil(o.ClientType) { + return nil, false + } + return o.ClientType, true +} + +// HasClientType returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasClientType() bool { + if o != nil && !IsNil(o.ClientType) { + return true + } + + return false +} + +// SetClientType gets a reference to the given ClientTypeEnum and assigns it to the ClientType field. +func (o *OAuth2ProviderRequest) SetClientType(v ClientTypeEnum) { + o.ClientType = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *OAuth2ProviderRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *OAuth2ProviderRequest) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetAccessCodeValidity returns the AccessCodeValidity field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetAccessCodeValidity() string { + if o == nil || IsNil(o.AccessCodeValidity) { + var ret string + return ret + } + return *o.AccessCodeValidity +} + +// GetAccessCodeValidityOk returns a tuple with the AccessCodeValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetAccessCodeValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessCodeValidity) { + return nil, false + } + return o.AccessCodeValidity, true +} + +// HasAccessCodeValidity returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasAccessCodeValidity() bool { + if o != nil && !IsNil(o.AccessCodeValidity) { + return true + } + + return false +} + +// SetAccessCodeValidity gets a reference to the given string and assigns it to the AccessCodeValidity field. +func (o *OAuth2ProviderRequest) SetAccessCodeValidity(v string) { + o.AccessCodeValidity = &v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *OAuth2ProviderRequest) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *OAuth2ProviderRequest) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +// GetRefreshTokenThreshold returns the RefreshTokenThreshold field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetRefreshTokenThreshold() string { + if o == nil || IsNil(o.RefreshTokenThreshold) { + var ret string + return ret + } + return *o.RefreshTokenThreshold +} + +// GetRefreshTokenThresholdOk returns a tuple with the RefreshTokenThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetRefreshTokenThresholdOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenThreshold) { + return nil, false + } + return o.RefreshTokenThreshold, true +} + +// HasRefreshTokenThreshold returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasRefreshTokenThreshold() bool { + if o != nil && !IsNil(o.RefreshTokenThreshold) { + return true + } + + return false +} + +// SetRefreshTokenThreshold gets a reference to the given string and assigns it to the RefreshTokenThreshold field. +func (o *OAuth2ProviderRequest) SetRefreshTokenThreshold(v string) { + o.RefreshTokenThreshold = &v +} + +// GetIncludeClaimsInIdToken returns the IncludeClaimsInIdToken field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetIncludeClaimsInIdToken() bool { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + var ret bool + return ret + } + return *o.IncludeClaimsInIdToken +} + +// GetIncludeClaimsInIdTokenOk returns a tuple with the IncludeClaimsInIdToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetIncludeClaimsInIdTokenOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + return nil, false + } + return o.IncludeClaimsInIdToken, true +} + +// HasIncludeClaimsInIdToken returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasIncludeClaimsInIdToken() bool { + if o != nil && !IsNil(o.IncludeClaimsInIdToken) { + return true + } + + return false +} + +// SetIncludeClaimsInIdToken gets a reference to the given bool and assigns it to the IncludeClaimsInIdToken field. +func (o *OAuth2ProviderRequest) SetIncludeClaimsInIdToken(v bool) { + o.IncludeClaimsInIdToken = &v +} + +// GetSigningKey returns the SigningKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2ProviderRequest) GetSigningKey() string { + if o == nil || IsNil(o.SigningKey.Get()) { + var ret string + return ret + } + return *o.SigningKey.Get() +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2ProviderRequest) GetSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKey.Get(), o.SigningKey.IsSet() +} + +// HasSigningKey returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasSigningKey() bool { + if o != nil && o.SigningKey.IsSet() { + return true + } + + return false +} + +// SetSigningKey gets a reference to the given NullableString and assigns it to the SigningKey field. +func (o *OAuth2ProviderRequest) SetSigningKey(v string) { + o.SigningKey.Set(&v) +} + +// SetSigningKeyNil sets the value for SigningKey to be an explicit nil +func (o *OAuth2ProviderRequest) SetSigningKeyNil() { + o.SigningKey.Set(nil) +} + +// UnsetSigningKey ensures that no value is present for SigningKey, not even an explicit nil +func (o *OAuth2ProviderRequest) UnsetSigningKey() { + o.SigningKey.Unset() +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuth2ProviderRequest) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey.Get()) { + var ret string + return ret + } + return *o.EncryptionKey.Get() +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuth2ProviderRequest) GetEncryptionKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKey.Get(), o.EncryptionKey.IsSet() +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasEncryptionKey() bool { + if o != nil && o.EncryptionKey.IsSet() { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given NullableString and assigns it to the EncryptionKey field. +func (o *OAuth2ProviderRequest) SetEncryptionKey(v string) { + o.EncryptionKey.Set(&v) +} + +// SetEncryptionKeyNil sets the value for EncryptionKey to be an explicit nil +func (o *OAuth2ProviderRequest) SetEncryptionKeyNil() { + o.EncryptionKey.Set(nil) +} + +// UnsetEncryptionKey ensures that no value is present for EncryptionKey, not even an explicit nil +func (o *OAuth2ProviderRequest) UnsetEncryptionKey() { + o.EncryptionKey.Unset() +} + +// GetRedirectUris returns the RedirectUris field value +func (o *OAuth2ProviderRequest) GetRedirectUris() []RedirectURIRequest { + if o == nil { + var ret []RedirectURIRequest + return ret + } + + return o.RedirectUris +} + +// GetRedirectUrisOk returns a tuple with the RedirectUris field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetRedirectUrisOk() ([]RedirectURIRequest, bool) { + if o == nil { + return nil, false + } + return o.RedirectUris, true +} + +// SetRedirectUris sets field value +func (o *OAuth2ProviderRequest) SetRedirectUris(v []RedirectURIRequest) { + o.RedirectUris = v +} + +// GetLogoutUri returns the LogoutUri field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetLogoutUri() string { + if o == nil || IsNil(o.LogoutUri) { + var ret string + return ret + } + return *o.LogoutUri +} + +// GetLogoutUriOk returns a tuple with the LogoutUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetLogoutUriOk() (*string, bool) { + if o == nil || IsNil(o.LogoutUri) { + return nil, false + } + return o.LogoutUri, true +} + +// HasLogoutUri returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasLogoutUri() bool { + if o != nil && !IsNil(o.LogoutUri) { + return true + } + + return false +} + +// SetLogoutUri gets a reference to the given string and assigns it to the LogoutUri field. +func (o *OAuth2ProviderRequest) SetLogoutUri(v string) { + o.LogoutUri = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetLogoutMethod() OAuth2ProviderLogoutMethodEnum { + if o == nil || IsNil(o.LogoutMethod) { + var ret OAuth2ProviderLogoutMethodEnum + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetLogoutMethodOk() (*OAuth2ProviderLogoutMethodEnum, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given OAuth2ProviderLogoutMethodEnum and assigns it to the LogoutMethod field. +func (o *OAuth2ProviderRequest) SetLogoutMethod(v OAuth2ProviderLogoutMethodEnum) { + o.LogoutMethod = &v +} + +// GetSubMode returns the SubMode field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetSubMode() SubModeEnum { + if o == nil || IsNil(o.SubMode) { + var ret SubModeEnum + return ret + } + return *o.SubMode +} + +// GetSubModeOk returns a tuple with the SubMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetSubModeOk() (*SubModeEnum, bool) { + if o == nil || IsNil(o.SubMode) { + return nil, false + } + return o.SubMode, true +} + +// HasSubMode returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasSubMode() bool { + if o != nil && !IsNil(o.SubMode) { + return true + } + + return false +} + +// SetSubMode gets a reference to the given SubModeEnum and assigns it to the SubMode field. +func (o *OAuth2ProviderRequest) SetSubMode(v SubModeEnum) { + o.SubMode = &v +} + +// GetIssuerMode returns the IssuerMode field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetIssuerMode() IssuerModeEnum { + if o == nil || IsNil(o.IssuerMode) { + var ret IssuerModeEnum + return ret + } + return *o.IssuerMode +} + +// GetIssuerModeOk returns a tuple with the IssuerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetIssuerModeOk() (*IssuerModeEnum, bool) { + if o == nil || IsNil(o.IssuerMode) { + return nil, false + } + return o.IssuerMode, true +} + +// HasIssuerMode returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasIssuerMode() bool { + if o != nil && !IsNil(o.IssuerMode) { + return true + } + + return false +} + +// SetIssuerMode gets a reference to the given IssuerModeEnum and assigns it to the IssuerMode field. +func (o *OAuth2ProviderRequest) SetIssuerMode(v IssuerModeEnum) { + o.IssuerMode = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *OAuth2ProviderRequest) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *OAuth2ProviderRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *OAuth2ProviderRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *OAuth2ProviderRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o OAuth2ProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.ClientType) { + toSerialize["client_type"] = o.ClientType + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.AccessCodeValidity) { + toSerialize["access_code_validity"] = o.AccessCodeValidity + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + if !IsNil(o.RefreshTokenThreshold) { + toSerialize["refresh_token_threshold"] = o.RefreshTokenThreshold + } + if !IsNil(o.IncludeClaimsInIdToken) { + toSerialize["include_claims_in_id_token"] = o.IncludeClaimsInIdToken + } + if o.SigningKey.IsSet() { + toSerialize["signing_key"] = o.SigningKey.Get() + } + if o.EncryptionKey.IsSet() { + toSerialize["encryption_key"] = o.EncryptionKey.Get() + } + toSerialize["redirect_uris"] = o.RedirectUris + if !IsNil(o.LogoutUri) { + toSerialize["logout_uri"] = o.LogoutUri + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.SubMode) { + toSerialize["sub_mode"] = o.SubMode + } + if !IsNil(o.IssuerMode) { + toSerialize["issuer_mode"] = o.IssuerMode + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuth2ProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + "redirect_uris", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuth2ProviderRequest := _OAuth2ProviderRequest{} + + err = json.Unmarshal(data, &varOAuth2ProviderRequest) + + if err != nil { + return err + } + + *o = OAuth2ProviderRequest(varOAuth2ProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "client_type") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "access_code_validity") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + delete(additionalProperties, "refresh_token_threshold") + delete(additionalProperties, "include_claims_in_id_token") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "encryption_key") + delete(additionalProperties, "redirect_uris") + delete(additionalProperties, "logout_uri") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "sub_mode") + delete(additionalProperties, "issuer_mode") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuth2ProviderRequest struct { + value *OAuth2ProviderRequest + isSet bool +} + +func (v NullableOAuth2ProviderRequest) Get() *OAuth2ProviderRequest { + return v.value +} + +func (v *NullableOAuth2ProviderRequest) Set(val *OAuth2ProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuth2ProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuth2ProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuth2ProviderRequest(val *OAuth2ProviderRequest) *NullableOAuth2ProviderRequest { + return &NullableOAuth2ProviderRequest{value: val, isSet: true} +} + +func (v NullableOAuth2ProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuth2ProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth2_provider_setup_urls.go b/packages/client-go/model_o_auth2_provider_setup_urls.go new file mode 100644 index 0000000000..6691240b20 --- /dev/null +++ b/packages/client-go/model_o_auth2_provider_setup_urls.go @@ -0,0 +1,341 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuth2ProviderSetupURLs type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuth2ProviderSetupURLs{} + +// OAuth2ProviderSetupURLs OAuth2 Provider Metadata serializer +type OAuth2ProviderSetupURLs struct { + Issuer string `json:"issuer"` + Authorize string `json:"authorize"` + Token string `json:"token"` + UserInfo string `json:"user_info"` + ProviderInfo string `json:"provider_info"` + Logout string `json:"logout"` + Jwks string `json:"jwks"` + AdditionalProperties map[string]interface{} +} + +type _OAuth2ProviderSetupURLs OAuth2ProviderSetupURLs + +// NewOAuth2ProviderSetupURLs instantiates a new OAuth2ProviderSetupURLs object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuth2ProviderSetupURLs(issuer string, authorize string, token string, userInfo string, providerInfo string, logout string, jwks string) *OAuth2ProviderSetupURLs { + this := OAuth2ProviderSetupURLs{} + this.Issuer = issuer + this.Authorize = authorize + this.Token = token + this.UserInfo = userInfo + this.ProviderInfo = providerInfo + this.Logout = logout + this.Jwks = jwks + return &this +} + +// NewOAuth2ProviderSetupURLsWithDefaults instantiates a new OAuth2ProviderSetupURLs object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuth2ProviderSetupURLsWithDefaults() *OAuth2ProviderSetupURLs { + this := OAuth2ProviderSetupURLs{} + return &this +} + +// GetIssuer returns the Issuer field value +func (o *OAuth2ProviderSetupURLs) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *OAuth2ProviderSetupURLs) SetIssuer(v string) { + o.Issuer = v +} + +// GetAuthorize returns the Authorize field value +func (o *OAuth2ProviderSetupURLs) GetAuthorize() string { + if o == nil { + var ret string + return ret + } + + return o.Authorize +} + +// GetAuthorizeOk returns a tuple with the Authorize field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetAuthorizeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Authorize, true +} + +// SetAuthorize sets field value +func (o *OAuth2ProviderSetupURLs) SetAuthorize(v string) { + o.Authorize = v +} + +// GetToken returns the Token field value +func (o *OAuth2ProviderSetupURLs) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *OAuth2ProviderSetupURLs) SetToken(v string) { + o.Token = v +} + +// GetUserInfo returns the UserInfo field value +func (o *OAuth2ProviderSetupURLs) GetUserInfo() string { + if o == nil { + var ret string + return ret + } + + return o.UserInfo +} + +// GetUserInfoOk returns a tuple with the UserInfo field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetUserInfoOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserInfo, true +} + +// SetUserInfo sets field value +func (o *OAuth2ProviderSetupURLs) SetUserInfo(v string) { + o.UserInfo = v +} + +// GetProviderInfo returns the ProviderInfo field value +func (o *OAuth2ProviderSetupURLs) GetProviderInfo() string { + if o == nil { + var ret string + return ret + } + + return o.ProviderInfo +} + +// GetProviderInfoOk returns a tuple with the ProviderInfo field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetProviderInfoOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProviderInfo, true +} + +// SetProviderInfo sets field value +func (o *OAuth2ProviderSetupURLs) SetProviderInfo(v string) { + o.ProviderInfo = v +} + +// GetLogout returns the Logout field value +func (o *OAuth2ProviderSetupURLs) GetLogout() string { + if o == nil { + var ret string + return ret + } + + return o.Logout +} + +// GetLogoutOk returns a tuple with the Logout field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetLogoutOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Logout, true +} + +// SetLogout sets field value +func (o *OAuth2ProviderSetupURLs) SetLogout(v string) { + o.Logout = v +} + +// GetJwks returns the Jwks field value +func (o *OAuth2ProviderSetupURLs) GetJwks() string { + if o == nil { + var ret string + return ret + } + + return o.Jwks +} + +// GetJwksOk returns a tuple with the Jwks field value +// and a boolean to check if the value has been set. +func (o *OAuth2ProviderSetupURLs) GetJwksOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Jwks, true +} + +// SetJwks sets field value +func (o *OAuth2ProviderSetupURLs) SetJwks(v string) { + o.Jwks = v +} + +func (o OAuth2ProviderSetupURLs) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuth2ProviderSetupURLs) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["issuer"] = o.Issuer + toSerialize["authorize"] = o.Authorize + toSerialize["token"] = o.Token + toSerialize["user_info"] = o.UserInfo + toSerialize["provider_info"] = o.ProviderInfo + toSerialize["logout"] = o.Logout + toSerialize["jwks"] = o.Jwks + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuth2ProviderSetupURLs) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "issuer", + "authorize", + "token", + "user_info", + "provider_info", + "logout", + "jwks", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuth2ProviderSetupURLs := _OAuth2ProviderSetupURLs{} + + err = json.Unmarshal(data, &varOAuth2ProviderSetupURLs) + + if err != nil { + return err + } + + *o = OAuth2ProviderSetupURLs(varOAuth2ProviderSetupURLs) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "issuer") + delete(additionalProperties, "authorize") + delete(additionalProperties, "token") + delete(additionalProperties, "user_info") + delete(additionalProperties, "provider_info") + delete(additionalProperties, "logout") + delete(additionalProperties, "jwks") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuth2ProviderSetupURLs struct { + value *OAuth2ProviderSetupURLs + isSet bool +} + +func (v NullableOAuth2ProviderSetupURLs) Get() *OAuth2ProviderSetupURLs { + return v.value +} + +func (v *NullableOAuth2ProviderSetupURLs) Set(val *OAuth2ProviderSetupURLs) { + v.value = val + v.isSet = true +} + +func (v NullableOAuth2ProviderSetupURLs) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuth2ProviderSetupURLs) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuth2ProviderSetupURLs(val *OAuth2ProviderSetupURLs) *NullableOAuth2ProviderSetupURLs { + return &NullableOAuth2ProviderSetupURLs{value: val, isSet: true} +} + +func (v NullableOAuth2ProviderSetupURLs) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuth2ProviderSetupURLs) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_device_code_challenge.go b/packages/client-go/model_o_auth_device_code_challenge.go new file mode 100644 index 0000000000..eb0aad4c06 --- /dev/null +++ b/packages/client-go/model_o_auth_device_code_challenge.go @@ -0,0 +1,232 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the OAuthDeviceCodeChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthDeviceCodeChallenge{} + +// OAuthDeviceCodeChallenge OAuth Device code challenge +type OAuthDeviceCodeChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuthDeviceCodeChallenge OAuthDeviceCodeChallenge + +// NewOAuthDeviceCodeChallenge instantiates a new OAuthDeviceCodeChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthDeviceCodeChallenge() *OAuthDeviceCodeChallenge { + this := OAuthDeviceCodeChallenge{} + var component string = "ak-provider-oauth2-device-code" + this.Component = &component + return &this +} + +// NewOAuthDeviceCodeChallengeWithDefaults instantiates a new OAuthDeviceCodeChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthDeviceCodeChallengeWithDefaults() *OAuthDeviceCodeChallenge { + this := OAuthDeviceCodeChallenge{} + var component string = "ak-provider-oauth2-device-code" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *OAuthDeviceCodeChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *OAuthDeviceCodeChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *OAuthDeviceCodeChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *OAuthDeviceCodeChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *OAuthDeviceCodeChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *OAuthDeviceCodeChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *OAuthDeviceCodeChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *OAuthDeviceCodeChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *OAuthDeviceCodeChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +func (o OAuthDeviceCodeChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthDeviceCodeChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthDeviceCodeChallenge) UnmarshalJSON(data []byte) (err error) { + varOAuthDeviceCodeChallenge := _OAuthDeviceCodeChallenge{} + + err = json.Unmarshal(data, &varOAuthDeviceCodeChallenge) + + if err != nil { + return err + } + + *o = OAuthDeviceCodeChallenge(varOAuthDeviceCodeChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthDeviceCodeChallenge struct { + value *OAuthDeviceCodeChallenge + isSet bool +} + +func (v NullableOAuthDeviceCodeChallenge) Get() *OAuthDeviceCodeChallenge { + return v.value +} + +func (v *NullableOAuthDeviceCodeChallenge) Set(val *OAuthDeviceCodeChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthDeviceCodeChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthDeviceCodeChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthDeviceCodeChallenge(val *OAuthDeviceCodeChallenge) *NullableOAuthDeviceCodeChallenge { + return &NullableOAuthDeviceCodeChallenge{value: val, isSet: true} +} + +func (v NullableOAuthDeviceCodeChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthDeviceCodeChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_device_code_challenge_response_request.go b/packages/client-go/model_o_auth_device_code_challenge_response_request.go new file mode 100644 index 0000000000..8fd0236045 --- /dev/null +++ b/packages/client-go/model_o_auth_device_code_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuthDeviceCodeChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthDeviceCodeChallengeResponseRequest{} + +// OAuthDeviceCodeChallengeResponseRequest Response that includes the user-entered device code +type OAuthDeviceCodeChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Code string `json:"code"` + AdditionalProperties map[string]interface{} +} + +type _OAuthDeviceCodeChallengeResponseRequest OAuthDeviceCodeChallengeResponseRequest + +// NewOAuthDeviceCodeChallengeResponseRequest instantiates a new OAuthDeviceCodeChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthDeviceCodeChallengeResponseRequest(code string) *OAuthDeviceCodeChallengeResponseRequest { + this := OAuthDeviceCodeChallengeResponseRequest{} + var component string = "ak-provider-oauth2-device-code" + this.Component = &component + this.Code = code + return &this +} + +// NewOAuthDeviceCodeChallengeResponseRequestWithDefaults instantiates a new OAuthDeviceCodeChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthDeviceCodeChallengeResponseRequestWithDefaults() *OAuthDeviceCodeChallengeResponseRequest { + this := OAuthDeviceCodeChallengeResponseRequest{} + var component string = "ak-provider-oauth2-device-code" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *OAuthDeviceCodeChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *OAuthDeviceCodeChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *OAuthDeviceCodeChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetCode returns the Code field value +func (o *OAuthDeviceCodeChallengeResponseRequest) GetCode() string { + if o == nil { + var ret string + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeChallengeResponseRequest) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *OAuthDeviceCodeChallengeResponseRequest) SetCode(v string) { + o.Code = v +} + +func (o OAuthDeviceCodeChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthDeviceCodeChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["code"] = o.Code + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthDeviceCodeChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthDeviceCodeChallengeResponseRequest := _OAuthDeviceCodeChallengeResponseRequest{} + + err = json.Unmarshal(data, &varOAuthDeviceCodeChallengeResponseRequest) + + if err != nil { + return err + } + + *o = OAuthDeviceCodeChallengeResponseRequest(varOAuthDeviceCodeChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthDeviceCodeChallengeResponseRequest struct { + value *OAuthDeviceCodeChallengeResponseRequest + isSet bool +} + +func (v NullableOAuthDeviceCodeChallengeResponseRequest) Get() *OAuthDeviceCodeChallengeResponseRequest { + return v.value +} + +func (v *NullableOAuthDeviceCodeChallengeResponseRequest) Set(val *OAuthDeviceCodeChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthDeviceCodeChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthDeviceCodeChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthDeviceCodeChallengeResponseRequest(val *OAuthDeviceCodeChallengeResponseRequest) *NullableOAuthDeviceCodeChallengeResponseRequest { + return &NullableOAuthDeviceCodeChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableOAuthDeviceCodeChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthDeviceCodeChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_device_code_finish_challenge.go b/packages/client-go/model_o_auth_device_code_finish_challenge.go new file mode 100644 index 0000000000..186ab75e22 --- /dev/null +++ b/packages/client-go/model_o_auth_device_code_finish_challenge.go @@ -0,0 +1,232 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the OAuthDeviceCodeFinishChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthDeviceCodeFinishChallenge{} + +// OAuthDeviceCodeFinishChallenge Final challenge after user enters their code +type OAuthDeviceCodeFinishChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuthDeviceCodeFinishChallenge OAuthDeviceCodeFinishChallenge + +// NewOAuthDeviceCodeFinishChallenge instantiates a new OAuthDeviceCodeFinishChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthDeviceCodeFinishChallenge() *OAuthDeviceCodeFinishChallenge { + this := OAuthDeviceCodeFinishChallenge{} + var component string = "ak-provider-oauth2-device-code-finish" + this.Component = &component + return &this +} + +// NewOAuthDeviceCodeFinishChallengeWithDefaults instantiates a new OAuthDeviceCodeFinishChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthDeviceCodeFinishChallengeWithDefaults() *OAuthDeviceCodeFinishChallenge { + this := OAuthDeviceCodeFinishChallenge{} + var component string = "ak-provider-oauth2-device-code-finish" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *OAuthDeviceCodeFinishChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeFinishChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *OAuthDeviceCodeFinishChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *OAuthDeviceCodeFinishChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *OAuthDeviceCodeFinishChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeFinishChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *OAuthDeviceCodeFinishChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *OAuthDeviceCodeFinishChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *OAuthDeviceCodeFinishChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeFinishChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *OAuthDeviceCodeFinishChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *OAuthDeviceCodeFinishChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +func (o OAuthDeviceCodeFinishChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthDeviceCodeFinishChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthDeviceCodeFinishChallenge) UnmarshalJSON(data []byte) (err error) { + varOAuthDeviceCodeFinishChallenge := _OAuthDeviceCodeFinishChallenge{} + + err = json.Unmarshal(data, &varOAuthDeviceCodeFinishChallenge) + + if err != nil { + return err + } + + *o = OAuthDeviceCodeFinishChallenge(varOAuthDeviceCodeFinishChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthDeviceCodeFinishChallenge struct { + value *OAuthDeviceCodeFinishChallenge + isSet bool +} + +func (v NullableOAuthDeviceCodeFinishChallenge) Get() *OAuthDeviceCodeFinishChallenge { + return v.value +} + +func (v *NullableOAuthDeviceCodeFinishChallenge) Set(val *OAuthDeviceCodeFinishChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthDeviceCodeFinishChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthDeviceCodeFinishChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthDeviceCodeFinishChallenge(val *OAuthDeviceCodeFinishChallenge) *NullableOAuthDeviceCodeFinishChallenge { + return &NullableOAuthDeviceCodeFinishChallenge{value: val, isSet: true} +} + +func (v NullableOAuthDeviceCodeFinishChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthDeviceCodeFinishChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_device_code_finish_challenge_response_request.go b/packages/client-go/model_o_auth_device_code_finish_challenge_response_request.go new file mode 100644 index 0000000000..f899e9d840 --- /dev/null +++ b/packages/client-go/model_o_auth_device_code_finish_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the OAuthDeviceCodeFinishChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthDeviceCodeFinishChallengeResponseRequest{} + +// OAuthDeviceCodeFinishChallengeResponseRequest Response that device has been authenticated and tab can be closed +type OAuthDeviceCodeFinishChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuthDeviceCodeFinishChallengeResponseRequest OAuthDeviceCodeFinishChallengeResponseRequest + +// NewOAuthDeviceCodeFinishChallengeResponseRequest instantiates a new OAuthDeviceCodeFinishChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthDeviceCodeFinishChallengeResponseRequest() *OAuthDeviceCodeFinishChallengeResponseRequest { + this := OAuthDeviceCodeFinishChallengeResponseRequest{} + var component string = "ak-provider-oauth2-device-code-finish" + this.Component = &component + return &this +} + +// NewOAuthDeviceCodeFinishChallengeResponseRequestWithDefaults instantiates a new OAuthDeviceCodeFinishChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthDeviceCodeFinishChallengeResponseRequestWithDefaults() *OAuthDeviceCodeFinishChallengeResponseRequest { + this := OAuthDeviceCodeFinishChallengeResponseRequest{} + var component string = "ak-provider-oauth2-device-code-finish" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *OAuthDeviceCodeFinishChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthDeviceCodeFinishChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *OAuthDeviceCodeFinishChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *OAuthDeviceCodeFinishChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o OAuthDeviceCodeFinishChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthDeviceCodeFinishChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthDeviceCodeFinishChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varOAuthDeviceCodeFinishChallengeResponseRequest := _OAuthDeviceCodeFinishChallengeResponseRequest{} + + err = json.Unmarshal(data, &varOAuthDeviceCodeFinishChallengeResponseRequest) + + if err != nil { + return err + } + + *o = OAuthDeviceCodeFinishChallengeResponseRequest(varOAuthDeviceCodeFinishChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthDeviceCodeFinishChallengeResponseRequest struct { + value *OAuthDeviceCodeFinishChallengeResponseRequest + isSet bool +} + +func (v NullableOAuthDeviceCodeFinishChallengeResponseRequest) Get() *OAuthDeviceCodeFinishChallengeResponseRequest { + return v.value +} + +func (v *NullableOAuthDeviceCodeFinishChallengeResponseRequest) Set(val *OAuthDeviceCodeFinishChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthDeviceCodeFinishChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthDeviceCodeFinishChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthDeviceCodeFinishChallengeResponseRequest(val *OAuthDeviceCodeFinishChallengeResponseRequest) *NullableOAuthDeviceCodeFinishChallengeResponseRequest { + return &NullableOAuthDeviceCodeFinishChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableOAuthDeviceCodeFinishChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthDeviceCodeFinishChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_source.go b/packages/client-go/model_o_auth_source.go new file mode 100644 index 0000000000..d69b95897d --- /dev/null +++ b/packages/client-go/model_o_auth_source.go @@ -0,0 +1,1411 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuthSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthSource{} + +// OAuthSource OAuth Source Serializer +type OAuthSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl NullableString `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + ProviderType ProviderTypeEnum `json:"provider_type"` + // URL used to request the initial token. This URL is only required for OAuth 1. + RequestTokenUrl NullableString `json:"request_token_url,omitempty"` + // URL the user is redirect to to conest the flow. + AuthorizationUrl NullableString `json:"authorization_url,omitempty"` + // URL used by authentik to retrieve tokens. + AccessTokenUrl NullableString `json:"access_token_url,omitempty"` + // URL used by authentik to get user information. + ProfileUrl NullableString `json:"profile_url,omitempty"` + Pkce *PKCEMethodEnum `json:"pkce,omitempty"` + ConsumerKey string `json:"consumer_key"` + // Get OAuth Callback URL + CallbackUrl string `json:"callback_url"` + AdditionalScopes *string `json:"additional_scopes,omitempty"` + Type SourceType `json:"type"` + OidcWellKnownUrl *string `json:"oidc_well_known_url,omitempty"` + OidcJwksUrl *string `json:"oidc_jwks_url,omitempty"` + OidcJwks map[string]interface{} `json:"oidc_jwks,omitempty"` + // How to perform authentication during an authorization_code token request flow + AuthorizationCodeAuthMethod *AuthorizationCodeAuthMethodEnum `json:"authorization_code_auth_method,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuthSource OAuthSource + +// NewOAuthSource instantiates a new OAuthSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl NullableString, iconThemedUrls NullableThemedUrls, providerType ProviderTypeEnum, consumerKey string, callbackUrl string, type_ SourceType) *OAuthSource { + this := OAuthSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.ProviderType = providerType + this.ConsumerKey = consumerKey + this.CallbackUrl = callbackUrl + this.Type = type_ + return &this +} + +// NewOAuthSourceWithDefaults instantiates a new OAuthSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthSourceWithDefaults() *OAuthSource { + this := OAuthSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *OAuthSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *OAuthSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *OAuthSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuthSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *OAuthSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *OAuthSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *OAuthSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *OAuthSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *OAuthSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *OAuthSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *OAuthSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *OAuthSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *OAuthSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *OAuthSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *OAuthSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *OAuthSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *OAuthSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *OAuthSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *OAuthSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *OAuthSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *OAuthSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *OAuthSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *OAuthSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *OAuthSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *OAuthSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *OAuthSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *OAuthSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *OAuthSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *OAuthSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *OAuthSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *OAuthSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *OAuthSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *OAuthSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *OAuthSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *OAuthSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *OAuthSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *OAuthSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *OAuthSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *OAuthSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *OAuthSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuthSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *OAuthSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *OAuthSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *OAuthSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *OAuthSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *OAuthSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *OAuthSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *OAuthSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *OAuthSource) GetIconUrl() string { + if o == nil || o.IconUrl.Get() == nil { + var ret string + return ret + } + + return *o.IconUrl.Get() +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IconUrl.Get(), o.IconUrl.IsSet() +} + +// SetIconUrl sets field value +func (o *OAuthSource) SetIconUrl(v string) { + o.IconUrl.Set(&v) +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *OAuthSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *OAuthSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *OAuthSource) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *OAuthSource) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *OAuthSource) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetProviderType returns the ProviderType field value +func (o *OAuthSource) GetProviderType() ProviderTypeEnum { + if o == nil { + var ret ProviderTypeEnum + return ret + } + + return o.ProviderType +} + +// GetProviderTypeOk returns a tuple with the ProviderType field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetProviderTypeOk() (*ProviderTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ProviderType, true +} + +// SetProviderType sets field value +func (o *OAuthSource) SetProviderType(v ProviderTypeEnum) { + o.ProviderType = v +} + +// GetRequestTokenUrl returns the RequestTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetRequestTokenUrl() string { + if o == nil || IsNil(o.RequestTokenUrl.Get()) { + var ret string + return ret + } + return *o.RequestTokenUrl.Get() +} + +// GetRequestTokenUrlOk returns a tuple with the RequestTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetRequestTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RequestTokenUrl.Get(), o.RequestTokenUrl.IsSet() +} + +// HasRequestTokenUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasRequestTokenUrl() bool { + if o != nil && o.RequestTokenUrl.IsSet() { + return true + } + + return false +} + +// SetRequestTokenUrl gets a reference to the given NullableString and assigns it to the RequestTokenUrl field. +func (o *OAuthSource) SetRequestTokenUrl(v string) { + o.RequestTokenUrl.Set(&v) +} + +// SetRequestTokenUrlNil sets the value for RequestTokenUrl to be an explicit nil +func (o *OAuthSource) SetRequestTokenUrlNil() { + o.RequestTokenUrl.Set(nil) +} + +// UnsetRequestTokenUrl ensures that no value is present for RequestTokenUrl, not even an explicit nil +func (o *OAuthSource) UnsetRequestTokenUrl() { + o.RequestTokenUrl.Unset() +} + +// GetAuthorizationUrl returns the AuthorizationUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetAuthorizationUrl() string { + if o == nil || IsNil(o.AuthorizationUrl.Get()) { + var ret string + return ret + } + return *o.AuthorizationUrl.Get() +} + +// GetAuthorizationUrlOk returns a tuple with the AuthorizationUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetAuthorizationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationUrl.Get(), o.AuthorizationUrl.IsSet() +} + +// HasAuthorizationUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasAuthorizationUrl() bool { + if o != nil && o.AuthorizationUrl.IsSet() { + return true + } + + return false +} + +// SetAuthorizationUrl gets a reference to the given NullableString and assigns it to the AuthorizationUrl field. +func (o *OAuthSource) SetAuthorizationUrl(v string) { + o.AuthorizationUrl.Set(&v) +} + +// SetAuthorizationUrlNil sets the value for AuthorizationUrl to be an explicit nil +func (o *OAuthSource) SetAuthorizationUrlNil() { + o.AuthorizationUrl.Set(nil) +} + +// UnsetAuthorizationUrl ensures that no value is present for AuthorizationUrl, not even an explicit nil +func (o *OAuthSource) UnsetAuthorizationUrl() { + o.AuthorizationUrl.Unset() +} + +// GetAccessTokenUrl returns the AccessTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetAccessTokenUrl() string { + if o == nil || IsNil(o.AccessTokenUrl.Get()) { + var ret string + return ret + } + return *o.AccessTokenUrl.Get() +} + +// GetAccessTokenUrlOk returns a tuple with the AccessTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetAccessTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessTokenUrl.Get(), o.AccessTokenUrl.IsSet() +} + +// HasAccessTokenUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasAccessTokenUrl() bool { + if o != nil && o.AccessTokenUrl.IsSet() { + return true + } + + return false +} + +// SetAccessTokenUrl gets a reference to the given NullableString and assigns it to the AccessTokenUrl field. +func (o *OAuthSource) SetAccessTokenUrl(v string) { + o.AccessTokenUrl.Set(&v) +} + +// SetAccessTokenUrlNil sets the value for AccessTokenUrl to be an explicit nil +func (o *OAuthSource) SetAccessTokenUrlNil() { + o.AccessTokenUrl.Set(nil) +} + +// UnsetAccessTokenUrl ensures that no value is present for AccessTokenUrl, not even an explicit nil +func (o *OAuthSource) UnsetAccessTokenUrl() { + o.AccessTokenUrl.Unset() +} + +// GetProfileUrl returns the ProfileUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSource) GetProfileUrl() string { + if o == nil || IsNil(o.ProfileUrl.Get()) { + var ret string + return ret + } + return *o.ProfileUrl.Get() +} + +// GetProfileUrlOk returns a tuple with the ProfileUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSource) GetProfileUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProfileUrl.Get(), o.ProfileUrl.IsSet() +} + +// HasProfileUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasProfileUrl() bool { + if o != nil && o.ProfileUrl.IsSet() { + return true + } + + return false +} + +// SetProfileUrl gets a reference to the given NullableString and assigns it to the ProfileUrl field. +func (o *OAuthSource) SetProfileUrl(v string) { + o.ProfileUrl.Set(&v) +} + +// SetProfileUrlNil sets the value for ProfileUrl to be an explicit nil +func (o *OAuthSource) SetProfileUrlNil() { + o.ProfileUrl.Set(nil) +} + +// UnsetProfileUrl ensures that no value is present for ProfileUrl, not even an explicit nil +func (o *OAuthSource) UnsetProfileUrl() { + o.ProfileUrl.Unset() +} + +// GetPkce returns the Pkce field value if set, zero value otherwise. +func (o *OAuthSource) GetPkce() PKCEMethodEnum { + if o == nil || IsNil(o.Pkce) { + var ret PKCEMethodEnum + return ret + } + return *o.Pkce +} + +// GetPkceOk returns a tuple with the Pkce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetPkceOk() (*PKCEMethodEnum, bool) { + if o == nil || IsNil(o.Pkce) { + return nil, false + } + return o.Pkce, true +} + +// HasPkce returns a boolean if a field has been set. +func (o *OAuthSource) HasPkce() bool { + if o != nil && !IsNil(o.Pkce) { + return true + } + + return false +} + +// SetPkce gets a reference to the given PKCEMethodEnum and assigns it to the Pkce field. +func (o *OAuthSource) SetPkce(v PKCEMethodEnum) { + o.Pkce = &v +} + +// GetConsumerKey returns the ConsumerKey field value +func (o *OAuthSource) GetConsumerKey() string { + if o == nil { + var ret string + return ret + } + + return o.ConsumerKey +} + +// GetConsumerKeyOk returns a tuple with the ConsumerKey field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetConsumerKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsumerKey, true +} + +// SetConsumerKey sets field value +func (o *OAuthSource) SetConsumerKey(v string) { + o.ConsumerKey = v +} + +// GetCallbackUrl returns the CallbackUrl field value +func (o *OAuthSource) GetCallbackUrl() string { + if o == nil { + var ret string + return ret + } + + return o.CallbackUrl +} + +// GetCallbackUrlOk returns a tuple with the CallbackUrl field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetCallbackUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CallbackUrl, true +} + +// SetCallbackUrl sets field value +func (o *OAuthSource) SetCallbackUrl(v string) { + o.CallbackUrl = v +} + +// GetAdditionalScopes returns the AdditionalScopes field value if set, zero value otherwise. +func (o *OAuthSource) GetAdditionalScopes() string { + if o == nil || IsNil(o.AdditionalScopes) { + var ret string + return ret + } + return *o.AdditionalScopes +} + +// GetAdditionalScopesOk returns a tuple with the AdditionalScopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetAdditionalScopesOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalScopes) { + return nil, false + } + return o.AdditionalScopes, true +} + +// HasAdditionalScopes returns a boolean if a field has been set. +func (o *OAuthSource) HasAdditionalScopes() bool { + if o != nil && !IsNil(o.AdditionalScopes) { + return true + } + + return false +} + +// SetAdditionalScopes gets a reference to the given string and assigns it to the AdditionalScopes field. +func (o *OAuthSource) SetAdditionalScopes(v string) { + o.AdditionalScopes = &v +} + +// GetType returns the Type field value +func (o *OAuthSource) GetType() SourceType { + if o == nil { + var ret SourceType + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetTypeOk() (*SourceType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *OAuthSource) SetType(v SourceType) { + o.Type = v +} + +// GetOidcWellKnownUrl returns the OidcWellKnownUrl field value if set, zero value otherwise. +func (o *OAuthSource) GetOidcWellKnownUrl() string { + if o == nil || IsNil(o.OidcWellKnownUrl) { + var ret string + return ret + } + return *o.OidcWellKnownUrl +} + +// GetOidcWellKnownUrlOk returns a tuple with the OidcWellKnownUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetOidcWellKnownUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcWellKnownUrl) { + return nil, false + } + return o.OidcWellKnownUrl, true +} + +// HasOidcWellKnownUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasOidcWellKnownUrl() bool { + if o != nil && !IsNil(o.OidcWellKnownUrl) { + return true + } + + return false +} + +// SetOidcWellKnownUrl gets a reference to the given string and assigns it to the OidcWellKnownUrl field. +func (o *OAuthSource) SetOidcWellKnownUrl(v string) { + o.OidcWellKnownUrl = &v +} + +// GetOidcJwksUrl returns the OidcJwksUrl field value if set, zero value otherwise. +func (o *OAuthSource) GetOidcJwksUrl() string { + if o == nil || IsNil(o.OidcJwksUrl) { + var ret string + return ret + } + return *o.OidcJwksUrl +} + +// GetOidcJwksUrlOk returns a tuple with the OidcJwksUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetOidcJwksUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcJwksUrl) { + return nil, false + } + return o.OidcJwksUrl, true +} + +// HasOidcJwksUrl returns a boolean if a field has been set. +func (o *OAuthSource) HasOidcJwksUrl() bool { + if o != nil && !IsNil(o.OidcJwksUrl) { + return true + } + + return false +} + +// SetOidcJwksUrl gets a reference to the given string and assigns it to the OidcJwksUrl field. +func (o *OAuthSource) SetOidcJwksUrl(v string) { + o.OidcJwksUrl = &v +} + +// GetOidcJwks returns the OidcJwks field value if set, zero value otherwise. +func (o *OAuthSource) GetOidcJwks() map[string]interface{} { + if o == nil || IsNil(o.OidcJwks) { + var ret map[string]interface{} + return ret + } + return o.OidcJwks +} + +// GetOidcJwksOk returns a tuple with the OidcJwks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetOidcJwksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.OidcJwks) { + return map[string]interface{}{}, false + } + return o.OidcJwks, true +} + +// HasOidcJwks returns a boolean if a field has been set. +func (o *OAuthSource) HasOidcJwks() bool { + if o != nil && !IsNil(o.OidcJwks) { + return true + } + + return false +} + +// SetOidcJwks gets a reference to the given map[string]interface{} and assigns it to the OidcJwks field. +func (o *OAuthSource) SetOidcJwks(v map[string]interface{}) { + o.OidcJwks = v +} + +// GetAuthorizationCodeAuthMethod returns the AuthorizationCodeAuthMethod field value if set, zero value otherwise. +func (o *OAuthSource) GetAuthorizationCodeAuthMethod() AuthorizationCodeAuthMethodEnum { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + var ret AuthorizationCodeAuthMethodEnum + return ret + } + return *o.AuthorizationCodeAuthMethod +} + +// GetAuthorizationCodeAuthMethodOk returns a tuple with the AuthorizationCodeAuthMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSource) GetAuthorizationCodeAuthMethodOk() (*AuthorizationCodeAuthMethodEnum, bool) { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + return nil, false + } + return o.AuthorizationCodeAuthMethod, true +} + +// HasAuthorizationCodeAuthMethod returns a boolean if a field has been set. +func (o *OAuthSource) HasAuthorizationCodeAuthMethod() bool { + if o != nil && !IsNil(o.AuthorizationCodeAuthMethod) { + return true + } + + return false +} + +// SetAuthorizationCodeAuthMethod gets a reference to the given AuthorizationCodeAuthMethodEnum and assigns it to the AuthorizationCodeAuthMethod field. +func (o *OAuthSource) SetAuthorizationCodeAuthMethod(v AuthorizationCodeAuthMethodEnum) { + o.AuthorizationCodeAuthMethod = &v +} + +func (o OAuthSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl.Get() + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["provider_type"] = o.ProviderType + if o.RequestTokenUrl.IsSet() { + toSerialize["request_token_url"] = o.RequestTokenUrl.Get() + } + if o.AuthorizationUrl.IsSet() { + toSerialize["authorization_url"] = o.AuthorizationUrl.Get() + } + if o.AccessTokenUrl.IsSet() { + toSerialize["access_token_url"] = o.AccessTokenUrl.Get() + } + if o.ProfileUrl.IsSet() { + toSerialize["profile_url"] = o.ProfileUrl.Get() + } + if !IsNil(o.Pkce) { + toSerialize["pkce"] = o.Pkce + } + toSerialize["consumer_key"] = o.ConsumerKey + toSerialize["callback_url"] = o.CallbackUrl + if !IsNil(o.AdditionalScopes) { + toSerialize["additional_scopes"] = o.AdditionalScopes + } + toSerialize["type"] = o.Type + if !IsNil(o.OidcWellKnownUrl) { + toSerialize["oidc_well_known_url"] = o.OidcWellKnownUrl + } + if !IsNil(o.OidcJwksUrl) { + toSerialize["oidc_jwks_url"] = o.OidcJwksUrl + } + if !IsNil(o.OidcJwks) { + toSerialize["oidc_jwks"] = o.OidcJwks + } + if !IsNil(o.AuthorizationCodeAuthMethod) { + toSerialize["authorization_code_auth_method"] = o.AuthorizationCodeAuthMethod + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "provider_type", + "consumer_key", + "callback_url", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthSource := _OAuthSource{} + + err = json.Unmarshal(data, &varOAuthSource) + + if err != nil { + return err + } + + *o = OAuthSource(varOAuthSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "provider_type") + delete(additionalProperties, "request_token_url") + delete(additionalProperties, "authorization_url") + delete(additionalProperties, "access_token_url") + delete(additionalProperties, "profile_url") + delete(additionalProperties, "pkce") + delete(additionalProperties, "consumer_key") + delete(additionalProperties, "callback_url") + delete(additionalProperties, "additional_scopes") + delete(additionalProperties, "type") + delete(additionalProperties, "oidc_well_known_url") + delete(additionalProperties, "oidc_jwks_url") + delete(additionalProperties, "oidc_jwks") + delete(additionalProperties, "authorization_code_auth_method") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthSource struct { + value *OAuthSource + isSet bool +} + +func (v NullableOAuthSource) Get() *OAuthSource { + return v.value +} + +func (v *NullableOAuthSource) Set(val *OAuthSource) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthSource) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthSource(val *OAuthSource) *NullableOAuthSource { + return &NullableOAuthSource{value: val, isSet: true} +} + +func (v NullableOAuthSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_source_property_mapping.go b/packages/client-go/model_o_auth_source_property_mapping.go new file mode 100644 index 0000000000..183476a864 --- /dev/null +++ b/packages/client-go/model_o_auth_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuthSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthSourcePropertyMapping{} + +// OAuthSourcePropertyMapping OAuthSourcePropertyMapping Serializer +type OAuthSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _OAuthSourcePropertyMapping OAuthSourcePropertyMapping + +// NewOAuthSourcePropertyMapping instantiates a new OAuthSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *OAuthSourcePropertyMapping { + this := OAuthSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewOAuthSourcePropertyMappingWithDefaults instantiates a new OAuthSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthSourcePropertyMappingWithDefaults() *OAuthSourcePropertyMapping { + this := OAuthSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *OAuthSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *OAuthSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *OAuthSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *OAuthSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *OAuthSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *OAuthSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *OAuthSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuthSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *OAuthSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *OAuthSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *OAuthSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *OAuthSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *OAuthSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *OAuthSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *OAuthSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *OAuthSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *OAuthSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *OAuthSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o OAuthSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthSourcePropertyMapping := _OAuthSourcePropertyMapping{} + + err = json.Unmarshal(data, &varOAuthSourcePropertyMapping) + + if err != nil { + return err + } + + *o = OAuthSourcePropertyMapping(varOAuthSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthSourcePropertyMapping struct { + value *OAuthSourcePropertyMapping + isSet bool +} + +func (v NullableOAuthSourcePropertyMapping) Get() *OAuthSourcePropertyMapping { + return v.value +} + +func (v *NullableOAuthSourcePropertyMapping) Set(val *OAuthSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthSourcePropertyMapping(val *OAuthSourcePropertyMapping) *NullableOAuthSourcePropertyMapping { + return &NullableOAuthSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableOAuthSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_source_property_mapping_request.go b/packages/client-go/model_o_auth_source_property_mapping_request.go new file mode 100644 index 0000000000..8a99b432b7 --- /dev/null +++ b/packages/client-go/model_o_auth_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuthSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthSourcePropertyMappingRequest{} + +// OAuthSourcePropertyMappingRequest OAuthSourcePropertyMapping Serializer +type OAuthSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _OAuthSourcePropertyMappingRequest OAuthSourcePropertyMappingRequest + +// NewOAuthSourcePropertyMappingRequest instantiates a new OAuthSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthSourcePropertyMappingRequest(name string, expression string) *OAuthSourcePropertyMappingRequest { + this := OAuthSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewOAuthSourcePropertyMappingRequestWithDefaults instantiates a new OAuthSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthSourcePropertyMappingRequestWithDefaults() *OAuthSourcePropertyMappingRequest { + this := OAuthSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *OAuthSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *OAuthSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *OAuthSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *OAuthSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *OAuthSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuthSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *OAuthSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *OAuthSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *OAuthSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o OAuthSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthSourcePropertyMappingRequest := _OAuthSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varOAuthSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = OAuthSourcePropertyMappingRequest(varOAuthSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthSourcePropertyMappingRequest struct { + value *OAuthSourcePropertyMappingRequest + isSet bool +} + +func (v NullableOAuthSourcePropertyMappingRequest) Get() *OAuthSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableOAuthSourcePropertyMappingRequest) Set(val *OAuthSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthSourcePropertyMappingRequest(val *OAuthSourcePropertyMappingRequest) *NullableOAuthSourcePropertyMappingRequest { + return &NullableOAuthSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableOAuthSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_o_auth_source_request.go b/packages/client-go/model_o_auth_source_request.go new file mode 100644 index 0000000000..7a34462324 --- /dev/null +++ b/packages/client-go/model_o_auth_source_request.go @@ -0,0 +1,1138 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OAuthSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OAuthSourceRequest{} + +// OAuthSourceRequest OAuth Source Serializer +type OAuthSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + ProviderType ProviderTypeEnum `json:"provider_type"` + // URL used to request the initial token. This URL is only required for OAuth 1. + RequestTokenUrl NullableString `json:"request_token_url,omitempty"` + // URL the user is redirect to to conest the flow. + AuthorizationUrl NullableString `json:"authorization_url,omitempty"` + // URL used by authentik to retrieve tokens. + AccessTokenUrl NullableString `json:"access_token_url,omitempty"` + // URL used by authentik to get user information. + ProfileUrl NullableString `json:"profile_url,omitempty"` + Pkce *PKCEMethodEnum `json:"pkce,omitempty"` + ConsumerKey string `json:"consumer_key"` + ConsumerSecret string `json:"consumer_secret"` + AdditionalScopes *string `json:"additional_scopes,omitempty"` + OidcWellKnownUrl *string `json:"oidc_well_known_url,omitempty"` + OidcJwksUrl *string `json:"oidc_jwks_url,omitempty"` + OidcJwks map[string]interface{} `json:"oidc_jwks,omitempty"` + // How to perform authentication during an authorization_code token request flow + AuthorizationCodeAuthMethod *AuthorizationCodeAuthMethodEnum `json:"authorization_code_auth_method,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OAuthSourceRequest OAuthSourceRequest + +// NewOAuthSourceRequest instantiates a new OAuthSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOAuthSourceRequest(name string, slug string, providerType ProviderTypeEnum, consumerKey string, consumerSecret string) *OAuthSourceRequest { + this := OAuthSourceRequest{} + this.Name = name + this.Slug = slug + this.ProviderType = providerType + this.ConsumerKey = consumerKey + this.ConsumerSecret = consumerSecret + return &this +} + +// NewOAuthSourceRequestWithDefaults instantiates a new OAuthSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOAuthSourceRequestWithDefaults() *OAuthSourceRequest { + this := OAuthSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *OAuthSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OAuthSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *OAuthSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *OAuthSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *OAuthSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *OAuthSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *OAuthSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *OAuthSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *OAuthSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *OAuthSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *OAuthSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *OAuthSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *OAuthSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *OAuthSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *OAuthSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *OAuthSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *OAuthSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *OAuthSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *OAuthSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetProviderType returns the ProviderType field value +func (o *OAuthSourceRequest) GetProviderType() ProviderTypeEnum { + if o == nil { + var ret ProviderTypeEnum + return ret + } + + return o.ProviderType +} + +// GetProviderTypeOk returns a tuple with the ProviderType field value +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetProviderTypeOk() (*ProviderTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.ProviderType, true +} + +// SetProviderType sets field value +func (o *OAuthSourceRequest) SetProviderType(v ProviderTypeEnum) { + o.ProviderType = v +} + +// GetRequestTokenUrl returns the RequestTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetRequestTokenUrl() string { + if o == nil || IsNil(o.RequestTokenUrl.Get()) { + var ret string + return ret + } + return *o.RequestTokenUrl.Get() +} + +// GetRequestTokenUrlOk returns a tuple with the RequestTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetRequestTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RequestTokenUrl.Get(), o.RequestTokenUrl.IsSet() +} + +// HasRequestTokenUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasRequestTokenUrl() bool { + if o != nil && o.RequestTokenUrl.IsSet() { + return true + } + + return false +} + +// SetRequestTokenUrl gets a reference to the given NullableString and assigns it to the RequestTokenUrl field. +func (o *OAuthSourceRequest) SetRequestTokenUrl(v string) { + o.RequestTokenUrl.Set(&v) +} + +// SetRequestTokenUrlNil sets the value for RequestTokenUrl to be an explicit nil +func (o *OAuthSourceRequest) SetRequestTokenUrlNil() { + o.RequestTokenUrl.Set(nil) +} + +// UnsetRequestTokenUrl ensures that no value is present for RequestTokenUrl, not even an explicit nil +func (o *OAuthSourceRequest) UnsetRequestTokenUrl() { + o.RequestTokenUrl.Unset() +} + +// GetAuthorizationUrl returns the AuthorizationUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetAuthorizationUrl() string { + if o == nil || IsNil(o.AuthorizationUrl.Get()) { + var ret string + return ret + } + return *o.AuthorizationUrl.Get() +} + +// GetAuthorizationUrlOk returns a tuple with the AuthorizationUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetAuthorizationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationUrl.Get(), o.AuthorizationUrl.IsSet() +} + +// HasAuthorizationUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasAuthorizationUrl() bool { + if o != nil && o.AuthorizationUrl.IsSet() { + return true + } + + return false +} + +// SetAuthorizationUrl gets a reference to the given NullableString and assigns it to the AuthorizationUrl field. +func (o *OAuthSourceRequest) SetAuthorizationUrl(v string) { + o.AuthorizationUrl.Set(&v) +} + +// SetAuthorizationUrlNil sets the value for AuthorizationUrl to be an explicit nil +func (o *OAuthSourceRequest) SetAuthorizationUrlNil() { + o.AuthorizationUrl.Set(nil) +} + +// UnsetAuthorizationUrl ensures that no value is present for AuthorizationUrl, not even an explicit nil +func (o *OAuthSourceRequest) UnsetAuthorizationUrl() { + o.AuthorizationUrl.Unset() +} + +// GetAccessTokenUrl returns the AccessTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetAccessTokenUrl() string { + if o == nil || IsNil(o.AccessTokenUrl.Get()) { + var ret string + return ret + } + return *o.AccessTokenUrl.Get() +} + +// GetAccessTokenUrlOk returns a tuple with the AccessTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetAccessTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessTokenUrl.Get(), o.AccessTokenUrl.IsSet() +} + +// HasAccessTokenUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasAccessTokenUrl() bool { + if o != nil && o.AccessTokenUrl.IsSet() { + return true + } + + return false +} + +// SetAccessTokenUrl gets a reference to the given NullableString and assigns it to the AccessTokenUrl field. +func (o *OAuthSourceRequest) SetAccessTokenUrl(v string) { + o.AccessTokenUrl.Set(&v) +} + +// SetAccessTokenUrlNil sets the value for AccessTokenUrl to be an explicit nil +func (o *OAuthSourceRequest) SetAccessTokenUrlNil() { + o.AccessTokenUrl.Set(nil) +} + +// UnsetAccessTokenUrl ensures that no value is present for AccessTokenUrl, not even an explicit nil +func (o *OAuthSourceRequest) UnsetAccessTokenUrl() { + o.AccessTokenUrl.Unset() +} + +// GetProfileUrl returns the ProfileUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OAuthSourceRequest) GetProfileUrl() string { + if o == nil || IsNil(o.ProfileUrl.Get()) { + var ret string + return ret + } + return *o.ProfileUrl.Get() +} + +// GetProfileUrlOk returns a tuple with the ProfileUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OAuthSourceRequest) GetProfileUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProfileUrl.Get(), o.ProfileUrl.IsSet() +} + +// HasProfileUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasProfileUrl() bool { + if o != nil && o.ProfileUrl.IsSet() { + return true + } + + return false +} + +// SetProfileUrl gets a reference to the given NullableString and assigns it to the ProfileUrl field. +func (o *OAuthSourceRequest) SetProfileUrl(v string) { + o.ProfileUrl.Set(&v) +} + +// SetProfileUrlNil sets the value for ProfileUrl to be an explicit nil +func (o *OAuthSourceRequest) SetProfileUrlNil() { + o.ProfileUrl.Set(nil) +} + +// UnsetProfileUrl ensures that no value is present for ProfileUrl, not even an explicit nil +func (o *OAuthSourceRequest) UnsetProfileUrl() { + o.ProfileUrl.Unset() +} + +// GetPkce returns the Pkce field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetPkce() PKCEMethodEnum { + if o == nil || IsNil(o.Pkce) { + var ret PKCEMethodEnum + return ret + } + return *o.Pkce +} + +// GetPkceOk returns a tuple with the Pkce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetPkceOk() (*PKCEMethodEnum, bool) { + if o == nil || IsNil(o.Pkce) { + return nil, false + } + return o.Pkce, true +} + +// HasPkce returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasPkce() bool { + if o != nil && !IsNil(o.Pkce) { + return true + } + + return false +} + +// SetPkce gets a reference to the given PKCEMethodEnum and assigns it to the Pkce field. +func (o *OAuthSourceRequest) SetPkce(v PKCEMethodEnum) { + o.Pkce = &v +} + +// GetConsumerKey returns the ConsumerKey field value +func (o *OAuthSourceRequest) GetConsumerKey() string { + if o == nil { + var ret string + return ret + } + + return o.ConsumerKey +} + +// GetConsumerKeyOk returns a tuple with the ConsumerKey field value +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetConsumerKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsumerKey, true +} + +// SetConsumerKey sets field value +func (o *OAuthSourceRequest) SetConsumerKey(v string) { + o.ConsumerKey = v +} + +// GetConsumerSecret returns the ConsumerSecret field value +func (o *OAuthSourceRequest) GetConsumerSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ConsumerSecret +} + +// GetConsumerSecretOk returns a tuple with the ConsumerSecret field value +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetConsumerSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsumerSecret, true +} + +// SetConsumerSecret sets field value +func (o *OAuthSourceRequest) SetConsumerSecret(v string) { + o.ConsumerSecret = v +} + +// GetAdditionalScopes returns the AdditionalScopes field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetAdditionalScopes() string { + if o == nil || IsNil(o.AdditionalScopes) { + var ret string + return ret + } + return *o.AdditionalScopes +} + +// GetAdditionalScopesOk returns a tuple with the AdditionalScopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetAdditionalScopesOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalScopes) { + return nil, false + } + return o.AdditionalScopes, true +} + +// HasAdditionalScopes returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasAdditionalScopes() bool { + if o != nil && !IsNil(o.AdditionalScopes) { + return true + } + + return false +} + +// SetAdditionalScopes gets a reference to the given string and assigns it to the AdditionalScopes field. +func (o *OAuthSourceRequest) SetAdditionalScopes(v string) { + o.AdditionalScopes = &v +} + +// GetOidcWellKnownUrl returns the OidcWellKnownUrl field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetOidcWellKnownUrl() string { + if o == nil || IsNil(o.OidcWellKnownUrl) { + var ret string + return ret + } + return *o.OidcWellKnownUrl +} + +// GetOidcWellKnownUrlOk returns a tuple with the OidcWellKnownUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetOidcWellKnownUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcWellKnownUrl) { + return nil, false + } + return o.OidcWellKnownUrl, true +} + +// HasOidcWellKnownUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasOidcWellKnownUrl() bool { + if o != nil && !IsNil(o.OidcWellKnownUrl) { + return true + } + + return false +} + +// SetOidcWellKnownUrl gets a reference to the given string and assigns it to the OidcWellKnownUrl field. +func (o *OAuthSourceRequest) SetOidcWellKnownUrl(v string) { + o.OidcWellKnownUrl = &v +} + +// GetOidcJwksUrl returns the OidcJwksUrl field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetOidcJwksUrl() string { + if o == nil || IsNil(o.OidcJwksUrl) { + var ret string + return ret + } + return *o.OidcJwksUrl +} + +// GetOidcJwksUrlOk returns a tuple with the OidcJwksUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetOidcJwksUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcJwksUrl) { + return nil, false + } + return o.OidcJwksUrl, true +} + +// HasOidcJwksUrl returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasOidcJwksUrl() bool { + if o != nil && !IsNil(o.OidcJwksUrl) { + return true + } + + return false +} + +// SetOidcJwksUrl gets a reference to the given string and assigns it to the OidcJwksUrl field. +func (o *OAuthSourceRequest) SetOidcJwksUrl(v string) { + o.OidcJwksUrl = &v +} + +// GetOidcJwks returns the OidcJwks field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetOidcJwks() map[string]interface{} { + if o == nil || IsNil(o.OidcJwks) { + var ret map[string]interface{} + return ret + } + return o.OidcJwks +} + +// GetOidcJwksOk returns a tuple with the OidcJwks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetOidcJwksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.OidcJwks) { + return map[string]interface{}{}, false + } + return o.OidcJwks, true +} + +// HasOidcJwks returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasOidcJwks() bool { + if o != nil && !IsNil(o.OidcJwks) { + return true + } + + return false +} + +// SetOidcJwks gets a reference to the given map[string]interface{} and assigns it to the OidcJwks field. +func (o *OAuthSourceRequest) SetOidcJwks(v map[string]interface{}) { + o.OidcJwks = v +} + +// GetAuthorizationCodeAuthMethod returns the AuthorizationCodeAuthMethod field value if set, zero value otherwise. +func (o *OAuthSourceRequest) GetAuthorizationCodeAuthMethod() AuthorizationCodeAuthMethodEnum { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + var ret AuthorizationCodeAuthMethodEnum + return ret + } + return *o.AuthorizationCodeAuthMethod +} + +// GetAuthorizationCodeAuthMethodOk returns a tuple with the AuthorizationCodeAuthMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OAuthSourceRequest) GetAuthorizationCodeAuthMethodOk() (*AuthorizationCodeAuthMethodEnum, bool) { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + return nil, false + } + return o.AuthorizationCodeAuthMethod, true +} + +// HasAuthorizationCodeAuthMethod returns a boolean if a field has been set. +func (o *OAuthSourceRequest) HasAuthorizationCodeAuthMethod() bool { + if o != nil && !IsNil(o.AuthorizationCodeAuthMethod) { + return true + } + + return false +} + +// SetAuthorizationCodeAuthMethod gets a reference to the given AuthorizationCodeAuthMethodEnum and assigns it to the AuthorizationCodeAuthMethod field. +func (o *OAuthSourceRequest) SetAuthorizationCodeAuthMethod(v AuthorizationCodeAuthMethodEnum) { + o.AuthorizationCodeAuthMethod = &v +} + +func (o OAuthSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OAuthSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["provider_type"] = o.ProviderType + if o.RequestTokenUrl.IsSet() { + toSerialize["request_token_url"] = o.RequestTokenUrl.Get() + } + if o.AuthorizationUrl.IsSet() { + toSerialize["authorization_url"] = o.AuthorizationUrl.Get() + } + if o.AccessTokenUrl.IsSet() { + toSerialize["access_token_url"] = o.AccessTokenUrl.Get() + } + if o.ProfileUrl.IsSet() { + toSerialize["profile_url"] = o.ProfileUrl.Get() + } + if !IsNil(o.Pkce) { + toSerialize["pkce"] = o.Pkce + } + toSerialize["consumer_key"] = o.ConsumerKey + toSerialize["consumer_secret"] = o.ConsumerSecret + if !IsNil(o.AdditionalScopes) { + toSerialize["additional_scopes"] = o.AdditionalScopes + } + if !IsNil(o.OidcWellKnownUrl) { + toSerialize["oidc_well_known_url"] = o.OidcWellKnownUrl + } + if !IsNil(o.OidcJwksUrl) { + toSerialize["oidc_jwks_url"] = o.OidcJwksUrl + } + if !IsNil(o.OidcJwks) { + toSerialize["oidc_jwks"] = o.OidcJwks + } + if !IsNil(o.AuthorizationCodeAuthMethod) { + toSerialize["authorization_code_auth_method"] = o.AuthorizationCodeAuthMethod + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OAuthSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "provider_type", + "consumer_key", + "consumer_secret", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOAuthSourceRequest := _OAuthSourceRequest{} + + err = json.Unmarshal(data, &varOAuthSourceRequest) + + if err != nil { + return err + } + + *o = OAuthSourceRequest(varOAuthSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "provider_type") + delete(additionalProperties, "request_token_url") + delete(additionalProperties, "authorization_url") + delete(additionalProperties, "access_token_url") + delete(additionalProperties, "profile_url") + delete(additionalProperties, "pkce") + delete(additionalProperties, "consumer_key") + delete(additionalProperties, "consumer_secret") + delete(additionalProperties, "additional_scopes") + delete(additionalProperties, "oidc_well_known_url") + delete(additionalProperties, "oidc_jwks_url") + delete(additionalProperties, "oidc_jwks") + delete(additionalProperties, "authorization_code_auth_method") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOAuthSourceRequest struct { + value *OAuthSourceRequest + isSet bool +} + +func (v NullableOAuthSourceRequest) Get() *OAuthSourceRequest { + return v.value +} + +func (v *NullableOAuthSourceRequest) Set(val *OAuthSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOAuthSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOAuthSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOAuthSourceRequest(val *OAuthSourceRequest) *NullableOAuthSourceRequest { + return &NullableOAuthSourceRequest{value: val, isSet: true} +} + +func (v NullableOAuthSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOAuthSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_open_id_connect_configuration.go b/packages/client-go/model_open_id_connect_configuration.go new file mode 100644 index 0000000000..8a071383e4 --- /dev/null +++ b/packages/client-go/model_open_id_connect_configuration.go @@ -0,0 +1,457 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OpenIDConnectConfiguration type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OpenIDConnectConfiguration{} + +// OpenIDConnectConfiguration rest_framework Serializer for OIDC Configuration +type OpenIDConnectConfiguration struct { + Issuer string `json:"issuer"` + AuthorizationEndpoint string `json:"authorization_endpoint"` + TokenEndpoint string `json:"token_endpoint"` + UserinfoEndpoint string `json:"userinfo_endpoint"` + EndSessionEndpoint string `json:"end_session_endpoint"` + IntrospectionEndpoint string `json:"introspection_endpoint"` + JwksUri string `json:"jwks_uri"` + ResponseTypesSupported []string `json:"response_types_supported"` + IdTokenSigningAlgValuesSupported []string `json:"id_token_signing_alg_values_supported"` + SubjectTypesSupported []string `json:"subject_types_supported"` + TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"` + AdditionalProperties map[string]interface{} +} + +type _OpenIDConnectConfiguration OpenIDConnectConfiguration + +// NewOpenIDConnectConfiguration instantiates a new OpenIDConnectConfiguration object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOpenIDConnectConfiguration(issuer string, authorizationEndpoint string, tokenEndpoint string, userinfoEndpoint string, endSessionEndpoint string, introspectionEndpoint string, jwksUri string, responseTypesSupported []string, idTokenSigningAlgValuesSupported []string, subjectTypesSupported []string, tokenEndpointAuthMethodsSupported []string) *OpenIDConnectConfiguration { + this := OpenIDConnectConfiguration{} + this.Issuer = issuer + this.AuthorizationEndpoint = authorizationEndpoint + this.TokenEndpoint = tokenEndpoint + this.UserinfoEndpoint = userinfoEndpoint + this.EndSessionEndpoint = endSessionEndpoint + this.IntrospectionEndpoint = introspectionEndpoint + this.JwksUri = jwksUri + this.ResponseTypesSupported = responseTypesSupported + this.IdTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported + this.SubjectTypesSupported = subjectTypesSupported + this.TokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported + return &this +} + +// NewOpenIDConnectConfigurationWithDefaults instantiates a new OpenIDConnectConfiguration object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOpenIDConnectConfigurationWithDefaults() *OpenIDConnectConfiguration { + this := OpenIDConnectConfiguration{} + return &this +} + +// GetIssuer returns the Issuer field value +func (o *OpenIDConnectConfiguration) GetIssuer() string { + if o == nil { + var ret string + return ret + } + + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetIssuerOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Issuer, true +} + +// SetIssuer sets field value +func (o *OpenIDConnectConfiguration) SetIssuer(v string) { + o.Issuer = v +} + +// GetAuthorizationEndpoint returns the AuthorizationEndpoint field value +func (o *OpenIDConnectConfiguration) GetAuthorizationEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationEndpoint +} + +// GetAuthorizationEndpointOk returns a tuple with the AuthorizationEndpoint field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetAuthorizationEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationEndpoint, true +} + +// SetAuthorizationEndpoint sets field value +func (o *OpenIDConnectConfiguration) SetAuthorizationEndpoint(v string) { + o.AuthorizationEndpoint = v +} + +// GetTokenEndpoint returns the TokenEndpoint field value +func (o *OpenIDConnectConfiguration) GetTokenEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.TokenEndpoint +} + +// GetTokenEndpointOk returns a tuple with the TokenEndpoint field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetTokenEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenEndpoint, true +} + +// SetTokenEndpoint sets field value +func (o *OpenIDConnectConfiguration) SetTokenEndpoint(v string) { + o.TokenEndpoint = v +} + +// GetUserinfoEndpoint returns the UserinfoEndpoint field value +func (o *OpenIDConnectConfiguration) GetUserinfoEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.UserinfoEndpoint +} + +// GetUserinfoEndpointOk returns a tuple with the UserinfoEndpoint field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetUserinfoEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserinfoEndpoint, true +} + +// SetUserinfoEndpoint sets field value +func (o *OpenIDConnectConfiguration) SetUserinfoEndpoint(v string) { + o.UserinfoEndpoint = v +} + +// GetEndSessionEndpoint returns the EndSessionEndpoint field value +func (o *OpenIDConnectConfiguration) GetEndSessionEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.EndSessionEndpoint +} + +// GetEndSessionEndpointOk returns a tuple with the EndSessionEndpoint field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetEndSessionEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EndSessionEndpoint, true +} + +// SetEndSessionEndpoint sets field value +func (o *OpenIDConnectConfiguration) SetEndSessionEndpoint(v string) { + o.EndSessionEndpoint = v +} + +// GetIntrospectionEndpoint returns the IntrospectionEndpoint field value +func (o *OpenIDConnectConfiguration) GetIntrospectionEndpoint() string { + if o == nil { + var ret string + return ret + } + + return o.IntrospectionEndpoint +} + +// GetIntrospectionEndpointOk returns a tuple with the IntrospectionEndpoint field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetIntrospectionEndpointOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IntrospectionEndpoint, true +} + +// SetIntrospectionEndpoint sets field value +func (o *OpenIDConnectConfiguration) SetIntrospectionEndpoint(v string) { + o.IntrospectionEndpoint = v +} + +// GetJwksUri returns the JwksUri field value +func (o *OpenIDConnectConfiguration) GetJwksUri() string { + if o == nil { + var ret string + return ret + } + + return o.JwksUri +} + +// GetJwksUriOk returns a tuple with the JwksUri field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetJwksUriOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.JwksUri, true +} + +// SetJwksUri sets field value +func (o *OpenIDConnectConfiguration) SetJwksUri(v string) { + o.JwksUri = v +} + +// GetResponseTypesSupported returns the ResponseTypesSupported field value +func (o *OpenIDConnectConfiguration) GetResponseTypesSupported() []string { + if o == nil { + var ret []string + return ret + } + + return o.ResponseTypesSupported +} + +// GetResponseTypesSupportedOk returns a tuple with the ResponseTypesSupported field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetResponseTypesSupportedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ResponseTypesSupported, true +} + +// SetResponseTypesSupported sets field value +func (o *OpenIDConnectConfiguration) SetResponseTypesSupported(v []string) { + o.ResponseTypesSupported = v +} + +// GetIdTokenSigningAlgValuesSupported returns the IdTokenSigningAlgValuesSupported field value +func (o *OpenIDConnectConfiguration) GetIdTokenSigningAlgValuesSupported() []string { + if o == nil { + var ret []string + return ret + } + + return o.IdTokenSigningAlgValuesSupported +} + +// GetIdTokenSigningAlgValuesSupportedOk returns a tuple with the IdTokenSigningAlgValuesSupported field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetIdTokenSigningAlgValuesSupportedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.IdTokenSigningAlgValuesSupported, true +} + +// SetIdTokenSigningAlgValuesSupported sets field value +func (o *OpenIDConnectConfiguration) SetIdTokenSigningAlgValuesSupported(v []string) { + o.IdTokenSigningAlgValuesSupported = v +} + +// GetSubjectTypesSupported returns the SubjectTypesSupported field value +func (o *OpenIDConnectConfiguration) GetSubjectTypesSupported() []string { + if o == nil { + var ret []string + return ret + } + + return o.SubjectTypesSupported +} + +// GetSubjectTypesSupportedOk returns a tuple with the SubjectTypesSupported field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetSubjectTypesSupportedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.SubjectTypesSupported, true +} + +// SetSubjectTypesSupported sets field value +func (o *OpenIDConnectConfiguration) SetSubjectTypesSupported(v []string) { + o.SubjectTypesSupported = v +} + +// GetTokenEndpointAuthMethodsSupported returns the TokenEndpointAuthMethodsSupported field value +func (o *OpenIDConnectConfiguration) GetTokenEndpointAuthMethodsSupported() []string { + if o == nil { + var ret []string + return ret + } + + return o.TokenEndpointAuthMethodsSupported +} + +// GetTokenEndpointAuthMethodsSupportedOk returns a tuple with the TokenEndpointAuthMethodsSupported field value +// and a boolean to check if the value has been set. +func (o *OpenIDConnectConfiguration) GetTokenEndpointAuthMethodsSupportedOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.TokenEndpointAuthMethodsSupported, true +} + +// SetTokenEndpointAuthMethodsSupported sets field value +func (o *OpenIDConnectConfiguration) SetTokenEndpointAuthMethodsSupported(v []string) { + o.TokenEndpointAuthMethodsSupported = v +} + +func (o OpenIDConnectConfiguration) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OpenIDConnectConfiguration) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["issuer"] = o.Issuer + toSerialize["authorization_endpoint"] = o.AuthorizationEndpoint + toSerialize["token_endpoint"] = o.TokenEndpoint + toSerialize["userinfo_endpoint"] = o.UserinfoEndpoint + toSerialize["end_session_endpoint"] = o.EndSessionEndpoint + toSerialize["introspection_endpoint"] = o.IntrospectionEndpoint + toSerialize["jwks_uri"] = o.JwksUri + toSerialize["response_types_supported"] = o.ResponseTypesSupported + toSerialize["id_token_signing_alg_values_supported"] = o.IdTokenSigningAlgValuesSupported + toSerialize["subject_types_supported"] = o.SubjectTypesSupported + toSerialize["token_endpoint_auth_methods_supported"] = o.TokenEndpointAuthMethodsSupported + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OpenIDConnectConfiguration) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "issuer", + "authorization_endpoint", + "token_endpoint", + "userinfo_endpoint", + "end_session_endpoint", + "introspection_endpoint", + "jwks_uri", + "response_types_supported", + "id_token_signing_alg_values_supported", + "subject_types_supported", + "token_endpoint_auth_methods_supported", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOpenIDConnectConfiguration := _OpenIDConnectConfiguration{} + + err = json.Unmarshal(data, &varOpenIDConnectConfiguration) + + if err != nil { + return err + } + + *o = OpenIDConnectConfiguration(varOpenIDConnectConfiguration) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "issuer") + delete(additionalProperties, "authorization_endpoint") + delete(additionalProperties, "token_endpoint") + delete(additionalProperties, "userinfo_endpoint") + delete(additionalProperties, "end_session_endpoint") + delete(additionalProperties, "introspection_endpoint") + delete(additionalProperties, "jwks_uri") + delete(additionalProperties, "response_types_supported") + delete(additionalProperties, "id_token_signing_alg_values_supported") + delete(additionalProperties, "subject_types_supported") + delete(additionalProperties, "token_endpoint_auth_methods_supported") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOpenIDConnectConfiguration struct { + value *OpenIDConnectConfiguration + isSet bool +} + +func (v NullableOpenIDConnectConfiguration) Get() *OpenIDConnectConfiguration { + return v.value +} + +func (v *NullableOpenIDConnectConfiguration) Set(val *OpenIDConnectConfiguration) { + v.value = val + v.isSet = true +} + +func (v NullableOpenIDConnectConfiguration) IsSet() bool { + return v.isSet +} + +func (v *NullableOpenIDConnectConfiguration) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOpenIDConnectConfiguration(val *OpenIDConnectConfiguration) *NullableOpenIDConnectConfiguration { + return &NullableOpenIDConnectConfiguration{value: val, isSet: true} +} + +func (v NullableOpenIDConnectConfiguration) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOpenIDConnectConfiguration) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_operating_system.go b/packages/client-go/model_operating_system.go new file mode 100644 index 0000000000..f45fb39264 --- /dev/null +++ b/packages/client-go/model_operating_system.go @@ -0,0 +1,280 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OperatingSystem type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperatingSystem{} + +// OperatingSystem For example: {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 LTS (Noble Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} +type OperatingSystem struct { + Family DeviceFactsOSFamily `json:"family"` + // Operating System name, such as 'Server 2022' or 'Ubuntu' + Name *string `json:"name,omitempty"` + // Operating System version, must always be the version number but may contain build name + Version *string `json:"version,omitempty"` + Arch *string `json:"arch,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OperatingSystem OperatingSystem + +// NewOperatingSystem instantiates a new OperatingSystem object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperatingSystem(family DeviceFactsOSFamily) *OperatingSystem { + this := OperatingSystem{} + this.Family = family + return &this +} + +// NewOperatingSystemWithDefaults instantiates a new OperatingSystem object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperatingSystemWithDefaults() *OperatingSystem { + this := OperatingSystem{} + return &this +} + +// GetFamily returns the Family field value +func (o *OperatingSystem) GetFamily() DeviceFactsOSFamily { + if o == nil { + var ret DeviceFactsOSFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetFamilyOk() (*DeviceFactsOSFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *OperatingSystem) SetFamily(v DeviceFactsOSFamily) { + o.Family = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OperatingSystem) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OperatingSystem) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OperatingSystem) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *OperatingSystem) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *OperatingSystem) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *OperatingSystem) SetVersion(v string) { + o.Version = &v +} + +// GetArch returns the Arch field value if set, zero value otherwise. +func (o *OperatingSystem) GetArch() string { + if o == nil || IsNil(o.Arch) { + var ret string + return ret + } + return *o.Arch +} + +// GetArchOk returns a tuple with the Arch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystem) GetArchOk() (*string, bool) { + if o == nil || IsNil(o.Arch) { + return nil, false + } + return o.Arch, true +} + +// HasArch returns a boolean if a field has been set. +func (o *OperatingSystem) HasArch() bool { + if o != nil && !IsNil(o.Arch) { + return true + } + + return false +} + +// SetArch gets a reference to the given string and assigns it to the Arch field. +func (o *OperatingSystem) SetArch(v string) { + o.Arch = &v +} + +func (o OperatingSystem) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperatingSystem) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.Arch) { + toSerialize["arch"] = o.Arch + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OperatingSystem) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperatingSystem := _OperatingSystem{} + + err = json.Unmarshal(data, &varOperatingSystem) + + if err != nil { + return err + } + + *o = OperatingSystem(varOperatingSystem) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "name") + delete(additionalProperties, "version") + delete(additionalProperties, "arch") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOperatingSystem struct { + value *OperatingSystem + isSet bool +} + +func (v NullableOperatingSystem) Get() *OperatingSystem { + return v.value +} + +func (v *NullableOperatingSystem) Set(val *OperatingSystem) { + v.value = val + v.isSet = true +} + +func (v NullableOperatingSystem) IsSet() bool { + return v.isSet +} + +func (v *NullableOperatingSystem) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperatingSystem(val *OperatingSystem) *NullableOperatingSystem { + return &NullableOperatingSystem{value: val, isSet: true} +} + +func (v NullableOperatingSystem) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperatingSystem) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_operating_system_request.go b/packages/client-go/model_operating_system_request.go new file mode 100644 index 0000000000..3be9feacdd --- /dev/null +++ b/packages/client-go/model_operating_system_request.go @@ -0,0 +1,280 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OperatingSystemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OperatingSystemRequest{} + +// OperatingSystemRequest For example: {\"family\":\"linux\",\"name\":\"Ubuntu\",\"version\":\"24.04.3 LTS (Noble Numbat)\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"windows\",\"name\":\"Server 2022 Datacenter\",\"version\":\"10.0.20348.4405\",\"arch\":\"amd64\"} {\"family\": \"mac_os\", \"name\": \"\", \"version\": \"26.2\", \"arch\": \"arm64\"} +type OperatingSystemRequest struct { + Family DeviceFactsOSFamily `json:"family"` + // Operating System name, such as 'Server 2022' or 'Ubuntu' + Name *string `json:"name,omitempty"` + // Operating System version, must always be the version number but may contain build name + Version *string `json:"version,omitempty"` + Arch *string `json:"arch,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OperatingSystemRequest OperatingSystemRequest + +// NewOperatingSystemRequest instantiates a new OperatingSystemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOperatingSystemRequest(family DeviceFactsOSFamily) *OperatingSystemRequest { + this := OperatingSystemRequest{} + this.Family = family + return &this +} + +// NewOperatingSystemRequestWithDefaults instantiates a new OperatingSystemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOperatingSystemRequestWithDefaults() *OperatingSystemRequest { + this := OperatingSystemRequest{} + return &this +} + +// GetFamily returns the Family field value +func (o *OperatingSystemRequest) GetFamily() DeviceFactsOSFamily { + if o == nil { + var ret DeviceFactsOSFamily + return ret + } + + return o.Family +} + +// GetFamilyOk returns a tuple with the Family field value +// and a boolean to check if the value has been set. +func (o *OperatingSystemRequest) GetFamilyOk() (*DeviceFactsOSFamily, bool) { + if o == nil { + return nil, false + } + return &o.Family, true +} + +// SetFamily sets field value +func (o *OperatingSystemRequest) SetFamily(v DeviceFactsOSFamily) { + o.Family = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *OperatingSystemRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystemRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *OperatingSystemRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *OperatingSystemRequest) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *OperatingSystemRequest) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystemRequest) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *OperatingSystemRequest) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *OperatingSystemRequest) SetVersion(v string) { + o.Version = &v +} + +// GetArch returns the Arch field value if set, zero value otherwise. +func (o *OperatingSystemRequest) GetArch() string { + if o == nil || IsNil(o.Arch) { + var ret string + return ret + } + return *o.Arch +} + +// GetArchOk returns a tuple with the Arch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *OperatingSystemRequest) GetArchOk() (*string, bool) { + if o == nil || IsNil(o.Arch) { + return nil, false + } + return o.Arch, true +} + +// HasArch returns a boolean if a field has been set. +func (o *OperatingSystemRequest) HasArch() bool { + if o != nil && !IsNil(o.Arch) { + return true + } + + return false +} + +// SetArch gets a reference to the given string and assigns it to the Arch field. +func (o *OperatingSystemRequest) SetArch(v string) { + o.Arch = &v +} + +func (o OperatingSystemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OperatingSystemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["family"] = o.Family + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + if !IsNil(o.Arch) { + toSerialize["arch"] = o.Arch + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OperatingSystemRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "family", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOperatingSystemRequest := _OperatingSystemRequest{} + + err = json.Unmarshal(data, &varOperatingSystemRequest) + + if err != nil { + return err + } + + *o = OperatingSystemRequest(varOperatingSystemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "family") + delete(additionalProperties, "name") + delete(additionalProperties, "version") + delete(additionalProperties, "arch") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOperatingSystemRequest struct { + value *OperatingSystemRequest + isSet bool +} + +func (v NullableOperatingSystemRequest) Get() *OperatingSystemRequest { + return v.value +} + +func (v *NullableOperatingSystemRequest) Set(val *OperatingSystemRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOperatingSystemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOperatingSystemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOperatingSystemRequest(val *OperatingSystemRequest) *NullableOperatingSystemRequest { + return &NullableOperatingSystemRequest{value: val, isSet: true} +} + +func (v NullableOperatingSystemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOperatingSystemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outgoing_sync_delete_action.go b/packages/client-go/model_outgoing_sync_delete_action.go new file mode 100644 index 0000000000..a269c8d817 --- /dev/null +++ b/packages/client-go/model_outgoing_sync_delete_action.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// OutgoingSyncDeleteAction the model 'OutgoingSyncDeleteAction' +type OutgoingSyncDeleteAction string + +// List of OutgoingSyncDeleteAction +const ( + OUTGOINGSYNCDELETEACTION_DO_NOTHING OutgoingSyncDeleteAction = "do_nothing" + OUTGOINGSYNCDELETEACTION_DELETE OutgoingSyncDeleteAction = "delete" + OUTGOINGSYNCDELETEACTION_SUSPEND OutgoingSyncDeleteAction = "suspend" +) + +// All allowed values of OutgoingSyncDeleteAction enum +var AllowedOutgoingSyncDeleteActionEnumValues = []OutgoingSyncDeleteAction{ + "do_nothing", + "delete", + "suspend", +} + +func (v *OutgoingSyncDeleteAction) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OutgoingSyncDeleteAction(value) + for _, existing := range AllowedOutgoingSyncDeleteActionEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OutgoingSyncDeleteAction", value) +} + +// NewOutgoingSyncDeleteActionFromValue returns a pointer to a valid OutgoingSyncDeleteAction +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOutgoingSyncDeleteActionFromValue(v string) (*OutgoingSyncDeleteAction, error) { + ev := OutgoingSyncDeleteAction(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OutgoingSyncDeleteAction: valid values are %v", v, AllowedOutgoingSyncDeleteActionEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OutgoingSyncDeleteAction) IsValid() bool { + for _, existing := range AllowedOutgoingSyncDeleteActionEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OutgoingSyncDeleteAction value +func (v OutgoingSyncDeleteAction) Ptr() *OutgoingSyncDeleteAction { + return &v +} + +type NullableOutgoingSyncDeleteAction struct { + value *OutgoingSyncDeleteAction + isSet bool +} + +func (v NullableOutgoingSyncDeleteAction) Get() *OutgoingSyncDeleteAction { + return v.value +} + +func (v *NullableOutgoingSyncDeleteAction) Set(val *OutgoingSyncDeleteAction) { + v.value = val + v.isSet = true +} + +func (v NullableOutgoingSyncDeleteAction) IsSet() bool { + return v.isSet +} + +func (v *NullableOutgoingSyncDeleteAction) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutgoingSyncDeleteAction(val *OutgoingSyncDeleteAction) *NullableOutgoingSyncDeleteAction { + return &NullableOutgoingSyncDeleteAction{value: val, isSet: true} +} + +func (v NullableOutgoingSyncDeleteAction) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutgoingSyncDeleteAction) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outpost.go b/packages/client-go/model_outpost.go new file mode 100644 index 0000000000..d43ba1b096 --- /dev/null +++ b/packages/client-go/model_outpost.go @@ -0,0 +1,500 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Outpost type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Outpost{} + +// Outpost Outpost Serializer +type Outpost struct { + Pk string `json:"pk"` + Name string `json:"name"` + Type OutpostTypeEnum `json:"type"` + Providers []int32 `json:"providers"` + ProvidersObj []Provider `json:"providers_obj"` + // Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment. + ServiceConnection NullableString `json:"service_connection,omitempty"` + ServiceConnectionObj NullableServiceConnection `json:"service_connection_obj"` + RefreshIntervalS int32 `json:"refresh_interval_s"` + // Get Token identifier + TokenIdentifier string `json:"token_identifier"` + Config map[string]interface{} `json:"config"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Outpost Outpost + +// NewOutpost instantiates a new Outpost object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutpost(pk string, name string, type_ OutpostTypeEnum, providers []int32, providersObj []Provider, serviceConnectionObj NullableServiceConnection, refreshIntervalS int32, tokenIdentifier string, config map[string]interface{}) *Outpost { + this := Outpost{} + this.Pk = pk + this.Name = name + this.Type = type_ + this.Providers = providers + this.ProvidersObj = providersObj + this.ServiceConnectionObj = serviceConnectionObj + this.RefreshIntervalS = refreshIntervalS + this.TokenIdentifier = tokenIdentifier + this.Config = config + return &this +} + +// NewOutpostWithDefaults instantiates a new Outpost object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutpostWithDefaults() *Outpost { + this := Outpost{} + return &this +} + +// GetPk returns the Pk field value +func (o *Outpost) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Outpost) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Outpost) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Outpost) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *Outpost) GetType() OutpostTypeEnum { + if o == nil { + var ret OutpostTypeEnum + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetTypeOk() (*OutpostTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Outpost) SetType(v OutpostTypeEnum) { + o.Type = v +} + +// GetProviders returns the Providers field value +func (o *Outpost) GetProviders() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Providers +} + +// GetProvidersOk returns a tuple with the Providers field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetProvidersOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Providers, true +} + +// SetProviders sets field value +func (o *Outpost) SetProviders(v []int32) { + o.Providers = v +} + +// GetProvidersObj returns the ProvidersObj field value +func (o *Outpost) GetProvidersObj() []Provider { + if o == nil { + var ret []Provider + return ret + } + + return o.ProvidersObj +} + +// GetProvidersObjOk returns a tuple with the ProvidersObj field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetProvidersObjOk() ([]Provider, bool) { + if o == nil { + return nil, false + } + return o.ProvidersObj, true +} + +// SetProvidersObj sets field value +func (o *Outpost) SetProvidersObj(v []Provider) { + o.ProvidersObj = v +} + +// GetServiceConnection returns the ServiceConnection field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Outpost) GetServiceConnection() string { + if o == nil || IsNil(o.ServiceConnection.Get()) { + var ret string + return ret + } + return *o.ServiceConnection.Get() +} + +// GetServiceConnectionOk returns a tuple with the ServiceConnection field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Outpost) GetServiceConnectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ServiceConnection.Get(), o.ServiceConnection.IsSet() +} + +// HasServiceConnection returns a boolean if a field has been set. +func (o *Outpost) HasServiceConnection() bool { + if o != nil && o.ServiceConnection.IsSet() { + return true + } + + return false +} + +// SetServiceConnection gets a reference to the given NullableString and assigns it to the ServiceConnection field. +func (o *Outpost) SetServiceConnection(v string) { + o.ServiceConnection.Set(&v) +} + +// SetServiceConnectionNil sets the value for ServiceConnection to be an explicit nil +func (o *Outpost) SetServiceConnectionNil() { + o.ServiceConnection.Set(nil) +} + +// UnsetServiceConnection ensures that no value is present for ServiceConnection, not even an explicit nil +func (o *Outpost) UnsetServiceConnection() { + o.ServiceConnection.Unset() +} + +// GetServiceConnectionObj returns the ServiceConnectionObj field value +// If the value is explicit nil, the zero value for ServiceConnection will be returned +func (o *Outpost) GetServiceConnectionObj() ServiceConnection { + if o == nil || o.ServiceConnectionObj.Get() == nil { + var ret ServiceConnection + return ret + } + + return *o.ServiceConnectionObj.Get() +} + +// GetServiceConnectionObjOk returns a tuple with the ServiceConnectionObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Outpost) GetServiceConnectionObjOk() (*ServiceConnection, bool) { + if o == nil { + return nil, false + } + return o.ServiceConnectionObj.Get(), o.ServiceConnectionObj.IsSet() +} + +// SetServiceConnectionObj sets field value +func (o *Outpost) SetServiceConnectionObj(v ServiceConnection) { + o.ServiceConnectionObj.Set(&v) +} + +// GetRefreshIntervalS returns the RefreshIntervalS field value +func (o *Outpost) GetRefreshIntervalS() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.RefreshIntervalS +} + +// GetRefreshIntervalSOk returns a tuple with the RefreshIntervalS field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetRefreshIntervalSOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RefreshIntervalS, true +} + +// SetRefreshIntervalS sets field value +func (o *Outpost) SetRefreshIntervalS(v int32) { + o.RefreshIntervalS = v +} + +// GetTokenIdentifier returns the TokenIdentifier field value +func (o *Outpost) GetTokenIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.TokenIdentifier +} + +// GetTokenIdentifierOk returns a tuple with the TokenIdentifier field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetTokenIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TokenIdentifier, true +} + +// SetTokenIdentifier sets field value +func (o *Outpost) SetTokenIdentifier(v string) { + o.TokenIdentifier = v +} + +// GetConfig returns the Config field value +func (o *Outpost) GetConfig() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *Outpost) GetConfigOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Config, true +} + +// SetConfig sets field value +func (o *Outpost) SetConfig(v map[string]interface{}) { + o.Config = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Outpost) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Outpost) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *Outpost) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *Outpost) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *Outpost) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *Outpost) UnsetManaged() { + o.Managed.Unset() +} + +func (o Outpost) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Outpost) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["providers"] = o.Providers + toSerialize["providers_obj"] = o.ProvidersObj + if o.ServiceConnection.IsSet() { + toSerialize["service_connection"] = o.ServiceConnection.Get() + } + toSerialize["service_connection_obj"] = o.ServiceConnectionObj.Get() + toSerialize["refresh_interval_s"] = o.RefreshIntervalS + toSerialize["token_identifier"] = o.TokenIdentifier + toSerialize["config"] = o.Config + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Outpost) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "type", + "providers", + "providers_obj", + "service_connection_obj", + "refresh_interval_s", + "token_identifier", + "config", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOutpost := _Outpost{} + + err = json.Unmarshal(data, &varOutpost) + + if err != nil { + return err + } + + *o = Outpost(varOutpost) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "providers") + delete(additionalProperties, "providers_obj") + delete(additionalProperties, "service_connection") + delete(additionalProperties, "service_connection_obj") + delete(additionalProperties, "refresh_interval_s") + delete(additionalProperties, "token_identifier") + delete(additionalProperties, "config") + delete(additionalProperties, "managed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOutpost struct { + value *Outpost + isSet bool +} + +func (v NullableOutpost) Get() *Outpost { + return v.value +} + +func (v *NullableOutpost) Set(val *Outpost) { + v.value = val + v.isSet = true +} + +func (v NullableOutpost) IsSet() bool { + return v.isSet +} + +func (v *NullableOutpost) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutpost(val *Outpost) *NullableOutpost { + return &NullableOutpost{value: val, isSet: true} +} + +func (v NullableOutpost) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutpost) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outpost_default_config.go b/packages/client-go/model_outpost_default_config.go new file mode 100644 index 0000000000..a474db4132 --- /dev/null +++ b/packages/client-go/model_outpost_default_config.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OutpostDefaultConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutpostDefaultConfig{} + +// OutpostDefaultConfig Global default outpost config +type OutpostDefaultConfig struct { + Config map[string]interface{} `json:"config"` + AdditionalProperties map[string]interface{} +} + +type _OutpostDefaultConfig OutpostDefaultConfig + +// NewOutpostDefaultConfig instantiates a new OutpostDefaultConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutpostDefaultConfig(config map[string]interface{}) *OutpostDefaultConfig { + this := OutpostDefaultConfig{} + this.Config = config + return &this +} + +// NewOutpostDefaultConfigWithDefaults instantiates a new OutpostDefaultConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutpostDefaultConfigWithDefaults() *OutpostDefaultConfig { + this := OutpostDefaultConfig{} + return &this +} + +// GetConfig returns the Config field value +func (o *OutpostDefaultConfig) GetConfig() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *OutpostDefaultConfig) GetConfigOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Config, true +} + +// SetConfig sets field value +func (o *OutpostDefaultConfig) SetConfig(v map[string]interface{}) { + o.Config = v +} + +func (o OutpostDefaultConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OutpostDefaultConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["config"] = o.Config + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OutpostDefaultConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "config", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOutpostDefaultConfig := _OutpostDefaultConfig{} + + err = json.Unmarshal(data, &varOutpostDefaultConfig) + + if err != nil { + return err + } + + *o = OutpostDefaultConfig(varOutpostDefaultConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "config") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOutpostDefaultConfig struct { + value *OutpostDefaultConfig + isSet bool +} + +func (v NullableOutpostDefaultConfig) Get() *OutpostDefaultConfig { + return v.value +} + +func (v *NullableOutpostDefaultConfig) Set(val *OutpostDefaultConfig) { + v.value = val + v.isSet = true +} + +func (v NullableOutpostDefaultConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableOutpostDefaultConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutpostDefaultConfig(val *OutpostDefaultConfig) *NullableOutpostDefaultConfig { + return &NullableOutpostDefaultConfig{value: val, isSet: true} +} + +func (v NullableOutpostDefaultConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutpostDefaultConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outpost_health.go b/packages/client-go/model_outpost_health.go new file mode 100644 index 0000000000..148af858fe --- /dev/null +++ b/packages/client-go/model_outpost_health.go @@ -0,0 +1,490 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the OutpostHealth type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutpostHealth{} + +// OutpostHealth Outpost health status +type OutpostHealth struct { + Uid string `json:"uid"` + LastSeen time.Time `json:"last_seen"` + Version string `json:"version"` + GolangVersion string `json:"golang_version"` + OpensslEnabled bool `json:"openssl_enabled"` + OpensslVersion string `json:"openssl_version"` + // Get FIPS enabled + FipsEnabled NullableBool `json:"fips_enabled"` + VersionShould string `json:"version_should"` + VersionOutdated bool `json:"version_outdated"` + BuildHash string `json:"build_hash"` + BuildHashShould string `json:"build_hash_should"` + Hostname string `json:"hostname"` + AdditionalProperties map[string]interface{} +} + +type _OutpostHealth OutpostHealth + +// NewOutpostHealth instantiates a new OutpostHealth object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutpostHealth(uid string, lastSeen time.Time, version string, golangVersion string, opensslEnabled bool, opensslVersion string, fipsEnabled NullableBool, versionShould string, versionOutdated bool, buildHash string, buildHashShould string, hostname string) *OutpostHealth { + this := OutpostHealth{} + this.Uid = uid + this.LastSeen = lastSeen + this.Version = version + this.GolangVersion = golangVersion + this.OpensslEnabled = opensslEnabled + this.OpensslVersion = opensslVersion + this.FipsEnabled = fipsEnabled + this.VersionShould = versionShould + this.VersionOutdated = versionOutdated + this.BuildHash = buildHash + this.BuildHashShould = buildHashShould + this.Hostname = hostname + return &this +} + +// NewOutpostHealthWithDefaults instantiates a new OutpostHealth object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutpostHealthWithDefaults() *OutpostHealth { + this := OutpostHealth{} + return &this +} + +// GetUid returns the Uid field value +func (o *OutpostHealth) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *OutpostHealth) SetUid(v string) { + o.Uid = v +} + +// GetLastSeen returns the LastSeen field value +func (o *OutpostHealth) GetLastSeen() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastSeen +} + +// GetLastSeenOk returns a tuple with the LastSeen field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetLastSeenOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastSeen, true +} + +// SetLastSeen sets field value +func (o *OutpostHealth) SetLastSeen(v time.Time) { + o.LastSeen = v +} + +// GetVersion returns the Version field value +func (o *OutpostHealth) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *OutpostHealth) SetVersion(v string) { + o.Version = v +} + +// GetGolangVersion returns the GolangVersion field value +func (o *OutpostHealth) GetGolangVersion() string { + if o == nil { + var ret string + return ret + } + + return o.GolangVersion +} + +// GetGolangVersionOk returns a tuple with the GolangVersion field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetGolangVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GolangVersion, true +} + +// SetGolangVersion sets field value +func (o *OutpostHealth) SetGolangVersion(v string) { + o.GolangVersion = v +} + +// GetOpensslEnabled returns the OpensslEnabled field value +func (o *OutpostHealth) GetOpensslEnabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.OpensslEnabled +} + +// GetOpensslEnabledOk returns a tuple with the OpensslEnabled field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetOpensslEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.OpensslEnabled, true +} + +// SetOpensslEnabled sets field value +func (o *OutpostHealth) SetOpensslEnabled(v bool) { + o.OpensslEnabled = v +} + +// GetOpensslVersion returns the OpensslVersion field value +func (o *OutpostHealth) GetOpensslVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OpensslVersion +} + +// GetOpensslVersionOk returns a tuple with the OpensslVersion field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetOpensslVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OpensslVersion, true +} + +// SetOpensslVersion sets field value +func (o *OutpostHealth) SetOpensslVersion(v string) { + o.OpensslVersion = v +} + +// GetFipsEnabled returns the FipsEnabled field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *OutpostHealth) GetFipsEnabled() bool { + if o == nil || o.FipsEnabled.Get() == nil { + var ret bool + return ret + } + + return *o.FipsEnabled.Get() +} + +// GetFipsEnabledOk returns a tuple with the FipsEnabled field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OutpostHealth) GetFipsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.FipsEnabled.Get(), o.FipsEnabled.IsSet() +} + +// SetFipsEnabled sets field value +func (o *OutpostHealth) SetFipsEnabled(v bool) { + o.FipsEnabled.Set(&v) +} + +// GetVersionShould returns the VersionShould field value +func (o *OutpostHealth) GetVersionShould() string { + if o == nil { + var ret string + return ret + } + + return o.VersionShould +} + +// GetVersionShouldOk returns a tuple with the VersionShould field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetVersionShouldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VersionShould, true +} + +// SetVersionShould sets field value +func (o *OutpostHealth) SetVersionShould(v string) { + o.VersionShould = v +} + +// GetVersionOutdated returns the VersionOutdated field value +func (o *OutpostHealth) GetVersionOutdated() bool { + if o == nil { + var ret bool + return ret + } + + return o.VersionOutdated +} + +// GetVersionOutdatedOk returns a tuple with the VersionOutdated field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetVersionOutdatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.VersionOutdated, true +} + +// SetVersionOutdated sets field value +func (o *OutpostHealth) SetVersionOutdated(v bool) { + o.VersionOutdated = v +} + +// GetBuildHash returns the BuildHash field value +func (o *OutpostHealth) GetBuildHash() string { + if o == nil { + var ret string + return ret + } + + return o.BuildHash +} + +// GetBuildHashOk returns a tuple with the BuildHash field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetBuildHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildHash, true +} + +// SetBuildHash sets field value +func (o *OutpostHealth) SetBuildHash(v string) { + o.BuildHash = v +} + +// GetBuildHashShould returns the BuildHashShould field value +func (o *OutpostHealth) GetBuildHashShould() string { + if o == nil { + var ret string + return ret + } + + return o.BuildHashShould +} + +// GetBuildHashShouldOk returns a tuple with the BuildHashShould field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetBuildHashShouldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildHashShould, true +} + +// SetBuildHashShould sets field value +func (o *OutpostHealth) SetBuildHashShould(v string) { + o.BuildHashShould = v +} + +// GetHostname returns the Hostname field value +func (o *OutpostHealth) GetHostname() string { + if o == nil { + var ret string + return ret + } + + return o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value +// and a boolean to check if the value has been set. +func (o *OutpostHealth) GetHostnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hostname, true +} + +// SetHostname sets field value +func (o *OutpostHealth) SetHostname(v string) { + o.Hostname = v +} + +func (o OutpostHealth) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OutpostHealth) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["uid"] = o.Uid + toSerialize["last_seen"] = o.LastSeen + toSerialize["version"] = o.Version + toSerialize["golang_version"] = o.GolangVersion + toSerialize["openssl_enabled"] = o.OpensslEnabled + toSerialize["openssl_version"] = o.OpensslVersion + toSerialize["fips_enabled"] = o.FipsEnabled.Get() + toSerialize["version_should"] = o.VersionShould + toSerialize["version_outdated"] = o.VersionOutdated + toSerialize["build_hash"] = o.BuildHash + toSerialize["build_hash_should"] = o.BuildHashShould + toSerialize["hostname"] = o.Hostname + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OutpostHealth) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "uid", + "last_seen", + "version", + "golang_version", + "openssl_enabled", + "openssl_version", + "fips_enabled", + "version_should", + "version_outdated", + "build_hash", + "build_hash_should", + "hostname", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOutpostHealth := _OutpostHealth{} + + err = json.Unmarshal(data, &varOutpostHealth) + + if err != nil { + return err + } + + *o = OutpostHealth(varOutpostHealth) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "uid") + delete(additionalProperties, "last_seen") + delete(additionalProperties, "version") + delete(additionalProperties, "golang_version") + delete(additionalProperties, "openssl_enabled") + delete(additionalProperties, "openssl_version") + delete(additionalProperties, "fips_enabled") + delete(additionalProperties, "version_should") + delete(additionalProperties, "version_outdated") + delete(additionalProperties, "build_hash") + delete(additionalProperties, "build_hash_should") + delete(additionalProperties, "hostname") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOutpostHealth struct { + value *OutpostHealth + isSet bool +} + +func (v NullableOutpostHealth) Get() *OutpostHealth { + return v.value +} + +func (v *NullableOutpostHealth) Set(val *OutpostHealth) { + v.value = val + v.isSet = true +} + +func (v NullableOutpostHealth) IsSet() bool { + return v.isSet +} + +func (v *NullableOutpostHealth) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutpostHealth(val *OutpostHealth) *NullableOutpostHealth { + return &NullableOutpostHealth{value: val, isSet: true} +} + +func (v NullableOutpostHealth) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutpostHealth) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outpost_request.go b/packages/client-go/model_outpost_request.go new file mode 100644 index 0000000000..cc0c1d2a60 --- /dev/null +++ b/packages/client-go/model_outpost_request.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the OutpostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &OutpostRequest{} + +// OutpostRequest Outpost Serializer +type OutpostRequest struct { + Name string `json:"name"` + Type OutpostTypeEnum `json:"type"` + Providers []int32 `json:"providers"` + // Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment. + ServiceConnection NullableString `json:"service_connection,omitempty"` + Config map[string]interface{} `json:"config"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _OutpostRequest OutpostRequest + +// NewOutpostRequest instantiates a new OutpostRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewOutpostRequest(name string, type_ OutpostTypeEnum, providers []int32, config map[string]interface{}) *OutpostRequest { + this := OutpostRequest{} + this.Name = name + this.Type = type_ + this.Providers = providers + this.Config = config + return &this +} + +// NewOutpostRequestWithDefaults instantiates a new OutpostRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewOutpostRequestWithDefaults() *OutpostRequest { + this := OutpostRequest{} + return &this +} + +// GetName returns the Name field value +func (o *OutpostRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *OutpostRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *OutpostRequest) SetName(v string) { + o.Name = v +} + +// GetType returns the Type field value +func (o *OutpostRequest) GetType() OutpostTypeEnum { + if o == nil { + var ret OutpostTypeEnum + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *OutpostRequest) GetTypeOk() (*OutpostTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *OutpostRequest) SetType(v OutpostTypeEnum) { + o.Type = v +} + +// GetProviders returns the Providers field value +func (o *OutpostRequest) GetProviders() []int32 { + if o == nil { + var ret []int32 + return ret + } + + return o.Providers +} + +// GetProvidersOk returns a tuple with the Providers field value +// and a boolean to check if the value has been set. +func (o *OutpostRequest) GetProvidersOk() ([]int32, bool) { + if o == nil { + return nil, false + } + return o.Providers, true +} + +// SetProviders sets field value +func (o *OutpostRequest) SetProviders(v []int32) { + o.Providers = v +} + +// GetServiceConnection returns the ServiceConnection field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OutpostRequest) GetServiceConnection() string { + if o == nil || IsNil(o.ServiceConnection.Get()) { + var ret string + return ret + } + return *o.ServiceConnection.Get() +} + +// GetServiceConnectionOk returns a tuple with the ServiceConnection field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OutpostRequest) GetServiceConnectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ServiceConnection.Get(), o.ServiceConnection.IsSet() +} + +// HasServiceConnection returns a boolean if a field has been set. +func (o *OutpostRequest) HasServiceConnection() bool { + if o != nil && o.ServiceConnection.IsSet() { + return true + } + + return false +} + +// SetServiceConnection gets a reference to the given NullableString and assigns it to the ServiceConnection field. +func (o *OutpostRequest) SetServiceConnection(v string) { + o.ServiceConnection.Set(&v) +} + +// SetServiceConnectionNil sets the value for ServiceConnection to be an explicit nil +func (o *OutpostRequest) SetServiceConnectionNil() { + o.ServiceConnection.Set(nil) +} + +// UnsetServiceConnection ensures that no value is present for ServiceConnection, not even an explicit nil +func (o *OutpostRequest) UnsetServiceConnection() { + o.ServiceConnection.Unset() +} + +// GetConfig returns the Config field value +func (o *OutpostRequest) GetConfig() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value +// and a boolean to check if the value has been set. +func (o *OutpostRequest) GetConfigOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Config, true +} + +// SetConfig sets field value +func (o *OutpostRequest) SetConfig(v map[string]interface{}) { + o.Config = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *OutpostRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *OutpostRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *OutpostRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *OutpostRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *OutpostRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *OutpostRequest) UnsetManaged() { + o.Managed.Unset() +} + +func (o OutpostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o OutpostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["type"] = o.Type + toSerialize["providers"] = o.Providers + if o.ServiceConnection.IsSet() { + toSerialize["service_connection"] = o.ServiceConnection.Get() + } + toSerialize["config"] = o.Config + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *OutpostRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "type", + "providers", + "config", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varOutpostRequest := _OutpostRequest{} + + err = json.Unmarshal(data, &varOutpostRequest) + + if err != nil { + return err + } + + *o = OutpostRequest(varOutpostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "providers") + delete(additionalProperties, "service_connection") + delete(additionalProperties, "config") + delete(additionalProperties, "managed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableOutpostRequest struct { + value *OutpostRequest + isSet bool +} + +func (v NullableOutpostRequest) Get() *OutpostRequest { + return v.value +} + +func (v *NullableOutpostRequest) Set(val *OutpostRequest) { + v.value = val + v.isSet = true +} + +func (v NullableOutpostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableOutpostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutpostRequest(val *OutpostRequest) *NullableOutpostRequest { + return &NullableOutpostRequest{value: val, isSet: true} +} + +func (v NullableOutpostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutpostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_outpost_type_enum.go b/packages/client-go/model_outpost_type_enum.go new file mode 100644 index 0000000000..7b4e8dbb15 --- /dev/null +++ b/packages/client-go/model_outpost_type_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// OutpostTypeEnum the model 'OutpostTypeEnum' +type OutpostTypeEnum string + +// List of OutpostTypeEnum +const ( + OUTPOSTTYPEENUM_PROXY OutpostTypeEnum = "proxy" + OUTPOSTTYPEENUM_LDAP OutpostTypeEnum = "ldap" + OUTPOSTTYPEENUM_RADIUS OutpostTypeEnum = "radius" + OUTPOSTTYPEENUM_RAC OutpostTypeEnum = "rac" +) + +// All allowed values of OutpostTypeEnum enum +var AllowedOutpostTypeEnumEnumValues = []OutpostTypeEnum{ + "proxy", + "ldap", + "radius", + "rac", +} + +func (v *OutpostTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := OutpostTypeEnum(value) + for _, existing := range AllowedOutpostTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid OutpostTypeEnum", value) +} + +// NewOutpostTypeEnumFromValue returns a pointer to a valid OutpostTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewOutpostTypeEnumFromValue(v string) (*OutpostTypeEnum, error) { + ev := OutpostTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for OutpostTypeEnum: valid values are %v", v, AllowedOutpostTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v OutpostTypeEnum) IsValid() bool { + for _, existing := range AllowedOutpostTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to OutpostTypeEnum value +func (v OutpostTypeEnum) Ptr() *OutpostTypeEnum { + return &v +} + +type NullableOutpostTypeEnum struct { + value *OutpostTypeEnum + isSet bool +} + +func (v NullableOutpostTypeEnum) Get() *OutpostTypeEnum { + return v.value +} + +func (v *NullableOutpostTypeEnum) Set(val *OutpostTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableOutpostTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableOutpostTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableOutpostTypeEnum(val *OutpostTypeEnum) *NullableOutpostTypeEnum { + return &NullableOutpostTypeEnum{value: val, isSet: true} +} + +func (v NullableOutpostTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableOutpostTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_agent_connector_list.go b/packages/client-go/model_paginated_agent_connector_list.go new file mode 100644 index 0000000000..199e04b2a4 --- /dev/null +++ b/packages/client-go/model_paginated_agent_connector_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAgentConnectorList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAgentConnectorList{} + +// PaginatedAgentConnectorList struct for PaginatedAgentConnectorList +type PaginatedAgentConnectorList struct { + Pagination Pagination `json:"pagination"` + Results []AgentConnector `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAgentConnectorList PaginatedAgentConnectorList + +// NewPaginatedAgentConnectorList instantiates a new PaginatedAgentConnectorList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAgentConnectorList(pagination Pagination, results []AgentConnector, autocomplete map[string]interface{}) *PaginatedAgentConnectorList { + this := PaginatedAgentConnectorList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAgentConnectorListWithDefaults instantiates a new PaginatedAgentConnectorList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAgentConnectorListWithDefaults() *PaginatedAgentConnectorList { + this := PaginatedAgentConnectorList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAgentConnectorList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAgentConnectorList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAgentConnectorList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAgentConnectorList) GetResults() []AgentConnector { + if o == nil { + var ret []AgentConnector + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAgentConnectorList) GetResultsOk() ([]AgentConnector, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAgentConnectorList) SetResults(v []AgentConnector) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAgentConnectorList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAgentConnectorList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAgentConnectorList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAgentConnectorList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAgentConnectorList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAgentConnectorList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAgentConnectorList := _PaginatedAgentConnectorList{} + + err = json.Unmarshal(data, &varPaginatedAgentConnectorList) + + if err != nil { + return err + } + + *o = PaginatedAgentConnectorList(varPaginatedAgentConnectorList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAgentConnectorList struct { + value *PaginatedAgentConnectorList + isSet bool +} + +func (v NullablePaginatedAgentConnectorList) Get() *PaginatedAgentConnectorList { + return v.value +} + +func (v *NullablePaginatedAgentConnectorList) Set(val *PaginatedAgentConnectorList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAgentConnectorList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAgentConnectorList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAgentConnectorList(val *PaginatedAgentConnectorList) *NullablePaginatedAgentConnectorList { + return &NullablePaginatedAgentConnectorList{value: val, isSet: true} +} + +func (v NullablePaginatedAgentConnectorList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAgentConnectorList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_application_entitlement_list.go b/packages/client-go/model_paginated_application_entitlement_list.go new file mode 100644 index 0000000000..2355e7a68b --- /dev/null +++ b/packages/client-go/model_paginated_application_entitlement_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedApplicationEntitlementList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedApplicationEntitlementList{} + +// PaginatedApplicationEntitlementList struct for PaginatedApplicationEntitlementList +type PaginatedApplicationEntitlementList struct { + Pagination Pagination `json:"pagination"` + Results []ApplicationEntitlement `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedApplicationEntitlementList PaginatedApplicationEntitlementList + +// NewPaginatedApplicationEntitlementList instantiates a new PaginatedApplicationEntitlementList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedApplicationEntitlementList(pagination Pagination, results []ApplicationEntitlement, autocomplete map[string]interface{}) *PaginatedApplicationEntitlementList { + this := PaginatedApplicationEntitlementList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedApplicationEntitlementListWithDefaults instantiates a new PaginatedApplicationEntitlementList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedApplicationEntitlementListWithDefaults() *PaginatedApplicationEntitlementList { + this := PaginatedApplicationEntitlementList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedApplicationEntitlementList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationEntitlementList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedApplicationEntitlementList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedApplicationEntitlementList) GetResults() []ApplicationEntitlement { + if o == nil { + var ret []ApplicationEntitlement + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationEntitlementList) GetResultsOk() ([]ApplicationEntitlement, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedApplicationEntitlementList) SetResults(v []ApplicationEntitlement) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedApplicationEntitlementList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationEntitlementList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedApplicationEntitlementList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedApplicationEntitlementList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedApplicationEntitlementList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedApplicationEntitlementList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedApplicationEntitlementList := _PaginatedApplicationEntitlementList{} + + err = json.Unmarshal(data, &varPaginatedApplicationEntitlementList) + + if err != nil { + return err + } + + *o = PaginatedApplicationEntitlementList(varPaginatedApplicationEntitlementList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedApplicationEntitlementList struct { + value *PaginatedApplicationEntitlementList + isSet bool +} + +func (v NullablePaginatedApplicationEntitlementList) Get() *PaginatedApplicationEntitlementList { + return v.value +} + +func (v *NullablePaginatedApplicationEntitlementList) Set(val *PaginatedApplicationEntitlementList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedApplicationEntitlementList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedApplicationEntitlementList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedApplicationEntitlementList(val *PaginatedApplicationEntitlementList) *NullablePaginatedApplicationEntitlementList { + return &NullablePaginatedApplicationEntitlementList{value: val, isSet: true} +} + +func (v NullablePaginatedApplicationEntitlementList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedApplicationEntitlementList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_application_list.go b/packages/client-go/model_paginated_application_list.go new file mode 100644 index 0000000000..7c8be1de01 --- /dev/null +++ b/packages/client-go/model_paginated_application_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedApplicationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedApplicationList{} + +// PaginatedApplicationList struct for PaginatedApplicationList +type PaginatedApplicationList struct { + Pagination Pagination `json:"pagination"` + Results []Application `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedApplicationList PaginatedApplicationList + +// NewPaginatedApplicationList instantiates a new PaginatedApplicationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedApplicationList(pagination Pagination, results []Application, autocomplete map[string]interface{}) *PaginatedApplicationList { + this := PaginatedApplicationList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedApplicationListWithDefaults instantiates a new PaginatedApplicationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedApplicationListWithDefaults() *PaginatedApplicationList { + this := PaginatedApplicationList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedApplicationList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedApplicationList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedApplicationList) GetResults() []Application { + if o == nil { + var ret []Application + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationList) GetResultsOk() ([]Application, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedApplicationList) SetResults(v []Application) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedApplicationList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedApplicationList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedApplicationList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedApplicationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedApplicationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedApplicationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedApplicationList := _PaginatedApplicationList{} + + err = json.Unmarshal(data, &varPaginatedApplicationList) + + if err != nil { + return err + } + + *o = PaginatedApplicationList(varPaginatedApplicationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedApplicationList struct { + value *PaginatedApplicationList + isSet bool +} + +func (v NullablePaginatedApplicationList) Get() *PaginatedApplicationList { + return v.value +} + +func (v *NullablePaginatedApplicationList) Set(val *PaginatedApplicationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedApplicationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedApplicationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedApplicationList(val *PaginatedApplicationList) *NullablePaginatedApplicationList { + return &NullablePaginatedApplicationList{value: val, isSet: true} +} + +func (v NullablePaginatedApplicationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedApplicationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticated_session_list.go b/packages/client-go/model_paginated_authenticated_session_list.go new file mode 100644 index 0000000000..8c3ec87224 --- /dev/null +++ b/packages/client-go/model_paginated_authenticated_session_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatedSessionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatedSessionList{} + +// PaginatedAuthenticatedSessionList struct for PaginatedAuthenticatedSessionList +type PaginatedAuthenticatedSessionList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatedSession `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatedSessionList PaginatedAuthenticatedSessionList + +// NewPaginatedAuthenticatedSessionList instantiates a new PaginatedAuthenticatedSessionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatedSessionList(pagination Pagination, results []AuthenticatedSession, autocomplete map[string]interface{}) *PaginatedAuthenticatedSessionList { + this := PaginatedAuthenticatedSessionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatedSessionListWithDefaults instantiates a new PaginatedAuthenticatedSessionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatedSessionListWithDefaults() *PaginatedAuthenticatedSessionList { + this := PaginatedAuthenticatedSessionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatedSessionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatedSessionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatedSessionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatedSessionList) GetResults() []AuthenticatedSession { + if o == nil { + var ret []AuthenticatedSession + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatedSessionList) GetResultsOk() ([]AuthenticatedSession, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatedSessionList) SetResults(v []AuthenticatedSession) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatedSessionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatedSessionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatedSessionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatedSessionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatedSessionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatedSessionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatedSessionList := _PaginatedAuthenticatedSessionList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatedSessionList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatedSessionList(varPaginatedAuthenticatedSessionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatedSessionList struct { + value *PaginatedAuthenticatedSessionList + isSet bool +} + +func (v NullablePaginatedAuthenticatedSessionList) Get() *PaginatedAuthenticatedSessionList { + return v.value +} + +func (v *NullablePaginatedAuthenticatedSessionList) Set(val *PaginatedAuthenticatedSessionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatedSessionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatedSessionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatedSessionList(val *PaginatedAuthenticatedSessionList) *NullablePaginatedAuthenticatedSessionList { + return &NullablePaginatedAuthenticatedSessionList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatedSessionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatedSessionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_duo_stage_list.go b/packages/client-go/model_paginated_authenticator_duo_stage_list.go new file mode 100644 index 0000000000..d447b3b2b9 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_duo_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorDuoStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorDuoStageList{} + +// PaginatedAuthenticatorDuoStageList struct for PaginatedAuthenticatorDuoStageList +type PaginatedAuthenticatorDuoStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorDuoStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorDuoStageList PaginatedAuthenticatorDuoStageList + +// NewPaginatedAuthenticatorDuoStageList instantiates a new PaginatedAuthenticatorDuoStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorDuoStageList(pagination Pagination, results []AuthenticatorDuoStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorDuoStageList { + this := PaginatedAuthenticatorDuoStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorDuoStageListWithDefaults instantiates a new PaginatedAuthenticatorDuoStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorDuoStageListWithDefaults() *PaginatedAuthenticatorDuoStageList { + this := PaginatedAuthenticatorDuoStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorDuoStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorDuoStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorDuoStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorDuoStageList) GetResults() []AuthenticatorDuoStage { + if o == nil { + var ret []AuthenticatorDuoStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorDuoStageList) GetResultsOk() ([]AuthenticatorDuoStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorDuoStageList) SetResults(v []AuthenticatorDuoStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorDuoStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorDuoStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorDuoStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorDuoStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorDuoStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorDuoStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorDuoStageList := _PaginatedAuthenticatorDuoStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorDuoStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorDuoStageList(varPaginatedAuthenticatorDuoStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorDuoStageList struct { + value *PaginatedAuthenticatorDuoStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorDuoStageList) Get() *PaginatedAuthenticatorDuoStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorDuoStageList) Set(val *PaginatedAuthenticatorDuoStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorDuoStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorDuoStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorDuoStageList(val *PaginatedAuthenticatorDuoStageList) *NullablePaginatedAuthenticatorDuoStageList { + return &NullablePaginatedAuthenticatorDuoStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorDuoStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorDuoStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_email_stage_list.go b/packages/client-go/model_paginated_authenticator_email_stage_list.go new file mode 100644 index 0000000000..89ed9fa623 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_email_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorEmailStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorEmailStageList{} + +// PaginatedAuthenticatorEmailStageList struct for PaginatedAuthenticatorEmailStageList +type PaginatedAuthenticatorEmailStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorEmailStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorEmailStageList PaginatedAuthenticatorEmailStageList + +// NewPaginatedAuthenticatorEmailStageList instantiates a new PaginatedAuthenticatorEmailStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorEmailStageList(pagination Pagination, results []AuthenticatorEmailStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorEmailStageList { + this := PaginatedAuthenticatorEmailStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorEmailStageListWithDefaults instantiates a new PaginatedAuthenticatorEmailStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorEmailStageListWithDefaults() *PaginatedAuthenticatorEmailStageList { + this := PaginatedAuthenticatorEmailStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorEmailStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEmailStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorEmailStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorEmailStageList) GetResults() []AuthenticatorEmailStage { + if o == nil { + var ret []AuthenticatorEmailStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEmailStageList) GetResultsOk() ([]AuthenticatorEmailStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorEmailStageList) SetResults(v []AuthenticatorEmailStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorEmailStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEmailStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorEmailStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorEmailStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorEmailStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorEmailStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorEmailStageList := _PaginatedAuthenticatorEmailStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorEmailStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorEmailStageList(varPaginatedAuthenticatorEmailStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorEmailStageList struct { + value *PaginatedAuthenticatorEmailStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorEmailStageList) Get() *PaginatedAuthenticatorEmailStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorEmailStageList) Set(val *PaginatedAuthenticatorEmailStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorEmailStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorEmailStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorEmailStageList(val *PaginatedAuthenticatorEmailStageList) *NullablePaginatedAuthenticatorEmailStageList { + return &NullablePaginatedAuthenticatorEmailStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorEmailStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorEmailStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_endpoint_gdtc_stage_list.go b/packages/client-go/model_paginated_authenticator_endpoint_gdtc_stage_list.go new file mode 100644 index 0000000000..de80423dc3 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_endpoint_gdtc_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorEndpointGDTCStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorEndpointGDTCStageList{} + +// PaginatedAuthenticatorEndpointGDTCStageList struct for PaginatedAuthenticatorEndpointGDTCStageList +type PaginatedAuthenticatorEndpointGDTCStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorEndpointGDTCStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorEndpointGDTCStageList PaginatedAuthenticatorEndpointGDTCStageList + +// NewPaginatedAuthenticatorEndpointGDTCStageList instantiates a new PaginatedAuthenticatorEndpointGDTCStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorEndpointGDTCStageList(pagination Pagination, results []AuthenticatorEndpointGDTCStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorEndpointGDTCStageList { + this := PaginatedAuthenticatorEndpointGDTCStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorEndpointGDTCStageListWithDefaults instantiates a new PaginatedAuthenticatorEndpointGDTCStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorEndpointGDTCStageListWithDefaults() *PaginatedAuthenticatorEndpointGDTCStageList { + this := PaginatedAuthenticatorEndpointGDTCStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetResults() []AuthenticatorEndpointGDTCStage { + if o == nil { + var ret []AuthenticatorEndpointGDTCStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetResultsOk() ([]AuthenticatorEndpointGDTCStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) SetResults(v []AuthenticatorEndpointGDTCStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorEndpointGDTCStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorEndpointGDTCStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorEndpointGDTCStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorEndpointGDTCStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorEndpointGDTCStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorEndpointGDTCStageList := _PaginatedAuthenticatorEndpointGDTCStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorEndpointGDTCStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorEndpointGDTCStageList(varPaginatedAuthenticatorEndpointGDTCStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorEndpointGDTCStageList struct { + value *PaginatedAuthenticatorEndpointGDTCStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorEndpointGDTCStageList) Get() *PaginatedAuthenticatorEndpointGDTCStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorEndpointGDTCStageList) Set(val *PaginatedAuthenticatorEndpointGDTCStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorEndpointGDTCStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorEndpointGDTCStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorEndpointGDTCStageList(val *PaginatedAuthenticatorEndpointGDTCStageList) *NullablePaginatedAuthenticatorEndpointGDTCStageList { + return &NullablePaginatedAuthenticatorEndpointGDTCStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorEndpointGDTCStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorEndpointGDTCStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_sms_stage_list.go b/packages/client-go/model_paginated_authenticator_sms_stage_list.go new file mode 100644 index 0000000000..de40d0a7c4 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_sms_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorSMSStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorSMSStageList{} + +// PaginatedAuthenticatorSMSStageList struct for PaginatedAuthenticatorSMSStageList +type PaginatedAuthenticatorSMSStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorSMSStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorSMSStageList PaginatedAuthenticatorSMSStageList + +// NewPaginatedAuthenticatorSMSStageList instantiates a new PaginatedAuthenticatorSMSStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorSMSStageList(pagination Pagination, results []AuthenticatorSMSStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorSMSStageList { + this := PaginatedAuthenticatorSMSStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorSMSStageListWithDefaults instantiates a new PaginatedAuthenticatorSMSStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorSMSStageListWithDefaults() *PaginatedAuthenticatorSMSStageList { + this := PaginatedAuthenticatorSMSStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorSMSStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorSMSStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorSMSStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorSMSStageList) GetResults() []AuthenticatorSMSStage { + if o == nil { + var ret []AuthenticatorSMSStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorSMSStageList) GetResultsOk() ([]AuthenticatorSMSStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorSMSStageList) SetResults(v []AuthenticatorSMSStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorSMSStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorSMSStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorSMSStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorSMSStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorSMSStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorSMSStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorSMSStageList := _PaginatedAuthenticatorSMSStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorSMSStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorSMSStageList(varPaginatedAuthenticatorSMSStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorSMSStageList struct { + value *PaginatedAuthenticatorSMSStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorSMSStageList) Get() *PaginatedAuthenticatorSMSStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorSMSStageList) Set(val *PaginatedAuthenticatorSMSStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorSMSStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorSMSStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorSMSStageList(val *PaginatedAuthenticatorSMSStageList) *NullablePaginatedAuthenticatorSMSStageList { + return &NullablePaginatedAuthenticatorSMSStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorSMSStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorSMSStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_static_stage_list.go b/packages/client-go/model_paginated_authenticator_static_stage_list.go new file mode 100644 index 0000000000..2526e09b78 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_static_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorStaticStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorStaticStageList{} + +// PaginatedAuthenticatorStaticStageList struct for PaginatedAuthenticatorStaticStageList +type PaginatedAuthenticatorStaticStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorStaticStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorStaticStageList PaginatedAuthenticatorStaticStageList + +// NewPaginatedAuthenticatorStaticStageList instantiates a new PaginatedAuthenticatorStaticStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorStaticStageList(pagination Pagination, results []AuthenticatorStaticStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorStaticStageList { + this := PaginatedAuthenticatorStaticStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorStaticStageListWithDefaults instantiates a new PaginatedAuthenticatorStaticStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorStaticStageListWithDefaults() *PaginatedAuthenticatorStaticStageList { + this := PaginatedAuthenticatorStaticStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorStaticStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorStaticStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorStaticStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorStaticStageList) GetResults() []AuthenticatorStaticStage { + if o == nil { + var ret []AuthenticatorStaticStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorStaticStageList) GetResultsOk() ([]AuthenticatorStaticStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorStaticStageList) SetResults(v []AuthenticatorStaticStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorStaticStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorStaticStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorStaticStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorStaticStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorStaticStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorStaticStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorStaticStageList := _PaginatedAuthenticatorStaticStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorStaticStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorStaticStageList(varPaginatedAuthenticatorStaticStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorStaticStageList struct { + value *PaginatedAuthenticatorStaticStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorStaticStageList) Get() *PaginatedAuthenticatorStaticStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorStaticStageList) Set(val *PaginatedAuthenticatorStaticStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorStaticStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorStaticStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorStaticStageList(val *PaginatedAuthenticatorStaticStageList) *NullablePaginatedAuthenticatorStaticStageList { + return &NullablePaginatedAuthenticatorStaticStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorStaticStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorStaticStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_totp_stage_list.go b/packages/client-go/model_paginated_authenticator_totp_stage_list.go new file mode 100644 index 0000000000..5b473065d5 --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_totp_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorTOTPStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorTOTPStageList{} + +// PaginatedAuthenticatorTOTPStageList struct for PaginatedAuthenticatorTOTPStageList +type PaginatedAuthenticatorTOTPStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorTOTPStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorTOTPStageList PaginatedAuthenticatorTOTPStageList + +// NewPaginatedAuthenticatorTOTPStageList instantiates a new PaginatedAuthenticatorTOTPStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorTOTPStageList(pagination Pagination, results []AuthenticatorTOTPStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorTOTPStageList { + this := PaginatedAuthenticatorTOTPStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorTOTPStageListWithDefaults instantiates a new PaginatedAuthenticatorTOTPStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorTOTPStageListWithDefaults() *PaginatedAuthenticatorTOTPStageList { + this := PaginatedAuthenticatorTOTPStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorTOTPStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorTOTPStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorTOTPStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorTOTPStageList) GetResults() []AuthenticatorTOTPStage { + if o == nil { + var ret []AuthenticatorTOTPStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorTOTPStageList) GetResultsOk() ([]AuthenticatorTOTPStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorTOTPStageList) SetResults(v []AuthenticatorTOTPStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorTOTPStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorTOTPStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorTOTPStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorTOTPStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorTOTPStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorTOTPStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorTOTPStageList := _PaginatedAuthenticatorTOTPStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorTOTPStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorTOTPStageList(varPaginatedAuthenticatorTOTPStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorTOTPStageList struct { + value *PaginatedAuthenticatorTOTPStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorTOTPStageList) Get() *PaginatedAuthenticatorTOTPStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorTOTPStageList) Set(val *PaginatedAuthenticatorTOTPStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorTOTPStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorTOTPStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorTOTPStageList(val *PaginatedAuthenticatorTOTPStageList) *NullablePaginatedAuthenticatorTOTPStageList { + return &NullablePaginatedAuthenticatorTOTPStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorTOTPStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorTOTPStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_validate_stage_list.go b/packages/client-go/model_paginated_authenticator_validate_stage_list.go new file mode 100644 index 0000000000..b39b354b2a --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_validate_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorValidateStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorValidateStageList{} + +// PaginatedAuthenticatorValidateStageList struct for PaginatedAuthenticatorValidateStageList +type PaginatedAuthenticatorValidateStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorValidateStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorValidateStageList PaginatedAuthenticatorValidateStageList + +// NewPaginatedAuthenticatorValidateStageList instantiates a new PaginatedAuthenticatorValidateStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorValidateStageList(pagination Pagination, results []AuthenticatorValidateStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorValidateStageList { + this := PaginatedAuthenticatorValidateStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorValidateStageListWithDefaults instantiates a new PaginatedAuthenticatorValidateStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorValidateStageListWithDefaults() *PaginatedAuthenticatorValidateStageList { + this := PaginatedAuthenticatorValidateStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorValidateStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorValidateStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorValidateStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorValidateStageList) GetResults() []AuthenticatorValidateStage { + if o == nil { + var ret []AuthenticatorValidateStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorValidateStageList) GetResultsOk() ([]AuthenticatorValidateStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorValidateStageList) SetResults(v []AuthenticatorValidateStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorValidateStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorValidateStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorValidateStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorValidateStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorValidateStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorValidateStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorValidateStageList := _PaginatedAuthenticatorValidateStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorValidateStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorValidateStageList(varPaginatedAuthenticatorValidateStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorValidateStageList struct { + value *PaginatedAuthenticatorValidateStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorValidateStageList) Get() *PaginatedAuthenticatorValidateStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorValidateStageList) Set(val *PaginatedAuthenticatorValidateStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorValidateStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorValidateStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorValidateStageList(val *PaginatedAuthenticatorValidateStageList) *NullablePaginatedAuthenticatorValidateStageList { + return &NullablePaginatedAuthenticatorValidateStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorValidateStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorValidateStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_authenticator_web_authn_stage_list.go b/packages/client-go/model_paginated_authenticator_web_authn_stage_list.go new file mode 100644 index 0000000000..f63d308cdd --- /dev/null +++ b/packages/client-go/model_paginated_authenticator_web_authn_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedAuthenticatorWebAuthnStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedAuthenticatorWebAuthnStageList{} + +// PaginatedAuthenticatorWebAuthnStageList struct for PaginatedAuthenticatorWebAuthnStageList +type PaginatedAuthenticatorWebAuthnStageList struct { + Pagination Pagination `json:"pagination"` + Results []AuthenticatorWebAuthnStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedAuthenticatorWebAuthnStageList PaginatedAuthenticatorWebAuthnStageList + +// NewPaginatedAuthenticatorWebAuthnStageList instantiates a new PaginatedAuthenticatorWebAuthnStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedAuthenticatorWebAuthnStageList(pagination Pagination, results []AuthenticatorWebAuthnStage, autocomplete map[string]interface{}) *PaginatedAuthenticatorWebAuthnStageList { + this := PaginatedAuthenticatorWebAuthnStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedAuthenticatorWebAuthnStageListWithDefaults instantiates a new PaginatedAuthenticatorWebAuthnStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedAuthenticatorWebAuthnStageListWithDefaults() *PaginatedAuthenticatorWebAuthnStageList { + this := PaginatedAuthenticatorWebAuthnStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedAuthenticatorWebAuthnStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorWebAuthnStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedAuthenticatorWebAuthnStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedAuthenticatorWebAuthnStageList) GetResults() []AuthenticatorWebAuthnStage { + if o == nil { + var ret []AuthenticatorWebAuthnStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorWebAuthnStageList) GetResultsOk() ([]AuthenticatorWebAuthnStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedAuthenticatorWebAuthnStageList) SetResults(v []AuthenticatorWebAuthnStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedAuthenticatorWebAuthnStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedAuthenticatorWebAuthnStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedAuthenticatorWebAuthnStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedAuthenticatorWebAuthnStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedAuthenticatorWebAuthnStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedAuthenticatorWebAuthnStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedAuthenticatorWebAuthnStageList := _PaginatedAuthenticatorWebAuthnStageList{} + + err = json.Unmarshal(data, &varPaginatedAuthenticatorWebAuthnStageList) + + if err != nil { + return err + } + + *o = PaginatedAuthenticatorWebAuthnStageList(varPaginatedAuthenticatorWebAuthnStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedAuthenticatorWebAuthnStageList struct { + value *PaginatedAuthenticatorWebAuthnStageList + isSet bool +} + +func (v NullablePaginatedAuthenticatorWebAuthnStageList) Get() *PaginatedAuthenticatorWebAuthnStageList { + return v.value +} + +func (v *NullablePaginatedAuthenticatorWebAuthnStageList) Set(val *PaginatedAuthenticatorWebAuthnStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedAuthenticatorWebAuthnStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedAuthenticatorWebAuthnStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedAuthenticatorWebAuthnStageList(val *PaginatedAuthenticatorWebAuthnStageList) *NullablePaginatedAuthenticatorWebAuthnStageList { + return &NullablePaginatedAuthenticatorWebAuthnStageList{value: val, isSet: true} +} + +func (v NullablePaginatedAuthenticatorWebAuthnStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedAuthenticatorWebAuthnStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_blueprint_instance_list.go b/packages/client-go/model_paginated_blueprint_instance_list.go new file mode 100644 index 0000000000..49f49992cf --- /dev/null +++ b/packages/client-go/model_paginated_blueprint_instance_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedBlueprintInstanceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedBlueprintInstanceList{} + +// PaginatedBlueprintInstanceList struct for PaginatedBlueprintInstanceList +type PaginatedBlueprintInstanceList struct { + Pagination Pagination `json:"pagination"` + Results []BlueprintInstance `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedBlueprintInstanceList PaginatedBlueprintInstanceList + +// NewPaginatedBlueprintInstanceList instantiates a new PaginatedBlueprintInstanceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedBlueprintInstanceList(pagination Pagination, results []BlueprintInstance, autocomplete map[string]interface{}) *PaginatedBlueprintInstanceList { + this := PaginatedBlueprintInstanceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedBlueprintInstanceListWithDefaults instantiates a new PaginatedBlueprintInstanceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedBlueprintInstanceListWithDefaults() *PaginatedBlueprintInstanceList { + this := PaginatedBlueprintInstanceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedBlueprintInstanceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedBlueprintInstanceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedBlueprintInstanceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedBlueprintInstanceList) GetResults() []BlueprintInstance { + if o == nil { + var ret []BlueprintInstance + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedBlueprintInstanceList) GetResultsOk() ([]BlueprintInstance, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedBlueprintInstanceList) SetResults(v []BlueprintInstance) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedBlueprintInstanceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedBlueprintInstanceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedBlueprintInstanceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedBlueprintInstanceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedBlueprintInstanceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedBlueprintInstanceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedBlueprintInstanceList := _PaginatedBlueprintInstanceList{} + + err = json.Unmarshal(data, &varPaginatedBlueprintInstanceList) + + if err != nil { + return err + } + + *o = PaginatedBlueprintInstanceList(varPaginatedBlueprintInstanceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedBlueprintInstanceList struct { + value *PaginatedBlueprintInstanceList + isSet bool +} + +func (v NullablePaginatedBlueprintInstanceList) Get() *PaginatedBlueprintInstanceList { + return v.value +} + +func (v *NullablePaginatedBlueprintInstanceList) Set(val *PaginatedBlueprintInstanceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedBlueprintInstanceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedBlueprintInstanceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedBlueprintInstanceList(val *PaginatedBlueprintInstanceList) *NullablePaginatedBlueprintInstanceList { + return &NullablePaginatedBlueprintInstanceList{value: val, isSet: true} +} + +func (v NullablePaginatedBlueprintInstanceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedBlueprintInstanceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_brand_list.go b/packages/client-go/model_paginated_brand_list.go new file mode 100644 index 0000000000..c6bc0c178a --- /dev/null +++ b/packages/client-go/model_paginated_brand_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedBrandList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedBrandList{} + +// PaginatedBrandList struct for PaginatedBrandList +type PaginatedBrandList struct { + Pagination Pagination `json:"pagination"` + Results []Brand `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedBrandList PaginatedBrandList + +// NewPaginatedBrandList instantiates a new PaginatedBrandList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedBrandList(pagination Pagination, results []Brand, autocomplete map[string]interface{}) *PaginatedBrandList { + this := PaginatedBrandList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedBrandListWithDefaults instantiates a new PaginatedBrandList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedBrandListWithDefaults() *PaginatedBrandList { + this := PaginatedBrandList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedBrandList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedBrandList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedBrandList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedBrandList) GetResults() []Brand { + if o == nil { + var ret []Brand + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedBrandList) GetResultsOk() ([]Brand, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedBrandList) SetResults(v []Brand) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedBrandList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedBrandList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedBrandList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedBrandList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedBrandList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedBrandList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedBrandList := _PaginatedBrandList{} + + err = json.Unmarshal(data, &varPaginatedBrandList) + + if err != nil { + return err + } + + *o = PaginatedBrandList(varPaginatedBrandList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedBrandList struct { + value *PaginatedBrandList + isSet bool +} + +func (v NullablePaginatedBrandList) Get() *PaginatedBrandList { + return v.value +} + +func (v *NullablePaginatedBrandList) Set(val *PaginatedBrandList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedBrandList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedBrandList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedBrandList(val *PaginatedBrandList) *NullablePaginatedBrandList { + return &NullablePaginatedBrandList{value: val, isSet: true} +} + +func (v NullablePaginatedBrandList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedBrandList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_captcha_stage_list.go b/packages/client-go/model_paginated_captcha_stage_list.go new file mode 100644 index 0000000000..f9bf3aa6bf --- /dev/null +++ b/packages/client-go/model_paginated_captcha_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedCaptchaStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCaptchaStageList{} + +// PaginatedCaptchaStageList struct for PaginatedCaptchaStageList +type PaginatedCaptchaStageList struct { + Pagination Pagination `json:"pagination"` + Results []CaptchaStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCaptchaStageList PaginatedCaptchaStageList + +// NewPaginatedCaptchaStageList instantiates a new PaginatedCaptchaStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCaptchaStageList(pagination Pagination, results []CaptchaStage, autocomplete map[string]interface{}) *PaginatedCaptchaStageList { + this := PaginatedCaptchaStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedCaptchaStageListWithDefaults instantiates a new PaginatedCaptchaStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCaptchaStageListWithDefaults() *PaginatedCaptchaStageList { + this := PaginatedCaptchaStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedCaptchaStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedCaptchaStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedCaptchaStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedCaptchaStageList) GetResults() []CaptchaStage { + if o == nil { + var ret []CaptchaStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedCaptchaStageList) GetResultsOk() ([]CaptchaStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedCaptchaStageList) SetResults(v []CaptchaStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedCaptchaStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedCaptchaStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedCaptchaStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedCaptchaStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCaptchaStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCaptchaStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedCaptchaStageList := _PaginatedCaptchaStageList{} + + err = json.Unmarshal(data, &varPaginatedCaptchaStageList) + + if err != nil { + return err + } + + *o = PaginatedCaptchaStageList(varPaginatedCaptchaStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCaptchaStageList struct { + value *PaginatedCaptchaStageList + isSet bool +} + +func (v NullablePaginatedCaptchaStageList) Get() *PaginatedCaptchaStageList { + return v.value +} + +func (v *NullablePaginatedCaptchaStageList) Set(val *PaginatedCaptchaStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCaptchaStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCaptchaStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCaptchaStageList(val *PaginatedCaptchaStageList) *NullablePaginatedCaptchaStageList { + return &NullablePaginatedCaptchaStageList{value: val, isSet: true} +} + +func (v NullablePaginatedCaptchaStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCaptchaStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_certificate_key_pair_list.go b/packages/client-go/model_paginated_certificate_key_pair_list.go new file mode 100644 index 0000000000..ce9d4e13de --- /dev/null +++ b/packages/client-go/model_paginated_certificate_key_pair_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedCertificateKeyPairList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedCertificateKeyPairList{} + +// PaginatedCertificateKeyPairList struct for PaginatedCertificateKeyPairList +type PaginatedCertificateKeyPairList struct { + Pagination Pagination `json:"pagination"` + Results []CertificateKeyPair `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedCertificateKeyPairList PaginatedCertificateKeyPairList + +// NewPaginatedCertificateKeyPairList instantiates a new PaginatedCertificateKeyPairList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedCertificateKeyPairList(pagination Pagination, results []CertificateKeyPair, autocomplete map[string]interface{}) *PaginatedCertificateKeyPairList { + this := PaginatedCertificateKeyPairList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedCertificateKeyPairListWithDefaults instantiates a new PaginatedCertificateKeyPairList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedCertificateKeyPairListWithDefaults() *PaginatedCertificateKeyPairList { + this := PaginatedCertificateKeyPairList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedCertificateKeyPairList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedCertificateKeyPairList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedCertificateKeyPairList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedCertificateKeyPairList) GetResults() []CertificateKeyPair { + if o == nil { + var ret []CertificateKeyPair + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedCertificateKeyPairList) GetResultsOk() ([]CertificateKeyPair, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedCertificateKeyPairList) SetResults(v []CertificateKeyPair) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedCertificateKeyPairList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedCertificateKeyPairList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedCertificateKeyPairList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedCertificateKeyPairList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedCertificateKeyPairList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedCertificateKeyPairList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedCertificateKeyPairList := _PaginatedCertificateKeyPairList{} + + err = json.Unmarshal(data, &varPaginatedCertificateKeyPairList) + + if err != nil { + return err + } + + *o = PaginatedCertificateKeyPairList(varPaginatedCertificateKeyPairList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedCertificateKeyPairList struct { + value *PaginatedCertificateKeyPairList + isSet bool +} + +func (v NullablePaginatedCertificateKeyPairList) Get() *PaginatedCertificateKeyPairList { + return v.value +} + +func (v *NullablePaginatedCertificateKeyPairList) Set(val *PaginatedCertificateKeyPairList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedCertificateKeyPairList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedCertificateKeyPairList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedCertificateKeyPairList(val *PaginatedCertificateKeyPairList) *NullablePaginatedCertificateKeyPairList { + return &NullablePaginatedCertificateKeyPairList{value: val, isSet: true} +} + +func (v NullablePaginatedCertificateKeyPairList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedCertificateKeyPairList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_connection_token_list.go b/packages/client-go/model_paginated_connection_token_list.go new file mode 100644 index 0000000000..26b96f170b --- /dev/null +++ b/packages/client-go/model_paginated_connection_token_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedConnectionTokenList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConnectionTokenList{} + +// PaginatedConnectionTokenList struct for PaginatedConnectionTokenList +type PaginatedConnectionTokenList struct { + Pagination Pagination `json:"pagination"` + Results []ConnectionToken `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConnectionTokenList PaginatedConnectionTokenList + +// NewPaginatedConnectionTokenList instantiates a new PaginatedConnectionTokenList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConnectionTokenList(pagination Pagination, results []ConnectionToken, autocomplete map[string]interface{}) *PaginatedConnectionTokenList { + this := PaginatedConnectionTokenList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedConnectionTokenListWithDefaults instantiates a new PaginatedConnectionTokenList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConnectionTokenListWithDefaults() *PaginatedConnectionTokenList { + this := PaginatedConnectionTokenList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedConnectionTokenList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectionTokenList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedConnectionTokenList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedConnectionTokenList) GetResults() []ConnectionToken { + if o == nil { + var ret []ConnectionToken + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectionTokenList) GetResultsOk() ([]ConnectionToken, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedConnectionTokenList) SetResults(v []ConnectionToken) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedConnectionTokenList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectionTokenList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedConnectionTokenList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedConnectionTokenList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConnectionTokenList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConnectionTokenList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedConnectionTokenList := _PaginatedConnectionTokenList{} + + err = json.Unmarshal(data, &varPaginatedConnectionTokenList) + + if err != nil { + return err + } + + *o = PaginatedConnectionTokenList(varPaginatedConnectionTokenList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConnectionTokenList struct { + value *PaginatedConnectionTokenList + isSet bool +} + +func (v NullablePaginatedConnectionTokenList) Get() *PaginatedConnectionTokenList { + return v.value +} + +func (v *NullablePaginatedConnectionTokenList) Set(val *PaginatedConnectionTokenList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConnectionTokenList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConnectionTokenList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConnectionTokenList(val *PaginatedConnectionTokenList) *NullablePaginatedConnectionTokenList { + return &NullablePaginatedConnectionTokenList{value: val, isSet: true} +} + +func (v NullablePaginatedConnectionTokenList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConnectionTokenList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_connector_list.go b/packages/client-go/model_paginated_connector_list.go new file mode 100644 index 0000000000..b79c9a8dee --- /dev/null +++ b/packages/client-go/model_paginated_connector_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedConnectorList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConnectorList{} + +// PaginatedConnectorList struct for PaginatedConnectorList +type PaginatedConnectorList struct { + Pagination Pagination `json:"pagination"` + Results []Connector `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConnectorList PaginatedConnectorList + +// NewPaginatedConnectorList instantiates a new PaginatedConnectorList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConnectorList(pagination Pagination, results []Connector, autocomplete map[string]interface{}) *PaginatedConnectorList { + this := PaginatedConnectorList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedConnectorListWithDefaults instantiates a new PaginatedConnectorList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConnectorListWithDefaults() *PaginatedConnectorList { + this := PaginatedConnectorList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedConnectorList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectorList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedConnectorList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedConnectorList) GetResults() []Connector { + if o == nil { + var ret []Connector + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectorList) GetResultsOk() ([]Connector, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedConnectorList) SetResults(v []Connector) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedConnectorList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedConnectorList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedConnectorList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedConnectorList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConnectorList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConnectorList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedConnectorList := _PaginatedConnectorList{} + + err = json.Unmarshal(data, &varPaginatedConnectorList) + + if err != nil { + return err + } + + *o = PaginatedConnectorList(varPaginatedConnectorList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConnectorList struct { + value *PaginatedConnectorList + isSet bool +} + +func (v NullablePaginatedConnectorList) Get() *PaginatedConnectorList { + return v.value +} + +func (v *NullablePaginatedConnectorList) Set(val *PaginatedConnectorList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConnectorList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConnectorList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConnectorList(val *PaginatedConnectorList) *NullablePaginatedConnectorList { + return &NullablePaginatedConnectorList{value: val, isSet: true} +} + +func (v NullablePaginatedConnectorList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConnectorList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_consent_stage_list.go b/packages/client-go/model_paginated_consent_stage_list.go new file mode 100644 index 0000000000..ace48637c2 --- /dev/null +++ b/packages/client-go/model_paginated_consent_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedConsentStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedConsentStageList{} + +// PaginatedConsentStageList struct for PaginatedConsentStageList +type PaginatedConsentStageList struct { + Pagination Pagination `json:"pagination"` + Results []ConsentStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedConsentStageList PaginatedConsentStageList + +// NewPaginatedConsentStageList instantiates a new PaginatedConsentStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedConsentStageList(pagination Pagination, results []ConsentStage, autocomplete map[string]interface{}) *PaginatedConsentStageList { + this := PaginatedConsentStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedConsentStageListWithDefaults instantiates a new PaginatedConsentStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedConsentStageListWithDefaults() *PaginatedConsentStageList { + this := PaginatedConsentStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedConsentStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedConsentStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedConsentStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedConsentStageList) GetResults() []ConsentStage { + if o == nil { + var ret []ConsentStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedConsentStageList) GetResultsOk() ([]ConsentStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedConsentStageList) SetResults(v []ConsentStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedConsentStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedConsentStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedConsentStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedConsentStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedConsentStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedConsentStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedConsentStageList := _PaginatedConsentStageList{} + + err = json.Unmarshal(data, &varPaginatedConsentStageList) + + if err != nil { + return err + } + + *o = PaginatedConsentStageList(varPaginatedConsentStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedConsentStageList struct { + value *PaginatedConsentStageList + isSet bool +} + +func (v NullablePaginatedConsentStageList) Get() *PaginatedConsentStageList { + return v.value +} + +func (v *NullablePaginatedConsentStageList) Set(val *PaginatedConsentStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedConsentStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedConsentStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedConsentStageList(val *PaginatedConsentStageList) *NullablePaginatedConsentStageList { + return &NullablePaginatedConsentStageList{value: val, isSet: true} +} + +func (v NullablePaginatedConsentStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedConsentStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_data_export_list.go b/packages/client-go/model_paginated_data_export_list.go new file mode 100644 index 0000000000..8070a1d621 --- /dev/null +++ b/packages/client-go/model_paginated_data_export_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDataExportList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDataExportList{} + +// PaginatedDataExportList struct for PaginatedDataExportList +type PaginatedDataExportList struct { + Pagination Pagination `json:"pagination"` + Results []DataExport `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDataExportList PaginatedDataExportList + +// NewPaginatedDataExportList instantiates a new PaginatedDataExportList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDataExportList(pagination Pagination, results []DataExport, autocomplete map[string]interface{}) *PaginatedDataExportList { + this := PaginatedDataExportList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDataExportListWithDefaults instantiates a new PaginatedDataExportList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDataExportListWithDefaults() *PaginatedDataExportList { + this := PaginatedDataExportList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDataExportList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDataExportList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDataExportList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDataExportList) GetResults() []DataExport { + if o == nil { + var ret []DataExport + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDataExportList) GetResultsOk() ([]DataExport, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDataExportList) SetResults(v []DataExport) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDataExportList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDataExportList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDataExportList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDataExportList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDataExportList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDataExportList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDataExportList := _PaginatedDataExportList{} + + err = json.Unmarshal(data, &varPaginatedDataExportList) + + if err != nil { + return err + } + + *o = PaginatedDataExportList(varPaginatedDataExportList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDataExportList struct { + value *PaginatedDataExportList + isSet bool +} + +func (v NullablePaginatedDataExportList) Get() *PaginatedDataExportList { + return v.value +} + +func (v *NullablePaginatedDataExportList) Set(val *PaginatedDataExportList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDataExportList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDataExportList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDataExportList(val *PaginatedDataExportList) *NullablePaginatedDataExportList { + return &NullablePaginatedDataExportList{value: val, isSet: true} +} + +func (v NullablePaginatedDataExportList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDataExportList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_deny_stage_list.go b/packages/client-go/model_paginated_deny_stage_list.go new file mode 100644 index 0000000000..a722bc61da --- /dev/null +++ b/packages/client-go/model_paginated_deny_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDenyStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDenyStageList{} + +// PaginatedDenyStageList struct for PaginatedDenyStageList +type PaginatedDenyStageList struct { + Pagination Pagination `json:"pagination"` + Results []DenyStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDenyStageList PaginatedDenyStageList + +// NewPaginatedDenyStageList instantiates a new PaginatedDenyStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDenyStageList(pagination Pagination, results []DenyStage, autocomplete map[string]interface{}) *PaginatedDenyStageList { + this := PaginatedDenyStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDenyStageListWithDefaults instantiates a new PaginatedDenyStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDenyStageListWithDefaults() *PaginatedDenyStageList { + this := PaginatedDenyStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDenyStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDenyStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDenyStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDenyStageList) GetResults() []DenyStage { + if o == nil { + var ret []DenyStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDenyStageList) GetResultsOk() ([]DenyStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDenyStageList) SetResults(v []DenyStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDenyStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDenyStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDenyStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDenyStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDenyStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDenyStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDenyStageList := _PaginatedDenyStageList{} + + err = json.Unmarshal(data, &varPaginatedDenyStageList) + + if err != nil { + return err + } + + *o = PaginatedDenyStageList(varPaginatedDenyStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDenyStageList struct { + value *PaginatedDenyStageList + isSet bool +} + +func (v NullablePaginatedDenyStageList) Get() *PaginatedDenyStageList { + return v.value +} + +func (v *NullablePaginatedDenyStageList) Set(val *PaginatedDenyStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDenyStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDenyStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDenyStageList(val *PaginatedDenyStageList) *NullablePaginatedDenyStageList { + return &NullablePaginatedDenyStageList{value: val, isSet: true} +} + +func (v NullablePaginatedDenyStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDenyStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_device_access_group_list.go b/packages/client-go/model_paginated_device_access_group_list.go new file mode 100644 index 0000000000..0ecf55b263 --- /dev/null +++ b/packages/client-go/model_paginated_device_access_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDeviceAccessGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceAccessGroupList{} + +// PaginatedDeviceAccessGroupList struct for PaginatedDeviceAccessGroupList +type PaginatedDeviceAccessGroupList struct { + Pagination Pagination `json:"pagination"` + Results []DeviceAccessGroup `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceAccessGroupList PaginatedDeviceAccessGroupList + +// NewPaginatedDeviceAccessGroupList instantiates a new PaginatedDeviceAccessGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceAccessGroupList(pagination Pagination, results []DeviceAccessGroup, autocomplete map[string]interface{}) *PaginatedDeviceAccessGroupList { + this := PaginatedDeviceAccessGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDeviceAccessGroupListWithDefaults instantiates a new PaginatedDeviceAccessGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceAccessGroupListWithDefaults() *PaginatedDeviceAccessGroupList { + this := PaginatedDeviceAccessGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDeviceAccessGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceAccessGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDeviceAccessGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDeviceAccessGroupList) GetResults() []DeviceAccessGroup { + if o == nil { + var ret []DeviceAccessGroup + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceAccessGroupList) GetResultsOk() ([]DeviceAccessGroup, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDeviceAccessGroupList) SetResults(v []DeviceAccessGroup) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDeviceAccessGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceAccessGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDeviceAccessGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDeviceAccessGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceAccessGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceAccessGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDeviceAccessGroupList := _PaginatedDeviceAccessGroupList{} + + err = json.Unmarshal(data, &varPaginatedDeviceAccessGroupList) + + if err != nil { + return err + } + + *o = PaginatedDeviceAccessGroupList(varPaginatedDeviceAccessGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceAccessGroupList struct { + value *PaginatedDeviceAccessGroupList + isSet bool +} + +func (v NullablePaginatedDeviceAccessGroupList) Get() *PaginatedDeviceAccessGroupList { + return v.value +} + +func (v *NullablePaginatedDeviceAccessGroupList) Set(val *PaginatedDeviceAccessGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceAccessGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceAccessGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceAccessGroupList(val *PaginatedDeviceAccessGroupList) *NullablePaginatedDeviceAccessGroupList { + return &NullablePaginatedDeviceAccessGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceAccessGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceAccessGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_device_user_binding_list.go b/packages/client-go/model_paginated_device_user_binding_list.go new file mode 100644 index 0000000000..68d1cc8d02 --- /dev/null +++ b/packages/client-go/model_paginated_device_user_binding_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDeviceUserBindingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDeviceUserBindingList{} + +// PaginatedDeviceUserBindingList struct for PaginatedDeviceUserBindingList +type PaginatedDeviceUserBindingList struct { + Pagination Pagination `json:"pagination"` + Results []DeviceUserBinding `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDeviceUserBindingList PaginatedDeviceUserBindingList + +// NewPaginatedDeviceUserBindingList instantiates a new PaginatedDeviceUserBindingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDeviceUserBindingList(pagination Pagination, results []DeviceUserBinding, autocomplete map[string]interface{}) *PaginatedDeviceUserBindingList { + this := PaginatedDeviceUserBindingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDeviceUserBindingListWithDefaults instantiates a new PaginatedDeviceUserBindingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDeviceUserBindingListWithDefaults() *PaginatedDeviceUserBindingList { + this := PaginatedDeviceUserBindingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDeviceUserBindingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceUserBindingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDeviceUserBindingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDeviceUserBindingList) GetResults() []DeviceUserBinding { + if o == nil { + var ret []DeviceUserBinding + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceUserBindingList) GetResultsOk() ([]DeviceUserBinding, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDeviceUserBindingList) SetResults(v []DeviceUserBinding) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDeviceUserBindingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDeviceUserBindingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDeviceUserBindingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDeviceUserBindingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDeviceUserBindingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDeviceUserBindingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDeviceUserBindingList := _PaginatedDeviceUserBindingList{} + + err = json.Unmarshal(data, &varPaginatedDeviceUserBindingList) + + if err != nil { + return err + } + + *o = PaginatedDeviceUserBindingList(varPaginatedDeviceUserBindingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDeviceUserBindingList struct { + value *PaginatedDeviceUserBindingList + isSet bool +} + +func (v NullablePaginatedDeviceUserBindingList) Get() *PaginatedDeviceUserBindingList { + return v.value +} + +func (v *NullablePaginatedDeviceUserBindingList) Set(val *PaginatedDeviceUserBindingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDeviceUserBindingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDeviceUserBindingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDeviceUserBindingList(val *PaginatedDeviceUserBindingList) *NullablePaginatedDeviceUserBindingList { + return &NullablePaginatedDeviceUserBindingList{value: val, isSet: true} +} + +func (v NullablePaginatedDeviceUserBindingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDeviceUserBindingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_docker_service_connection_list.go b/packages/client-go/model_paginated_docker_service_connection_list.go new file mode 100644 index 0000000000..5ab4deba94 --- /dev/null +++ b/packages/client-go/model_paginated_docker_service_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDockerServiceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDockerServiceConnectionList{} + +// PaginatedDockerServiceConnectionList struct for PaginatedDockerServiceConnectionList +type PaginatedDockerServiceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []DockerServiceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDockerServiceConnectionList PaginatedDockerServiceConnectionList + +// NewPaginatedDockerServiceConnectionList instantiates a new PaginatedDockerServiceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDockerServiceConnectionList(pagination Pagination, results []DockerServiceConnection, autocomplete map[string]interface{}) *PaginatedDockerServiceConnectionList { + this := PaginatedDockerServiceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDockerServiceConnectionListWithDefaults instantiates a new PaginatedDockerServiceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDockerServiceConnectionListWithDefaults() *PaginatedDockerServiceConnectionList { + this := PaginatedDockerServiceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDockerServiceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDockerServiceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDockerServiceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDockerServiceConnectionList) GetResults() []DockerServiceConnection { + if o == nil { + var ret []DockerServiceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDockerServiceConnectionList) GetResultsOk() ([]DockerServiceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDockerServiceConnectionList) SetResults(v []DockerServiceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDockerServiceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDockerServiceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDockerServiceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDockerServiceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDockerServiceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDockerServiceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDockerServiceConnectionList := _PaginatedDockerServiceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedDockerServiceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedDockerServiceConnectionList(varPaginatedDockerServiceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDockerServiceConnectionList struct { + value *PaginatedDockerServiceConnectionList + isSet bool +} + +func (v NullablePaginatedDockerServiceConnectionList) Get() *PaginatedDockerServiceConnectionList { + return v.value +} + +func (v *NullablePaginatedDockerServiceConnectionList) Set(val *PaginatedDockerServiceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDockerServiceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDockerServiceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDockerServiceConnectionList(val *PaginatedDockerServiceConnectionList) *NullablePaginatedDockerServiceConnectionList { + return &NullablePaginatedDockerServiceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedDockerServiceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDockerServiceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_domain_list.go b/packages/client-go/model_paginated_domain_list.go new file mode 100644 index 0000000000..d2f17241c1 --- /dev/null +++ b/packages/client-go/model_paginated_domain_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDomainList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDomainList{} + +// PaginatedDomainList struct for PaginatedDomainList +type PaginatedDomainList struct { + Pagination Pagination `json:"pagination"` + Results []Domain `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDomainList PaginatedDomainList + +// NewPaginatedDomainList instantiates a new PaginatedDomainList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDomainList(pagination Pagination, results []Domain, autocomplete map[string]interface{}) *PaginatedDomainList { + this := PaginatedDomainList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDomainListWithDefaults instantiates a new PaginatedDomainList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDomainListWithDefaults() *PaginatedDomainList { + this := PaginatedDomainList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDomainList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDomainList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDomainList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDomainList) GetResults() []Domain { + if o == nil { + var ret []Domain + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDomainList) GetResultsOk() ([]Domain, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDomainList) SetResults(v []Domain) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDomainList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDomainList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDomainList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDomainList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDomainList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDomainList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDomainList := _PaginatedDomainList{} + + err = json.Unmarshal(data, &varPaginatedDomainList) + + if err != nil { + return err + } + + *o = PaginatedDomainList(varPaginatedDomainList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDomainList struct { + value *PaginatedDomainList + isSet bool +} + +func (v NullablePaginatedDomainList) Get() *PaginatedDomainList { + return v.value +} + +func (v *NullablePaginatedDomainList) Set(val *PaginatedDomainList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDomainList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDomainList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDomainList(val *PaginatedDomainList) *NullablePaginatedDomainList { + return &NullablePaginatedDomainList{value: val, isSet: true} +} + +func (v NullablePaginatedDomainList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDomainList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_dummy_policy_list.go b/packages/client-go/model_paginated_dummy_policy_list.go new file mode 100644 index 0000000000..1f146d0022 --- /dev/null +++ b/packages/client-go/model_paginated_dummy_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDummyPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDummyPolicyList{} + +// PaginatedDummyPolicyList struct for PaginatedDummyPolicyList +type PaginatedDummyPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []DummyPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDummyPolicyList PaginatedDummyPolicyList + +// NewPaginatedDummyPolicyList instantiates a new PaginatedDummyPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDummyPolicyList(pagination Pagination, results []DummyPolicy, autocomplete map[string]interface{}) *PaginatedDummyPolicyList { + this := PaginatedDummyPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDummyPolicyListWithDefaults instantiates a new PaginatedDummyPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDummyPolicyListWithDefaults() *PaginatedDummyPolicyList { + this := PaginatedDummyPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDummyPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDummyPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDummyPolicyList) GetResults() []DummyPolicy { + if o == nil { + var ret []DummyPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyPolicyList) GetResultsOk() ([]DummyPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDummyPolicyList) SetResults(v []DummyPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDummyPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDummyPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDummyPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDummyPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDummyPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDummyPolicyList := _PaginatedDummyPolicyList{} + + err = json.Unmarshal(data, &varPaginatedDummyPolicyList) + + if err != nil { + return err + } + + *o = PaginatedDummyPolicyList(varPaginatedDummyPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDummyPolicyList struct { + value *PaginatedDummyPolicyList + isSet bool +} + +func (v NullablePaginatedDummyPolicyList) Get() *PaginatedDummyPolicyList { + return v.value +} + +func (v *NullablePaginatedDummyPolicyList) Set(val *PaginatedDummyPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDummyPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDummyPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDummyPolicyList(val *PaginatedDummyPolicyList) *NullablePaginatedDummyPolicyList { + return &NullablePaginatedDummyPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedDummyPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDummyPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_dummy_stage_list.go b/packages/client-go/model_paginated_dummy_stage_list.go new file mode 100644 index 0000000000..7cb03d5cf4 --- /dev/null +++ b/packages/client-go/model_paginated_dummy_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDummyStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDummyStageList{} + +// PaginatedDummyStageList struct for PaginatedDummyStageList +type PaginatedDummyStageList struct { + Pagination Pagination `json:"pagination"` + Results []DummyStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDummyStageList PaginatedDummyStageList + +// NewPaginatedDummyStageList instantiates a new PaginatedDummyStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDummyStageList(pagination Pagination, results []DummyStage, autocomplete map[string]interface{}) *PaginatedDummyStageList { + this := PaginatedDummyStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDummyStageListWithDefaults instantiates a new PaginatedDummyStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDummyStageListWithDefaults() *PaginatedDummyStageList { + this := PaginatedDummyStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDummyStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDummyStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDummyStageList) GetResults() []DummyStage { + if o == nil { + var ret []DummyStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyStageList) GetResultsOk() ([]DummyStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDummyStageList) SetResults(v []DummyStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDummyStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDummyStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDummyStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDummyStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDummyStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDummyStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDummyStageList := _PaginatedDummyStageList{} + + err = json.Unmarshal(data, &varPaginatedDummyStageList) + + if err != nil { + return err + } + + *o = PaginatedDummyStageList(varPaginatedDummyStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDummyStageList struct { + value *PaginatedDummyStageList + isSet bool +} + +func (v NullablePaginatedDummyStageList) Get() *PaginatedDummyStageList { + return v.value +} + +func (v *NullablePaginatedDummyStageList) Set(val *PaginatedDummyStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDummyStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDummyStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDummyStageList(val *PaginatedDummyStageList) *NullablePaginatedDummyStageList { + return &NullablePaginatedDummyStageList{value: val, isSet: true} +} + +func (v NullablePaginatedDummyStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDummyStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_duo_device_list.go b/packages/client-go/model_paginated_duo_device_list.go new file mode 100644 index 0000000000..78968fe12a --- /dev/null +++ b/packages/client-go/model_paginated_duo_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedDuoDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedDuoDeviceList{} + +// PaginatedDuoDeviceList struct for PaginatedDuoDeviceList +type PaginatedDuoDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []DuoDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedDuoDeviceList PaginatedDuoDeviceList + +// NewPaginatedDuoDeviceList instantiates a new PaginatedDuoDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedDuoDeviceList(pagination Pagination, results []DuoDevice, autocomplete map[string]interface{}) *PaginatedDuoDeviceList { + this := PaginatedDuoDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedDuoDeviceListWithDefaults instantiates a new PaginatedDuoDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedDuoDeviceListWithDefaults() *PaginatedDuoDeviceList { + this := PaginatedDuoDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedDuoDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedDuoDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedDuoDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedDuoDeviceList) GetResults() []DuoDevice { + if o == nil { + var ret []DuoDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedDuoDeviceList) GetResultsOk() ([]DuoDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedDuoDeviceList) SetResults(v []DuoDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedDuoDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedDuoDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedDuoDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedDuoDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedDuoDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedDuoDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedDuoDeviceList := _PaginatedDuoDeviceList{} + + err = json.Unmarshal(data, &varPaginatedDuoDeviceList) + + if err != nil { + return err + } + + *o = PaginatedDuoDeviceList(varPaginatedDuoDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedDuoDeviceList struct { + value *PaginatedDuoDeviceList + isSet bool +} + +func (v NullablePaginatedDuoDeviceList) Get() *PaginatedDuoDeviceList { + return v.value +} + +func (v *NullablePaginatedDuoDeviceList) Set(val *PaginatedDuoDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedDuoDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedDuoDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedDuoDeviceList(val *PaginatedDuoDeviceList) *NullablePaginatedDuoDeviceList { + return &NullablePaginatedDuoDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedDuoDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedDuoDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_email_device_list.go b/packages/client-go/model_paginated_email_device_list.go new file mode 100644 index 0000000000..136f9bfff4 --- /dev/null +++ b/packages/client-go/model_paginated_email_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEmailDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEmailDeviceList{} + +// PaginatedEmailDeviceList struct for PaginatedEmailDeviceList +type PaginatedEmailDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []EmailDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEmailDeviceList PaginatedEmailDeviceList + +// NewPaginatedEmailDeviceList instantiates a new PaginatedEmailDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEmailDeviceList(pagination Pagination, results []EmailDevice, autocomplete map[string]interface{}) *PaginatedEmailDeviceList { + this := PaginatedEmailDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEmailDeviceListWithDefaults instantiates a new PaginatedEmailDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEmailDeviceListWithDefaults() *PaginatedEmailDeviceList { + this := PaginatedEmailDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEmailDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEmailDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEmailDeviceList) GetResults() []EmailDevice { + if o == nil { + var ret []EmailDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailDeviceList) GetResultsOk() ([]EmailDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEmailDeviceList) SetResults(v []EmailDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEmailDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEmailDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEmailDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEmailDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEmailDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEmailDeviceList := _PaginatedEmailDeviceList{} + + err = json.Unmarshal(data, &varPaginatedEmailDeviceList) + + if err != nil { + return err + } + + *o = PaginatedEmailDeviceList(varPaginatedEmailDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEmailDeviceList struct { + value *PaginatedEmailDeviceList + isSet bool +} + +func (v NullablePaginatedEmailDeviceList) Get() *PaginatedEmailDeviceList { + return v.value +} + +func (v *NullablePaginatedEmailDeviceList) Set(val *PaginatedEmailDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEmailDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEmailDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEmailDeviceList(val *PaginatedEmailDeviceList) *NullablePaginatedEmailDeviceList { + return &NullablePaginatedEmailDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedEmailDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEmailDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_email_stage_list.go b/packages/client-go/model_paginated_email_stage_list.go new file mode 100644 index 0000000000..e38f7d43b6 --- /dev/null +++ b/packages/client-go/model_paginated_email_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEmailStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEmailStageList{} + +// PaginatedEmailStageList struct for PaginatedEmailStageList +type PaginatedEmailStageList struct { + Pagination Pagination `json:"pagination"` + Results []EmailStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEmailStageList PaginatedEmailStageList + +// NewPaginatedEmailStageList instantiates a new PaginatedEmailStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEmailStageList(pagination Pagination, results []EmailStage, autocomplete map[string]interface{}) *PaginatedEmailStageList { + this := PaginatedEmailStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEmailStageListWithDefaults instantiates a new PaginatedEmailStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEmailStageListWithDefaults() *PaginatedEmailStageList { + this := PaginatedEmailStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEmailStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEmailStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEmailStageList) GetResults() []EmailStage { + if o == nil { + var ret []EmailStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailStageList) GetResultsOk() ([]EmailStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEmailStageList) SetResults(v []EmailStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEmailStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEmailStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEmailStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEmailStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEmailStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEmailStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEmailStageList := _PaginatedEmailStageList{} + + err = json.Unmarshal(data, &varPaginatedEmailStageList) + + if err != nil { + return err + } + + *o = PaginatedEmailStageList(varPaginatedEmailStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEmailStageList struct { + value *PaginatedEmailStageList + isSet bool +} + +func (v NullablePaginatedEmailStageList) Get() *PaginatedEmailStageList { + return v.value +} + +func (v *NullablePaginatedEmailStageList) Set(val *PaginatedEmailStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEmailStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEmailStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEmailStageList(val *PaginatedEmailStageList) *NullablePaginatedEmailStageList { + return &NullablePaginatedEmailStageList{value: val, isSet: true} +} + +func (v NullablePaginatedEmailStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEmailStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_endpoint_device_list.go b/packages/client-go/model_paginated_endpoint_device_list.go new file mode 100644 index 0000000000..b57fe407c3 --- /dev/null +++ b/packages/client-go/model_paginated_endpoint_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEndpointDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEndpointDeviceList{} + +// PaginatedEndpointDeviceList struct for PaginatedEndpointDeviceList +type PaginatedEndpointDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []EndpointDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEndpointDeviceList PaginatedEndpointDeviceList + +// NewPaginatedEndpointDeviceList instantiates a new PaginatedEndpointDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEndpointDeviceList(pagination Pagination, results []EndpointDevice, autocomplete map[string]interface{}) *PaginatedEndpointDeviceList { + this := PaginatedEndpointDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEndpointDeviceListWithDefaults instantiates a new PaginatedEndpointDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEndpointDeviceListWithDefaults() *PaginatedEndpointDeviceList { + this := PaginatedEndpointDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEndpointDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEndpointDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEndpointDeviceList) GetResults() []EndpointDevice { + if o == nil { + var ret []EndpointDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointDeviceList) GetResultsOk() ([]EndpointDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEndpointDeviceList) SetResults(v []EndpointDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEndpointDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEndpointDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEndpointDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEndpointDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEndpointDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEndpointDeviceList := _PaginatedEndpointDeviceList{} + + err = json.Unmarshal(data, &varPaginatedEndpointDeviceList) + + if err != nil { + return err + } + + *o = PaginatedEndpointDeviceList(varPaginatedEndpointDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEndpointDeviceList struct { + value *PaginatedEndpointDeviceList + isSet bool +} + +func (v NullablePaginatedEndpointDeviceList) Get() *PaginatedEndpointDeviceList { + return v.value +} + +func (v *NullablePaginatedEndpointDeviceList) Set(val *PaginatedEndpointDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEndpointDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEndpointDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEndpointDeviceList(val *PaginatedEndpointDeviceList) *NullablePaginatedEndpointDeviceList { + return &NullablePaginatedEndpointDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedEndpointDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEndpointDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_endpoint_list.go b/packages/client-go/model_paginated_endpoint_list.go new file mode 100644 index 0000000000..a153d3a4c2 --- /dev/null +++ b/packages/client-go/model_paginated_endpoint_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEndpointList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEndpointList{} + +// PaginatedEndpointList struct for PaginatedEndpointList +type PaginatedEndpointList struct { + Pagination Pagination `json:"pagination"` + Results []Endpoint `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEndpointList PaginatedEndpointList + +// NewPaginatedEndpointList instantiates a new PaginatedEndpointList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEndpointList(pagination Pagination, results []Endpoint, autocomplete map[string]interface{}) *PaginatedEndpointList { + this := PaginatedEndpointList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEndpointListWithDefaults instantiates a new PaginatedEndpointList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEndpointListWithDefaults() *PaginatedEndpointList { + this := PaginatedEndpointList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEndpointList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEndpointList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEndpointList) GetResults() []Endpoint { + if o == nil { + var ret []Endpoint + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointList) GetResultsOk() ([]Endpoint, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEndpointList) SetResults(v []Endpoint) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEndpointList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEndpointList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEndpointList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEndpointList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEndpointList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEndpointList := _PaginatedEndpointList{} + + err = json.Unmarshal(data, &varPaginatedEndpointList) + + if err != nil { + return err + } + + *o = PaginatedEndpointList(varPaginatedEndpointList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEndpointList struct { + value *PaginatedEndpointList + isSet bool +} + +func (v NullablePaginatedEndpointList) Get() *PaginatedEndpointList { + return v.value +} + +func (v *NullablePaginatedEndpointList) Set(val *PaginatedEndpointList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEndpointList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEndpointList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEndpointList(val *PaginatedEndpointList) *NullablePaginatedEndpointList { + return &NullablePaginatedEndpointList{value: val, isSet: true} +} + +func (v NullablePaginatedEndpointList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEndpointList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_endpoint_stage_list.go b/packages/client-go/model_paginated_endpoint_stage_list.go new file mode 100644 index 0000000000..cd33f86ec8 --- /dev/null +++ b/packages/client-go/model_paginated_endpoint_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEndpointStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEndpointStageList{} + +// PaginatedEndpointStageList struct for PaginatedEndpointStageList +type PaginatedEndpointStageList struct { + Pagination Pagination `json:"pagination"` + Results []EndpointStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEndpointStageList PaginatedEndpointStageList + +// NewPaginatedEndpointStageList instantiates a new PaginatedEndpointStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEndpointStageList(pagination Pagination, results []EndpointStage, autocomplete map[string]interface{}) *PaginatedEndpointStageList { + this := PaginatedEndpointStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEndpointStageListWithDefaults instantiates a new PaginatedEndpointStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEndpointStageListWithDefaults() *PaginatedEndpointStageList { + this := PaginatedEndpointStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEndpointStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEndpointStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEndpointStageList) GetResults() []EndpointStage { + if o == nil { + var ret []EndpointStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointStageList) GetResultsOk() ([]EndpointStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEndpointStageList) SetResults(v []EndpointStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEndpointStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEndpointStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEndpointStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEndpointStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEndpointStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEndpointStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEndpointStageList := _PaginatedEndpointStageList{} + + err = json.Unmarshal(data, &varPaginatedEndpointStageList) + + if err != nil { + return err + } + + *o = PaginatedEndpointStageList(varPaginatedEndpointStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEndpointStageList struct { + value *PaginatedEndpointStageList + isSet bool +} + +func (v NullablePaginatedEndpointStageList) Get() *PaginatedEndpointStageList { + return v.value +} + +func (v *NullablePaginatedEndpointStageList) Set(val *PaginatedEndpointStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEndpointStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEndpointStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEndpointStageList(val *PaginatedEndpointStageList) *NullablePaginatedEndpointStageList { + return &NullablePaginatedEndpointStageList{value: val, isSet: true} +} + +func (v NullablePaginatedEndpointStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEndpointStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_enrollment_token_list.go b/packages/client-go/model_paginated_enrollment_token_list.go new file mode 100644 index 0000000000..397d45f79f --- /dev/null +++ b/packages/client-go/model_paginated_enrollment_token_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEnrollmentTokenList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEnrollmentTokenList{} + +// PaginatedEnrollmentTokenList struct for PaginatedEnrollmentTokenList +type PaginatedEnrollmentTokenList struct { + Pagination Pagination `json:"pagination"` + Results []EnrollmentToken `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEnrollmentTokenList PaginatedEnrollmentTokenList + +// NewPaginatedEnrollmentTokenList instantiates a new PaginatedEnrollmentTokenList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEnrollmentTokenList(pagination Pagination, results []EnrollmentToken, autocomplete map[string]interface{}) *PaginatedEnrollmentTokenList { + this := PaginatedEnrollmentTokenList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEnrollmentTokenListWithDefaults instantiates a new PaginatedEnrollmentTokenList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEnrollmentTokenListWithDefaults() *PaginatedEnrollmentTokenList { + this := PaginatedEnrollmentTokenList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEnrollmentTokenList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEnrollmentTokenList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEnrollmentTokenList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEnrollmentTokenList) GetResults() []EnrollmentToken { + if o == nil { + var ret []EnrollmentToken + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEnrollmentTokenList) GetResultsOk() ([]EnrollmentToken, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEnrollmentTokenList) SetResults(v []EnrollmentToken) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEnrollmentTokenList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEnrollmentTokenList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEnrollmentTokenList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEnrollmentTokenList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEnrollmentTokenList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEnrollmentTokenList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEnrollmentTokenList := _PaginatedEnrollmentTokenList{} + + err = json.Unmarshal(data, &varPaginatedEnrollmentTokenList) + + if err != nil { + return err + } + + *o = PaginatedEnrollmentTokenList(varPaginatedEnrollmentTokenList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEnrollmentTokenList struct { + value *PaginatedEnrollmentTokenList + isSet bool +} + +func (v NullablePaginatedEnrollmentTokenList) Get() *PaginatedEnrollmentTokenList { + return v.value +} + +func (v *NullablePaginatedEnrollmentTokenList) Set(val *PaginatedEnrollmentTokenList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEnrollmentTokenList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEnrollmentTokenList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEnrollmentTokenList(val *PaginatedEnrollmentTokenList) *NullablePaginatedEnrollmentTokenList { + return &NullablePaginatedEnrollmentTokenList{value: val, isSet: true} +} + +func (v NullablePaginatedEnrollmentTokenList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEnrollmentTokenList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_event_list.go b/packages/client-go/model_paginated_event_list.go new file mode 100644 index 0000000000..158a51869e --- /dev/null +++ b/packages/client-go/model_paginated_event_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEventList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEventList{} + +// PaginatedEventList struct for PaginatedEventList +type PaginatedEventList struct { + Pagination Pagination `json:"pagination"` + Results []Event `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEventList PaginatedEventList + +// NewPaginatedEventList instantiates a new PaginatedEventList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEventList(pagination Pagination, results []Event, autocomplete map[string]interface{}) *PaginatedEventList { + this := PaginatedEventList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEventListWithDefaults instantiates a new PaginatedEventList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEventListWithDefaults() *PaginatedEventList { + this := PaginatedEventList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEventList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEventList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEventList) GetResults() []Event { + if o == nil { + var ret []Event + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventList) GetResultsOk() ([]Event, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEventList) SetResults(v []Event) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEventList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEventList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEventList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEventList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEventList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEventList := _PaginatedEventList{} + + err = json.Unmarshal(data, &varPaginatedEventList) + + if err != nil { + return err + } + + *o = PaginatedEventList(varPaginatedEventList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEventList struct { + value *PaginatedEventList + isSet bool +} + +func (v NullablePaginatedEventList) Get() *PaginatedEventList { + return v.value +} + +func (v *NullablePaginatedEventList) Set(val *PaginatedEventList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEventList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEventList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEventList(val *PaginatedEventList) *NullablePaginatedEventList { + return &NullablePaginatedEventList{value: val, isSet: true} +} + +func (v NullablePaginatedEventList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEventList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_event_matcher_policy_list.go b/packages/client-go/model_paginated_event_matcher_policy_list.go new file mode 100644 index 0000000000..6066e9c8d3 --- /dev/null +++ b/packages/client-go/model_paginated_event_matcher_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedEventMatcherPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedEventMatcherPolicyList{} + +// PaginatedEventMatcherPolicyList struct for PaginatedEventMatcherPolicyList +type PaginatedEventMatcherPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []EventMatcherPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedEventMatcherPolicyList PaginatedEventMatcherPolicyList + +// NewPaginatedEventMatcherPolicyList instantiates a new PaginatedEventMatcherPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedEventMatcherPolicyList(pagination Pagination, results []EventMatcherPolicy, autocomplete map[string]interface{}) *PaginatedEventMatcherPolicyList { + this := PaginatedEventMatcherPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedEventMatcherPolicyListWithDefaults instantiates a new PaginatedEventMatcherPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedEventMatcherPolicyListWithDefaults() *PaginatedEventMatcherPolicyList { + this := PaginatedEventMatcherPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedEventMatcherPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventMatcherPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedEventMatcherPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedEventMatcherPolicyList) GetResults() []EventMatcherPolicy { + if o == nil { + var ret []EventMatcherPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventMatcherPolicyList) GetResultsOk() ([]EventMatcherPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedEventMatcherPolicyList) SetResults(v []EventMatcherPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedEventMatcherPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedEventMatcherPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedEventMatcherPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedEventMatcherPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedEventMatcherPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedEventMatcherPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedEventMatcherPolicyList := _PaginatedEventMatcherPolicyList{} + + err = json.Unmarshal(data, &varPaginatedEventMatcherPolicyList) + + if err != nil { + return err + } + + *o = PaginatedEventMatcherPolicyList(varPaginatedEventMatcherPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedEventMatcherPolicyList struct { + value *PaginatedEventMatcherPolicyList + isSet bool +} + +func (v NullablePaginatedEventMatcherPolicyList) Get() *PaginatedEventMatcherPolicyList { + return v.value +} + +func (v *NullablePaginatedEventMatcherPolicyList) Set(val *PaginatedEventMatcherPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedEventMatcherPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedEventMatcherPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedEventMatcherPolicyList(val *PaginatedEventMatcherPolicyList) *NullablePaginatedEventMatcherPolicyList { + return &NullablePaginatedEventMatcherPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedEventMatcherPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedEventMatcherPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_expiring_base_grant_model_list.go b/packages/client-go/model_paginated_expiring_base_grant_model_list.go new file mode 100644 index 0000000000..bbda096cb8 --- /dev/null +++ b/packages/client-go/model_paginated_expiring_base_grant_model_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedExpiringBaseGrantModelList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedExpiringBaseGrantModelList{} + +// PaginatedExpiringBaseGrantModelList struct for PaginatedExpiringBaseGrantModelList +type PaginatedExpiringBaseGrantModelList struct { + Pagination Pagination `json:"pagination"` + Results []ExpiringBaseGrantModel `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedExpiringBaseGrantModelList PaginatedExpiringBaseGrantModelList + +// NewPaginatedExpiringBaseGrantModelList instantiates a new PaginatedExpiringBaseGrantModelList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedExpiringBaseGrantModelList(pagination Pagination, results []ExpiringBaseGrantModel, autocomplete map[string]interface{}) *PaginatedExpiringBaseGrantModelList { + this := PaginatedExpiringBaseGrantModelList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedExpiringBaseGrantModelListWithDefaults instantiates a new PaginatedExpiringBaseGrantModelList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedExpiringBaseGrantModelListWithDefaults() *PaginatedExpiringBaseGrantModelList { + this := PaginatedExpiringBaseGrantModelList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedExpiringBaseGrantModelList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpiringBaseGrantModelList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedExpiringBaseGrantModelList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedExpiringBaseGrantModelList) GetResults() []ExpiringBaseGrantModel { + if o == nil { + var ret []ExpiringBaseGrantModel + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpiringBaseGrantModelList) GetResultsOk() ([]ExpiringBaseGrantModel, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedExpiringBaseGrantModelList) SetResults(v []ExpiringBaseGrantModel) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedExpiringBaseGrantModelList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpiringBaseGrantModelList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedExpiringBaseGrantModelList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedExpiringBaseGrantModelList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedExpiringBaseGrantModelList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedExpiringBaseGrantModelList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedExpiringBaseGrantModelList := _PaginatedExpiringBaseGrantModelList{} + + err = json.Unmarshal(data, &varPaginatedExpiringBaseGrantModelList) + + if err != nil { + return err + } + + *o = PaginatedExpiringBaseGrantModelList(varPaginatedExpiringBaseGrantModelList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedExpiringBaseGrantModelList struct { + value *PaginatedExpiringBaseGrantModelList + isSet bool +} + +func (v NullablePaginatedExpiringBaseGrantModelList) Get() *PaginatedExpiringBaseGrantModelList { + return v.value +} + +func (v *NullablePaginatedExpiringBaseGrantModelList) Set(val *PaginatedExpiringBaseGrantModelList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedExpiringBaseGrantModelList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedExpiringBaseGrantModelList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedExpiringBaseGrantModelList(val *PaginatedExpiringBaseGrantModelList) *NullablePaginatedExpiringBaseGrantModelList { + return &NullablePaginatedExpiringBaseGrantModelList{value: val, isSet: true} +} + +func (v NullablePaginatedExpiringBaseGrantModelList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedExpiringBaseGrantModelList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_expression_policy_list.go b/packages/client-go/model_paginated_expression_policy_list.go new file mode 100644 index 0000000000..eeccdd7ac0 --- /dev/null +++ b/packages/client-go/model_paginated_expression_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedExpressionPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedExpressionPolicyList{} + +// PaginatedExpressionPolicyList struct for PaginatedExpressionPolicyList +type PaginatedExpressionPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []ExpressionPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedExpressionPolicyList PaginatedExpressionPolicyList + +// NewPaginatedExpressionPolicyList instantiates a new PaginatedExpressionPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedExpressionPolicyList(pagination Pagination, results []ExpressionPolicy, autocomplete map[string]interface{}) *PaginatedExpressionPolicyList { + this := PaginatedExpressionPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedExpressionPolicyListWithDefaults instantiates a new PaginatedExpressionPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedExpressionPolicyListWithDefaults() *PaginatedExpressionPolicyList { + this := PaginatedExpressionPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedExpressionPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpressionPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedExpressionPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedExpressionPolicyList) GetResults() []ExpressionPolicy { + if o == nil { + var ret []ExpressionPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpressionPolicyList) GetResultsOk() ([]ExpressionPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedExpressionPolicyList) SetResults(v []ExpressionPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedExpressionPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedExpressionPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedExpressionPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedExpressionPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedExpressionPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedExpressionPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedExpressionPolicyList := _PaginatedExpressionPolicyList{} + + err = json.Unmarshal(data, &varPaginatedExpressionPolicyList) + + if err != nil { + return err + } + + *o = PaginatedExpressionPolicyList(varPaginatedExpressionPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedExpressionPolicyList struct { + value *PaginatedExpressionPolicyList + isSet bool +} + +func (v NullablePaginatedExpressionPolicyList) Get() *PaginatedExpressionPolicyList { + return v.value +} + +func (v *NullablePaginatedExpressionPolicyList) Set(val *PaginatedExpressionPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedExpressionPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedExpressionPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedExpressionPolicyList(val *PaginatedExpressionPolicyList) *NullablePaginatedExpressionPolicyList { + return &NullablePaginatedExpressionPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedExpressionPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedExpressionPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_extra_role_object_permission_list.go b/packages/client-go/model_paginated_extra_role_object_permission_list.go new file mode 100644 index 0000000000..2be30099d4 --- /dev/null +++ b/packages/client-go/model_paginated_extra_role_object_permission_list.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedExtraRoleObjectPermissionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedExtraRoleObjectPermissionList{} + +// PaginatedExtraRoleObjectPermissionList struct for PaginatedExtraRoleObjectPermissionList +type PaginatedExtraRoleObjectPermissionList struct { + Pagination Pagination `json:"pagination"` + Results []ExtraRoleObjectPermission `json:"results"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedExtraRoleObjectPermissionList PaginatedExtraRoleObjectPermissionList + +// NewPaginatedExtraRoleObjectPermissionList instantiates a new PaginatedExtraRoleObjectPermissionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedExtraRoleObjectPermissionList(pagination Pagination, results []ExtraRoleObjectPermission) *PaginatedExtraRoleObjectPermissionList { + this := PaginatedExtraRoleObjectPermissionList{} + this.Pagination = pagination + this.Results = results + return &this +} + +// NewPaginatedExtraRoleObjectPermissionListWithDefaults instantiates a new PaginatedExtraRoleObjectPermissionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedExtraRoleObjectPermissionListWithDefaults() *PaginatedExtraRoleObjectPermissionList { + this := PaginatedExtraRoleObjectPermissionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedExtraRoleObjectPermissionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedExtraRoleObjectPermissionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedExtraRoleObjectPermissionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedExtraRoleObjectPermissionList) GetResults() []ExtraRoleObjectPermission { + if o == nil { + var ret []ExtraRoleObjectPermission + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedExtraRoleObjectPermissionList) GetResultsOk() ([]ExtraRoleObjectPermission, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedExtraRoleObjectPermissionList) SetResults(v []ExtraRoleObjectPermission) { + o.Results = v +} + +func (o PaginatedExtraRoleObjectPermissionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedExtraRoleObjectPermissionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedExtraRoleObjectPermissionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedExtraRoleObjectPermissionList := _PaginatedExtraRoleObjectPermissionList{} + + err = json.Unmarshal(data, &varPaginatedExtraRoleObjectPermissionList) + + if err != nil { + return err + } + + *o = PaginatedExtraRoleObjectPermissionList(varPaginatedExtraRoleObjectPermissionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedExtraRoleObjectPermissionList struct { + value *PaginatedExtraRoleObjectPermissionList + isSet bool +} + +func (v NullablePaginatedExtraRoleObjectPermissionList) Get() *PaginatedExtraRoleObjectPermissionList { + return v.value +} + +func (v *NullablePaginatedExtraRoleObjectPermissionList) Set(val *PaginatedExtraRoleObjectPermissionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedExtraRoleObjectPermissionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedExtraRoleObjectPermissionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedExtraRoleObjectPermissionList(val *PaginatedExtraRoleObjectPermissionList) *NullablePaginatedExtraRoleObjectPermissionList { + return &NullablePaginatedExtraRoleObjectPermissionList{value: val, isSet: true} +} + +func (v NullablePaginatedExtraRoleObjectPermissionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedExtraRoleObjectPermissionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_fleet_connector_list.go b/packages/client-go/model_paginated_fleet_connector_list.go new file mode 100644 index 0000000000..4673f829a1 --- /dev/null +++ b/packages/client-go/model_paginated_fleet_connector_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedFleetConnectorList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFleetConnectorList{} + +// PaginatedFleetConnectorList struct for PaginatedFleetConnectorList +type PaginatedFleetConnectorList struct { + Pagination Pagination `json:"pagination"` + Results []FleetConnector `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFleetConnectorList PaginatedFleetConnectorList + +// NewPaginatedFleetConnectorList instantiates a new PaginatedFleetConnectorList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFleetConnectorList(pagination Pagination, results []FleetConnector, autocomplete map[string]interface{}) *PaginatedFleetConnectorList { + this := PaginatedFleetConnectorList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedFleetConnectorListWithDefaults instantiates a new PaginatedFleetConnectorList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFleetConnectorListWithDefaults() *PaginatedFleetConnectorList { + this := PaginatedFleetConnectorList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedFleetConnectorList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedFleetConnectorList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedFleetConnectorList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedFleetConnectorList) GetResults() []FleetConnector { + if o == nil { + var ret []FleetConnector + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedFleetConnectorList) GetResultsOk() ([]FleetConnector, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedFleetConnectorList) SetResults(v []FleetConnector) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedFleetConnectorList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedFleetConnectorList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedFleetConnectorList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedFleetConnectorList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFleetConnectorList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFleetConnectorList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedFleetConnectorList := _PaginatedFleetConnectorList{} + + err = json.Unmarshal(data, &varPaginatedFleetConnectorList) + + if err != nil { + return err + } + + *o = PaginatedFleetConnectorList(varPaginatedFleetConnectorList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFleetConnectorList struct { + value *PaginatedFleetConnectorList + isSet bool +} + +func (v NullablePaginatedFleetConnectorList) Get() *PaginatedFleetConnectorList { + return v.value +} + +func (v *NullablePaginatedFleetConnectorList) Set(val *PaginatedFleetConnectorList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFleetConnectorList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFleetConnectorList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFleetConnectorList(val *PaginatedFleetConnectorList) *NullablePaginatedFleetConnectorList { + return &NullablePaginatedFleetConnectorList{value: val, isSet: true} +} + +func (v NullablePaginatedFleetConnectorList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFleetConnectorList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_flow_list.go b/packages/client-go/model_paginated_flow_list.go new file mode 100644 index 0000000000..4f02f92501 --- /dev/null +++ b/packages/client-go/model_paginated_flow_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedFlowList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFlowList{} + +// PaginatedFlowList struct for PaginatedFlowList +type PaginatedFlowList struct { + Pagination Pagination `json:"pagination"` + Results []Flow `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFlowList PaginatedFlowList + +// NewPaginatedFlowList instantiates a new PaginatedFlowList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFlowList(pagination Pagination, results []Flow, autocomplete map[string]interface{}) *PaginatedFlowList { + this := PaginatedFlowList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedFlowListWithDefaults instantiates a new PaginatedFlowList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFlowListWithDefaults() *PaginatedFlowList { + this := PaginatedFlowList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedFlowList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedFlowList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedFlowList) GetResults() []Flow { + if o == nil { + var ret []Flow + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowList) GetResultsOk() ([]Flow, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedFlowList) SetResults(v []Flow) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedFlowList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedFlowList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedFlowList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFlowList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFlowList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedFlowList := _PaginatedFlowList{} + + err = json.Unmarshal(data, &varPaginatedFlowList) + + if err != nil { + return err + } + + *o = PaginatedFlowList(varPaginatedFlowList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFlowList struct { + value *PaginatedFlowList + isSet bool +} + +func (v NullablePaginatedFlowList) Get() *PaginatedFlowList { + return v.value +} + +func (v *NullablePaginatedFlowList) Set(val *PaginatedFlowList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFlowList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFlowList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFlowList(val *PaginatedFlowList) *NullablePaginatedFlowList { + return &NullablePaginatedFlowList{value: val, isSet: true} +} + +func (v NullablePaginatedFlowList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFlowList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_flow_stage_binding_list.go b/packages/client-go/model_paginated_flow_stage_binding_list.go new file mode 100644 index 0000000000..3930adb1c4 --- /dev/null +++ b/packages/client-go/model_paginated_flow_stage_binding_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedFlowStageBindingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedFlowStageBindingList{} + +// PaginatedFlowStageBindingList struct for PaginatedFlowStageBindingList +type PaginatedFlowStageBindingList struct { + Pagination Pagination `json:"pagination"` + Results []FlowStageBinding `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedFlowStageBindingList PaginatedFlowStageBindingList + +// NewPaginatedFlowStageBindingList instantiates a new PaginatedFlowStageBindingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedFlowStageBindingList(pagination Pagination, results []FlowStageBinding, autocomplete map[string]interface{}) *PaginatedFlowStageBindingList { + this := PaginatedFlowStageBindingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedFlowStageBindingListWithDefaults instantiates a new PaginatedFlowStageBindingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedFlowStageBindingListWithDefaults() *PaginatedFlowStageBindingList { + this := PaginatedFlowStageBindingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedFlowStageBindingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowStageBindingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedFlowStageBindingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedFlowStageBindingList) GetResults() []FlowStageBinding { + if o == nil { + var ret []FlowStageBinding + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowStageBindingList) GetResultsOk() ([]FlowStageBinding, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedFlowStageBindingList) SetResults(v []FlowStageBinding) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedFlowStageBindingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedFlowStageBindingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedFlowStageBindingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedFlowStageBindingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedFlowStageBindingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedFlowStageBindingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedFlowStageBindingList := _PaginatedFlowStageBindingList{} + + err = json.Unmarshal(data, &varPaginatedFlowStageBindingList) + + if err != nil { + return err + } + + *o = PaginatedFlowStageBindingList(varPaginatedFlowStageBindingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedFlowStageBindingList struct { + value *PaginatedFlowStageBindingList + isSet bool +} + +func (v NullablePaginatedFlowStageBindingList) Get() *PaginatedFlowStageBindingList { + return v.value +} + +func (v *NullablePaginatedFlowStageBindingList) Set(val *PaginatedFlowStageBindingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedFlowStageBindingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedFlowStageBindingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedFlowStageBindingList(val *PaginatedFlowStageBindingList) *NullablePaginatedFlowStageBindingList { + return &NullablePaginatedFlowStageBindingList{value: val, isSet: true} +} + +func (v NullablePaginatedFlowStageBindingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedFlowStageBindingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_geo_ip_policy_list.go b/packages/client-go/model_paginated_geo_ip_policy_list.go new file mode 100644 index 0000000000..e18a6bb6d2 --- /dev/null +++ b/packages/client-go/model_paginated_geo_ip_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGeoIPPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGeoIPPolicyList{} + +// PaginatedGeoIPPolicyList struct for PaginatedGeoIPPolicyList +type PaginatedGeoIPPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []GeoIPPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGeoIPPolicyList PaginatedGeoIPPolicyList + +// NewPaginatedGeoIPPolicyList instantiates a new PaginatedGeoIPPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGeoIPPolicyList(pagination Pagination, results []GeoIPPolicy, autocomplete map[string]interface{}) *PaginatedGeoIPPolicyList { + this := PaginatedGeoIPPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGeoIPPolicyListWithDefaults instantiates a new PaginatedGeoIPPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGeoIPPolicyListWithDefaults() *PaginatedGeoIPPolicyList { + this := PaginatedGeoIPPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGeoIPPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGeoIPPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGeoIPPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGeoIPPolicyList) GetResults() []GeoIPPolicy { + if o == nil { + var ret []GeoIPPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGeoIPPolicyList) GetResultsOk() ([]GeoIPPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGeoIPPolicyList) SetResults(v []GeoIPPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGeoIPPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGeoIPPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGeoIPPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGeoIPPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGeoIPPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGeoIPPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGeoIPPolicyList := _PaginatedGeoIPPolicyList{} + + err = json.Unmarshal(data, &varPaginatedGeoIPPolicyList) + + if err != nil { + return err + } + + *o = PaginatedGeoIPPolicyList(varPaginatedGeoIPPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGeoIPPolicyList struct { + value *PaginatedGeoIPPolicyList + isSet bool +} + +func (v NullablePaginatedGeoIPPolicyList) Get() *PaginatedGeoIPPolicyList { + return v.value +} + +func (v *NullablePaginatedGeoIPPolicyList) Set(val *PaginatedGeoIPPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGeoIPPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGeoIPPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGeoIPPolicyList(val *PaginatedGeoIPPolicyList) *NullablePaginatedGeoIPPolicyList { + return &NullablePaginatedGeoIPPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedGeoIPPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGeoIPPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_chrome_connector_list.go b/packages/client-go/model_paginated_google_chrome_connector_list.go new file mode 100644 index 0000000000..468b01e89d --- /dev/null +++ b/packages/client-go/model_paginated_google_chrome_connector_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleChromeConnectorList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleChromeConnectorList{} + +// PaginatedGoogleChromeConnectorList struct for PaginatedGoogleChromeConnectorList +type PaginatedGoogleChromeConnectorList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleChromeConnector `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleChromeConnectorList PaginatedGoogleChromeConnectorList + +// NewPaginatedGoogleChromeConnectorList instantiates a new PaginatedGoogleChromeConnectorList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleChromeConnectorList(pagination Pagination, results []GoogleChromeConnector, autocomplete map[string]interface{}) *PaginatedGoogleChromeConnectorList { + this := PaginatedGoogleChromeConnectorList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleChromeConnectorListWithDefaults instantiates a new PaginatedGoogleChromeConnectorList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleChromeConnectorListWithDefaults() *PaginatedGoogleChromeConnectorList { + this := PaginatedGoogleChromeConnectorList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleChromeConnectorList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleChromeConnectorList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleChromeConnectorList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleChromeConnectorList) GetResults() []GoogleChromeConnector { + if o == nil { + var ret []GoogleChromeConnector + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleChromeConnectorList) GetResultsOk() ([]GoogleChromeConnector, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleChromeConnectorList) SetResults(v []GoogleChromeConnector) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleChromeConnectorList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleChromeConnectorList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleChromeConnectorList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleChromeConnectorList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleChromeConnectorList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleChromeConnectorList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleChromeConnectorList := _PaginatedGoogleChromeConnectorList{} + + err = json.Unmarshal(data, &varPaginatedGoogleChromeConnectorList) + + if err != nil { + return err + } + + *o = PaginatedGoogleChromeConnectorList(varPaginatedGoogleChromeConnectorList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleChromeConnectorList struct { + value *PaginatedGoogleChromeConnectorList + isSet bool +} + +func (v NullablePaginatedGoogleChromeConnectorList) Get() *PaginatedGoogleChromeConnectorList { + return v.value +} + +func (v *NullablePaginatedGoogleChromeConnectorList) Set(val *PaginatedGoogleChromeConnectorList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleChromeConnectorList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleChromeConnectorList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleChromeConnectorList(val *PaginatedGoogleChromeConnectorList) *NullablePaginatedGoogleChromeConnectorList { + return &NullablePaginatedGoogleChromeConnectorList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleChromeConnectorList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleChromeConnectorList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_endpoint_device_list.go b/packages/client-go/model_paginated_google_endpoint_device_list.go new file mode 100644 index 0000000000..a14b3b77d5 --- /dev/null +++ b/packages/client-go/model_paginated_google_endpoint_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleEndpointDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleEndpointDeviceList{} + +// PaginatedGoogleEndpointDeviceList struct for PaginatedGoogleEndpointDeviceList +type PaginatedGoogleEndpointDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleEndpointDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleEndpointDeviceList PaginatedGoogleEndpointDeviceList + +// NewPaginatedGoogleEndpointDeviceList instantiates a new PaginatedGoogleEndpointDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleEndpointDeviceList(pagination Pagination, results []GoogleEndpointDevice, autocomplete map[string]interface{}) *PaginatedGoogleEndpointDeviceList { + this := PaginatedGoogleEndpointDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleEndpointDeviceListWithDefaults instantiates a new PaginatedGoogleEndpointDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleEndpointDeviceListWithDefaults() *PaginatedGoogleEndpointDeviceList { + this := PaginatedGoogleEndpointDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleEndpointDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleEndpointDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleEndpointDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleEndpointDeviceList) GetResults() []GoogleEndpointDevice { + if o == nil { + var ret []GoogleEndpointDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleEndpointDeviceList) GetResultsOk() ([]GoogleEndpointDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleEndpointDeviceList) SetResults(v []GoogleEndpointDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleEndpointDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleEndpointDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleEndpointDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleEndpointDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleEndpointDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleEndpointDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleEndpointDeviceList := _PaginatedGoogleEndpointDeviceList{} + + err = json.Unmarshal(data, &varPaginatedGoogleEndpointDeviceList) + + if err != nil { + return err + } + + *o = PaginatedGoogleEndpointDeviceList(varPaginatedGoogleEndpointDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleEndpointDeviceList struct { + value *PaginatedGoogleEndpointDeviceList + isSet bool +} + +func (v NullablePaginatedGoogleEndpointDeviceList) Get() *PaginatedGoogleEndpointDeviceList { + return v.value +} + +func (v *NullablePaginatedGoogleEndpointDeviceList) Set(val *PaginatedGoogleEndpointDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleEndpointDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleEndpointDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleEndpointDeviceList(val *PaginatedGoogleEndpointDeviceList) *NullablePaginatedGoogleEndpointDeviceList { + return &NullablePaginatedGoogleEndpointDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleEndpointDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleEndpointDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_workspace_provider_group_list.go b/packages/client-go/model_paginated_google_workspace_provider_group_list.go new file mode 100644 index 0000000000..6a88161c39 --- /dev/null +++ b/packages/client-go/model_paginated_google_workspace_provider_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleWorkspaceProviderGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleWorkspaceProviderGroupList{} + +// PaginatedGoogleWorkspaceProviderGroupList struct for PaginatedGoogleWorkspaceProviderGroupList +type PaginatedGoogleWorkspaceProviderGroupList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleWorkspaceProviderGroup `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleWorkspaceProviderGroupList PaginatedGoogleWorkspaceProviderGroupList + +// NewPaginatedGoogleWorkspaceProviderGroupList instantiates a new PaginatedGoogleWorkspaceProviderGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleWorkspaceProviderGroupList(pagination Pagination, results []GoogleWorkspaceProviderGroup, autocomplete map[string]interface{}) *PaginatedGoogleWorkspaceProviderGroupList { + this := PaginatedGoogleWorkspaceProviderGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleWorkspaceProviderGroupListWithDefaults instantiates a new PaginatedGoogleWorkspaceProviderGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleWorkspaceProviderGroupListWithDefaults() *PaginatedGoogleWorkspaceProviderGroupList { + this := PaginatedGoogleWorkspaceProviderGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetResults() []GoogleWorkspaceProviderGroup { + if o == nil { + var ret []GoogleWorkspaceProviderGroup + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetResultsOk() ([]GoogleWorkspaceProviderGroup, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) SetResults(v []GoogleWorkspaceProviderGroup) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleWorkspaceProviderGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleWorkspaceProviderGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleWorkspaceProviderGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleWorkspaceProviderGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleWorkspaceProviderGroupList := _PaginatedGoogleWorkspaceProviderGroupList{} + + err = json.Unmarshal(data, &varPaginatedGoogleWorkspaceProviderGroupList) + + if err != nil { + return err + } + + *o = PaginatedGoogleWorkspaceProviderGroupList(varPaginatedGoogleWorkspaceProviderGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleWorkspaceProviderGroupList struct { + value *PaginatedGoogleWorkspaceProviderGroupList + isSet bool +} + +func (v NullablePaginatedGoogleWorkspaceProviderGroupList) Get() *PaginatedGoogleWorkspaceProviderGroupList { + return v.value +} + +func (v *NullablePaginatedGoogleWorkspaceProviderGroupList) Set(val *PaginatedGoogleWorkspaceProviderGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleWorkspaceProviderGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleWorkspaceProviderGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleWorkspaceProviderGroupList(val *PaginatedGoogleWorkspaceProviderGroupList) *NullablePaginatedGoogleWorkspaceProviderGroupList { + return &NullablePaginatedGoogleWorkspaceProviderGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleWorkspaceProviderGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleWorkspaceProviderGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_workspace_provider_list.go b/packages/client-go/model_paginated_google_workspace_provider_list.go new file mode 100644 index 0000000000..fa4a7a6e07 --- /dev/null +++ b/packages/client-go/model_paginated_google_workspace_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleWorkspaceProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleWorkspaceProviderList{} + +// PaginatedGoogleWorkspaceProviderList struct for PaginatedGoogleWorkspaceProviderList +type PaginatedGoogleWorkspaceProviderList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleWorkspaceProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleWorkspaceProviderList PaginatedGoogleWorkspaceProviderList + +// NewPaginatedGoogleWorkspaceProviderList instantiates a new PaginatedGoogleWorkspaceProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleWorkspaceProviderList(pagination Pagination, results []GoogleWorkspaceProvider, autocomplete map[string]interface{}) *PaginatedGoogleWorkspaceProviderList { + this := PaginatedGoogleWorkspaceProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleWorkspaceProviderListWithDefaults instantiates a new PaginatedGoogleWorkspaceProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleWorkspaceProviderListWithDefaults() *PaginatedGoogleWorkspaceProviderList { + this := PaginatedGoogleWorkspaceProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleWorkspaceProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleWorkspaceProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleWorkspaceProviderList) GetResults() []GoogleWorkspaceProvider { + if o == nil { + var ret []GoogleWorkspaceProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderList) GetResultsOk() ([]GoogleWorkspaceProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleWorkspaceProviderList) SetResults(v []GoogleWorkspaceProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleWorkspaceProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleWorkspaceProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleWorkspaceProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleWorkspaceProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleWorkspaceProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleWorkspaceProviderList := _PaginatedGoogleWorkspaceProviderList{} + + err = json.Unmarshal(data, &varPaginatedGoogleWorkspaceProviderList) + + if err != nil { + return err + } + + *o = PaginatedGoogleWorkspaceProviderList(varPaginatedGoogleWorkspaceProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleWorkspaceProviderList struct { + value *PaginatedGoogleWorkspaceProviderList + isSet bool +} + +func (v NullablePaginatedGoogleWorkspaceProviderList) Get() *PaginatedGoogleWorkspaceProviderList { + return v.value +} + +func (v *NullablePaginatedGoogleWorkspaceProviderList) Set(val *PaginatedGoogleWorkspaceProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleWorkspaceProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleWorkspaceProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleWorkspaceProviderList(val *PaginatedGoogleWorkspaceProviderList) *NullablePaginatedGoogleWorkspaceProviderList { + return &NullablePaginatedGoogleWorkspaceProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleWorkspaceProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleWorkspaceProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_workspace_provider_mapping_list.go b/packages/client-go/model_paginated_google_workspace_provider_mapping_list.go new file mode 100644 index 0000000000..a11fc0f35d --- /dev/null +++ b/packages/client-go/model_paginated_google_workspace_provider_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleWorkspaceProviderMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleWorkspaceProviderMappingList{} + +// PaginatedGoogleWorkspaceProviderMappingList struct for PaginatedGoogleWorkspaceProviderMappingList +type PaginatedGoogleWorkspaceProviderMappingList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleWorkspaceProviderMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleWorkspaceProviderMappingList PaginatedGoogleWorkspaceProviderMappingList + +// NewPaginatedGoogleWorkspaceProviderMappingList instantiates a new PaginatedGoogleWorkspaceProviderMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleWorkspaceProviderMappingList(pagination Pagination, results []GoogleWorkspaceProviderMapping, autocomplete map[string]interface{}) *PaginatedGoogleWorkspaceProviderMappingList { + this := PaginatedGoogleWorkspaceProviderMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleWorkspaceProviderMappingListWithDefaults instantiates a new PaginatedGoogleWorkspaceProviderMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleWorkspaceProviderMappingListWithDefaults() *PaginatedGoogleWorkspaceProviderMappingList { + this := PaginatedGoogleWorkspaceProviderMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetResults() []GoogleWorkspaceProviderMapping { + if o == nil { + var ret []GoogleWorkspaceProviderMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetResultsOk() ([]GoogleWorkspaceProviderMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) SetResults(v []GoogleWorkspaceProviderMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleWorkspaceProviderMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleWorkspaceProviderMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleWorkspaceProviderMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleWorkspaceProviderMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleWorkspaceProviderMappingList := _PaginatedGoogleWorkspaceProviderMappingList{} + + err = json.Unmarshal(data, &varPaginatedGoogleWorkspaceProviderMappingList) + + if err != nil { + return err + } + + *o = PaginatedGoogleWorkspaceProviderMappingList(varPaginatedGoogleWorkspaceProviderMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleWorkspaceProviderMappingList struct { + value *PaginatedGoogleWorkspaceProviderMappingList + isSet bool +} + +func (v NullablePaginatedGoogleWorkspaceProviderMappingList) Get() *PaginatedGoogleWorkspaceProviderMappingList { + return v.value +} + +func (v *NullablePaginatedGoogleWorkspaceProviderMappingList) Set(val *PaginatedGoogleWorkspaceProviderMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleWorkspaceProviderMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleWorkspaceProviderMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleWorkspaceProviderMappingList(val *PaginatedGoogleWorkspaceProviderMappingList) *NullablePaginatedGoogleWorkspaceProviderMappingList { + return &NullablePaginatedGoogleWorkspaceProviderMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleWorkspaceProviderMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleWorkspaceProviderMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_google_workspace_provider_user_list.go b/packages/client-go/model_paginated_google_workspace_provider_user_list.go new file mode 100644 index 0000000000..4b7a11828d --- /dev/null +++ b/packages/client-go/model_paginated_google_workspace_provider_user_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGoogleWorkspaceProviderUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGoogleWorkspaceProviderUserList{} + +// PaginatedGoogleWorkspaceProviderUserList struct for PaginatedGoogleWorkspaceProviderUserList +type PaginatedGoogleWorkspaceProviderUserList struct { + Pagination Pagination `json:"pagination"` + Results []GoogleWorkspaceProviderUser `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGoogleWorkspaceProviderUserList PaginatedGoogleWorkspaceProviderUserList + +// NewPaginatedGoogleWorkspaceProviderUserList instantiates a new PaginatedGoogleWorkspaceProviderUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGoogleWorkspaceProviderUserList(pagination Pagination, results []GoogleWorkspaceProviderUser, autocomplete map[string]interface{}) *PaginatedGoogleWorkspaceProviderUserList { + this := PaginatedGoogleWorkspaceProviderUserList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGoogleWorkspaceProviderUserListWithDefaults instantiates a new PaginatedGoogleWorkspaceProviderUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGoogleWorkspaceProviderUserListWithDefaults() *PaginatedGoogleWorkspaceProviderUserList { + this := PaginatedGoogleWorkspaceProviderUserList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGoogleWorkspaceProviderUserList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderUserList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGoogleWorkspaceProviderUserList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGoogleWorkspaceProviderUserList) GetResults() []GoogleWorkspaceProviderUser { + if o == nil { + var ret []GoogleWorkspaceProviderUser + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderUserList) GetResultsOk() ([]GoogleWorkspaceProviderUser, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGoogleWorkspaceProviderUserList) SetResults(v []GoogleWorkspaceProviderUser) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGoogleWorkspaceProviderUserList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGoogleWorkspaceProviderUserList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGoogleWorkspaceProviderUserList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGoogleWorkspaceProviderUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGoogleWorkspaceProviderUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGoogleWorkspaceProviderUserList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGoogleWorkspaceProviderUserList := _PaginatedGoogleWorkspaceProviderUserList{} + + err = json.Unmarshal(data, &varPaginatedGoogleWorkspaceProviderUserList) + + if err != nil { + return err + } + + *o = PaginatedGoogleWorkspaceProviderUserList(varPaginatedGoogleWorkspaceProviderUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGoogleWorkspaceProviderUserList struct { + value *PaginatedGoogleWorkspaceProviderUserList + isSet bool +} + +func (v NullablePaginatedGoogleWorkspaceProviderUserList) Get() *PaginatedGoogleWorkspaceProviderUserList { + return v.value +} + +func (v *NullablePaginatedGoogleWorkspaceProviderUserList) Set(val *PaginatedGoogleWorkspaceProviderUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGoogleWorkspaceProviderUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGoogleWorkspaceProviderUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGoogleWorkspaceProviderUserList(val *PaginatedGoogleWorkspaceProviderUserList) *NullablePaginatedGoogleWorkspaceProviderUserList { + return &NullablePaginatedGoogleWorkspaceProviderUserList{value: val, isSet: true} +} + +func (v NullablePaginatedGoogleWorkspaceProviderUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGoogleWorkspaceProviderUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_kerberos_source_connection_list.go b/packages/client-go/model_paginated_group_kerberos_source_connection_list.go new file mode 100644 index 0000000000..6502a300c9 --- /dev/null +++ b/packages/client-go/model_paginated_group_kerberos_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupKerberosSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupKerberosSourceConnectionList{} + +// PaginatedGroupKerberosSourceConnectionList struct for PaginatedGroupKerberosSourceConnectionList +type PaginatedGroupKerberosSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupKerberosSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupKerberosSourceConnectionList PaginatedGroupKerberosSourceConnectionList + +// NewPaginatedGroupKerberosSourceConnectionList instantiates a new PaginatedGroupKerberosSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupKerberosSourceConnectionList(pagination Pagination, results []GroupKerberosSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupKerberosSourceConnectionList { + this := PaginatedGroupKerberosSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupKerberosSourceConnectionListWithDefaults instantiates a new PaginatedGroupKerberosSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupKerberosSourceConnectionListWithDefaults() *PaginatedGroupKerberosSourceConnectionList { + this := PaginatedGroupKerberosSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupKerberosSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupKerberosSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupKerberosSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupKerberosSourceConnectionList) GetResults() []GroupKerberosSourceConnection { + if o == nil { + var ret []GroupKerberosSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupKerberosSourceConnectionList) GetResultsOk() ([]GroupKerberosSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupKerberosSourceConnectionList) SetResults(v []GroupKerberosSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupKerberosSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupKerberosSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupKerberosSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupKerberosSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupKerberosSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupKerberosSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupKerberosSourceConnectionList := _PaginatedGroupKerberosSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupKerberosSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupKerberosSourceConnectionList(varPaginatedGroupKerberosSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupKerberosSourceConnectionList struct { + value *PaginatedGroupKerberosSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupKerberosSourceConnectionList) Get() *PaginatedGroupKerberosSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupKerberosSourceConnectionList) Set(val *PaginatedGroupKerberosSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupKerberosSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupKerberosSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupKerberosSourceConnectionList(val *PaginatedGroupKerberosSourceConnectionList) *NullablePaginatedGroupKerberosSourceConnectionList { + return &NullablePaginatedGroupKerberosSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupKerberosSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupKerberosSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_ldap_source_connection_list.go b/packages/client-go/model_paginated_group_ldap_source_connection_list.go new file mode 100644 index 0000000000..9df4652502 --- /dev/null +++ b/packages/client-go/model_paginated_group_ldap_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupLDAPSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupLDAPSourceConnectionList{} + +// PaginatedGroupLDAPSourceConnectionList struct for PaginatedGroupLDAPSourceConnectionList +type PaginatedGroupLDAPSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupLDAPSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupLDAPSourceConnectionList PaginatedGroupLDAPSourceConnectionList + +// NewPaginatedGroupLDAPSourceConnectionList instantiates a new PaginatedGroupLDAPSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupLDAPSourceConnectionList(pagination Pagination, results []GroupLDAPSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupLDAPSourceConnectionList { + this := PaginatedGroupLDAPSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupLDAPSourceConnectionListWithDefaults instantiates a new PaginatedGroupLDAPSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupLDAPSourceConnectionListWithDefaults() *PaginatedGroupLDAPSourceConnectionList { + this := PaginatedGroupLDAPSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupLDAPSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupLDAPSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupLDAPSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupLDAPSourceConnectionList) GetResults() []GroupLDAPSourceConnection { + if o == nil { + var ret []GroupLDAPSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupLDAPSourceConnectionList) GetResultsOk() ([]GroupLDAPSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupLDAPSourceConnectionList) SetResults(v []GroupLDAPSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupLDAPSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupLDAPSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupLDAPSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupLDAPSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupLDAPSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupLDAPSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupLDAPSourceConnectionList := _PaginatedGroupLDAPSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupLDAPSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupLDAPSourceConnectionList(varPaginatedGroupLDAPSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupLDAPSourceConnectionList struct { + value *PaginatedGroupLDAPSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupLDAPSourceConnectionList) Get() *PaginatedGroupLDAPSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupLDAPSourceConnectionList) Set(val *PaginatedGroupLDAPSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupLDAPSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupLDAPSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupLDAPSourceConnectionList(val *PaginatedGroupLDAPSourceConnectionList) *NullablePaginatedGroupLDAPSourceConnectionList { + return &NullablePaginatedGroupLDAPSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupLDAPSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupLDAPSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_list.go b/packages/client-go/model_paginated_group_list.go new file mode 100644 index 0000000000..1b3633b392 --- /dev/null +++ b/packages/client-go/model_paginated_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupList{} + +// PaginatedGroupList struct for PaginatedGroupList +type PaginatedGroupList struct { + Pagination Pagination `json:"pagination"` + Results []Group `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupList PaginatedGroupList + +// NewPaginatedGroupList instantiates a new PaginatedGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupList(pagination Pagination, results []Group, autocomplete map[string]interface{}) *PaginatedGroupList { + this := PaginatedGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupListWithDefaults instantiates a new PaginatedGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupListWithDefaults() *PaginatedGroupList { + this := PaginatedGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupList) GetResults() []Group { + if o == nil { + var ret []Group + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupList) GetResultsOk() ([]Group, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupList) SetResults(v []Group) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupList := _PaginatedGroupList{} + + err = json.Unmarshal(data, &varPaginatedGroupList) + + if err != nil { + return err + } + + *o = PaginatedGroupList(varPaginatedGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupList struct { + value *PaginatedGroupList + isSet bool +} + +func (v NullablePaginatedGroupList) Get() *PaginatedGroupList { + return v.value +} + +func (v *NullablePaginatedGroupList) Set(val *PaginatedGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupList(val *PaginatedGroupList) *NullablePaginatedGroupList { + return &NullablePaginatedGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_o_auth_source_connection_list.go b/packages/client-go/model_paginated_group_o_auth_source_connection_list.go new file mode 100644 index 0000000000..240e7618f7 --- /dev/null +++ b/packages/client-go/model_paginated_group_o_auth_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupOAuthSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupOAuthSourceConnectionList{} + +// PaginatedGroupOAuthSourceConnectionList struct for PaginatedGroupOAuthSourceConnectionList +type PaginatedGroupOAuthSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupOAuthSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupOAuthSourceConnectionList PaginatedGroupOAuthSourceConnectionList + +// NewPaginatedGroupOAuthSourceConnectionList instantiates a new PaginatedGroupOAuthSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupOAuthSourceConnectionList(pagination Pagination, results []GroupOAuthSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupOAuthSourceConnectionList { + this := PaginatedGroupOAuthSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupOAuthSourceConnectionListWithDefaults instantiates a new PaginatedGroupOAuthSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupOAuthSourceConnectionListWithDefaults() *PaginatedGroupOAuthSourceConnectionList { + this := PaginatedGroupOAuthSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupOAuthSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupOAuthSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupOAuthSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupOAuthSourceConnectionList) GetResults() []GroupOAuthSourceConnection { + if o == nil { + var ret []GroupOAuthSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupOAuthSourceConnectionList) GetResultsOk() ([]GroupOAuthSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupOAuthSourceConnectionList) SetResults(v []GroupOAuthSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupOAuthSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupOAuthSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupOAuthSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupOAuthSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupOAuthSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupOAuthSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupOAuthSourceConnectionList := _PaginatedGroupOAuthSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupOAuthSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupOAuthSourceConnectionList(varPaginatedGroupOAuthSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupOAuthSourceConnectionList struct { + value *PaginatedGroupOAuthSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupOAuthSourceConnectionList) Get() *PaginatedGroupOAuthSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupOAuthSourceConnectionList) Set(val *PaginatedGroupOAuthSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupOAuthSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupOAuthSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupOAuthSourceConnectionList(val *PaginatedGroupOAuthSourceConnectionList) *NullablePaginatedGroupOAuthSourceConnectionList { + return &NullablePaginatedGroupOAuthSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupOAuthSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupOAuthSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_plex_source_connection_list.go b/packages/client-go/model_paginated_group_plex_source_connection_list.go new file mode 100644 index 0000000000..48da9e3c6a --- /dev/null +++ b/packages/client-go/model_paginated_group_plex_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupPlexSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupPlexSourceConnectionList{} + +// PaginatedGroupPlexSourceConnectionList struct for PaginatedGroupPlexSourceConnectionList +type PaginatedGroupPlexSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupPlexSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupPlexSourceConnectionList PaginatedGroupPlexSourceConnectionList + +// NewPaginatedGroupPlexSourceConnectionList instantiates a new PaginatedGroupPlexSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupPlexSourceConnectionList(pagination Pagination, results []GroupPlexSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupPlexSourceConnectionList { + this := PaginatedGroupPlexSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupPlexSourceConnectionListWithDefaults instantiates a new PaginatedGroupPlexSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupPlexSourceConnectionListWithDefaults() *PaginatedGroupPlexSourceConnectionList { + this := PaginatedGroupPlexSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupPlexSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupPlexSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupPlexSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupPlexSourceConnectionList) GetResults() []GroupPlexSourceConnection { + if o == nil { + var ret []GroupPlexSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupPlexSourceConnectionList) GetResultsOk() ([]GroupPlexSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupPlexSourceConnectionList) SetResults(v []GroupPlexSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupPlexSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupPlexSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupPlexSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupPlexSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupPlexSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupPlexSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupPlexSourceConnectionList := _PaginatedGroupPlexSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupPlexSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupPlexSourceConnectionList(varPaginatedGroupPlexSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupPlexSourceConnectionList struct { + value *PaginatedGroupPlexSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupPlexSourceConnectionList) Get() *PaginatedGroupPlexSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupPlexSourceConnectionList) Set(val *PaginatedGroupPlexSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupPlexSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupPlexSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupPlexSourceConnectionList(val *PaginatedGroupPlexSourceConnectionList) *NullablePaginatedGroupPlexSourceConnectionList { + return &NullablePaginatedGroupPlexSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupPlexSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupPlexSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_saml_source_connection_list.go b/packages/client-go/model_paginated_group_saml_source_connection_list.go new file mode 100644 index 0000000000..eab1a64b07 --- /dev/null +++ b/packages/client-go/model_paginated_group_saml_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupSAMLSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupSAMLSourceConnectionList{} + +// PaginatedGroupSAMLSourceConnectionList struct for PaginatedGroupSAMLSourceConnectionList +type PaginatedGroupSAMLSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupSAMLSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupSAMLSourceConnectionList PaginatedGroupSAMLSourceConnectionList + +// NewPaginatedGroupSAMLSourceConnectionList instantiates a new PaginatedGroupSAMLSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupSAMLSourceConnectionList(pagination Pagination, results []GroupSAMLSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupSAMLSourceConnectionList { + this := PaginatedGroupSAMLSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupSAMLSourceConnectionListWithDefaults instantiates a new PaginatedGroupSAMLSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupSAMLSourceConnectionListWithDefaults() *PaginatedGroupSAMLSourceConnectionList { + this := PaginatedGroupSAMLSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupSAMLSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSAMLSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupSAMLSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupSAMLSourceConnectionList) GetResults() []GroupSAMLSourceConnection { + if o == nil { + var ret []GroupSAMLSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSAMLSourceConnectionList) GetResultsOk() ([]GroupSAMLSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupSAMLSourceConnectionList) SetResults(v []GroupSAMLSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupSAMLSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSAMLSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupSAMLSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupSAMLSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupSAMLSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupSAMLSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupSAMLSourceConnectionList := _PaginatedGroupSAMLSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupSAMLSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupSAMLSourceConnectionList(varPaginatedGroupSAMLSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupSAMLSourceConnectionList struct { + value *PaginatedGroupSAMLSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupSAMLSourceConnectionList) Get() *PaginatedGroupSAMLSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupSAMLSourceConnectionList) Set(val *PaginatedGroupSAMLSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupSAMLSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupSAMLSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupSAMLSourceConnectionList(val *PaginatedGroupSAMLSourceConnectionList) *NullablePaginatedGroupSAMLSourceConnectionList { + return &NullablePaginatedGroupSAMLSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupSAMLSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupSAMLSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_source_connection_list.go b/packages/client-go/model_paginated_group_source_connection_list.go new file mode 100644 index 0000000000..bec7f61383 --- /dev/null +++ b/packages/client-go/model_paginated_group_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupSourceConnectionList{} + +// PaginatedGroupSourceConnectionList struct for PaginatedGroupSourceConnectionList +type PaginatedGroupSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupSourceConnectionList PaginatedGroupSourceConnectionList + +// NewPaginatedGroupSourceConnectionList instantiates a new PaginatedGroupSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupSourceConnectionList(pagination Pagination, results []GroupSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupSourceConnectionList { + this := PaginatedGroupSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupSourceConnectionListWithDefaults instantiates a new PaginatedGroupSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupSourceConnectionListWithDefaults() *PaginatedGroupSourceConnectionList { + this := PaginatedGroupSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupSourceConnectionList) GetResults() []GroupSourceConnection { + if o == nil { + var ret []GroupSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSourceConnectionList) GetResultsOk() ([]GroupSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupSourceConnectionList) SetResults(v []GroupSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupSourceConnectionList := _PaginatedGroupSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupSourceConnectionList(varPaginatedGroupSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupSourceConnectionList struct { + value *PaginatedGroupSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupSourceConnectionList) Get() *PaginatedGroupSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupSourceConnectionList) Set(val *PaginatedGroupSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupSourceConnectionList(val *PaginatedGroupSourceConnectionList) *NullablePaginatedGroupSourceConnectionList { + return &NullablePaginatedGroupSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_group_telegram_source_connection_list.go b/packages/client-go/model_paginated_group_telegram_source_connection_list.go new file mode 100644 index 0000000000..06f88ba98a --- /dev/null +++ b/packages/client-go/model_paginated_group_telegram_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedGroupTelegramSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedGroupTelegramSourceConnectionList{} + +// PaginatedGroupTelegramSourceConnectionList struct for PaginatedGroupTelegramSourceConnectionList +type PaginatedGroupTelegramSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []GroupTelegramSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedGroupTelegramSourceConnectionList PaginatedGroupTelegramSourceConnectionList + +// NewPaginatedGroupTelegramSourceConnectionList instantiates a new PaginatedGroupTelegramSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedGroupTelegramSourceConnectionList(pagination Pagination, results []GroupTelegramSourceConnection, autocomplete map[string]interface{}) *PaginatedGroupTelegramSourceConnectionList { + this := PaginatedGroupTelegramSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedGroupTelegramSourceConnectionListWithDefaults instantiates a new PaginatedGroupTelegramSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedGroupTelegramSourceConnectionListWithDefaults() *PaginatedGroupTelegramSourceConnectionList { + this := PaginatedGroupTelegramSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedGroupTelegramSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupTelegramSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedGroupTelegramSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedGroupTelegramSourceConnectionList) GetResults() []GroupTelegramSourceConnection { + if o == nil { + var ret []GroupTelegramSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupTelegramSourceConnectionList) GetResultsOk() ([]GroupTelegramSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedGroupTelegramSourceConnectionList) SetResults(v []GroupTelegramSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedGroupTelegramSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedGroupTelegramSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedGroupTelegramSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedGroupTelegramSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedGroupTelegramSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedGroupTelegramSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedGroupTelegramSourceConnectionList := _PaginatedGroupTelegramSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedGroupTelegramSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedGroupTelegramSourceConnectionList(varPaginatedGroupTelegramSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedGroupTelegramSourceConnectionList struct { + value *PaginatedGroupTelegramSourceConnectionList + isSet bool +} + +func (v NullablePaginatedGroupTelegramSourceConnectionList) Get() *PaginatedGroupTelegramSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedGroupTelegramSourceConnectionList) Set(val *PaginatedGroupTelegramSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedGroupTelegramSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedGroupTelegramSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedGroupTelegramSourceConnectionList(val *PaginatedGroupTelegramSourceConnectionList) *NullablePaginatedGroupTelegramSourceConnectionList { + return &NullablePaginatedGroupTelegramSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedGroupTelegramSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedGroupTelegramSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_identification_stage_list.go b/packages/client-go/model_paginated_identification_stage_list.go new file mode 100644 index 0000000000..e62980ef93 --- /dev/null +++ b/packages/client-go/model_paginated_identification_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedIdentificationStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedIdentificationStageList{} + +// PaginatedIdentificationStageList struct for PaginatedIdentificationStageList +type PaginatedIdentificationStageList struct { + Pagination Pagination `json:"pagination"` + Results []IdentificationStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedIdentificationStageList PaginatedIdentificationStageList + +// NewPaginatedIdentificationStageList instantiates a new PaginatedIdentificationStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedIdentificationStageList(pagination Pagination, results []IdentificationStage, autocomplete map[string]interface{}) *PaginatedIdentificationStageList { + this := PaginatedIdentificationStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedIdentificationStageListWithDefaults instantiates a new PaginatedIdentificationStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedIdentificationStageListWithDefaults() *PaginatedIdentificationStageList { + this := PaginatedIdentificationStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedIdentificationStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedIdentificationStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedIdentificationStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedIdentificationStageList) GetResults() []IdentificationStage { + if o == nil { + var ret []IdentificationStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedIdentificationStageList) GetResultsOk() ([]IdentificationStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedIdentificationStageList) SetResults(v []IdentificationStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedIdentificationStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedIdentificationStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedIdentificationStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedIdentificationStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedIdentificationStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedIdentificationStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedIdentificationStageList := _PaginatedIdentificationStageList{} + + err = json.Unmarshal(data, &varPaginatedIdentificationStageList) + + if err != nil { + return err + } + + *o = PaginatedIdentificationStageList(varPaginatedIdentificationStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedIdentificationStageList struct { + value *PaginatedIdentificationStageList + isSet bool +} + +func (v NullablePaginatedIdentificationStageList) Get() *PaginatedIdentificationStageList { + return v.value +} + +func (v *NullablePaginatedIdentificationStageList) Set(val *PaginatedIdentificationStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedIdentificationStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedIdentificationStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedIdentificationStageList(val *PaginatedIdentificationStageList) *NullablePaginatedIdentificationStageList { + return &NullablePaginatedIdentificationStageList{value: val, isSet: true} +} + +func (v NullablePaginatedIdentificationStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedIdentificationStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_initial_permissions_list.go b/packages/client-go/model_paginated_initial_permissions_list.go new file mode 100644 index 0000000000..e94c17abc4 --- /dev/null +++ b/packages/client-go/model_paginated_initial_permissions_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedInitialPermissionsList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInitialPermissionsList{} + +// PaginatedInitialPermissionsList struct for PaginatedInitialPermissionsList +type PaginatedInitialPermissionsList struct { + Pagination Pagination `json:"pagination"` + Results []InitialPermissions `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInitialPermissionsList PaginatedInitialPermissionsList + +// NewPaginatedInitialPermissionsList instantiates a new PaginatedInitialPermissionsList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInitialPermissionsList(pagination Pagination, results []InitialPermissions, autocomplete map[string]interface{}) *PaginatedInitialPermissionsList { + this := PaginatedInitialPermissionsList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedInitialPermissionsListWithDefaults instantiates a new PaginatedInitialPermissionsList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInitialPermissionsListWithDefaults() *PaginatedInitialPermissionsList { + this := PaginatedInitialPermissionsList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedInitialPermissionsList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedInitialPermissionsList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedInitialPermissionsList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedInitialPermissionsList) GetResults() []InitialPermissions { + if o == nil { + var ret []InitialPermissions + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedInitialPermissionsList) GetResultsOk() ([]InitialPermissions, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedInitialPermissionsList) SetResults(v []InitialPermissions) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedInitialPermissionsList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedInitialPermissionsList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedInitialPermissionsList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedInitialPermissionsList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInitialPermissionsList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInitialPermissionsList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedInitialPermissionsList := _PaginatedInitialPermissionsList{} + + err = json.Unmarshal(data, &varPaginatedInitialPermissionsList) + + if err != nil { + return err + } + + *o = PaginatedInitialPermissionsList(varPaginatedInitialPermissionsList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInitialPermissionsList struct { + value *PaginatedInitialPermissionsList + isSet bool +} + +func (v NullablePaginatedInitialPermissionsList) Get() *PaginatedInitialPermissionsList { + return v.value +} + +func (v *NullablePaginatedInitialPermissionsList) Set(val *PaginatedInitialPermissionsList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInitialPermissionsList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInitialPermissionsList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInitialPermissionsList(val *PaginatedInitialPermissionsList) *NullablePaginatedInitialPermissionsList { + return &NullablePaginatedInitialPermissionsList{value: val, isSet: true} +} + +func (v NullablePaginatedInitialPermissionsList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInitialPermissionsList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_invitation_list.go b/packages/client-go/model_paginated_invitation_list.go new file mode 100644 index 0000000000..4b95dda998 --- /dev/null +++ b/packages/client-go/model_paginated_invitation_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedInvitationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInvitationList{} + +// PaginatedInvitationList struct for PaginatedInvitationList +type PaginatedInvitationList struct { + Pagination Pagination `json:"pagination"` + Results []Invitation `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInvitationList PaginatedInvitationList + +// NewPaginatedInvitationList instantiates a new PaginatedInvitationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInvitationList(pagination Pagination, results []Invitation, autocomplete map[string]interface{}) *PaginatedInvitationList { + this := PaginatedInvitationList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedInvitationListWithDefaults instantiates a new PaginatedInvitationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInvitationListWithDefaults() *PaginatedInvitationList { + this := PaginatedInvitationList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedInvitationList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedInvitationList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedInvitationList) GetResults() []Invitation { + if o == nil { + var ret []Invitation + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationList) GetResultsOk() ([]Invitation, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedInvitationList) SetResults(v []Invitation) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedInvitationList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedInvitationList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedInvitationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInvitationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInvitationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedInvitationList := _PaginatedInvitationList{} + + err = json.Unmarshal(data, &varPaginatedInvitationList) + + if err != nil { + return err + } + + *o = PaginatedInvitationList(varPaginatedInvitationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInvitationList struct { + value *PaginatedInvitationList + isSet bool +} + +func (v NullablePaginatedInvitationList) Get() *PaginatedInvitationList { + return v.value +} + +func (v *NullablePaginatedInvitationList) Set(val *PaginatedInvitationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInvitationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInvitationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInvitationList(val *PaginatedInvitationList) *NullablePaginatedInvitationList { + return &NullablePaginatedInvitationList{value: val, isSet: true} +} + +func (v NullablePaginatedInvitationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInvitationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_invitation_stage_list.go b/packages/client-go/model_paginated_invitation_stage_list.go new file mode 100644 index 0000000000..35106f0cd2 --- /dev/null +++ b/packages/client-go/model_paginated_invitation_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedInvitationStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedInvitationStageList{} + +// PaginatedInvitationStageList struct for PaginatedInvitationStageList +type PaginatedInvitationStageList struct { + Pagination Pagination `json:"pagination"` + Results []InvitationStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedInvitationStageList PaginatedInvitationStageList + +// NewPaginatedInvitationStageList instantiates a new PaginatedInvitationStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedInvitationStageList(pagination Pagination, results []InvitationStage, autocomplete map[string]interface{}) *PaginatedInvitationStageList { + this := PaginatedInvitationStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedInvitationStageListWithDefaults instantiates a new PaginatedInvitationStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedInvitationStageListWithDefaults() *PaginatedInvitationStageList { + this := PaginatedInvitationStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedInvitationStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedInvitationStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedInvitationStageList) GetResults() []InvitationStage { + if o == nil { + var ret []InvitationStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationStageList) GetResultsOk() ([]InvitationStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedInvitationStageList) SetResults(v []InvitationStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedInvitationStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedInvitationStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedInvitationStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedInvitationStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedInvitationStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedInvitationStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedInvitationStageList := _PaginatedInvitationStageList{} + + err = json.Unmarshal(data, &varPaginatedInvitationStageList) + + if err != nil { + return err + } + + *o = PaginatedInvitationStageList(varPaginatedInvitationStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedInvitationStageList struct { + value *PaginatedInvitationStageList + isSet bool +} + +func (v NullablePaginatedInvitationStageList) Get() *PaginatedInvitationStageList { + return v.value +} + +func (v *NullablePaginatedInvitationStageList) Set(val *PaginatedInvitationStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedInvitationStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedInvitationStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedInvitationStageList(val *PaginatedInvitationStageList) *NullablePaginatedInvitationStageList { + return &NullablePaginatedInvitationStageList{value: val, isSet: true} +} + +func (v NullablePaginatedInvitationStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedInvitationStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_kerberos_source_list.go b/packages/client-go/model_paginated_kerberos_source_list.go new file mode 100644 index 0000000000..895183eb79 --- /dev/null +++ b/packages/client-go/model_paginated_kerberos_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedKerberosSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedKerberosSourceList{} + +// PaginatedKerberosSourceList struct for PaginatedKerberosSourceList +type PaginatedKerberosSourceList struct { + Pagination Pagination `json:"pagination"` + Results []KerberosSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedKerberosSourceList PaginatedKerberosSourceList + +// NewPaginatedKerberosSourceList instantiates a new PaginatedKerberosSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedKerberosSourceList(pagination Pagination, results []KerberosSource, autocomplete map[string]interface{}) *PaginatedKerberosSourceList { + this := PaginatedKerberosSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedKerberosSourceListWithDefaults instantiates a new PaginatedKerberosSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedKerberosSourceListWithDefaults() *PaginatedKerberosSourceList { + this := PaginatedKerberosSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedKerberosSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedKerberosSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedKerberosSourceList) GetResults() []KerberosSource { + if o == nil { + var ret []KerberosSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourceList) GetResultsOk() ([]KerberosSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedKerberosSourceList) SetResults(v []KerberosSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedKerberosSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedKerberosSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedKerberosSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedKerberosSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedKerberosSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedKerberosSourceList := _PaginatedKerberosSourceList{} + + err = json.Unmarshal(data, &varPaginatedKerberosSourceList) + + if err != nil { + return err + } + + *o = PaginatedKerberosSourceList(varPaginatedKerberosSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedKerberosSourceList struct { + value *PaginatedKerberosSourceList + isSet bool +} + +func (v NullablePaginatedKerberosSourceList) Get() *PaginatedKerberosSourceList { + return v.value +} + +func (v *NullablePaginatedKerberosSourceList) Set(val *PaginatedKerberosSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedKerberosSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedKerberosSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedKerberosSourceList(val *PaginatedKerberosSourceList) *NullablePaginatedKerberosSourceList { + return &NullablePaginatedKerberosSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedKerberosSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedKerberosSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_kerberos_source_property_mapping_list.go b/packages/client-go/model_paginated_kerberos_source_property_mapping_list.go new file mode 100644 index 0000000000..084e99ae90 --- /dev/null +++ b/packages/client-go/model_paginated_kerberos_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedKerberosSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedKerberosSourcePropertyMappingList{} + +// PaginatedKerberosSourcePropertyMappingList struct for PaginatedKerberosSourcePropertyMappingList +type PaginatedKerberosSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []KerberosSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedKerberosSourcePropertyMappingList PaginatedKerberosSourcePropertyMappingList + +// NewPaginatedKerberosSourcePropertyMappingList instantiates a new PaginatedKerberosSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedKerberosSourcePropertyMappingList(pagination Pagination, results []KerberosSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedKerberosSourcePropertyMappingList { + this := PaginatedKerberosSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedKerberosSourcePropertyMappingListWithDefaults instantiates a new PaginatedKerberosSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedKerberosSourcePropertyMappingListWithDefaults() *PaginatedKerberosSourcePropertyMappingList { + this := PaginatedKerberosSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedKerberosSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedKerberosSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedKerberosSourcePropertyMappingList) GetResults() []KerberosSourcePropertyMapping { + if o == nil { + var ret []KerberosSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourcePropertyMappingList) GetResultsOk() ([]KerberosSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedKerberosSourcePropertyMappingList) SetResults(v []KerberosSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedKerberosSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedKerberosSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedKerberosSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedKerberosSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedKerberosSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedKerberosSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedKerberosSourcePropertyMappingList := _PaginatedKerberosSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedKerberosSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedKerberosSourcePropertyMappingList(varPaginatedKerberosSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedKerberosSourcePropertyMappingList struct { + value *PaginatedKerberosSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedKerberosSourcePropertyMappingList) Get() *PaginatedKerberosSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedKerberosSourcePropertyMappingList) Set(val *PaginatedKerberosSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedKerberosSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedKerberosSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedKerberosSourcePropertyMappingList(val *PaginatedKerberosSourcePropertyMappingList) *NullablePaginatedKerberosSourcePropertyMappingList { + return &NullablePaginatedKerberosSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedKerberosSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedKerberosSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_kubernetes_service_connection_list.go b/packages/client-go/model_paginated_kubernetes_service_connection_list.go new file mode 100644 index 0000000000..ae8c6ef4eb --- /dev/null +++ b/packages/client-go/model_paginated_kubernetes_service_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedKubernetesServiceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedKubernetesServiceConnectionList{} + +// PaginatedKubernetesServiceConnectionList struct for PaginatedKubernetesServiceConnectionList +type PaginatedKubernetesServiceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []KubernetesServiceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedKubernetesServiceConnectionList PaginatedKubernetesServiceConnectionList + +// NewPaginatedKubernetesServiceConnectionList instantiates a new PaginatedKubernetesServiceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedKubernetesServiceConnectionList(pagination Pagination, results []KubernetesServiceConnection, autocomplete map[string]interface{}) *PaginatedKubernetesServiceConnectionList { + this := PaginatedKubernetesServiceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedKubernetesServiceConnectionListWithDefaults instantiates a new PaginatedKubernetesServiceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedKubernetesServiceConnectionListWithDefaults() *PaginatedKubernetesServiceConnectionList { + this := PaginatedKubernetesServiceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedKubernetesServiceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedKubernetesServiceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedKubernetesServiceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedKubernetesServiceConnectionList) GetResults() []KubernetesServiceConnection { + if o == nil { + var ret []KubernetesServiceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedKubernetesServiceConnectionList) GetResultsOk() ([]KubernetesServiceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedKubernetesServiceConnectionList) SetResults(v []KubernetesServiceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedKubernetesServiceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedKubernetesServiceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedKubernetesServiceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedKubernetesServiceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedKubernetesServiceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedKubernetesServiceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedKubernetesServiceConnectionList := _PaginatedKubernetesServiceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedKubernetesServiceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedKubernetesServiceConnectionList(varPaginatedKubernetesServiceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedKubernetesServiceConnectionList struct { + value *PaginatedKubernetesServiceConnectionList + isSet bool +} + +func (v NullablePaginatedKubernetesServiceConnectionList) Get() *PaginatedKubernetesServiceConnectionList { + return v.value +} + +func (v *NullablePaginatedKubernetesServiceConnectionList) Set(val *PaginatedKubernetesServiceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedKubernetesServiceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedKubernetesServiceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedKubernetesServiceConnectionList(val *PaginatedKubernetesServiceConnectionList) *NullablePaginatedKubernetesServiceConnectionList { + return &NullablePaginatedKubernetesServiceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedKubernetesServiceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedKubernetesServiceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ldap_outpost_config_list.go b/packages/client-go/model_paginated_ldap_outpost_config_list.go new file mode 100644 index 0000000000..803abb8f67 --- /dev/null +++ b/packages/client-go/model_paginated_ldap_outpost_config_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLDAPOutpostConfigList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLDAPOutpostConfigList{} + +// PaginatedLDAPOutpostConfigList struct for PaginatedLDAPOutpostConfigList +type PaginatedLDAPOutpostConfigList struct { + Pagination Pagination `json:"pagination"` + Results []LDAPOutpostConfig `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLDAPOutpostConfigList PaginatedLDAPOutpostConfigList + +// NewPaginatedLDAPOutpostConfigList instantiates a new PaginatedLDAPOutpostConfigList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLDAPOutpostConfigList(pagination Pagination, results []LDAPOutpostConfig, autocomplete map[string]interface{}) *PaginatedLDAPOutpostConfigList { + this := PaginatedLDAPOutpostConfigList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLDAPOutpostConfigListWithDefaults instantiates a new PaginatedLDAPOutpostConfigList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLDAPOutpostConfigListWithDefaults() *PaginatedLDAPOutpostConfigList { + this := PaginatedLDAPOutpostConfigList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLDAPOutpostConfigList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPOutpostConfigList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLDAPOutpostConfigList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLDAPOutpostConfigList) GetResults() []LDAPOutpostConfig { + if o == nil { + var ret []LDAPOutpostConfig + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPOutpostConfigList) GetResultsOk() ([]LDAPOutpostConfig, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLDAPOutpostConfigList) SetResults(v []LDAPOutpostConfig) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLDAPOutpostConfigList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPOutpostConfigList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLDAPOutpostConfigList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLDAPOutpostConfigList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLDAPOutpostConfigList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLDAPOutpostConfigList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLDAPOutpostConfigList := _PaginatedLDAPOutpostConfigList{} + + err = json.Unmarshal(data, &varPaginatedLDAPOutpostConfigList) + + if err != nil { + return err + } + + *o = PaginatedLDAPOutpostConfigList(varPaginatedLDAPOutpostConfigList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLDAPOutpostConfigList struct { + value *PaginatedLDAPOutpostConfigList + isSet bool +} + +func (v NullablePaginatedLDAPOutpostConfigList) Get() *PaginatedLDAPOutpostConfigList { + return v.value +} + +func (v *NullablePaginatedLDAPOutpostConfigList) Set(val *PaginatedLDAPOutpostConfigList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLDAPOutpostConfigList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLDAPOutpostConfigList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLDAPOutpostConfigList(val *PaginatedLDAPOutpostConfigList) *NullablePaginatedLDAPOutpostConfigList { + return &NullablePaginatedLDAPOutpostConfigList{value: val, isSet: true} +} + +func (v NullablePaginatedLDAPOutpostConfigList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLDAPOutpostConfigList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ldap_provider_list.go b/packages/client-go/model_paginated_ldap_provider_list.go new file mode 100644 index 0000000000..498583f118 --- /dev/null +++ b/packages/client-go/model_paginated_ldap_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLDAPProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLDAPProviderList{} + +// PaginatedLDAPProviderList struct for PaginatedLDAPProviderList +type PaginatedLDAPProviderList struct { + Pagination Pagination `json:"pagination"` + Results []LDAPProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLDAPProviderList PaginatedLDAPProviderList + +// NewPaginatedLDAPProviderList instantiates a new PaginatedLDAPProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLDAPProviderList(pagination Pagination, results []LDAPProvider, autocomplete map[string]interface{}) *PaginatedLDAPProviderList { + this := PaginatedLDAPProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLDAPProviderListWithDefaults instantiates a new PaginatedLDAPProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLDAPProviderListWithDefaults() *PaginatedLDAPProviderList { + this := PaginatedLDAPProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLDAPProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLDAPProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLDAPProviderList) GetResults() []LDAPProvider { + if o == nil { + var ret []LDAPProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPProviderList) GetResultsOk() ([]LDAPProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLDAPProviderList) SetResults(v []LDAPProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLDAPProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLDAPProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLDAPProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLDAPProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLDAPProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLDAPProviderList := _PaginatedLDAPProviderList{} + + err = json.Unmarshal(data, &varPaginatedLDAPProviderList) + + if err != nil { + return err + } + + *o = PaginatedLDAPProviderList(varPaginatedLDAPProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLDAPProviderList struct { + value *PaginatedLDAPProviderList + isSet bool +} + +func (v NullablePaginatedLDAPProviderList) Get() *PaginatedLDAPProviderList { + return v.value +} + +func (v *NullablePaginatedLDAPProviderList) Set(val *PaginatedLDAPProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLDAPProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLDAPProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLDAPProviderList(val *PaginatedLDAPProviderList) *NullablePaginatedLDAPProviderList { + return &NullablePaginatedLDAPProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedLDAPProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLDAPProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ldap_source_list.go b/packages/client-go/model_paginated_ldap_source_list.go new file mode 100644 index 0000000000..2b2ca2bdfc --- /dev/null +++ b/packages/client-go/model_paginated_ldap_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLDAPSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLDAPSourceList{} + +// PaginatedLDAPSourceList struct for PaginatedLDAPSourceList +type PaginatedLDAPSourceList struct { + Pagination Pagination `json:"pagination"` + Results []LDAPSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLDAPSourceList PaginatedLDAPSourceList + +// NewPaginatedLDAPSourceList instantiates a new PaginatedLDAPSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLDAPSourceList(pagination Pagination, results []LDAPSource, autocomplete map[string]interface{}) *PaginatedLDAPSourceList { + this := PaginatedLDAPSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLDAPSourceListWithDefaults instantiates a new PaginatedLDAPSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLDAPSourceListWithDefaults() *PaginatedLDAPSourceList { + this := PaginatedLDAPSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLDAPSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLDAPSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLDAPSourceList) GetResults() []LDAPSource { + if o == nil { + var ret []LDAPSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourceList) GetResultsOk() ([]LDAPSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLDAPSourceList) SetResults(v []LDAPSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLDAPSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLDAPSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLDAPSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLDAPSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLDAPSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLDAPSourceList := _PaginatedLDAPSourceList{} + + err = json.Unmarshal(data, &varPaginatedLDAPSourceList) + + if err != nil { + return err + } + + *o = PaginatedLDAPSourceList(varPaginatedLDAPSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLDAPSourceList struct { + value *PaginatedLDAPSourceList + isSet bool +} + +func (v NullablePaginatedLDAPSourceList) Get() *PaginatedLDAPSourceList { + return v.value +} + +func (v *NullablePaginatedLDAPSourceList) Set(val *PaginatedLDAPSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLDAPSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLDAPSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLDAPSourceList(val *PaginatedLDAPSourceList) *NullablePaginatedLDAPSourceList { + return &NullablePaginatedLDAPSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedLDAPSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLDAPSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ldap_source_property_mapping_list.go b/packages/client-go/model_paginated_ldap_source_property_mapping_list.go new file mode 100644 index 0000000000..49f7bf96fe --- /dev/null +++ b/packages/client-go/model_paginated_ldap_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLDAPSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLDAPSourcePropertyMappingList{} + +// PaginatedLDAPSourcePropertyMappingList struct for PaginatedLDAPSourcePropertyMappingList +type PaginatedLDAPSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []LDAPSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLDAPSourcePropertyMappingList PaginatedLDAPSourcePropertyMappingList + +// NewPaginatedLDAPSourcePropertyMappingList instantiates a new PaginatedLDAPSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLDAPSourcePropertyMappingList(pagination Pagination, results []LDAPSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedLDAPSourcePropertyMappingList { + this := PaginatedLDAPSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLDAPSourcePropertyMappingListWithDefaults instantiates a new PaginatedLDAPSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLDAPSourcePropertyMappingListWithDefaults() *PaginatedLDAPSourcePropertyMappingList { + this := PaginatedLDAPSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLDAPSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLDAPSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLDAPSourcePropertyMappingList) GetResults() []LDAPSourcePropertyMapping { + if o == nil { + var ret []LDAPSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourcePropertyMappingList) GetResultsOk() ([]LDAPSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLDAPSourcePropertyMappingList) SetResults(v []LDAPSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLDAPSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLDAPSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLDAPSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLDAPSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLDAPSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLDAPSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLDAPSourcePropertyMappingList := _PaginatedLDAPSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedLDAPSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedLDAPSourcePropertyMappingList(varPaginatedLDAPSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLDAPSourcePropertyMappingList struct { + value *PaginatedLDAPSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedLDAPSourcePropertyMappingList) Get() *PaginatedLDAPSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedLDAPSourcePropertyMappingList) Set(val *PaginatedLDAPSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLDAPSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLDAPSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLDAPSourcePropertyMappingList(val *PaginatedLDAPSourcePropertyMappingList) *NullablePaginatedLDAPSourcePropertyMappingList { + return &NullablePaginatedLDAPSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedLDAPSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLDAPSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_license_list.go b/packages/client-go/model_paginated_license_list.go new file mode 100644 index 0000000000..cf38228ba1 --- /dev/null +++ b/packages/client-go/model_paginated_license_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLicenseList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLicenseList{} + +// PaginatedLicenseList struct for PaginatedLicenseList +type PaginatedLicenseList struct { + Pagination Pagination `json:"pagination"` + Results []License `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLicenseList PaginatedLicenseList + +// NewPaginatedLicenseList instantiates a new PaginatedLicenseList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLicenseList(pagination Pagination, results []License, autocomplete map[string]interface{}) *PaginatedLicenseList { + this := PaginatedLicenseList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLicenseListWithDefaults instantiates a new PaginatedLicenseList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLicenseListWithDefaults() *PaginatedLicenseList { + this := PaginatedLicenseList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLicenseList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLicenseList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLicenseList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLicenseList) GetResults() []License { + if o == nil { + var ret []License + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLicenseList) GetResultsOk() ([]License, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLicenseList) SetResults(v []License) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLicenseList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLicenseList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLicenseList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLicenseList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLicenseList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLicenseList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLicenseList := _PaginatedLicenseList{} + + err = json.Unmarshal(data, &varPaginatedLicenseList) + + if err != nil { + return err + } + + *o = PaginatedLicenseList(varPaginatedLicenseList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLicenseList struct { + value *PaginatedLicenseList + isSet bool +} + +func (v NullablePaginatedLicenseList) Get() *PaginatedLicenseList { + return v.value +} + +func (v *NullablePaginatedLicenseList) Set(val *PaginatedLicenseList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLicenseList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLicenseList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLicenseList(val *PaginatedLicenseList) *NullablePaginatedLicenseList { + return &NullablePaginatedLicenseList{value: val, isSet: true} +} + +func (v NullablePaginatedLicenseList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLicenseList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_lifecycle_iteration_list.go b/packages/client-go/model_paginated_lifecycle_iteration_list.go new file mode 100644 index 0000000000..4aa03b5da7 --- /dev/null +++ b/packages/client-go/model_paginated_lifecycle_iteration_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLifecycleIterationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLifecycleIterationList{} + +// PaginatedLifecycleIterationList struct for PaginatedLifecycleIterationList +type PaginatedLifecycleIterationList struct { + Pagination Pagination `json:"pagination"` + Results []LifecycleIteration `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLifecycleIterationList PaginatedLifecycleIterationList + +// NewPaginatedLifecycleIterationList instantiates a new PaginatedLifecycleIterationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLifecycleIterationList(pagination Pagination, results []LifecycleIteration, autocomplete map[string]interface{}) *PaginatedLifecycleIterationList { + this := PaginatedLifecycleIterationList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLifecycleIterationListWithDefaults instantiates a new PaginatedLifecycleIterationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLifecycleIterationListWithDefaults() *PaginatedLifecycleIterationList { + this := PaginatedLifecycleIterationList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLifecycleIterationList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleIterationList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLifecycleIterationList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLifecycleIterationList) GetResults() []LifecycleIteration { + if o == nil { + var ret []LifecycleIteration + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleIterationList) GetResultsOk() ([]LifecycleIteration, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLifecycleIterationList) SetResults(v []LifecycleIteration) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLifecycleIterationList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleIterationList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLifecycleIterationList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLifecycleIterationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLifecycleIterationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLifecycleIterationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLifecycleIterationList := _PaginatedLifecycleIterationList{} + + err = json.Unmarshal(data, &varPaginatedLifecycleIterationList) + + if err != nil { + return err + } + + *o = PaginatedLifecycleIterationList(varPaginatedLifecycleIterationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLifecycleIterationList struct { + value *PaginatedLifecycleIterationList + isSet bool +} + +func (v NullablePaginatedLifecycleIterationList) Get() *PaginatedLifecycleIterationList { + return v.value +} + +func (v *NullablePaginatedLifecycleIterationList) Set(val *PaginatedLifecycleIterationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLifecycleIterationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLifecycleIterationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLifecycleIterationList(val *PaginatedLifecycleIterationList) *NullablePaginatedLifecycleIterationList { + return &NullablePaginatedLifecycleIterationList{value: val, isSet: true} +} + +func (v NullablePaginatedLifecycleIterationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLifecycleIterationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_lifecycle_rule_list.go b/packages/client-go/model_paginated_lifecycle_rule_list.go new file mode 100644 index 0000000000..1961c99417 --- /dev/null +++ b/packages/client-go/model_paginated_lifecycle_rule_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedLifecycleRuleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedLifecycleRuleList{} + +// PaginatedLifecycleRuleList struct for PaginatedLifecycleRuleList +type PaginatedLifecycleRuleList struct { + Pagination Pagination `json:"pagination"` + Results []LifecycleRule `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedLifecycleRuleList PaginatedLifecycleRuleList + +// NewPaginatedLifecycleRuleList instantiates a new PaginatedLifecycleRuleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedLifecycleRuleList(pagination Pagination, results []LifecycleRule, autocomplete map[string]interface{}) *PaginatedLifecycleRuleList { + this := PaginatedLifecycleRuleList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedLifecycleRuleListWithDefaults instantiates a new PaginatedLifecycleRuleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedLifecycleRuleListWithDefaults() *PaginatedLifecycleRuleList { + this := PaginatedLifecycleRuleList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedLifecycleRuleList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleRuleList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedLifecycleRuleList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedLifecycleRuleList) GetResults() []LifecycleRule { + if o == nil { + var ret []LifecycleRule + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleRuleList) GetResultsOk() ([]LifecycleRule, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedLifecycleRuleList) SetResults(v []LifecycleRule) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedLifecycleRuleList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedLifecycleRuleList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedLifecycleRuleList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedLifecycleRuleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedLifecycleRuleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedLifecycleRuleList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedLifecycleRuleList := _PaginatedLifecycleRuleList{} + + err = json.Unmarshal(data, &varPaginatedLifecycleRuleList) + + if err != nil { + return err + } + + *o = PaginatedLifecycleRuleList(varPaginatedLifecycleRuleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedLifecycleRuleList struct { + value *PaginatedLifecycleRuleList + isSet bool +} + +func (v NullablePaginatedLifecycleRuleList) Get() *PaginatedLifecycleRuleList { + return v.value +} + +func (v *NullablePaginatedLifecycleRuleList) Set(val *PaginatedLifecycleRuleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedLifecycleRuleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedLifecycleRuleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedLifecycleRuleList(val *PaginatedLifecycleRuleList) *NullablePaginatedLifecycleRuleList { + return &NullablePaginatedLifecycleRuleList{value: val, isSet: true} +} + +func (v NullablePaginatedLifecycleRuleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedLifecycleRuleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_microsoft_entra_provider_group_list.go b/packages/client-go/model_paginated_microsoft_entra_provider_group_list.go new file mode 100644 index 0000000000..012ad10c38 --- /dev/null +++ b/packages/client-go/model_paginated_microsoft_entra_provider_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedMicrosoftEntraProviderGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedMicrosoftEntraProviderGroupList{} + +// PaginatedMicrosoftEntraProviderGroupList struct for PaginatedMicrosoftEntraProviderGroupList +type PaginatedMicrosoftEntraProviderGroupList struct { + Pagination Pagination `json:"pagination"` + Results []MicrosoftEntraProviderGroup `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedMicrosoftEntraProviderGroupList PaginatedMicrosoftEntraProviderGroupList + +// NewPaginatedMicrosoftEntraProviderGroupList instantiates a new PaginatedMicrosoftEntraProviderGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedMicrosoftEntraProviderGroupList(pagination Pagination, results []MicrosoftEntraProviderGroup, autocomplete map[string]interface{}) *PaginatedMicrosoftEntraProviderGroupList { + this := PaginatedMicrosoftEntraProviderGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedMicrosoftEntraProviderGroupListWithDefaults instantiates a new PaginatedMicrosoftEntraProviderGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedMicrosoftEntraProviderGroupListWithDefaults() *PaginatedMicrosoftEntraProviderGroupList { + this := PaginatedMicrosoftEntraProviderGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedMicrosoftEntraProviderGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedMicrosoftEntraProviderGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedMicrosoftEntraProviderGroupList) GetResults() []MicrosoftEntraProviderGroup { + if o == nil { + var ret []MicrosoftEntraProviderGroup + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderGroupList) GetResultsOk() ([]MicrosoftEntraProviderGroup, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedMicrosoftEntraProviderGroupList) SetResults(v []MicrosoftEntraProviderGroup) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedMicrosoftEntraProviderGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedMicrosoftEntraProviderGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedMicrosoftEntraProviderGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedMicrosoftEntraProviderGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedMicrosoftEntraProviderGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedMicrosoftEntraProviderGroupList := _PaginatedMicrosoftEntraProviderGroupList{} + + err = json.Unmarshal(data, &varPaginatedMicrosoftEntraProviderGroupList) + + if err != nil { + return err + } + + *o = PaginatedMicrosoftEntraProviderGroupList(varPaginatedMicrosoftEntraProviderGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedMicrosoftEntraProviderGroupList struct { + value *PaginatedMicrosoftEntraProviderGroupList + isSet bool +} + +func (v NullablePaginatedMicrosoftEntraProviderGroupList) Get() *PaginatedMicrosoftEntraProviderGroupList { + return v.value +} + +func (v *NullablePaginatedMicrosoftEntraProviderGroupList) Set(val *PaginatedMicrosoftEntraProviderGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedMicrosoftEntraProviderGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedMicrosoftEntraProviderGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedMicrosoftEntraProviderGroupList(val *PaginatedMicrosoftEntraProviderGroupList) *NullablePaginatedMicrosoftEntraProviderGroupList { + return &NullablePaginatedMicrosoftEntraProviderGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedMicrosoftEntraProviderGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedMicrosoftEntraProviderGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_microsoft_entra_provider_list.go b/packages/client-go/model_paginated_microsoft_entra_provider_list.go new file mode 100644 index 0000000000..2e12f28e1c --- /dev/null +++ b/packages/client-go/model_paginated_microsoft_entra_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedMicrosoftEntraProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedMicrosoftEntraProviderList{} + +// PaginatedMicrosoftEntraProviderList struct for PaginatedMicrosoftEntraProviderList +type PaginatedMicrosoftEntraProviderList struct { + Pagination Pagination `json:"pagination"` + Results []MicrosoftEntraProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedMicrosoftEntraProviderList PaginatedMicrosoftEntraProviderList + +// NewPaginatedMicrosoftEntraProviderList instantiates a new PaginatedMicrosoftEntraProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedMicrosoftEntraProviderList(pagination Pagination, results []MicrosoftEntraProvider, autocomplete map[string]interface{}) *PaginatedMicrosoftEntraProviderList { + this := PaginatedMicrosoftEntraProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedMicrosoftEntraProviderListWithDefaults instantiates a new PaginatedMicrosoftEntraProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedMicrosoftEntraProviderListWithDefaults() *PaginatedMicrosoftEntraProviderList { + this := PaginatedMicrosoftEntraProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedMicrosoftEntraProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedMicrosoftEntraProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedMicrosoftEntraProviderList) GetResults() []MicrosoftEntraProvider { + if o == nil { + var ret []MicrosoftEntraProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderList) GetResultsOk() ([]MicrosoftEntraProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedMicrosoftEntraProviderList) SetResults(v []MicrosoftEntraProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedMicrosoftEntraProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedMicrosoftEntraProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedMicrosoftEntraProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedMicrosoftEntraProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedMicrosoftEntraProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedMicrosoftEntraProviderList := _PaginatedMicrosoftEntraProviderList{} + + err = json.Unmarshal(data, &varPaginatedMicrosoftEntraProviderList) + + if err != nil { + return err + } + + *o = PaginatedMicrosoftEntraProviderList(varPaginatedMicrosoftEntraProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedMicrosoftEntraProviderList struct { + value *PaginatedMicrosoftEntraProviderList + isSet bool +} + +func (v NullablePaginatedMicrosoftEntraProviderList) Get() *PaginatedMicrosoftEntraProviderList { + return v.value +} + +func (v *NullablePaginatedMicrosoftEntraProviderList) Set(val *PaginatedMicrosoftEntraProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedMicrosoftEntraProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedMicrosoftEntraProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedMicrosoftEntraProviderList(val *PaginatedMicrosoftEntraProviderList) *NullablePaginatedMicrosoftEntraProviderList { + return &NullablePaginatedMicrosoftEntraProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedMicrosoftEntraProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedMicrosoftEntraProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_microsoft_entra_provider_mapping_list.go b/packages/client-go/model_paginated_microsoft_entra_provider_mapping_list.go new file mode 100644 index 0000000000..1b534d11c8 --- /dev/null +++ b/packages/client-go/model_paginated_microsoft_entra_provider_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedMicrosoftEntraProviderMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedMicrosoftEntraProviderMappingList{} + +// PaginatedMicrosoftEntraProviderMappingList struct for PaginatedMicrosoftEntraProviderMappingList +type PaginatedMicrosoftEntraProviderMappingList struct { + Pagination Pagination `json:"pagination"` + Results []MicrosoftEntraProviderMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedMicrosoftEntraProviderMappingList PaginatedMicrosoftEntraProviderMappingList + +// NewPaginatedMicrosoftEntraProviderMappingList instantiates a new PaginatedMicrosoftEntraProviderMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedMicrosoftEntraProviderMappingList(pagination Pagination, results []MicrosoftEntraProviderMapping, autocomplete map[string]interface{}) *PaginatedMicrosoftEntraProviderMappingList { + this := PaginatedMicrosoftEntraProviderMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedMicrosoftEntraProviderMappingListWithDefaults instantiates a new PaginatedMicrosoftEntraProviderMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedMicrosoftEntraProviderMappingListWithDefaults() *PaginatedMicrosoftEntraProviderMappingList { + this := PaginatedMicrosoftEntraProviderMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedMicrosoftEntraProviderMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedMicrosoftEntraProviderMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedMicrosoftEntraProviderMappingList) GetResults() []MicrosoftEntraProviderMapping { + if o == nil { + var ret []MicrosoftEntraProviderMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderMappingList) GetResultsOk() ([]MicrosoftEntraProviderMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedMicrosoftEntraProviderMappingList) SetResults(v []MicrosoftEntraProviderMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedMicrosoftEntraProviderMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedMicrosoftEntraProviderMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedMicrosoftEntraProviderMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedMicrosoftEntraProviderMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedMicrosoftEntraProviderMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedMicrosoftEntraProviderMappingList := _PaginatedMicrosoftEntraProviderMappingList{} + + err = json.Unmarshal(data, &varPaginatedMicrosoftEntraProviderMappingList) + + if err != nil { + return err + } + + *o = PaginatedMicrosoftEntraProviderMappingList(varPaginatedMicrosoftEntraProviderMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedMicrosoftEntraProviderMappingList struct { + value *PaginatedMicrosoftEntraProviderMappingList + isSet bool +} + +func (v NullablePaginatedMicrosoftEntraProviderMappingList) Get() *PaginatedMicrosoftEntraProviderMappingList { + return v.value +} + +func (v *NullablePaginatedMicrosoftEntraProviderMappingList) Set(val *PaginatedMicrosoftEntraProviderMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedMicrosoftEntraProviderMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedMicrosoftEntraProviderMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedMicrosoftEntraProviderMappingList(val *PaginatedMicrosoftEntraProviderMappingList) *NullablePaginatedMicrosoftEntraProviderMappingList { + return &NullablePaginatedMicrosoftEntraProviderMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedMicrosoftEntraProviderMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedMicrosoftEntraProviderMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_microsoft_entra_provider_user_list.go b/packages/client-go/model_paginated_microsoft_entra_provider_user_list.go new file mode 100644 index 0000000000..29b9593ad6 --- /dev/null +++ b/packages/client-go/model_paginated_microsoft_entra_provider_user_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedMicrosoftEntraProviderUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedMicrosoftEntraProviderUserList{} + +// PaginatedMicrosoftEntraProviderUserList struct for PaginatedMicrosoftEntraProviderUserList +type PaginatedMicrosoftEntraProviderUserList struct { + Pagination Pagination `json:"pagination"` + Results []MicrosoftEntraProviderUser `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedMicrosoftEntraProviderUserList PaginatedMicrosoftEntraProviderUserList + +// NewPaginatedMicrosoftEntraProviderUserList instantiates a new PaginatedMicrosoftEntraProviderUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedMicrosoftEntraProviderUserList(pagination Pagination, results []MicrosoftEntraProviderUser, autocomplete map[string]interface{}) *PaginatedMicrosoftEntraProviderUserList { + this := PaginatedMicrosoftEntraProviderUserList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedMicrosoftEntraProviderUserListWithDefaults instantiates a new PaginatedMicrosoftEntraProviderUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedMicrosoftEntraProviderUserListWithDefaults() *PaginatedMicrosoftEntraProviderUserList { + this := PaginatedMicrosoftEntraProviderUserList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedMicrosoftEntraProviderUserList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderUserList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedMicrosoftEntraProviderUserList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedMicrosoftEntraProviderUserList) GetResults() []MicrosoftEntraProviderUser { + if o == nil { + var ret []MicrosoftEntraProviderUser + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderUserList) GetResultsOk() ([]MicrosoftEntraProviderUser, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedMicrosoftEntraProviderUserList) SetResults(v []MicrosoftEntraProviderUser) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedMicrosoftEntraProviderUserList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedMicrosoftEntraProviderUserList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedMicrosoftEntraProviderUserList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedMicrosoftEntraProviderUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedMicrosoftEntraProviderUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedMicrosoftEntraProviderUserList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedMicrosoftEntraProviderUserList := _PaginatedMicrosoftEntraProviderUserList{} + + err = json.Unmarshal(data, &varPaginatedMicrosoftEntraProviderUserList) + + if err != nil { + return err + } + + *o = PaginatedMicrosoftEntraProviderUserList(varPaginatedMicrosoftEntraProviderUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedMicrosoftEntraProviderUserList struct { + value *PaginatedMicrosoftEntraProviderUserList + isSet bool +} + +func (v NullablePaginatedMicrosoftEntraProviderUserList) Get() *PaginatedMicrosoftEntraProviderUserList { + return v.value +} + +func (v *NullablePaginatedMicrosoftEntraProviderUserList) Set(val *PaginatedMicrosoftEntraProviderUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedMicrosoftEntraProviderUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedMicrosoftEntraProviderUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedMicrosoftEntraProviderUserList(val *PaginatedMicrosoftEntraProviderUserList) *NullablePaginatedMicrosoftEntraProviderUserList { + return &NullablePaginatedMicrosoftEntraProviderUserList{value: val, isSet: true} +} + +func (v NullablePaginatedMicrosoftEntraProviderUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedMicrosoftEntraProviderUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_mutual_tls_stage_list.go b/packages/client-go/model_paginated_mutual_tls_stage_list.go new file mode 100644 index 0000000000..b2ae43df7a --- /dev/null +++ b/packages/client-go/model_paginated_mutual_tls_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedMutualTLSStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedMutualTLSStageList{} + +// PaginatedMutualTLSStageList struct for PaginatedMutualTLSStageList +type PaginatedMutualTLSStageList struct { + Pagination Pagination `json:"pagination"` + Results []MutualTLSStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedMutualTLSStageList PaginatedMutualTLSStageList + +// NewPaginatedMutualTLSStageList instantiates a new PaginatedMutualTLSStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedMutualTLSStageList(pagination Pagination, results []MutualTLSStage, autocomplete map[string]interface{}) *PaginatedMutualTLSStageList { + this := PaginatedMutualTLSStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedMutualTLSStageListWithDefaults instantiates a new PaginatedMutualTLSStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedMutualTLSStageListWithDefaults() *PaginatedMutualTLSStageList { + this := PaginatedMutualTLSStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedMutualTLSStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedMutualTLSStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedMutualTLSStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedMutualTLSStageList) GetResults() []MutualTLSStage { + if o == nil { + var ret []MutualTLSStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedMutualTLSStageList) GetResultsOk() ([]MutualTLSStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedMutualTLSStageList) SetResults(v []MutualTLSStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedMutualTLSStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedMutualTLSStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedMutualTLSStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedMutualTLSStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedMutualTLSStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedMutualTLSStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedMutualTLSStageList := _PaginatedMutualTLSStageList{} + + err = json.Unmarshal(data, &varPaginatedMutualTLSStageList) + + if err != nil { + return err + } + + *o = PaginatedMutualTLSStageList(varPaginatedMutualTLSStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedMutualTLSStageList struct { + value *PaginatedMutualTLSStageList + isSet bool +} + +func (v NullablePaginatedMutualTLSStageList) Get() *PaginatedMutualTLSStageList { + return v.value +} + +func (v *NullablePaginatedMutualTLSStageList) Set(val *PaginatedMutualTLSStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedMutualTLSStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedMutualTLSStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedMutualTLSStageList(val *PaginatedMutualTLSStageList) *NullablePaginatedMutualTLSStageList { + return &NullablePaginatedMutualTLSStageList{value: val, isSet: true} +} + +func (v NullablePaginatedMutualTLSStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedMutualTLSStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_notification_list.go b/packages/client-go/model_paginated_notification_list.go new file mode 100644 index 0000000000..009471e645 --- /dev/null +++ b/packages/client-go/model_paginated_notification_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedNotificationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedNotificationList{} + +// PaginatedNotificationList struct for PaginatedNotificationList +type PaginatedNotificationList struct { + Pagination Pagination `json:"pagination"` + Results []Notification `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedNotificationList PaginatedNotificationList + +// NewPaginatedNotificationList instantiates a new PaginatedNotificationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedNotificationList(pagination Pagination, results []Notification, autocomplete map[string]interface{}) *PaginatedNotificationList { + this := PaginatedNotificationList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedNotificationListWithDefaults instantiates a new PaginatedNotificationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedNotificationListWithDefaults() *PaginatedNotificationList { + this := PaginatedNotificationList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedNotificationList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedNotificationList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedNotificationList) GetResults() []Notification { + if o == nil { + var ret []Notification + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationList) GetResultsOk() ([]Notification, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedNotificationList) SetResults(v []Notification) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedNotificationList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedNotificationList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedNotificationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedNotificationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedNotificationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedNotificationList := _PaginatedNotificationList{} + + err = json.Unmarshal(data, &varPaginatedNotificationList) + + if err != nil { + return err + } + + *o = PaginatedNotificationList(varPaginatedNotificationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedNotificationList struct { + value *PaginatedNotificationList + isSet bool +} + +func (v NullablePaginatedNotificationList) Get() *PaginatedNotificationList { + return v.value +} + +func (v *NullablePaginatedNotificationList) Set(val *PaginatedNotificationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedNotificationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedNotificationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedNotificationList(val *PaginatedNotificationList) *NullablePaginatedNotificationList { + return &NullablePaginatedNotificationList{value: val, isSet: true} +} + +func (v NullablePaginatedNotificationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedNotificationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_notification_rule_list.go b/packages/client-go/model_paginated_notification_rule_list.go new file mode 100644 index 0000000000..bd6ad654e2 --- /dev/null +++ b/packages/client-go/model_paginated_notification_rule_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedNotificationRuleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedNotificationRuleList{} + +// PaginatedNotificationRuleList struct for PaginatedNotificationRuleList +type PaginatedNotificationRuleList struct { + Pagination Pagination `json:"pagination"` + Results []NotificationRule `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedNotificationRuleList PaginatedNotificationRuleList + +// NewPaginatedNotificationRuleList instantiates a new PaginatedNotificationRuleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedNotificationRuleList(pagination Pagination, results []NotificationRule, autocomplete map[string]interface{}) *PaginatedNotificationRuleList { + this := PaginatedNotificationRuleList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedNotificationRuleListWithDefaults instantiates a new PaginatedNotificationRuleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedNotificationRuleListWithDefaults() *PaginatedNotificationRuleList { + this := PaginatedNotificationRuleList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedNotificationRuleList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationRuleList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedNotificationRuleList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedNotificationRuleList) GetResults() []NotificationRule { + if o == nil { + var ret []NotificationRule + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationRuleList) GetResultsOk() ([]NotificationRule, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedNotificationRuleList) SetResults(v []NotificationRule) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedNotificationRuleList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationRuleList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedNotificationRuleList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedNotificationRuleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedNotificationRuleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedNotificationRuleList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedNotificationRuleList := _PaginatedNotificationRuleList{} + + err = json.Unmarshal(data, &varPaginatedNotificationRuleList) + + if err != nil { + return err + } + + *o = PaginatedNotificationRuleList(varPaginatedNotificationRuleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedNotificationRuleList struct { + value *PaginatedNotificationRuleList + isSet bool +} + +func (v NullablePaginatedNotificationRuleList) Get() *PaginatedNotificationRuleList { + return v.value +} + +func (v *NullablePaginatedNotificationRuleList) Set(val *PaginatedNotificationRuleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedNotificationRuleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedNotificationRuleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedNotificationRuleList(val *PaginatedNotificationRuleList) *NullablePaginatedNotificationRuleList { + return &NullablePaginatedNotificationRuleList{value: val, isSet: true} +} + +func (v NullablePaginatedNotificationRuleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedNotificationRuleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_notification_transport_list.go b/packages/client-go/model_paginated_notification_transport_list.go new file mode 100644 index 0000000000..2058e4be42 --- /dev/null +++ b/packages/client-go/model_paginated_notification_transport_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedNotificationTransportList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedNotificationTransportList{} + +// PaginatedNotificationTransportList struct for PaginatedNotificationTransportList +type PaginatedNotificationTransportList struct { + Pagination Pagination `json:"pagination"` + Results []NotificationTransport `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedNotificationTransportList PaginatedNotificationTransportList + +// NewPaginatedNotificationTransportList instantiates a new PaginatedNotificationTransportList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedNotificationTransportList(pagination Pagination, results []NotificationTransport, autocomplete map[string]interface{}) *PaginatedNotificationTransportList { + this := PaginatedNotificationTransportList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedNotificationTransportListWithDefaults instantiates a new PaginatedNotificationTransportList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedNotificationTransportListWithDefaults() *PaginatedNotificationTransportList { + this := PaginatedNotificationTransportList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedNotificationTransportList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationTransportList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedNotificationTransportList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedNotificationTransportList) GetResults() []NotificationTransport { + if o == nil { + var ret []NotificationTransport + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationTransportList) GetResultsOk() ([]NotificationTransport, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedNotificationTransportList) SetResults(v []NotificationTransport) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedNotificationTransportList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationTransportList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedNotificationTransportList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedNotificationTransportList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedNotificationTransportList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedNotificationTransportList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedNotificationTransportList := _PaginatedNotificationTransportList{} + + err = json.Unmarshal(data, &varPaginatedNotificationTransportList) + + if err != nil { + return err + } + + *o = PaginatedNotificationTransportList(varPaginatedNotificationTransportList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedNotificationTransportList struct { + value *PaginatedNotificationTransportList + isSet bool +} + +func (v NullablePaginatedNotificationTransportList) Get() *PaginatedNotificationTransportList { + return v.value +} + +func (v *NullablePaginatedNotificationTransportList) Set(val *PaginatedNotificationTransportList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedNotificationTransportList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedNotificationTransportList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedNotificationTransportList(val *PaginatedNotificationTransportList) *NullablePaginatedNotificationTransportList { + return &NullablePaginatedNotificationTransportList{value: val, isSet: true} +} + +func (v NullablePaginatedNotificationTransportList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedNotificationTransportList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_notification_webhook_mapping_list.go b/packages/client-go/model_paginated_notification_webhook_mapping_list.go new file mode 100644 index 0000000000..3116ba6c1a --- /dev/null +++ b/packages/client-go/model_paginated_notification_webhook_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedNotificationWebhookMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedNotificationWebhookMappingList{} + +// PaginatedNotificationWebhookMappingList struct for PaginatedNotificationWebhookMappingList +type PaginatedNotificationWebhookMappingList struct { + Pagination Pagination `json:"pagination"` + Results []NotificationWebhookMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedNotificationWebhookMappingList PaginatedNotificationWebhookMappingList + +// NewPaginatedNotificationWebhookMappingList instantiates a new PaginatedNotificationWebhookMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedNotificationWebhookMappingList(pagination Pagination, results []NotificationWebhookMapping, autocomplete map[string]interface{}) *PaginatedNotificationWebhookMappingList { + this := PaginatedNotificationWebhookMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedNotificationWebhookMappingListWithDefaults instantiates a new PaginatedNotificationWebhookMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedNotificationWebhookMappingListWithDefaults() *PaginatedNotificationWebhookMappingList { + this := PaginatedNotificationWebhookMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedNotificationWebhookMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationWebhookMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedNotificationWebhookMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedNotificationWebhookMappingList) GetResults() []NotificationWebhookMapping { + if o == nil { + var ret []NotificationWebhookMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationWebhookMappingList) GetResultsOk() ([]NotificationWebhookMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedNotificationWebhookMappingList) SetResults(v []NotificationWebhookMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedNotificationWebhookMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedNotificationWebhookMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedNotificationWebhookMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedNotificationWebhookMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedNotificationWebhookMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedNotificationWebhookMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedNotificationWebhookMappingList := _PaginatedNotificationWebhookMappingList{} + + err = json.Unmarshal(data, &varPaginatedNotificationWebhookMappingList) + + if err != nil { + return err + } + + *o = PaginatedNotificationWebhookMappingList(varPaginatedNotificationWebhookMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedNotificationWebhookMappingList struct { + value *PaginatedNotificationWebhookMappingList + isSet bool +} + +func (v NullablePaginatedNotificationWebhookMappingList) Get() *PaginatedNotificationWebhookMappingList { + return v.value +} + +func (v *NullablePaginatedNotificationWebhookMappingList) Set(val *PaginatedNotificationWebhookMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedNotificationWebhookMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedNotificationWebhookMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedNotificationWebhookMappingList(val *PaginatedNotificationWebhookMappingList) *NullablePaginatedNotificationWebhookMappingList { + return &NullablePaginatedNotificationWebhookMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedNotificationWebhookMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedNotificationWebhookMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_o_auth2_provider_list.go b/packages/client-go/model_paginated_o_auth2_provider_list.go new file mode 100644 index 0000000000..0cff7ec139 --- /dev/null +++ b/packages/client-go/model_paginated_o_auth2_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedOAuth2ProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedOAuth2ProviderList{} + +// PaginatedOAuth2ProviderList struct for PaginatedOAuth2ProviderList +type PaginatedOAuth2ProviderList struct { + Pagination Pagination `json:"pagination"` + Results []OAuth2Provider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedOAuth2ProviderList PaginatedOAuth2ProviderList + +// NewPaginatedOAuth2ProviderList instantiates a new PaginatedOAuth2ProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedOAuth2ProviderList(pagination Pagination, results []OAuth2Provider, autocomplete map[string]interface{}) *PaginatedOAuth2ProviderList { + this := PaginatedOAuth2ProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedOAuth2ProviderListWithDefaults instantiates a new PaginatedOAuth2ProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedOAuth2ProviderListWithDefaults() *PaginatedOAuth2ProviderList { + this := PaginatedOAuth2ProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedOAuth2ProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuth2ProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedOAuth2ProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedOAuth2ProviderList) GetResults() []OAuth2Provider { + if o == nil { + var ret []OAuth2Provider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuth2ProviderList) GetResultsOk() ([]OAuth2Provider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedOAuth2ProviderList) SetResults(v []OAuth2Provider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedOAuth2ProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuth2ProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedOAuth2ProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedOAuth2ProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedOAuth2ProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedOAuth2ProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedOAuth2ProviderList := _PaginatedOAuth2ProviderList{} + + err = json.Unmarshal(data, &varPaginatedOAuth2ProviderList) + + if err != nil { + return err + } + + *o = PaginatedOAuth2ProviderList(varPaginatedOAuth2ProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedOAuth2ProviderList struct { + value *PaginatedOAuth2ProviderList + isSet bool +} + +func (v NullablePaginatedOAuth2ProviderList) Get() *PaginatedOAuth2ProviderList { + return v.value +} + +func (v *NullablePaginatedOAuth2ProviderList) Set(val *PaginatedOAuth2ProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedOAuth2ProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedOAuth2ProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedOAuth2ProviderList(val *PaginatedOAuth2ProviderList) *NullablePaginatedOAuth2ProviderList { + return &NullablePaginatedOAuth2ProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedOAuth2ProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedOAuth2ProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_o_auth_source_list.go b/packages/client-go/model_paginated_o_auth_source_list.go new file mode 100644 index 0000000000..625cdb2bb1 --- /dev/null +++ b/packages/client-go/model_paginated_o_auth_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedOAuthSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedOAuthSourceList{} + +// PaginatedOAuthSourceList struct for PaginatedOAuthSourceList +type PaginatedOAuthSourceList struct { + Pagination Pagination `json:"pagination"` + Results []OAuthSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedOAuthSourceList PaginatedOAuthSourceList + +// NewPaginatedOAuthSourceList instantiates a new PaginatedOAuthSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedOAuthSourceList(pagination Pagination, results []OAuthSource, autocomplete map[string]interface{}) *PaginatedOAuthSourceList { + this := PaginatedOAuthSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedOAuthSourceListWithDefaults instantiates a new PaginatedOAuthSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedOAuthSourceListWithDefaults() *PaginatedOAuthSourceList { + this := PaginatedOAuthSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedOAuthSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedOAuthSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedOAuthSourceList) GetResults() []OAuthSource { + if o == nil { + var ret []OAuthSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourceList) GetResultsOk() ([]OAuthSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedOAuthSourceList) SetResults(v []OAuthSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedOAuthSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedOAuthSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedOAuthSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedOAuthSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedOAuthSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedOAuthSourceList := _PaginatedOAuthSourceList{} + + err = json.Unmarshal(data, &varPaginatedOAuthSourceList) + + if err != nil { + return err + } + + *o = PaginatedOAuthSourceList(varPaginatedOAuthSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedOAuthSourceList struct { + value *PaginatedOAuthSourceList + isSet bool +} + +func (v NullablePaginatedOAuthSourceList) Get() *PaginatedOAuthSourceList { + return v.value +} + +func (v *NullablePaginatedOAuthSourceList) Set(val *PaginatedOAuthSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedOAuthSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedOAuthSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedOAuthSourceList(val *PaginatedOAuthSourceList) *NullablePaginatedOAuthSourceList { + return &NullablePaginatedOAuthSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedOAuthSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedOAuthSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_o_auth_source_property_mapping_list.go b/packages/client-go/model_paginated_o_auth_source_property_mapping_list.go new file mode 100644 index 0000000000..a0b8b3a88e --- /dev/null +++ b/packages/client-go/model_paginated_o_auth_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedOAuthSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedOAuthSourcePropertyMappingList{} + +// PaginatedOAuthSourcePropertyMappingList struct for PaginatedOAuthSourcePropertyMappingList +type PaginatedOAuthSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []OAuthSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedOAuthSourcePropertyMappingList PaginatedOAuthSourcePropertyMappingList + +// NewPaginatedOAuthSourcePropertyMappingList instantiates a new PaginatedOAuthSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedOAuthSourcePropertyMappingList(pagination Pagination, results []OAuthSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedOAuthSourcePropertyMappingList { + this := PaginatedOAuthSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedOAuthSourcePropertyMappingListWithDefaults instantiates a new PaginatedOAuthSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedOAuthSourcePropertyMappingListWithDefaults() *PaginatedOAuthSourcePropertyMappingList { + this := PaginatedOAuthSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedOAuthSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedOAuthSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedOAuthSourcePropertyMappingList) GetResults() []OAuthSourcePropertyMapping { + if o == nil { + var ret []OAuthSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourcePropertyMappingList) GetResultsOk() ([]OAuthSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedOAuthSourcePropertyMappingList) SetResults(v []OAuthSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedOAuthSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedOAuthSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedOAuthSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedOAuthSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedOAuthSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedOAuthSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedOAuthSourcePropertyMappingList := _PaginatedOAuthSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedOAuthSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedOAuthSourcePropertyMappingList(varPaginatedOAuthSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedOAuthSourcePropertyMappingList struct { + value *PaginatedOAuthSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedOAuthSourcePropertyMappingList) Get() *PaginatedOAuthSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedOAuthSourcePropertyMappingList) Set(val *PaginatedOAuthSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedOAuthSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedOAuthSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedOAuthSourcePropertyMappingList(val *PaginatedOAuthSourcePropertyMappingList) *NullablePaginatedOAuthSourcePropertyMappingList { + return &NullablePaginatedOAuthSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedOAuthSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedOAuthSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_outpost_list.go b/packages/client-go/model_paginated_outpost_list.go new file mode 100644 index 0000000000..1993b2a0e2 --- /dev/null +++ b/packages/client-go/model_paginated_outpost_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedOutpostList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedOutpostList{} + +// PaginatedOutpostList struct for PaginatedOutpostList +type PaginatedOutpostList struct { + Pagination Pagination `json:"pagination"` + Results []Outpost `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedOutpostList PaginatedOutpostList + +// NewPaginatedOutpostList instantiates a new PaginatedOutpostList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedOutpostList(pagination Pagination, results []Outpost, autocomplete map[string]interface{}) *PaginatedOutpostList { + this := PaginatedOutpostList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedOutpostListWithDefaults instantiates a new PaginatedOutpostList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedOutpostListWithDefaults() *PaginatedOutpostList { + this := PaginatedOutpostList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedOutpostList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedOutpostList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedOutpostList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedOutpostList) GetResults() []Outpost { + if o == nil { + var ret []Outpost + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedOutpostList) GetResultsOk() ([]Outpost, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedOutpostList) SetResults(v []Outpost) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedOutpostList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedOutpostList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedOutpostList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedOutpostList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedOutpostList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedOutpostList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedOutpostList := _PaginatedOutpostList{} + + err = json.Unmarshal(data, &varPaginatedOutpostList) + + if err != nil { + return err + } + + *o = PaginatedOutpostList(varPaginatedOutpostList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedOutpostList struct { + value *PaginatedOutpostList + isSet bool +} + +func (v NullablePaginatedOutpostList) Get() *PaginatedOutpostList { + return v.value +} + +func (v *NullablePaginatedOutpostList) Set(val *PaginatedOutpostList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedOutpostList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedOutpostList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedOutpostList(val *PaginatedOutpostList) *NullablePaginatedOutpostList { + return &NullablePaginatedOutpostList{value: val, isSet: true} +} + +func (v NullablePaginatedOutpostList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedOutpostList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_password_expiry_policy_list.go b/packages/client-go/model_paginated_password_expiry_policy_list.go new file mode 100644 index 0000000000..78a7fc79bc --- /dev/null +++ b/packages/client-go/model_paginated_password_expiry_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPasswordExpiryPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPasswordExpiryPolicyList{} + +// PaginatedPasswordExpiryPolicyList struct for PaginatedPasswordExpiryPolicyList +type PaginatedPasswordExpiryPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []PasswordExpiryPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPasswordExpiryPolicyList PaginatedPasswordExpiryPolicyList + +// NewPaginatedPasswordExpiryPolicyList instantiates a new PaginatedPasswordExpiryPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPasswordExpiryPolicyList(pagination Pagination, results []PasswordExpiryPolicy, autocomplete map[string]interface{}) *PaginatedPasswordExpiryPolicyList { + this := PaginatedPasswordExpiryPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPasswordExpiryPolicyListWithDefaults instantiates a new PaginatedPasswordExpiryPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPasswordExpiryPolicyListWithDefaults() *PaginatedPasswordExpiryPolicyList { + this := PaginatedPasswordExpiryPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPasswordExpiryPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordExpiryPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPasswordExpiryPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPasswordExpiryPolicyList) GetResults() []PasswordExpiryPolicy { + if o == nil { + var ret []PasswordExpiryPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordExpiryPolicyList) GetResultsOk() ([]PasswordExpiryPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPasswordExpiryPolicyList) SetResults(v []PasswordExpiryPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPasswordExpiryPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordExpiryPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPasswordExpiryPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPasswordExpiryPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPasswordExpiryPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPasswordExpiryPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPasswordExpiryPolicyList := _PaginatedPasswordExpiryPolicyList{} + + err = json.Unmarshal(data, &varPaginatedPasswordExpiryPolicyList) + + if err != nil { + return err + } + + *o = PaginatedPasswordExpiryPolicyList(varPaginatedPasswordExpiryPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPasswordExpiryPolicyList struct { + value *PaginatedPasswordExpiryPolicyList + isSet bool +} + +func (v NullablePaginatedPasswordExpiryPolicyList) Get() *PaginatedPasswordExpiryPolicyList { + return v.value +} + +func (v *NullablePaginatedPasswordExpiryPolicyList) Set(val *PaginatedPasswordExpiryPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPasswordExpiryPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPasswordExpiryPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPasswordExpiryPolicyList(val *PaginatedPasswordExpiryPolicyList) *NullablePaginatedPasswordExpiryPolicyList { + return &NullablePaginatedPasswordExpiryPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedPasswordExpiryPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPasswordExpiryPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_password_policy_list.go b/packages/client-go/model_paginated_password_policy_list.go new file mode 100644 index 0000000000..5775722006 --- /dev/null +++ b/packages/client-go/model_paginated_password_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPasswordPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPasswordPolicyList{} + +// PaginatedPasswordPolicyList struct for PaginatedPasswordPolicyList +type PaginatedPasswordPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []PasswordPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPasswordPolicyList PaginatedPasswordPolicyList + +// NewPaginatedPasswordPolicyList instantiates a new PaginatedPasswordPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPasswordPolicyList(pagination Pagination, results []PasswordPolicy, autocomplete map[string]interface{}) *PaginatedPasswordPolicyList { + this := PaginatedPasswordPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPasswordPolicyListWithDefaults instantiates a new PaginatedPasswordPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPasswordPolicyListWithDefaults() *PaginatedPasswordPolicyList { + this := PaginatedPasswordPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPasswordPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPasswordPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPasswordPolicyList) GetResults() []PasswordPolicy { + if o == nil { + var ret []PasswordPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordPolicyList) GetResultsOk() ([]PasswordPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPasswordPolicyList) SetResults(v []PasswordPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPasswordPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPasswordPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPasswordPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPasswordPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPasswordPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPasswordPolicyList := _PaginatedPasswordPolicyList{} + + err = json.Unmarshal(data, &varPaginatedPasswordPolicyList) + + if err != nil { + return err + } + + *o = PaginatedPasswordPolicyList(varPaginatedPasswordPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPasswordPolicyList struct { + value *PaginatedPasswordPolicyList + isSet bool +} + +func (v NullablePaginatedPasswordPolicyList) Get() *PaginatedPasswordPolicyList { + return v.value +} + +func (v *NullablePaginatedPasswordPolicyList) Set(val *PaginatedPasswordPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPasswordPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPasswordPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPasswordPolicyList(val *PaginatedPasswordPolicyList) *NullablePaginatedPasswordPolicyList { + return &NullablePaginatedPasswordPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedPasswordPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPasswordPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_password_stage_list.go b/packages/client-go/model_paginated_password_stage_list.go new file mode 100644 index 0000000000..d065c9857f --- /dev/null +++ b/packages/client-go/model_paginated_password_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPasswordStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPasswordStageList{} + +// PaginatedPasswordStageList struct for PaginatedPasswordStageList +type PaginatedPasswordStageList struct { + Pagination Pagination `json:"pagination"` + Results []PasswordStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPasswordStageList PaginatedPasswordStageList + +// NewPaginatedPasswordStageList instantiates a new PaginatedPasswordStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPasswordStageList(pagination Pagination, results []PasswordStage, autocomplete map[string]interface{}) *PaginatedPasswordStageList { + this := PaginatedPasswordStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPasswordStageListWithDefaults instantiates a new PaginatedPasswordStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPasswordStageListWithDefaults() *PaginatedPasswordStageList { + this := PaginatedPasswordStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPasswordStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPasswordStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPasswordStageList) GetResults() []PasswordStage { + if o == nil { + var ret []PasswordStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordStageList) GetResultsOk() ([]PasswordStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPasswordStageList) SetResults(v []PasswordStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPasswordStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPasswordStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPasswordStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPasswordStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPasswordStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPasswordStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPasswordStageList := _PaginatedPasswordStageList{} + + err = json.Unmarshal(data, &varPaginatedPasswordStageList) + + if err != nil { + return err + } + + *o = PaginatedPasswordStageList(varPaginatedPasswordStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPasswordStageList struct { + value *PaginatedPasswordStageList + isSet bool +} + +func (v NullablePaginatedPasswordStageList) Get() *PaginatedPasswordStageList { + return v.value +} + +func (v *NullablePaginatedPasswordStageList) Set(val *PaginatedPasswordStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPasswordStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPasswordStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPasswordStageList(val *PaginatedPasswordStageList) *NullablePaginatedPasswordStageList { + return &NullablePaginatedPasswordStageList{value: val, isSet: true} +} + +func (v NullablePaginatedPasswordStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPasswordStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_permission_list.go b/packages/client-go/model_paginated_permission_list.go new file mode 100644 index 0000000000..90f48d9f5e --- /dev/null +++ b/packages/client-go/model_paginated_permission_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPermissionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPermissionList{} + +// PaginatedPermissionList struct for PaginatedPermissionList +type PaginatedPermissionList struct { + Pagination Pagination `json:"pagination"` + Results []Permission `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPermissionList PaginatedPermissionList + +// NewPaginatedPermissionList instantiates a new PaginatedPermissionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPermissionList(pagination Pagination, results []Permission, autocomplete map[string]interface{}) *PaginatedPermissionList { + this := PaginatedPermissionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPermissionListWithDefaults instantiates a new PaginatedPermissionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPermissionListWithDefaults() *PaginatedPermissionList { + this := PaginatedPermissionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPermissionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPermissionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPermissionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPermissionList) GetResults() []Permission { + if o == nil { + var ret []Permission + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPermissionList) GetResultsOk() ([]Permission, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPermissionList) SetResults(v []Permission) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPermissionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPermissionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPermissionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPermissionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPermissionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPermissionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPermissionList := _PaginatedPermissionList{} + + err = json.Unmarshal(data, &varPaginatedPermissionList) + + if err != nil { + return err + } + + *o = PaginatedPermissionList(varPaginatedPermissionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPermissionList struct { + value *PaginatedPermissionList + isSet bool +} + +func (v NullablePaginatedPermissionList) Get() *PaginatedPermissionList { + return v.value +} + +func (v *NullablePaginatedPermissionList) Set(val *PaginatedPermissionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPermissionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPermissionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPermissionList(val *PaginatedPermissionList) *NullablePaginatedPermissionList { + return &NullablePaginatedPermissionList{value: val, isSet: true} +} + +func (v NullablePaginatedPermissionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPermissionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_plex_source_list.go b/packages/client-go/model_paginated_plex_source_list.go new file mode 100644 index 0000000000..6d3b1a446e --- /dev/null +++ b/packages/client-go/model_paginated_plex_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPlexSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPlexSourceList{} + +// PaginatedPlexSourceList struct for PaginatedPlexSourceList +type PaginatedPlexSourceList struct { + Pagination Pagination `json:"pagination"` + Results []PlexSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPlexSourceList PaginatedPlexSourceList + +// NewPaginatedPlexSourceList instantiates a new PaginatedPlexSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPlexSourceList(pagination Pagination, results []PlexSource, autocomplete map[string]interface{}) *PaginatedPlexSourceList { + this := PaginatedPlexSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPlexSourceListWithDefaults instantiates a new PaginatedPlexSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPlexSourceListWithDefaults() *PaginatedPlexSourceList { + this := PaginatedPlexSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPlexSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPlexSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPlexSourceList) GetResults() []PlexSource { + if o == nil { + var ret []PlexSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourceList) GetResultsOk() ([]PlexSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPlexSourceList) SetResults(v []PlexSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPlexSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPlexSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPlexSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPlexSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPlexSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPlexSourceList := _PaginatedPlexSourceList{} + + err = json.Unmarshal(data, &varPaginatedPlexSourceList) + + if err != nil { + return err + } + + *o = PaginatedPlexSourceList(varPaginatedPlexSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPlexSourceList struct { + value *PaginatedPlexSourceList + isSet bool +} + +func (v NullablePaginatedPlexSourceList) Get() *PaginatedPlexSourceList { + return v.value +} + +func (v *NullablePaginatedPlexSourceList) Set(val *PaginatedPlexSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPlexSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPlexSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPlexSourceList(val *PaginatedPlexSourceList) *NullablePaginatedPlexSourceList { + return &NullablePaginatedPlexSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedPlexSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPlexSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_plex_source_property_mapping_list.go b/packages/client-go/model_paginated_plex_source_property_mapping_list.go new file mode 100644 index 0000000000..516f436457 --- /dev/null +++ b/packages/client-go/model_paginated_plex_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPlexSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPlexSourcePropertyMappingList{} + +// PaginatedPlexSourcePropertyMappingList struct for PaginatedPlexSourcePropertyMappingList +type PaginatedPlexSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []PlexSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPlexSourcePropertyMappingList PaginatedPlexSourcePropertyMappingList + +// NewPaginatedPlexSourcePropertyMappingList instantiates a new PaginatedPlexSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPlexSourcePropertyMappingList(pagination Pagination, results []PlexSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedPlexSourcePropertyMappingList { + this := PaginatedPlexSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPlexSourcePropertyMappingListWithDefaults instantiates a new PaginatedPlexSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPlexSourcePropertyMappingListWithDefaults() *PaginatedPlexSourcePropertyMappingList { + this := PaginatedPlexSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPlexSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPlexSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPlexSourcePropertyMappingList) GetResults() []PlexSourcePropertyMapping { + if o == nil { + var ret []PlexSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourcePropertyMappingList) GetResultsOk() ([]PlexSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPlexSourcePropertyMappingList) SetResults(v []PlexSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPlexSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPlexSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPlexSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPlexSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPlexSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPlexSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPlexSourcePropertyMappingList := _PaginatedPlexSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedPlexSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedPlexSourcePropertyMappingList(varPaginatedPlexSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPlexSourcePropertyMappingList struct { + value *PaginatedPlexSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedPlexSourcePropertyMappingList) Get() *PaginatedPlexSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedPlexSourcePropertyMappingList) Set(val *PaginatedPlexSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPlexSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPlexSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPlexSourcePropertyMappingList(val *PaginatedPlexSourcePropertyMappingList) *NullablePaginatedPlexSourcePropertyMappingList { + return &NullablePaginatedPlexSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedPlexSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPlexSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_policy_binding_list.go b/packages/client-go/model_paginated_policy_binding_list.go new file mode 100644 index 0000000000..eb98911c1d --- /dev/null +++ b/packages/client-go/model_paginated_policy_binding_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPolicyBindingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPolicyBindingList{} + +// PaginatedPolicyBindingList struct for PaginatedPolicyBindingList +type PaginatedPolicyBindingList struct { + Pagination Pagination `json:"pagination"` + Results []PolicyBinding `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPolicyBindingList PaginatedPolicyBindingList + +// NewPaginatedPolicyBindingList instantiates a new PaginatedPolicyBindingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPolicyBindingList(pagination Pagination, results []PolicyBinding, autocomplete map[string]interface{}) *PaginatedPolicyBindingList { + this := PaginatedPolicyBindingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPolicyBindingListWithDefaults instantiates a new PaginatedPolicyBindingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPolicyBindingListWithDefaults() *PaginatedPolicyBindingList { + this := PaginatedPolicyBindingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPolicyBindingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyBindingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPolicyBindingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPolicyBindingList) GetResults() []PolicyBinding { + if o == nil { + var ret []PolicyBinding + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyBindingList) GetResultsOk() ([]PolicyBinding, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPolicyBindingList) SetResults(v []PolicyBinding) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPolicyBindingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyBindingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPolicyBindingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPolicyBindingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPolicyBindingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPolicyBindingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPolicyBindingList := _PaginatedPolicyBindingList{} + + err = json.Unmarshal(data, &varPaginatedPolicyBindingList) + + if err != nil { + return err + } + + *o = PaginatedPolicyBindingList(varPaginatedPolicyBindingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPolicyBindingList struct { + value *PaginatedPolicyBindingList + isSet bool +} + +func (v NullablePaginatedPolicyBindingList) Get() *PaginatedPolicyBindingList { + return v.value +} + +func (v *NullablePaginatedPolicyBindingList) Set(val *PaginatedPolicyBindingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPolicyBindingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPolicyBindingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPolicyBindingList(val *PaginatedPolicyBindingList) *NullablePaginatedPolicyBindingList { + return &NullablePaginatedPolicyBindingList{value: val, isSet: true} +} + +func (v NullablePaginatedPolicyBindingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPolicyBindingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_policy_list.go b/packages/client-go/model_paginated_policy_list.go new file mode 100644 index 0000000000..feb3a9f1dc --- /dev/null +++ b/packages/client-go/model_paginated_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPolicyList{} + +// PaginatedPolicyList struct for PaginatedPolicyList +type PaginatedPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []Policy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPolicyList PaginatedPolicyList + +// NewPaginatedPolicyList instantiates a new PaginatedPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPolicyList(pagination Pagination, results []Policy, autocomplete map[string]interface{}) *PaginatedPolicyList { + this := PaginatedPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPolicyListWithDefaults instantiates a new PaginatedPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPolicyListWithDefaults() *PaginatedPolicyList { + this := PaginatedPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPolicyList) GetResults() []Policy { + if o == nil { + var ret []Policy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyList) GetResultsOk() ([]Policy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPolicyList) SetResults(v []Policy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPolicyList := _PaginatedPolicyList{} + + err = json.Unmarshal(data, &varPaginatedPolicyList) + + if err != nil { + return err + } + + *o = PaginatedPolicyList(varPaginatedPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPolicyList struct { + value *PaginatedPolicyList + isSet bool +} + +func (v NullablePaginatedPolicyList) Get() *PaginatedPolicyList { + return v.value +} + +func (v *NullablePaginatedPolicyList) Set(val *PaginatedPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPolicyList(val *PaginatedPolicyList) *NullablePaginatedPolicyList { + return &NullablePaginatedPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_prompt_list.go b/packages/client-go/model_paginated_prompt_list.go new file mode 100644 index 0000000000..f1074bfdea --- /dev/null +++ b/packages/client-go/model_paginated_prompt_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPromptList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPromptList{} + +// PaginatedPromptList struct for PaginatedPromptList +type PaginatedPromptList struct { + Pagination Pagination `json:"pagination"` + Results []Prompt `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPromptList PaginatedPromptList + +// NewPaginatedPromptList instantiates a new PaginatedPromptList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPromptList(pagination Pagination, results []Prompt, autocomplete map[string]interface{}) *PaginatedPromptList { + this := PaginatedPromptList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPromptListWithDefaults instantiates a new PaginatedPromptList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPromptListWithDefaults() *PaginatedPromptList { + this := PaginatedPromptList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPromptList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPromptList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPromptList) GetResults() []Prompt { + if o == nil { + var ret []Prompt + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptList) GetResultsOk() ([]Prompt, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPromptList) SetResults(v []Prompt) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPromptList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPromptList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPromptList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPromptList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPromptList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPromptList := _PaginatedPromptList{} + + err = json.Unmarshal(data, &varPaginatedPromptList) + + if err != nil { + return err + } + + *o = PaginatedPromptList(varPaginatedPromptList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPromptList struct { + value *PaginatedPromptList + isSet bool +} + +func (v NullablePaginatedPromptList) Get() *PaginatedPromptList { + return v.value +} + +func (v *NullablePaginatedPromptList) Set(val *PaginatedPromptList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPromptList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPromptList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPromptList(val *PaginatedPromptList) *NullablePaginatedPromptList { + return &NullablePaginatedPromptList{value: val, isSet: true} +} + +func (v NullablePaginatedPromptList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPromptList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_prompt_stage_list.go b/packages/client-go/model_paginated_prompt_stage_list.go new file mode 100644 index 0000000000..f440f73368 --- /dev/null +++ b/packages/client-go/model_paginated_prompt_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPromptStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPromptStageList{} + +// PaginatedPromptStageList struct for PaginatedPromptStageList +type PaginatedPromptStageList struct { + Pagination Pagination `json:"pagination"` + Results []PromptStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPromptStageList PaginatedPromptStageList + +// NewPaginatedPromptStageList instantiates a new PaginatedPromptStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPromptStageList(pagination Pagination, results []PromptStage, autocomplete map[string]interface{}) *PaginatedPromptStageList { + this := PaginatedPromptStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPromptStageListWithDefaults instantiates a new PaginatedPromptStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPromptStageListWithDefaults() *PaginatedPromptStageList { + this := PaginatedPromptStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPromptStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPromptStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPromptStageList) GetResults() []PromptStage { + if o == nil { + var ret []PromptStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptStageList) GetResultsOk() ([]PromptStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPromptStageList) SetResults(v []PromptStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPromptStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPromptStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPromptStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPromptStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPromptStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPromptStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPromptStageList := _PaginatedPromptStageList{} + + err = json.Unmarshal(data, &varPaginatedPromptStageList) + + if err != nil { + return err + } + + *o = PaginatedPromptStageList(varPaginatedPromptStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPromptStageList struct { + value *PaginatedPromptStageList + isSet bool +} + +func (v NullablePaginatedPromptStageList) Get() *PaginatedPromptStageList { + return v.value +} + +func (v *NullablePaginatedPromptStageList) Set(val *PaginatedPromptStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPromptStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPromptStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPromptStageList(val *PaginatedPromptStageList) *NullablePaginatedPromptStageList { + return &NullablePaginatedPromptStageList{value: val, isSet: true} +} + +func (v NullablePaginatedPromptStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPromptStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_property_mapping_list.go b/packages/client-go/model_paginated_property_mapping_list.go new file mode 100644 index 0000000000..6936cf7241 --- /dev/null +++ b/packages/client-go/model_paginated_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedPropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedPropertyMappingList{} + +// PaginatedPropertyMappingList struct for PaginatedPropertyMappingList +type PaginatedPropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []PropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedPropertyMappingList PaginatedPropertyMappingList + +// NewPaginatedPropertyMappingList instantiates a new PaginatedPropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedPropertyMappingList(pagination Pagination, results []PropertyMapping, autocomplete map[string]interface{}) *PaginatedPropertyMappingList { + this := PaginatedPropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedPropertyMappingListWithDefaults instantiates a new PaginatedPropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedPropertyMappingListWithDefaults() *PaginatedPropertyMappingList { + this := PaginatedPropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedPropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedPropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedPropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedPropertyMappingList) GetResults() []PropertyMapping { + if o == nil { + var ret []PropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedPropertyMappingList) GetResultsOk() ([]PropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedPropertyMappingList) SetResults(v []PropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedPropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedPropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedPropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedPropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedPropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedPropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedPropertyMappingList := _PaginatedPropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedPropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedPropertyMappingList(varPaginatedPropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedPropertyMappingList struct { + value *PaginatedPropertyMappingList + isSet bool +} + +func (v NullablePaginatedPropertyMappingList) Get() *PaginatedPropertyMappingList { + return v.value +} + +func (v *NullablePaginatedPropertyMappingList) Set(val *PaginatedPropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedPropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedPropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedPropertyMappingList(val *PaginatedPropertyMappingList) *NullablePaginatedPropertyMappingList { + return &NullablePaginatedPropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedPropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedPropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_provider_list.go b/packages/client-go/model_paginated_provider_list.go new file mode 100644 index 0000000000..4feafad863 --- /dev/null +++ b/packages/client-go/model_paginated_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProviderList{} + +// PaginatedProviderList struct for PaginatedProviderList +type PaginatedProviderList struct { + Pagination Pagination `json:"pagination"` + Results []Provider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProviderList PaginatedProviderList + +// NewPaginatedProviderList instantiates a new PaginatedProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProviderList(pagination Pagination, results []Provider, autocomplete map[string]interface{}) *PaginatedProviderList { + this := PaginatedProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedProviderListWithDefaults instantiates a new PaginatedProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProviderListWithDefaults() *PaginatedProviderList { + this := PaginatedProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedProviderList) GetResults() []Provider { + if o == nil { + var ret []Provider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedProviderList) GetResultsOk() ([]Provider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedProviderList) SetResults(v []Provider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedProviderList := _PaginatedProviderList{} + + err = json.Unmarshal(data, &varPaginatedProviderList) + + if err != nil { + return err + } + + *o = PaginatedProviderList(varPaginatedProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProviderList struct { + value *PaginatedProviderList + isSet bool +} + +func (v NullablePaginatedProviderList) Get() *PaginatedProviderList { + return v.value +} + +func (v *NullablePaginatedProviderList) Set(val *PaginatedProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProviderList(val *PaginatedProviderList) *NullablePaginatedProviderList { + return &NullablePaginatedProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_proxy_outpost_config_list.go b/packages/client-go/model_paginated_proxy_outpost_config_list.go new file mode 100644 index 0000000000..6a7200043d --- /dev/null +++ b/packages/client-go/model_paginated_proxy_outpost_config_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedProxyOutpostConfigList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProxyOutpostConfigList{} + +// PaginatedProxyOutpostConfigList struct for PaginatedProxyOutpostConfigList +type PaginatedProxyOutpostConfigList struct { + Pagination Pagination `json:"pagination"` + Results []ProxyOutpostConfig `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProxyOutpostConfigList PaginatedProxyOutpostConfigList + +// NewPaginatedProxyOutpostConfigList instantiates a new PaginatedProxyOutpostConfigList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProxyOutpostConfigList(pagination Pagination, results []ProxyOutpostConfig, autocomplete map[string]interface{}) *PaginatedProxyOutpostConfigList { + this := PaginatedProxyOutpostConfigList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedProxyOutpostConfigListWithDefaults instantiates a new PaginatedProxyOutpostConfigList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProxyOutpostConfigListWithDefaults() *PaginatedProxyOutpostConfigList { + this := PaginatedProxyOutpostConfigList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedProxyOutpostConfigList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyOutpostConfigList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedProxyOutpostConfigList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedProxyOutpostConfigList) GetResults() []ProxyOutpostConfig { + if o == nil { + var ret []ProxyOutpostConfig + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyOutpostConfigList) GetResultsOk() ([]ProxyOutpostConfig, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedProxyOutpostConfigList) SetResults(v []ProxyOutpostConfig) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedProxyOutpostConfigList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyOutpostConfigList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedProxyOutpostConfigList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedProxyOutpostConfigList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProxyOutpostConfigList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProxyOutpostConfigList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedProxyOutpostConfigList := _PaginatedProxyOutpostConfigList{} + + err = json.Unmarshal(data, &varPaginatedProxyOutpostConfigList) + + if err != nil { + return err + } + + *o = PaginatedProxyOutpostConfigList(varPaginatedProxyOutpostConfigList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProxyOutpostConfigList struct { + value *PaginatedProxyOutpostConfigList + isSet bool +} + +func (v NullablePaginatedProxyOutpostConfigList) Get() *PaginatedProxyOutpostConfigList { + return v.value +} + +func (v *NullablePaginatedProxyOutpostConfigList) Set(val *PaginatedProxyOutpostConfigList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProxyOutpostConfigList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProxyOutpostConfigList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProxyOutpostConfigList(val *PaginatedProxyOutpostConfigList) *NullablePaginatedProxyOutpostConfigList { + return &NullablePaginatedProxyOutpostConfigList{value: val, isSet: true} +} + +func (v NullablePaginatedProxyOutpostConfigList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProxyOutpostConfigList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_proxy_provider_list.go b/packages/client-go/model_paginated_proxy_provider_list.go new file mode 100644 index 0000000000..c13a770c32 --- /dev/null +++ b/packages/client-go/model_paginated_proxy_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedProxyProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedProxyProviderList{} + +// PaginatedProxyProviderList struct for PaginatedProxyProviderList +type PaginatedProxyProviderList struct { + Pagination Pagination `json:"pagination"` + Results []ProxyProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedProxyProviderList PaginatedProxyProviderList + +// NewPaginatedProxyProviderList instantiates a new PaginatedProxyProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedProxyProviderList(pagination Pagination, results []ProxyProvider, autocomplete map[string]interface{}) *PaginatedProxyProviderList { + this := PaginatedProxyProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedProxyProviderListWithDefaults instantiates a new PaginatedProxyProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedProxyProviderListWithDefaults() *PaginatedProxyProviderList { + this := PaginatedProxyProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedProxyProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedProxyProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedProxyProviderList) GetResults() []ProxyProvider { + if o == nil { + var ret []ProxyProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyProviderList) GetResultsOk() ([]ProxyProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedProxyProviderList) SetResults(v []ProxyProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedProxyProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedProxyProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedProxyProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedProxyProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedProxyProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedProxyProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedProxyProviderList := _PaginatedProxyProviderList{} + + err = json.Unmarshal(data, &varPaginatedProxyProviderList) + + if err != nil { + return err + } + + *o = PaginatedProxyProviderList(varPaginatedProxyProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedProxyProviderList struct { + value *PaginatedProxyProviderList + isSet bool +} + +func (v NullablePaginatedProxyProviderList) Get() *PaginatedProxyProviderList { + return v.value +} + +func (v *NullablePaginatedProxyProviderList) Set(val *PaginatedProxyProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedProxyProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedProxyProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedProxyProviderList(val *PaginatedProxyProviderList) *NullablePaginatedProxyProviderList { + return &NullablePaginatedProxyProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedProxyProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedProxyProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_rac_property_mapping_list.go b/packages/client-go/model_paginated_rac_property_mapping_list.go new file mode 100644 index 0000000000..fcea272d95 --- /dev/null +++ b/packages/client-go/model_paginated_rac_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRACPropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRACPropertyMappingList{} + +// PaginatedRACPropertyMappingList struct for PaginatedRACPropertyMappingList +type PaginatedRACPropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []RACPropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRACPropertyMappingList PaginatedRACPropertyMappingList + +// NewPaginatedRACPropertyMappingList instantiates a new PaginatedRACPropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRACPropertyMappingList(pagination Pagination, results []RACPropertyMapping, autocomplete map[string]interface{}) *PaginatedRACPropertyMappingList { + this := PaginatedRACPropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRACPropertyMappingListWithDefaults instantiates a new PaginatedRACPropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRACPropertyMappingListWithDefaults() *PaginatedRACPropertyMappingList { + this := PaginatedRACPropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRACPropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACPropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRACPropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRACPropertyMappingList) GetResults() []RACPropertyMapping { + if o == nil { + var ret []RACPropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACPropertyMappingList) GetResultsOk() ([]RACPropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRACPropertyMappingList) SetResults(v []RACPropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRACPropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACPropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRACPropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRACPropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRACPropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRACPropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRACPropertyMappingList := _PaginatedRACPropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedRACPropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedRACPropertyMappingList(varPaginatedRACPropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRACPropertyMappingList struct { + value *PaginatedRACPropertyMappingList + isSet bool +} + +func (v NullablePaginatedRACPropertyMappingList) Get() *PaginatedRACPropertyMappingList { + return v.value +} + +func (v *NullablePaginatedRACPropertyMappingList) Set(val *PaginatedRACPropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRACPropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRACPropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRACPropertyMappingList(val *PaginatedRACPropertyMappingList) *NullablePaginatedRACPropertyMappingList { + return &NullablePaginatedRACPropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedRACPropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRACPropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_rac_provider_list.go b/packages/client-go/model_paginated_rac_provider_list.go new file mode 100644 index 0000000000..24daef4ca5 --- /dev/null +++ b/packages/client-go/model_paginated_rac_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRACProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRACProviderList{} + +// PaginatedRACProviderList struct for PaginatedRACProviderList +type PaginatedRACProviderList struct { + Pagination Pagination `json:"pagination"` + Results []RACProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRACProviderList PaginatedRACProviderList + +// NewPaginatedRACProviderList instantiates a new PaginatedRACProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRACProviderList(pagination Pagination, results []RACProvider, autocomplete map[string]interface{}) *PaginatedRACProviderList { + this := PaginatedRACProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRACProviderListWithDefaults instantiates a new PaginatedRACProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRACProviderListWithDefaults() *PaginatedRACProviderList { + this := PaginatedRACProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRACProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRACProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRACProviderList) GetResults() []RACProvider { + if o == nil { + var ret []RACProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACProviderList) GetResultsOk() ([]RACProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRACProviderList) SetResults(v []RACProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRACProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRACProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRACProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRACProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRACProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRACProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRACProviderList := _PaginatedRACProviderList{} + + err = json.Unmarshal(data, &varPaginatedRACProviderList) + + if err != nil { + return err + } + + *o = PaginatedRACProviderList(varPaginatedRACProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRACProviderList struct { + value *PaginatedRACProviderList + isSet bool +} + +func (v NullablePaginatedRACProviderList) Get() *PaginatedRACProviderList { + return v.value +} + +func (v *NullablePaginatedRACProviderList) Set(val *PaginatedRACProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRACProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRACProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRACProviderList(val *PaginatedRACProviderList) *NullablePaginatedRACProviderList { + return &NullablePaginatedRACProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedRACProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRACProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_radius_outpost_config_list.go b/packages/client-go/model_paginated_radius_outpost_config_list.go new file mode 100644 index 0000000000..b7b35b9cb2 --- /dev/null +++ b/packages/client-go/model_paginated_radius_outpost_config_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRadiusOutpostConfigList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRadiusOutpostConfigList{} + +// PaginatedRadiusOutpostConfigList struct for PaginatedRadiusOutpostConfigList +type PaginatedRadiusOutpostConfigList struct { + Pagination Pagination `json:"pagination"` + Results []RadiusOutpostConfig `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRadiusOutpostConfigList PaginatedRadiusOutpostConfigList + +// NewPaginatedRadiusOutpostConfigList instantiates a new PaginatedRadiusOutpostConfigList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRadiusOutpostConfigList(pagination Pagination, results []RadiusOutpostConfig, autocomplete map[string]interface{}) *PaginatedRadiusOutpostConfigList { + this := PaginatedRadiusOutpostConfigList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRadiusOutpostConfigListWithDefaults instantiates a new PaginatedRadiusOutpostConfigList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRadiusOutpostConfigListWithDefaults() *PaginatedRadiusOutpostConfigList { + this := PaginatedRadiusOutpostConfigList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRadiusOutpostConfigList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusOutpostConfigList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRadiusOutpostConfigList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRadiusOutpostConfigList) GetResults() []RadiusOutpostConfig { + if o == nil { + var ret []RadiusOutpostConfig + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusOutpostConfigList) GetResultsOk() ([]RadiusOutpostConfig, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRadiusOutpostConfigList) SetResults(v []RadiusOutpostConfig) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRadiusOutpostConfigList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusOutpostConfigList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRadiusOutpostConfigList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRadiusOutpostConfigList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRadiusOutpostConfigList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRadiusOutpostConfigList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRadiusOutpostConfigList := _PaginatedRadiusOutpostConfigList{} + + err = json.Unmarshal(data, &varPaginatedRadiusOutpostConfigList) + + if err != nil { + return err + } + + *o = PaginatedRadiusOutpostConfigList(varPaginatedRadiusOutpostConfigList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRadiusOutpostConfigList struct { + value *PaginatedRadiusOutpostConfigList + isSet bool +} + +func (v NullablePaginatedRadiusOutpostConfigList) Get() *PaginatedRadiusOutpostConfigList { + return v.value +} + +func (v *NullablePaginatedRadiusOutpostConfigList) Set(val *PaginatedRadiusOutpostConfigList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRadiusOutpostConfigList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRadiusOutpostConfigList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRadiusOutpostConfigList(val *PaginatedRadiusOutpostConfigList) *NullablePaginatedRadiusOutpostConfigList { + return &NullablePaginatedRadiusOutpostConfigList{value: val, isSet: true} +} + +func (v NullablePaginatedRadiusOutpostConfigList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRadiusOutpostConfigList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_radius_provider_list.go b/packages/client-go/model_paginated_radius_provider_list.go new file mode 100644 index 0000000000..174f49f549 --- /dev/null +++ b/packages/client-go/model_paginated_radius_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRadiusProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRadiusProviderList{} + +// PaginatedRadiusProviderList struct for PaginatedRadiusProviderList +type PaginatedRadiusProviderList struct { + Pagination Pagination `json:"pagination"` + Results []RadiusProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRadiusProviderList PaginatedRadiusProviderList + +// NewPaginatedRadiusProviderList instantiates a new PaginatedRadiusProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRadiusProviderList(pagination Pagination, results []RadiusProvider, autocomplete map[string]interface{}) *PaginatedRadiusProviderList { + this := PaginatedRadiusProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRadiusProviderListWithDefaults instantiates a new PaginatedRadiusProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRadiusProviderListWithDefaults() *PaginatedRadiusProviderList { + this := PaginatedRadiusProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRadiusProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRadiusProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRadiusProviderList) GetResults() []RadiusProvider { + if o == nil { + var ret []RadiusProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderList) GetResultsOk() ([]RadiusProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRadiusProviderList) SetResults(v []RadiusProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRadiusProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRadiusProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRadiusProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRadiusProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRadiusProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRadiusProviderList := _PaginatedRadiusProviderList{} + + err = json.Unmarshal(data, &varPaginatedRadiusProviderList) + + if err != nil { + return err + } + + *o = PaginatedRadiusProviderList(varPaginatedRadiusProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRadiusProviderList struct { + value *PaginatedRadiusProviderList + isSet bool +} + +func (v NullablePaginatedRadiusProviderList) Get() *PaginatedRadiusProviderList { + return v.value +} + +func (v *NullablePaginatedRadiusProviderList) Set(val *PaginatedRadiusProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRadiusProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRadiusProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRadiusProviderList(val *PaginatedRadiusProviderList) *NullablePaginatedRadiusProviderList { + return &NullablePaginatedRadiusProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedRadiusProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRadiusProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_radius_provider_property_mapping_list.go b/packages/client-go/model_paginated_radius_provider_property_mapping_list.go new file mode 100644 index 0000000000..3b12465179 --- /dev/null +++ b/packages/client-go/model_paginated_radius_provider_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRadiusProviderPropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRadiusProviderPropertyMappingList{} + +// PaginatedRadiusProviderPropertyMappingList struct for PaginatedRadiusProviderPropertyMappingList +type PaginatedRadiusProviderPropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []RadiusProviderPropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRadiusProviderPropertyMappingList PaginatedRadiusProviderPropertyMappingList + +// NewPaginatedRadiusProviderPropertyMappingList instantiates a new PaginatedRadiusProviderPropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRadiusProviderPropertyMappingList(pagination Pagination, results []RadiusProviderPropertyMapping, autocomplete map[string]interface{}) *PaginatedRadiusProviderPropertyMappingList { + this := PaginatedRadiusProviderPropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRadiusProviderPropertyMappingListWithDefaults instantiates a new PaginatedRadiusProviderPropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRadiusProviderPropertyMappingListWithDefaults() *PaginatedRadiusProviderPropertyMappingList { + this := PaginatedRadiusProviderPropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRadiusProviderPropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderPropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRadiusProviderPropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRadiusProviderPropertyMappingList) GetResults() []RadiusProviderPropertyMapping { + if o == nil { + var ret []RadiusProviderPropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderPropertyMappingList) GetResultsOk() ([]RadiusProviderPropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRadiusProviderPropertyMappingList) SetResults(v []RadiusProviderPropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRadiusProviderPropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRadiusProviderPropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRadiusProviderPropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRadiusProviderPropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRadiusProviderPropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRadiusProviderPropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRadiusProviderPropertyMappingList := _PaginatedRadiusProviderPropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedRadiusProviderPropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedRadiusProviderPropertyMappingList(varPaginatedRadiusProviderPropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRadiusProviderPropertyMappingList struct { + value *PaginatedRadiusProviderPropertyMappingList + isSet bool +} + +func (v NullablePaginatedRadiusProviderPropertyMappingList) Get() *PaginatedRadiusProviderPropertyMappingList { + return v.value +} + +func (v *NullablePaginatedRadiusProviderPropertyMappingList) Set(val *PaginatedRadiusProviderPropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRadiusProviderPropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRadiusProviderPropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRadiusProviderPropertyMappingList(val *PaginatedRadiusProviderPropertyMappingList) *NullablePaginatedRadiusProviderPropertyMappingList { + return &NullablePaginatedRadiusProviderPropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedRadiusProviderPropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRadiusProviderPropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_redirect_stage_list.go b/packages/client-go/model_paginated_redirect_stage_list.go new file mode 100644 index 0000000000..64ed9bb22e --- /dev/null +++ b/packages/client-go/model_paginated_redirect_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRedirectStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRedirectStageList{} + +// PaginatedRedirectStageList struct for PaginatedRedirectStageList +type PaginatedRedirectStageList struct { + Pagination Pagination `json:"pagination"` + Results []RedirectStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRedirectStageList PaginatedRedirectStageList + +// NewPaginatedRedirectStageList instantiates a new PaginatedRedirectStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRedirectStageList(pagination Pagination, results []RedirectStage, autocomplete map[string]interface{}) *PaginatedRedirectStageList { + this := PaginatedRedirectStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRedirectStageListWithDefaults instantiates a new PaginatedRedirectStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRedirectStageListWithDefaults() *PaginatedRedirectStageList { + this := PaginatedRedirectStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRedirectStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRedirectStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRedirectStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRedirectStageList) GetResults() []RedirectStage { + if o == nil { + var ret []RedirectStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRedirectStageList) GetResultsOk() ([]RedirectStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRedirectStageList) SetResults(v []RedirectStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRedirectStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRedirectStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRedirectStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRedirectStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRedirectStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRedirectStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRedirectStageList := _PaginatedRedirectStageList{} + + err = json.Unmarshal(data, &varPaginatedRedirectStageList) + + if err != nil { + return err + } + + *o = PaginatedRedirectStageList(varPaginatedRedirectStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRedirectStageList struct { + value *PaginatedRedirectStageList + isSet bool +} + +func (v NullablePaginatedRedirectStageList) Get() *PaginatedRedirectStageList { + return v.value +} + +func (v *NullablePaginatedRedirectStageList) Set(val *PaginatedRedirectStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRedirectStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRedirectStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRedirectStageList(val *PaginatedRedirectStageList) *NullablePaginatedRedirectStageList { + return &NullablePaginatedRedirectStageList{value: val, isSet: true} +} + +func (v NullablePaginatedRedirectStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRedirectStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_reputation_list.go b/packages/client-go/model_paginated_reputation_list.go new file mode 100644 index 0000000000..8980965cc9 --- /dev/null +++ b/packages/client-go/model_paginated_reputation_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedReputationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedReputationList{} + +// PaginatedReputationList struct for PaginatedReputationList +type PaginatedReputationList struct { + Pagination Pagination `json:"pagination"` + Results []Reputation `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedReputationList PaginatedReputationList + +// NewPaginatedReputationList instantiates a new PaginatedReputationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedReputationList(pagination Pagination, results []Reputation, autocomplete map[string]interface{}) *PaginatedReputationList { + this := PaginatedReputationList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedReputationListWithDefaults instantiates a new PaginatedReputationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedReputationListWithDefaults() *PaginatedReputationList { + this := PaginatedReputationList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedReputationList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedReputationList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedReputationList) GetResults() []Reputation { + if o == nil { + var ret []Reputation + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationList) GetResultsOk() ([]Reputation, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedReputationList) SetResults(v []Reputation) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedReputationList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedReputationList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedReputationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedReputationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedReputationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedReputationList := _PaginatedReputationList{} + + err = json.Unmarshal(data, &varPaginatedReputationList) + + if err != nil { + return err + } + + *o = PaginatedReputationList(varPaginatedReputationList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedReputationList struct { + value *PaginatedReputationList + isSet bool +} + +func (v NullablePaginatedReputationList) Get() *PaginatedReputationList { + return v.value +} + +func (v *NullablePaginatedReputationList) Set(val *PaginatedReputationList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedReputationList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedReputationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedReputationList(val *PaginatedReputationList) *NullablePaginatedReputationList { + return &NullablePaginatedReputationList{value: val, isSet: true} +} + +func (v NullablePaginatedReputationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedReputationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_reputation_policy_list.go b/packages/client-go/model_paginated_reputation_policy_list.go new file mode 100644 index 0000000000..b0ca29f2ac --- /dev/null +++ b/packages/client-go/model_paginated_reputation_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedReputationPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedReputationPolicyList{} + +// PaginatedReputationPolicyList struct for PaginatedReputationPolicyList +type PaginatedReputationPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []ReputationPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedReputationPolicyList PaginatedReputationPolicyList + +// NewPaginatedReputationPolicyList instantiates a new PaginatedReputationPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedReputationPolicyList(pagination Pagination, results []ReputationPolicy, autocomplete map[string]interface{}) *PaginatedReputationPolicyList { + this := PaginatedReputationPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedReputationPolicyListWithDefaults instantiates a new PaginatedReputationPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedReputationPolicyListWithDefaults() *PaginatedReputationPolicyList { + this := PaginatedReputationPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedReputationPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedReputationPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedReputationPolicyList) GetResults() []ReputationPolicy { + if o == nil { + var ret []ReputationPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationPolicyList) GetResultsOk() ([]ReputationPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedReputationPolicyList) SetResults(v []ReputationPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedReputationPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedReputationPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedReputationPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedReputationPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedReputationPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedReputationPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedReputationPolicyList := _PaginatedReputationPolicyList{} + + err = json.Unmarshal(data, &varPaginatedReputationPolicyList) + + if err != nil { + return err + } + + *o = PaginatedReputationPolicyList(varPaginatedReputationPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedReputationPolicyList struct { + value *PaginatedReputationPolicyList + isSet bool +} + +func (v NullablePaginatedReputationPolicyList) Get() *PaginatedReputationPolicyList { + return v.value +} + +func (v *NullablePaginatedReputationPolicyList) Set(val *PaginatedReputationPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedReputationPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedReputationPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedReputationPolicyList(val *PaginatedReputationPolicyList) *NullablePaginatedReputationPolicyList { + return &NullablePaginatedReputationPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedReputationPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedReputationPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_role_assigned_object_permission_list.go b/packages/client-go/model_paginated_role_assigned_object_permission_list.go new file mode 100644 index 0000000000..63217f2599 --- /dev/null +++ b/packages/client-go/model_paginated_role_assigned_object_permission_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRoleAssignedObjectPermissionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRoleAssignedObjectPermissionList{} + +// PaginatedRoleAssignedObjectPermissionList struct for PaginatedRoleAssignedObjectPermissionList +type PaginatedRoleAssignedObjectPermissionList struct { + Pagination Pagination `json:"pagination"` + Results []RoleAssignedObjectPermission `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRoleAssignedObjectPermissionList PaginatedRoleAssignedObjectPermissionList + +// NewPaginatedRoleAssignedObjectPermissionList instantiates a new PaginatedRoleAssignedObjectPermissionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRoleAssignedObjectPermissionList(pagination Pagination, results []RoleAssignedObjectPermission, autocomplete map[string]interface{}) *PaginatedRoleAssignedObjectPermissionList { + this := PaginatedRoleAssignedObjectPermissionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRoleAssignedObjectPermissionListWithDefaults instantiates a new PaginatedRoleAssignedObjectPermissionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRoleAssignedObjectPermissionListWithDefaults() *PaginatedRoleAssignedObjectPermissionList { + this := PaginatedRoleAssignedObjectPermissionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRoleAssignedObjectPermissionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleAssignedObjectPermissionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRoleAssignedObjectPermissionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRoleAssignedObjectPermissionList) GetResults() []RoleAssignedObjectPermission { + if o == nil { + var ret []RoleAssignedObjectPermission + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleAssignedObjectPermissionList) GetResultsOk() ([]RoleAssignedObjectPermission, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRoleAssignedObjectPermissionList) SetResults(v []RoleAssignedObjectPermission) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRoleAssignedObjectPermissionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleAssignedObjectPermissionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRoleAssignedObjectPermissionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRoleAssignedObjectPermissionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRoleAssignedObjectPermissionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRoleAssignedObjectPermissionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRoleAssignedObjectPermissionList := _PaginatedRoleAssignedObjectPermissionList{} + + err = json.Unmarshal(data, &varPaginatedRoleAssignedObjectPermissionList) + + if err != nil { + return err + } + + *o = PaginatedRoleAssignedObjectPermissionList(varPaginatedRoleAssignedObjectPermissionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRoleAssignedObjectPermissionList struct { + value *PaginatedRoleAssignedObjectPermissionList + isSet bool +} + +func (v NullablePaginatedRoleAssignedObjectPermissionList) Get() *PaginatedRoleAssignedObjectPermissionList { + return v.value +} + +func (v *NullablePaginatedRoleAssignedObjectPermissionList) Set(val *PaginatedRoleAssignedObjectPermissionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRoleAssignedObjectPermissionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRoleAssignedObjectPermissionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRoleAssignedObjectPermissionList(val *PaginatedRoleAssignedObjectPermissionList) *NullablePaginatedRoleAssignedObjectPermissionList { + return &NullablePaginatedRoleAssignedObjectPermissionList{value: val, isSet: true} +} + +func (v NullablePaginatedRoleAssignedObjectPermissionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRoleAssignedObjectPermissionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_role_list.go b/packages/client-go/model_paginated_role_list.go new file mode 100644 index 0000000000..ca95e4b6bf --- /dev/null +++ b/packages/client-go/model_paginated_role_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedRoleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedRoleList{} + +// PaginatedRoleList struct for PaginatedRoleList +type PaginatedRoleList struct { + Pagination Pagination `json:"pagination"` + Results []Role `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedRoleList PaginatedRoleList + +// NewPaginatedRoleList instantiates a new PaginatedRoleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedRoleList(pagination Pagination, results []Role, autocomplete map[string]interface{}) *PaginatedRoleList { + this := PaginatedRoleList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedRoleListWithDefaults instantiates a new PaginatedRoleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedRoleListWithDefaults() *PaginatedRoleList { + this := PaginatedRoleList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedRoleList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedRoleList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedRoleList) GetResults() []Role { + if o == nil { + var ret []Role + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleList) GetResultsOk() ([]Role, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedRoleList) SetResults(v []Role) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedRoleList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedRoleList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedRoleList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedRoleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedRoleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedRoleList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedRoleList := _PaginatedRoleList{} + + err = json.Unmarshal(data, &varPaginatedRoleList) + + if err != nil { + return err + } + + *o = PaginatedRoleList(varPaginatedRoleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedRoleList struct { + value *PaginatedRoleList + isSet bool +} + +func (v NullablePaginatedRoleList) Get() *PaginatedRoleList { + return v.value +} + +func (v *NullablePaginatedRoleList) Set(val *PaginatedRoleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedRoleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedRoleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedRoleList(val *PaginatedRoleList) *NullablePaginatedRoleList { + return &NullablePaginatedRoleList{value: val, isSet: true} +} + +func (v NullablePaginatedRoleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedRoleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_saml_property_mapping_list.go b/packages/client-go/model_paginated_saml_property_mapping_list.go new file mode 100644 index 0000000000..e537bc510c --- /dev/null +++ b/packages/client-go/model_paginated_saml_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSAMLPropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSAMLPropertyMappingList{} + +// PaginatedSAMLPropertyMappingList struct for PaginatedSAMLPropertyMappingList +type PaginatedSAMLPropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []SAMLPropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSAMLPropertyMappingList PaginatedSAMLPropertyMappingList + +// NewPaginatedSAMLPropertyMappingList instantiates a new PaginatedSAMLPropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSAMLPropertyMappingList(pagination Pagination, results []SAMLPropertyMapping, autocomplete map[string]interface{}) *PaginatedSAMLPropertyMappingList { + this := PaginatedSAMLPropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSAMLPropertyMappingListWithDefaults instantiates a new PaginatedSAMLPropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSAMLPropertyMappingListWithDefaults() *PaginatedSAMLPropertyMappingList { + this := PaginatedSAMLPropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSAMLPropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLPropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSAMLPropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSAMLPropertyMappingList) GetResults() []SAMLPropertyMapping { + if o == nil { + var ret []SAMLPropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLPropertyMappingList) GetResultsOk() ([]SAMLPropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSAMLPropertyMappingList) SetResults(v []SAMLPropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSAMLPropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLPropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSAMLPropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSAMLPropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSAMLPropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSAMLPropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSAMLPropertyMappingList := _PaginatedSAMLPropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedSAMLPropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedSAMLPropertyMappingList(varPaginatedSAMLPropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSAMLPropertyMappingList struct { + value *PaginatedSAMLPropertyMappingList + isSet bool +} + +func (v NullablePaginatedSAMLPropertyMappingList) Get() *PaginatedSAMLPropertyMappingList { + return v.value +} + +func (v *NullablePaginatedSAMLPropertyMappingList) Set(val *PaginatedSAMLPropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSAMLPropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSAMLPropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSAMLPropertyMappingList(val *PaginatedSAMLPropertyMappingList) *NullablePaginatedSAMLPropertyMappingList { + return &NullablePaginatedSAMLPropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedSAMLPropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSAMLPropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_saml_provider_list.go b/packages/client-go/model_paginated_saml_provider_list.go new file mode 100644 index 0000000000..40d33b6d0a --- /dev/null +++ b/packages/client-go/model_paginated_saml_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSAMLProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSAMLProviderList{} + +// PaginatedSAMLProviderList struct for PaginatedSAMLProviderList +type PaginatedSAMLProviderList struct { + Pagination Pagination `json:"pagination"` + Results []SAMLProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSAMLProviderList PaginatedSAMLProviderList + +// NewPaginatedSAMLProviderList instantiates a new PaginatedSAMLProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSAMLProviderList(pagination Pagination, results []SAMLProvider, autocomplete map[string]interface{}) *PaginatedSAMLProviderList { + this := PaginatedSAMLProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSAMLProviderListWithDefaults instantiates a new PaginatedSAMLProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSAMLProviderListWithDefaults() *PaginatedSAMLProviderList { + this := PaginatedSAMLProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSAMLProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSAMLProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSAMLProviderList) GetResults() []SAMLProvider { + if o == nil { + var ret []SAMLProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLProviderList) GetResultsOk() ([]SAMLProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSAMLProviderList) SetResults(v []SAMLProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSAMLProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSAMLProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSAMLProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSAMLProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSAMLProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSAMLProviderList := _PaginatedSAMLProviderList{} + + err = json.Unmarshal(data, &varPaginatedSAMLProviderList) + + if err != nil { + return err + } + + *o = PaginatedSAMLProviderList(varPaginatedSAMLProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSAMLProviderList struct { + value *PaginatedSAMLProviderList + isSet bool +} + +func (v NullablePaginatedSAMLProviderList) Get() *PaginatedSAMLProviderList { + return v.value +} + +func (v *NullablePaginatedSAMLProviderList) Set(val *PaginatedSAMLProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSAMLProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSAMLProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSAMLProviderList(val *PaginatedSAMLProviderList) *NullablePaginatedSAMLProviderList { + return &NullablePaginatedSAMLProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedSAMLProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSAMLProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_saml_source_list.go b/packages/client-go/model_paginated_saml_source_list.go new file mode 100644 index 0000000000..630e3bc82a --- /dev/null +++ b/packages/client-go/model_paginated_saml_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSAMLSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSAMLSourceList{} + +// PaginatedSAMLSourceList struct for PaginatedSAMLSourceList +type PaginatedSAMLSourceList struct { + Pagination Pagination `json:"pagination"` + Results []SAMLSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSAMLSourceList PaginatedSAMLSourceList + +// NewPaginatedSAMLSourceList instantiates a new PaginatedSAMLSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSAMLSourceList(pagination Pagination, results []SAMLSource, autocomplete map[string]interface{}) *PaginatedSAMLSourceList { + this := PaginatedSAMLSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSAMLSourceListWithDefaults instantiates a new PaginatedSAMLSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSAMLSourceListWithDefaults() *PaginatedSAMLSourceList { + this := PaginatedSAMLSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSAMLSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSAMLSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSAMLSourceList) GetResults() []SAMLSource { + if o == nil { + var ret []SAMLSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourceList) GetResultsOk() ([]SAMLSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSAMLSourceList) SetResults(v []SAMLSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSAMLSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSAMLSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSAMLSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSAMLSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSAMLSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSAMLSourceList := _PaginatedSAMLSourceList{} + + err = json.Unmarshal(data, &varPaginatedSAMLSourceList) + + if err != nil { + return err + } + + *o = PaginatedSAMLSourceList(varPaginatedSAMLSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSAMLSourceList struct { + value *PaginatedSAMLSourceList + isSet bool +} + +func (v NullablePaginatedSAMLSourceList) Get() *PaginatedSAMLSourceList { + return v.value +} + +func (v *NullablePaginatedSAMLSourceList) Set(val *PaginatedSAMLSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSAMLSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSAMLSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSAMLSourceList(val *PaginatedSAMLSourceList) *NullablePaginatedSAMLSourceList { + return &NullablePaginatedSAMLSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedSAMLSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSAMLSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_saml_source_property_mapping_list.go b/packages/client-go/model_paginated_saml_source_property_mapping_list.go new file mode 100644 index 0000000000..052c548851 --- /dev/null +++ b/packages/client-go/model_paginated_saml_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSAMLSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSAMLSourcePropertyMappingList{} + +// PaginatedSAMLSourcePropertyMappingList struct for PaginatedSAMLSourcePropertyMappingList +type PaginatedSAMLSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []SAMLSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSAMLSourcePropertyMappingList PaginatedSAMLSourcePropertyMappingList + +// NewPaginatedSAMLSourcePropertyMappingList instantiates a new PaginatedSAMLSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSAMLSourcePropertyMappingList(pagination Pagination, results []SAMLSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedSAMLSourcePropertyMappingList { + this := PaginatedSAMLSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSAMLSourcePropertyMappingListWithDefaults instantiates a new PaginatedSAMLSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSAMLSourcePropertyMappingListWithDefaults() *PaginatedSAMLSourcePropertyMappingList { + this := PaginatedSAMLSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSAMLSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSAMLSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSAMLSourcePropertyMappingList) GetResults() []SAMLSourcePropertyMapping { + if o == nil { + var ret []SAMLSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourcePropertyMappingList) GetResultsOk() ([]SAMLSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSAMLSourcePropertyMappingList) SetResults(v []SAMLSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSAMLSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSAMLSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSAMLSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSAMLSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSAMLSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSAMLSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSAMLSourcePropertyMappingList := _PaginatedSAMLSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedSAMLSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedSAMLSourcePropertyMappingList(varPaginatedSAMLSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSAMLSourcePropertyMappingList struct { + value *PaginatedSAMLSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedSAMLSourcePropertyMappingList) Get() *PaginatedSAMLSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedSAMLSourcePropertyMappingList) Set(val *PaginatedSAMLSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSAMLSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSAMLSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSAMLSourcePropertyMappingList(val *PaginatedSAMLSourcePropertyMappingList) *NullablePaginatedSAMLSourcePropertyMappingList { + return &NullablePaginatedSAMLSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedSAMLSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSAMLSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_schedule_list.go b/packages/client-go/model_paginated_schedule_list.go new file mode 100644 index 0000000000..4ed249ce72 --- /dev/null +++ b/packages/client-go/model_paginated_schedule_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedScheduleList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedScheduleList{} + +// PaginatedScheduleList struct for PaginatedScheduleList +type PaginatedScheduleList struct { + Pagination Pagination `json:"pagination"` + Results []Schedule `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedScheduleList PaginatedScheduleList + +// NewPaginatedScheduleList instantiates a new PaginatedScheduleList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedScheduleList(pagination Pagination, results []Schedule, autocomplete map[string]interface{}) *PaginatedScheduleList { + this := PaginatedScheduleList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedScheduleListWithDefaults instantiates a new PaginatedScheduleList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedScheduleListWithDefaults() *PaginatedScheduleList { + this := PaginatedScheduleList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedScheduleList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedScheduleList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedScheduleList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedScheduleList) GetResults() []Schedule { + if o == nil { + var ret []Schedule + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedScheduleList) GetResultsOk() ([]Schedule, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedScheduleList) SetResults(v []Schedule) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedScheduleList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedScheduleList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedScheduleList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedScheduleList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedScheduleList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedScheduleList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedScheduleList := _PaginatedScheduleList{} + + err = json.Unmarshal(data, &varPaginatedScheduleList) + + if err != nil { + return err + } + + *o = PaginatedScheduleList(varPaginatedScheduleList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedScheduleList struct { + value *PaginatedScheduleList + isSet bool +} + +func (v NullablePaginatedScheduleList) Get() *PaginatedScheduleList { + return v.value +} + +func (v *NullablePaginatedScheduleList) Set(val *PaginatedScheduleList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedScheduleList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedScheduleList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedScheduleList(val *PaginatedScheduleList) *NullablePaginatedScheduleList { + return &NullablePaginatedScheduleList{value: val, isSet: true} +} + +func (v NullablePaginatedScheduleList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedScheduleList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_mapping_list.go b/packages/client-go/model_paginated_scim_mapping_list.go new file mode 100644 index 0000000000..6e8c07c748 --- /dev/null +++ b/packages/client-go/model_paginated_scim_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMMappingList{} + +// PaginatedSCIMMappingList struct for PaginatedSCIMMappingList +type PaginatedSCIMMappingList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMMappingList PaginatedSCIMMappingList + +// NewPaginatedSCIMMappingList instantiates a new PaginatedSCIMMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMMappingList(pagination Pagination, results []SCIMMapping, autocomplete map[string]interface{}) *PaginatedSCIMMappingList { + this := PaginatedSCIMMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMMappingListWithDefaults instantiates a new PaginatedSCIMMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMMappingListWithDefaults() *PaginatedSCIMMappingList { + this := PaginatedSCIMMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMMappingList) GetResults() []SCIMMapping { + if o == nil { + var ret []SCIMMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMMappingList) GetResultsOk() ([]SCIMMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMMappingList) SetResults(v []SCIMMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMMappingList := _PaginatedSCIMMappingList{} + + err = json.Unmarshal(data, &varPaginatedSCIMMappingList) + + if err != nil { + return err + } + + *o = PaginatedSCIMMappingList(varPaginatedSCIMMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMMappingList struct { + value *PaginatedSCIMMappingList + isSet bool +} + +func (v NullablePaginatedSCIMMappingList) Get() *PaginatedSCIMMappingList { + return v.value +} + +func (v *NullablePaginatedSCIMMappingList) Set(val *PaginatedSCIMMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMMappingList(val *PaginatedSCIMMappingList) *NullablePaginatedSCIMMappingList { + return &NullablePaginatedSCIMMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_provider_group_list.go b/packages/client-go/model_paginated_scim_provider_group_list.go new file mode 100644 index 0000000000..b8b5d48ebe --- /dev/null +++ b/packages/client-go/model_paginated_scim_provider_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMProviderGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMProviderGroupList{} + +// PaginatedSCIMProviderGroupList struct for PaginatedSCIMProviderGroupList +type PaginatedSCIMProviderGroupList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMProviderGroup `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMProviderGroupList PaginatedSCIMProviderGroupList + +// NewPaginatedSCIMProviderGroupList instantiates a new PaginatedSCIMProviderGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMProviderGroupList(pagination Pagination, results []SCIMProviderGroup, autocomplete map[string]interface{}) *PaginatedSCIMProviderGroupList { + this := PaginatedSCIMProviderGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMProviderGroupListWithDefaults instantiates a new PaginatedSCIMProviderGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMProviderGroupListWithDefaults() *PaginatedSCIMProviderGroupList { + this := PaginatedSCIMProviderGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMProviderGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMProviderGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMProviderGroupList) GetResults() []SCIMProviderGroup { + if o == nil { + var ret []SCIMProviderGroup + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderGroupList) GetResultsOk() ([]SCIMProviderGroup, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMProviderGroupList) SetResults(v []SCIMProviderGroup) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMProviderGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMProviderGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMProviderGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMProviderGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMProviderGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMProviderGroupList := _PaginatedSCIMProviderGroupList{} + + err = json.Unmarshal(data, &varPaginatedSCIMProviderGroupList) + + if err != nil { + return err + } + + *o = PaginatedSCIMProviderGroupList(varPaginatedSCIMProviderGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMProviderGroupList struct { + value *PaginatedSCIMProviderGroupList + isSet bool +} + +func (v NullablePaginatedSCIMProviderGroupList) Get() *PaginatedSCIMProviderGroupList { + return v.value +} + +func (v *NullablePaginatedSCIMProviderGroupList) Set(val *PaginatedSCIMProviderGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMProviderGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMProviderGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMProviderGroupList(val *PaginatedSCIMProviderGroupList) *NullablePaginatedSCIMProviderGroupList { + return &NullablePaginatedSCIMProviderGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMProviderGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMProviderGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_provider_list.go b/packages/client-go/model_paginated_scim_provider_list.go new file mode 100644 index 0000000000..cba9d6fde0 --- /dev/null +++ b/packages/client-go/model_paginated_scim_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMProviderList{} + +// PaginatedSCIMProviderList struct for PaginatedSCIMProviderList +type PaginatedSCIMProviderList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMProviderList PaginatedSCIMProviderList + +// NewPaginatedSCIMProviderList instantiates a new PaginatedSCIMProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMProviderList(pagination Pagination, results []SCIMProvider, autocomplete map[string]interface{}) *PaginatedSCIMProviderList { + this := PaginatedSCIMProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMProviderListWithDefaults instantiates a new PaginatedSCIMProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMProviderListWithDefaults() *PaginatedSCIMProviderList { + this := PaginatedSCIMProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMProviderList) GetResults() []SCIMProvider { + if o == nil { + var ret []SCIMProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderList) GetResultsOk() ([]SCIMProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMProviderList) SetResults(v []SCIMProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMProviderList := _PaginatedSCIMProviderList{} + + err = json.Unmarshal(data, &varPaginatedSCIMProviderList) + + if err != nil { + return err + } + + *o = PaginatedSCIMProviderList(varPaginatedSCIMProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMProviderList struct { + value *PaginatedSCIMProviderList + isSet bool +} + +func (v NullablePaginatedSCIMProviderList) Get() *PaginatedSCIMProviderList { + return v.value +} + +func (v *NullablePaginatedSCIMProviderList) Set(val *PaginatedSCIMProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMProviderList(val *PaginatedSCIMProviderList) *NullablePaginatedSCIMProviderList { + return &NullablePaginatedSCIMProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_provider_user_list.go b/packages/client-go/model_paginated_scim_provider_user_list.go new file mode 100644 index 0000000000..bc4d03df40 --- /dev/null +++ b/packages/client-go/model_paginated_scim_provider_user_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMProviderUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMProviderUserList{} + +// PaginatedSCIMProviderUserList struct for PaginatedSCIMProviderUserList +type PaginatedSCIMProviderUserList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMProviderUser `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMProviderUserList PaginatedSCIMProviderUserList + +// NewPaginatedSCIMProviderUserList instantiates a new PaginatedSCIMProviderUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMProviderUserList(pagination Pagination, results []SCIMProviderUser, autocomplete map[string]interface{}) *PaginatedSCIMProviderUserList { + this := PaginatedSCIMProviderUserList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMProviderUserListWithDefaults instantiates a new PaginatedSCIMProviderUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMProviderUserListWithDefaults() *PaginatedSCIMProviderUserList { + this := PaginatedSCIMProviderUserList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMProviderUserList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderUserList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMProviderUserList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMProviderUserList) GetResults() []SCIMProviderUser { + if o == nil { + var ret []SCIMProviderUser + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderUserList) GetResultsOk() ([]SCIMProviderUser, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMProviderUserList) SetResults(v []SCIMProviderUser) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMProviderUserList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMProviderUserList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMProviderUserList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMProviderUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMProviderUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMProviderUserList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMProviderUserList := _PaginatedSCIMProviderUserList{} + + err = json.Unmarshal(data, &varPaginatedSCIMProviderUserList) + + if err != nil { + return err + } + + *o = PaginatedSCIMProviderUserList(varPaginatedSCIMProviderUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMProviderUserList struct { + value *PaginatedSCIMProviderUserList + isSet bool +} + +func (v NullablePaginatedSCIMProviderUserList) Get() *PaginatedSCIMProviderUserList { + return v.value +} + +func (v *NullablePaginatedSCIMProviderUserList) Set(val *PaginatedSCIMProviderUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMProviderUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMProviderUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMProviderUserList(val *PaginatedSCIMProviderUserList) *NullablePaginatedSCIMProviderUserList { + return &NullablePaginatedSCIMProviderUserList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMProviderUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMProviderUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_source_group_list.go b/packages/client-go/model_paginated_scim_source_group_list.go new file mode 100644 index 0000000000..751780fc64 --- /dev/null +++ b/packages/client-go/model_paginated_scim_source_group_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMSourceGroupList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMSourceGroupList{} + +// PaginatedSCIMSourceGroupList struct for PaginatedSCIMSourceGroupList +type PaginatedSCIMSourceGroupList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMSourceGroup `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMSourceGroupList PaginatedSCIMSourceGroupList + +// NewPaginatedSCIMSourceGroupList instantiates a new PaginatedSCIMSourceGroupList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMSourceGroupList(pagination Pagination, results []SCIMSourceGroup, autocomplete map[string]interface{}) *PaginatedSCIMSourceGroupList { + this := PaginatedSCIMSourceGroupList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMSourceGroupListWithDefaults instantiates a new PaginatedSCIMSourceGroupList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMSourceGroupListWithDefaults() *PaginatedSCIMSourceGroupList { + this := PaginatedSCIMSourceGroupList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMSourceGroupList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceGroupList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMSourceGroupList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMSourceGroupList) GetResults() []SCIMSourceGroup { + if o == nil { + var ret []SCIMSourceGroup + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceGroupList) GetResultsOk() ([]SCIMSourceGroup, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMSourceGroupList) SetResults(v []SCIMSourceGroup) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMSourceGroupList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceGroupList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMSourceGroupList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMSourceGroupList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMSourceGroupList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMSourceGroupList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMSourceGroupList := _PaginatedSCIMSourceGroupList{} + + err = json.Unmarshal(data, &varPaginatedSCIMSourceGroupList) + + if err != nil { + return err + } + + *o = PaginatedSCIMSourceGroupList(varPaginatedSCIMSourceGroupList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMSourceGroupList struct { + value *PaginatedSCIMSourceGroupList + isSet bool +} + +func (v NullablePaginatedSCIMSourceGroupList) Get() *PaginatedSCIMSourceGroupList { + return v.value +} + +func (v *NullablePaginatedSCIMSourceGroupList) Set(val *PaginatedSCIMSourceGroupList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMSourceGroupList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMSourceGroupList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMSourceGroupList(val *PaginatedSCIMSourceGroupList) *NullablePaginatedSCIMSourceGroupList { + return &NullablePaginatedSCIMSourceGroupList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMSourceGroupList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMSourceGroupList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_source_list.go b/packages/client-go/model_paginated_scim_source_list.go new file mode 100644 index 0000000000..49c1db6387 --- /dev/null +++ b/packages/client-go/model_paginated_scim_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMSourceList{} + +// PaginatedSCIMSourceList struct for PaginatedSCIMSourceList +type PaginatedSCIMSourceList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMSourceList PaginatedSCIMSourceList + +// NewPaginatedSCIMSourceList instantiates a new PaginatedSCIMSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMSourceList(pagination Pagination, results []SCIMSource, autocomplete map[string]interface{}) *PaginatedSCIMSourceList { + this := PaginatedSCIMSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMSourceListWithDefaults instantiates a new PaginatedSCIMSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMSourceListWithDefaults() *PaginatedSCIMSourceList { + this := PaginatedSCIMSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMSourceList) GetResults() []SCIMSource { + if o == nil { + var ret []SCIMSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceList) GetResultsOk() ([]SCIMSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMSourceList) SetResults(v []SCIMSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMSourceList := _PaginatedSCIMSourceList{} + + err = json.Unmarshal(data, &varPaginatedSCIMSourceList) + + if err != nil { + return err + } + + *o = PaginatedSCIMSourceList(varPaginatedSCIMSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMSourceList struct { + value *PaginatedSCIMSourceList + isSet bool +} + +func (v NullablePaginatedSCIMSourceList) Get() *PaginatedSCIMSourceList { + return v.value +} + +func (v *NullablePaginatedSCIMSourceList) Set(val *PaginatedSCIMSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMSourceList(val *PaginatedSCIMSourceList) *NullablePaginatedSCIMSourceList { + return &NullablePaginatedSCIMSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_source_property_mapping_list.go b/packages/client-go/model_paginated_scim_source_property_mapping_list.go new file mode 100644 index 0000000000..c1db16e727 --- /dev/null +++ b/packages/client-go/model_paginated_scim_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMSourcePropertyMappingList{} + +// PaginatedSCIMSourcePropertyMappingList struct for PaginatedSCIMSourcePropertyMappingList +type PaginatedSCIMSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMSourcePropertyMappingList PaginatedSCIMSourcePropertyMappingList + +// NewPaginatedSCIMSourcePropertyMappingList instantiates a new PaginatedSCIMSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMSourcePropertyMappingList(pagination Pagination, results []SCIMSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedSCIMSourcePropertyMappingList { + this := PaginatedSCIMSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMSourcePropertyMappingListWithDefaults instantiates a new PaginatedSCIMSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMSourcePropertyMappingListWithDefaults() *PaginatedSCIMSourcePropertyMappingList { + this := PaginatedSCIMSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMSourcePropertyMappingList) GetResults() []SCIMSourcePropertyMapping { + if o == nil { + var ret []SCIMSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourcePropertyMappingList) GetResultsOk() ([]SCIMSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMSourcePropertyMappingList) SetResults(v []SCIMSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMSourcePropertyMappingList := _PaginatedSCIMSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedSCIMSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedSCIMSourcePropertyMappingList(varPaginatedSCIMSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMSourcePropertyMappingList struct { + value *PaginatedSCIMSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedSCIMSourcePropertyMappingList) Get() *PaginatedSCIMSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedSCIMSourcePropertyMappingList) Set(val *PaginatedSCIMSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMSourcePropertyMappingList(val *PaginatedSCIMSourcePropertyMappingList) *NullablePaginatedSCIMSourcePropertyMappingList { + return &NullablePaginatedSCIMSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scim_source_user_list.go b/packages/client-go/model_paginated_scim_source_user_list.go new file mode 100644 index 0000000000..0d58bc6dec --- /dev/null +++ b/packages/client-go/model_paginated_scim_source_user_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSCIMSourceUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSCIMSourceUserList{} + +// PaginatedSCIMSourceUserList struct for PaginatedSCIMSourceUserList +type PaginatedSCIMSourceUserList struct { + Pagination Pagination `json:"pagination"` + Results []SCIMSourceUser `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSCIMSourceUserList PaginatedSCIMSourceUserList + +// NewPaginatedSCIMSourceUserList instantiates a new PaginatedSCIMSourceUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSCIMSourceUserList(pagination Pagination, results []SCIMSourceUser, autocomplete map[string]interface{}) *PaginatedSCIMSourceUserList { + this := PaginatedSCIMSourceUserList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSCIMSourceUserListWithDefaults instantiates a new PaginatedSCIMSourceUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSCIMSourceUserListWithDefaults() *PaginatedSCIMSourceUserList { + this := PaginatedSCIMSourceUserList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSCIMSourceUserList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceUserList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSCIMSourceUserList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSCIMSourceUserList) GetResults() []SCIMSourceUser { + if o == nil { + var ret []SCIMSourceUser + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceUserList) GetResultsOk() ([]SCIMSourceUser, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSCIMSourceUserList) SetResults(v []SCIMSourceUser) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSCIMSourceUserList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSCIMSourceUserList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSCIMSourceUserList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSCIMSourceUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSCIMSourceUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSCIMSourceUserList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSCIMSourceUserList := _PaginatedSCIMSourceUserList{} + + err = json.Unmarshal(data, &varPaginatedSCIMSourceUserList) + + if err != nil { + return err + } + + *o = PaginatedSCIMSourceUserList(varPaginatedSCIMSourceUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSCIMSourceUserList struct { + value *PaginatedSCIMSourceUserList + isSet bool +} + +func (v NullablePaginatedSCIMSourceUserList) Get() *PaginatedSCIMSourceUserList { + return v.value +} + +func (v *NullablePaginatedSCIMSourceUserList) Set(val *PaginatedSCIMSourceUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSCIMSourceUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSCIMSourceUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSCIMSourceUserList(val *PaginatedSCIMSourceUserList) *NullablePaginatedSCIMSourceUserList { + return &NullablePaginatedSCIMSourceUserList{value: val, isSet: true} +} + +func (v NullablePaginatedSCIMSourceUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSCIMSourceUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_scope_mapping_list.go b/packages/client-go/model_paginated_scope_mapping_list.go new file mode 100644 index 0000000000..80a5e3277f --- /dev/null +++ b/packages/client-go/model_paginated_scope_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedScopeMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedScopeMappingList{} + +// PaginatedScopeMappingList struct for PaginatedScopeMappingList +type PaginatedScopeMappingList struct { + Pagination Pagination `json:"pagination"` + Results []ScopeMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedScopeMappingList PaginatedScopeMappingList + +// NewPaginatedScopeMappingList instantiates a new PaginatedScopeMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedScopeMappingList(pagination Pagination, results []ScopeMapping, autocomplete map[string]interface{}) *PaginatedScopeMappingList { + this := PaginatedScopeMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedScopeMappingListWithDefaults instantiates a new PaginatedScopeMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedScopeMappingListWithDefaults() *PaginatedScopeMappingList { + this := PaginatedScopeMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedScopeMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedScopeMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedScopeMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedScopeMappingList) GetResults() []ScopeMapping { + if o == nil { + var ret []ScopeMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedScopeMappingList) GetResultsOk() ([]ScopeMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedScopeMappingList) SetResults(v []ScopeMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedScopeMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedScopeMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedScopeMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedScopeMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedScopeMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedScopeMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedScopeMappingList := _PaginatedScopeMappingList{} + + err = json.Unmarshal(data, &varPaginatedScopeMappingList) + + if err != nil { + return err + } + + *o = PaginatedScopeMappingList(varPaginatedScopeMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedScopeMappingList struct { + value *PaginatedScopeMappingList + isSet bool +} + +func (v NullablePaginatedScopeMappingList) Get() *PaginatedScopeMappingList { + return v.value +} + +func (v *NullablePaginatedScopeMappingList) Set(val *PaginatedScopeMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedScopeMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedScopeMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedScopeMappingList(val *PaginatedScopeMappingList) *NullablePaginatedScopeMappingList { + return &NullablePaginatedScopeMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedScopeMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedScopeMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_service_connection_list.go b/packages/client-go/model_paginated_service_connection_list.go new file mode 100644 index 0000000000..e1bd0f0836 --- /dev/null +++ b/packages/client-go/model_paginated_service_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedServiceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedServiceConnectionList{} + +// PaginatedServiceConnectionList struct for PaginatedServiceConnectionList +type PaginatedServiceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []ServiceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedServiceConnectionList PaginatedServiceConnectionList + +// NewPaginatedServiceConnectionList instantiates a new PaginatedServiceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedServiceConnectionList(pagination Pagination, results []ServiceConnection, autocomplete map[string]interface{}) *PaginatedServiceConnectionList { + this := PaginatedServiceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedServiceConnectionListWithDefaults instantiates a new PaginatedServiceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedServiceConnectionListWithDefaults() *PaginatedServiceConnectionList { + this := PaginatedServiceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedServiceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedServiceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedServiceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedServiceConnectionList) GetResults() []ServiceConnection { + if o == nil { + var ret []ServiceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedServiceConnectionList) GetResultsOk() ([]ServiceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedServiceConnectionList) SetResults(v []ServiceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedServiceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedServiceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedServiceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedServiceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedServiceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedServiceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedServiceConnectionList := _PaginatedServiceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedServiceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedServiceConnectionList(varPaginatedServiceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedServiceConnectionList struct { + value *PaginatedServiceConnectionList + isSet bool +} + +func (v NullablePaginatedServiceConnectionList) Get() *PaginatedServiceConnectionList { + return v.value +} + +func (v *NullablePaginatedServiceConnectionList) Set(val *PaginatedServiceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedServiceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedServiceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedServiceConnectionList(val *PaginatedServiceConnectionList) *NullablePaginatedServiceConnectionList { + return &NullablePaginatedServiceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedServiceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedServiceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_sms_device_list.go b/packages/client-go/model_paginated_sms_device_list.go new file mode 100644 index 0000000000..c1585e7a1d --- /dev/null +++ b/packages/client-go/model_paginated_sms_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSMSDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSMSDeviceList{} + +// PaginatedSMSDeviceList struct for PaginatedSMSDeviceList +type PaginatedSMSDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []SMSDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSMSDeviceList PaginatedSMSDeviceList + +// NewPaginatedSMSDeviceList instantiates a new PaginatedSMSDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSMSDeviceList(pagination Pagination, results []SMSDevice, autocomplete map[string]interface{}) *PaginatedSMSDeviceList { + this := PaginatedSMSDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSMSDeviceListWithDefaults instantiates a new PaginatedSMSDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSMSDeviceListWithDefaults() *PaginatedSMSDeviceList { + this := PaginatedSMSDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSMSDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSMSDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSMSDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSMSDeviceList) GetResults() []SMSDevice { + if o == nil { + var ret []SMSDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSMSDeviceList) GetResultsOk() ([]SMSDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSMSDeviceList) SetResults(v []SMSDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSMSDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSMSDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSMSDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSMSDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSMSDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSMSDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSMSDeviceList := _PaginatedSMSDeviceList{} + + err = json.Unmarshal(data, &varPaginatedSMSDeviceList) + + if err != nil { + return err + } + + *o = PaginatedSMSDeviceList(varPaginatedSMSDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSMSDeviceList struct { + value *PaginatedSMSDeviceList + isSet bool +} + +func (v NullablePaginatedSMSDeviceList) Get() *PaginatedSMSDeviceList { + return v.value +} + +func (v *NullablePaginatedSMSDeviceList) Set(val *PaginatedSMSDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSMSDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSMSDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSMSDeviceList(val *PaginatedSMSDeviceList) *NullablePaginatedSMSDeviceList { + return &NullablePaginatedSMSDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedSMSDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSMSDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_source_list.go b/packages/client-go/model_paginated_source_list.go new file mode 100644 index 0000000000..d4b89b0880 --- /dev/null +++ b/packages/client-go/model_paginated_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSourceList{} + +// PaginatedSourceList struct for PaginatedSourceList +type PaginatedSourceList struct { + Pagination Pagination `json:"pagination"` + Results []Source `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSourceList PaginatedSourceList + +// NewPaginatedSourceList instantiates a new PaginatedSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSourceList(pagination Pagination, results []Source, autocomplete map[string]interface{}) *PaginatedSourceList { + this := PaginatedSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSourceListWithDefaults instantiates a new PaginatedSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSourceListWithDefaults() *PaginatedSourceList { + this := PaginatedSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSourceList) GetResults() []Source { + if o == nil { + var ret []Source + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceList) GetResultsOk() ([]Source, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSourceList) SetResults(v []Source) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSourceList := _PaginatedSourceList{} + + err = json.Unmarshal(data, &varPaginatedSourceList) + + if err != nil { + return err + } + + *o = PaginatedSourceList(varPaginatedSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSourceList struct { + value *PaginatedSourceList + isSet bool +} + +func (v NullablePaginatedSourceList) Get() *PaginatedSourceList { + return v.value +} + +func (v *NullablePaginatedSourceList) Set(val *PaginatedSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSourceList(val *PaginatedSourceList) *NullablePaginatedSourceList { + return &NullablePaginatedSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_source_stage_list.go b/packages/client-go/model_paginated_source_stage_list.go new file mode 100644 index 0000000000..69c3368ffe --- /dev/null +++ b/packages/client-go/model_paginated_source_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSourceStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSourceStageList{} + +// PaginatedSourceStageList struct for PaginatedSourceStageList +type PaginatedSourceStageList struct { + Pagination Pagination `json:"pagination"` + Results []SourceStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSourceStageList PaginatedSourceStageList + +// NewPaginatedSourceStageList instantiates a new PaginatedSourceStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSourceStageList(pagination Pagination, results []SourceStage, autocomplete map[string]interface{}) *PaginatedSourceStageList { + this := PaginatedSourceStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSourceStageListWithDefaults instantiates a new PaginatedSourceStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSourceStageListWithDefaults() *PaginatedSourceStageList { + this := PaginatedSourceStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSourceStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSourceStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSourceStageList) GetResults() []SourceStage { + if o == nil { + var ret []SourceStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceStageList) GetResultsOk() ([]SourceStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSourceStageList) SetResults(v []SourceStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSourceStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSourceStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSourceStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSourceStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSourceStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSourceStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSourceStageList := _PaginatedSourceStageList{} + + err = json.Unmarshal(data, &varPaginatedSourceStageList) + + if err != nil { + return err + } + + *o = PaginatedSourceStageList(varPaginatedSourceStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSourceStageList struct { + value *PaginatedSourceStageList + isSet bool +} + +func (v NullablePaginatedSourceStageList) Get() *PaginatedSourceStageList { + return v.value +} + +func (v *NullablePaginatedSourceStageList) Set(val *PaginatedSourceStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSourceStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSourceStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSourceStageList(val *PaginatedSourceStageList) *NullablePaginatedSourceStageList { + return &NullablePaginatedSourceStageList{value: val, isSet: true} +} + +func (v NullablePaginatedSourceStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSourceStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ssf_provider_list.go b/packages/client-go/model_paginated_ssf_provider_list.go new file mode 100644 index 0000000000..c188073c76 --- /dev/null +++ b/packages/client-go/model_paginated_ssf_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSSFProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSSFProviderList{} + +// PaginatedSSFProviderList struct for PaginatedSSFProviderList +type PaginatedSSFProviderList struct { + Pagination Pagination `json:"pagination"` + Results []SSFProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSSFProviderList PaginatedSSFProviderList + +// NewPaginatedSSFProviderList instantiates a new PaginatedSSFProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSSFProviderList(pagination Pagination, results []SSFProvider, autocomplete map[string]interface{}) *PaginatedSSFProviderList { + this := PaginatedSSFProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSSFProviderListWithDefaults instantiates a new PaginatedSSFProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSSFProviderListWithDefaults() *PaginatedSSFProviderList { + this := PaginatedSSFProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSSFProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSSFProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSSFProviderList) GetResults() []SSFProvider { + if o == nil { + var ret []SSFProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFProviderList) GetResultsOk() ([]SSFProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSSFProviderList) SetResults(v []SSFProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSSFProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSSFProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSSFProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSSFProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSSFProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSSFProviderList := _PaginatedSSFProviderList{} + + err = json.Unmarshal(data, &varPaginatedSSFProviderList) + + if err != nil { + return err + } + + *o = PaginatedSSFProviderList(varPaginatedSSFProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSSFProviderList struct { + value *PaginatedSSFProviderList + isSet bool +} + +func (v NullablePaginatedSSFProviderList) Get() *PaginatedSSFProviderList { + return v.value +} + +func (v *NullablePaginatedSSFProviderList) Set(val *PaginatedSSFProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSSFProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSSFProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSSFProviderList(val *PaginatedSSFProviderList) *NullablePaginatedSSFProviderList { + return &NullablePaginatedSSFProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedSSFProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSSFProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ssf_stream_list.go b/packages/client-go/model_paginated_ssf_stream_list.go new file mode 100644 index 0000000000..a8d7495032 --- /dev/null +++ b/packages/client-go/model_paginated_ssf_stream_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedSSFStreamList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedSSFStreamList{} + +// PaginatedSSFStreamList struct for PaginatedSSFStreamList +type PaginatedSSFStreamList struct { + Pagination Pagination `json:"pagination"` + Results []SSFStream `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedSSFStreamList PaginatedSSFStreamList + +// NewPaginatedSSFStreamList instantiates a new PaginatedSSFStreamList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedSSFStreamList(pagination Pagination, results []SSFStream, autocomplete map[string]interface{}) *PaginatedSSFStreamList { + this := PaginatedSSFStreamList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedSSFStreamListWithDefaults instantiates a new PaginatedSSFStreamList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedSSFStreamListWithDefaults() *PaginatedSSFStreamList { + this := PaginatedSSFStreamList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedSSFStreamList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFStreamList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedSSFStreamList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedSSFStreamList) GetResults() []SSFStream { + if o == nil { + var ret []SSFStream + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFStreamList) GetResultsOk() ([]SSFStream, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedSSFStreamList) SetResults(v []SSFStream) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedSSFStreamList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedSSFStreamList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedSSFStreamList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedSSFStreamList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedSSFStreamList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedSSFStreamList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedSSFStreamList := _PaginatedSSFStreamList{} + + err = json.Unmarshal(data, &varPaginatedSSFStreamList) + + if err != nil { + return err + } + + *o = PaginatedSSFStreamList(varPaginatedSSFStreamList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedSSFStreamList struct { + value *PaginatedSSFStreamList + isSet bool +} + +func (v NullablePaginatedSSFStreamList) Get() *PaginatedSSFStreamList { + return v.value +} + +func (v *NullablePaginatedSSFStreamList) Set(val *PaginatedSSFStreamList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedSSFStreamList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedSSFStreamList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedSSFStreamList(val *PaginatedSSFStreamList) *NullablePaginatedSSFStreamList { + return &NullablePaginatedSSFStreamList{value: val, isSet: true} +} + +func (v NullablePaginatedSSFStreamList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedSSFStreamList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_stage_list.go b/packages/client-go/model_paginated_stage_list.go new file mode 100644 index 0000000000..31c72fffac --- /dev/null +++ b/packages/client-go/model_paginated_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedStageList{} + +// PaginatedStageList struct for PaginatedStageList +type PaginatedStageList struct { + Pagination Pagination `json:"pagination"` + Results []Stage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedStageList PaginatedStageList + +// NewPaginatedStageList instantiates a new PaginatedStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedStageList(pagination Pagination, results []Stage, autocomplete map[string]interface{}) *PaginatedStageList { + this := PaginatedStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedStageListWithDefaults instantiates a new PaginatedStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedStageListWithDefaults() *PaginatedStageList { + this := PaginatedStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedStageList) GetResults() []Stage { + if o == nil { + var ret []Stage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedStageList) GetResultsOk() ([]Stage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedStageList) SetResults(v []Stage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedStageList := _PaginatedStageList{} + + err = json.Unmarshal(data, &varPaginatedStageList) + + if err != nil { + return err + } + + *o = PaginatedStageList(varPaginatedStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedStageList struct { + value *PaginatedStageList + isSet bool +} + +func (v NullablePaginatedStageList) Get() *PaginatedStageList { + return v.value +} + +func (v *NullablePaginatedStageList) Set(val *PaginatedStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedStageList(val *PaginatedStageList) *NullablePaginatedStageList { + return &NullablePaginatedStageList{value: val, isSet: true} +} + +func (v NullablePaginatedStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_static_device_list.go b/packages/client-go/model_paginated_static_device_list.go new file mode 100644 index 0000000000..6cf191102d --- /dev/null +++ b/packages/client-go/model_paginated_static_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedStaticDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedStaticDeviceList{} + +// PaginatedStaticDeviceList struct for PaginatedStaticDeviceList +type PaginatedStaticDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []StaticDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedStaticDeviceList PaginatedStaticDeviceList + +// NewPaginatedStaticDeviceList instantiates a new PaginatedStaticDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedStaticDeviceList(pagination Pagination, results []StaticDevice, autocomplete map[string]interface{}) *PaginatedStaticDeviceList { + this := PaginatedStaticDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedStaticDeviceListWithDefaults instantiates a new PaginatedStaticDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedStaticDeviceListWithDefaults() *PaginatedStaticDeviceList { + this := PaginatedStaticDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedStaticDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedStaticDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedStaticDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedStaticDeviceList) GetResults() []StaticDevice { + if o == nil { + var ret []StaticDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedStaticDeviceList) GetResultsOk() ([]StaticDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedStaticDeviceList) SetResults(v []StaticDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedStaticDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedStaticDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedStaticDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedStaticDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedStaticDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedStaticDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedStaticDeviceList := _PaginatedStaticDeviceList{} + + err = json.Unmarshal(data, &varPaginatedStaticDeviceList) + + if err != nil { + return err + } + + *o = PaginatedStaticDeviceList(varPaginatedStaticDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedStaticDeviceList struct { + value *PaginatedStaticDeviceList + isSet bool +} + +func (v NullablePaginatedStaticDeviceList) Get() *PaginatedStaticDeviceList { + return v.value +} + +func (v *NullablePaginatedStaticDeviceList) Set(val *PaginatedStaticDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedStaticDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedStaticDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedStaticDeviceList(val *PaginatedStaticDeviceList) *NullablePaginatedStaticDeviceList { + return &NullablePaginatedStaticDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedStaticDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedStaticDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_task_list.go b/packages/client-go/model_paginated_task_list.go new file mode 100644 index 0000000000..3c43db57b2 --- /dev/null +++ b/packages/client-go/model_paginated_task_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTaskList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTaskList{} + +// PaginatedTaskList struct for PaginatedTaskList +type PaginatedTaskList struct { + Pagination Pagination `json:"pagination"` + Results []Task `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTaskList PaginatedTaskList + +// NewPaginatedTaskList instantiates a new PaginatedTaskList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTaskList(pagination Pagination, results []Task, autocomplete map[string]interface{}) *PaginatedTaskList { + this := PaginatedTaskList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTaskListWithDefaults instantiates a new PaginatedTaskList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTaskListWithDefaults() *PaginatedTaskList { + this := PaginatedTaskList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTaskList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTaskList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTaskList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTaskList) GetResults() []Task { + if o == nil { + var ret []Task + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTaskList) GetResultsOk() ([]Task, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTaskList) SetResults(v []Task) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTaskList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTaskList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTaskList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTaskList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTaskList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTaskList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTaskList := _PaginatedTaskList{} + + err = json.Unmarshal(data, &varPaginatedTaskList) + + if err != nil { + return err + } + + *o = PaginatedTaskList(varPaginatedTaskList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTaskList struct { + value *PaginatedTaskList + isSet bool +} + +func (v NullablePaginatedTaskList) Get() *PaginatedTaskList { + return v.value +} + +func (v *NullablePaginatedTaskList) Set(val *PaginatedTaskList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTaskList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTaskList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTaskList(val *PaginatedTaskList) *NullablePaginatedTaskList { + return &NullablePaginatedTaskList{value: val, isSet: true} +} + +func (v NullablePaginatedTaskList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTaskList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_telegram_source_list.go b/packages/client-go/model_paginated_telegram_source_list.go new file mode 100644 index 0000000000..10dd3d70f3 --- /dev/null +++ b/packages/client-go/model_paginated_telegram_source_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTelegramSourceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTelegramSourceList{} + +// PaginatedTelegramSourceList struct for PaginatedTelegramSourceList +type PaginatedTelegramSourceList struct { + Pagination Pagination `json:"pagination"` + Results []TelegramSource `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTelegramSourceList PaginatedTelegramSourceList + +// NewPaginatedTelegramSourceList instantiates a new PaginatedTelegramSourceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTelegramSourceList(pagination Pagination, results []TelegramSource, autocomplete map[string]interface{}) *PaginatedTelegramSourceList { + this := PaginatedTelegramSourceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTelegramSourceListWithDefaults instantiates a new PaginatedTelegramSourceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTelegramSourceListWithDefaults() *PaginatedTelegramSourceList { + this := PaginatedTelegramSourceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTelegramSourceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTelegramSourceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTelegramSourceList) GetResults() []TelegramSource { + if o == nil { + var ret []TelegramSource + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourceList) GetResultsOk() ([]TelegramSource, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTelegramSourceList) SetResults(v []TelegramSource) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTelegramSourceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTelegramSourceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTelegramSourceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTelegramSourceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTelegramSourceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTelegramSourceList := _PaginatedTelegramSourceList{} + + err = json.Unmarshal(data, &varPaginatedTelegramSourceList) + + if err != nil { + return err + } + + *o = PaginatedTelegramSourceList(varPaginatedTelegramSourceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTelegramSourceList struct { + value *PaginatedTelegramSourceList + isSet bool +} + +func (v NullablePaginatedTelegramSourceList) Get() *PaginatedTelegramSourceList { + return v.value +} + +func (v *NullablePaginatedTelegramSourceList) Set(val *PaginatedTelegramSourceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTelegramSourceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTelegramSourceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTelegramSourceList(val *PaginatedTelegramSourceList) *NullablePaginatedTelegramSourceList { + return &NullablePaginatedTelegramSourceList{value: val, isSet: true} +} + +func (v NullablePaginatedTelegramSourceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTelegramSourceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_telegram_source_property_mapping_list.go b/packages/client-go/model_paginated_telegram_source_property_mapping_list.go new file mode 100644 index 0000000000..adffe91bc6 --- /dev/null +++ b/packages/client-go/model_paginated_telegram_source_property_mapping_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTelegramSourcePropertyMappingList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTelegramSourcePropertyMappingList{} + +// PaginatedTelegramSourcePropertyMappingList struct for PaginatedTelegramSourcePropertyMappingList +type PaginatedTelegramSourcePropertyMappingList struct { + Pagination Pagination `json:"pagination"` + Results []TelegramSourcePropertyMapping `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTelegramSourcePropertyMappingList PaginatedTelegramSourcePropertyMappingList + +// NewPaginatedTelegramSourcePropertyMappingList instantiates a new PaginatedTelegramSourcePropertyMappingList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTelegramSourcePropertyMappingList(pagination Pagination, results []TelegramSourcePropertyMapping, autocomplete map[string]interface{}) *PaginatedTelegramSourcePropertyMappingList { + this := PaginatedTelegramSourcePropertyMappingList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTelegramSourcePropertyMappingListWithDefaults instantiates a new PaginatedTelegramSourcePropertyMappingList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTelegramSourcePropertyMappingListWithDefaults() *PaginatedTelegramSourcePropertyMappingList { + this := PaginatedTelegramSourcePropertyMappingList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTelegramSourcePropertyMappingList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourcePropertyMappingList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTelegramSourcePropertyMappingList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTelegramSourcePropertyMappingList) GetResults() []TelegramSourcePropertyMapping { + if o == nil { + var ret []TelegramSourcePropertyMapping + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourcePropertyMappingList) GetResultsOk() ([]TelegramSourcePropertyMapping, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTelegramSourcePropertyMappingList) SetResults(v []TelegramSourcePropertyMapping) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTelegramSourcePropertyMappingList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTelegramSourcePropertyMappingList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTelegramSourcePropertyMappingList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTelegramSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTelegramSourcePropertyMappingList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTelegramSourcePropertyMappingList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTelegramSourcePropertyMappingList := _PaginatedTelegramSourcePropertyMappingList{} + + err = json.Unmarshal(data, &varPaginatedTelegramSourcePropertyMappingList) + + if err != nil { + return err + } + + *o = PaginatedTelegramSourcePropertyMappingList(varPaginatedTelegramSourcePropertyMappingList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTelegramSourcePropertyMappingList struct { + value *PaginatedTelegramSourcePropertyMappingList + isSet bool +} + +func (v NullablePaginatedTelegramSourcePropertyMappingList) Get() *PaginatedTelegramSourcePropertyMappingList { + return v.value +} + +func (v *NullablePaginatedTelegramSourcePropertyMappingList) Set(val *PaginatedTelegramSourcePropertyMappingList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTelegramSourcePropertyMappingList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTelegramSourcePropertyMappingList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTelegramSourcePropertyMappingList(val *PaginatedTelegramSourcePropertyMappingList) *NullablePaginatedTelegramSourcePropertyMappingList { + return &NullablePaginatedTelegramSourcePropertyMappingList{value: val, isSet: true} +} + +func (v NullablePaginatedTelegramSourcePropertyMappingList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTelegramSourcePropertyMappingList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_tenant_list.go b/packages/client-go/model_paginated_tenant_list.go new file mode 100644 index 0000000000..be16573f34 --- /dev/null +++ b/packages/client-go/model_paginated_tenant_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTenantList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTenantList{} + +// PaginatedTenantList struct for PaginatedTenantList +type PaginatedTenantList struct { + Pagination Pagination `json:"pagination"` + Results []Tenant `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTenantList PaginatedTenantList + +// NewPaginatedTenantList instantiates a new PaginatedTenantList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTenantList(pagination Pagination, results []Tenant, autocomplete map[string]interface{}) *PaginatedTenantList { + this := PaginatedTenantList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTenantListWithDefaults instantiates a new PaginatedTenantList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTenantListWithDefaults() *PaginatedTenantList { + this := PaginatedTenantList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTenantList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTenantList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTenantList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTenantList) GetResults() []Tenant { + if o == nil { + var ret []Tenant + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTenantList) GetResultsOk() ([]Tenant, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTenantList) SetResults(v []Tenant) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTenantList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTenantList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTenantList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTenantList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTenantList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTenantList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTenantList := _PaginatedTenantList{} + + err = json.Unmarshal(data, &varPaginatedTenantList) + + if err != nil { + return err + } + + *o = PaginatedTenantList(varPaginatedTenantList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTenantList struct { + value *PaginatedTenantList + isSet bool +} + +func (v NullablePaginatedTenantList) Get() *PaginatedTenantList { + return v.value +} + +func (v *NullablePaginatedTenantList) Set(val *PaginatedTenantList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTenantList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTenantList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTenantList(val *PaginatedTenantList) *NullablePaginatedTenantList { + return &NullablePaginatedTenantList{value: val, isSet: true} +} + +func (v NullablePaginatedTenantList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTenantList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_token_list.go b/packages/client-go/model_paginated_token_list.go new file mode 100644 index 0000000000..729aebb189 --- /dev/null +++ b/packages/client-go/model_paginated_token_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTokenList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTokenList{} + +// PaginatedTokenList struct for PaginatedTokenList +type PaginatedTokenList struct { + Pagination Pagination `json:"pagination"` + Results []Token `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTokenList PaginatedTokenList + +// NewPaginatedTokenList instantiates a new PaginatedTokenList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTokenList(pagination Pagination, results []Token, autocomplete map[string]interface{}) *PaginatedTokenList { + this := PaginatedTokenList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTokenListWithDefaults instantiates a new PaginatedTokenList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTokenListWithDefaults() *PaginatedTokenList { + this := PaginatedTokenList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTokenList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTokenList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTokenList) GetResults() []Token { + if o == nil { + var ret []Token + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenList) GetResultsOk() ([]Token, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTokenList) SetResults(v []Token) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTokenList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTokenList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTokenList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTokenList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTokenList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTokenList := _PaginatedTokenList{} + + err = json.Unmarshal(data, &varPaginatedTokenList) + + if err != nil { + return err + } + + *o = PaginatedTokenList(varPaginatedTokenList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTokenList struct { + value *PaginatedTokenList + isSet bool +} + +func (v NullablePaginatedTokenList) Get() *PaginatedTokenList { + return v.value +} + +func (v *NullablePaginatedTokenList) Set(val *PaginatedTokenList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTokenList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTokenList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTokenList(val *PaginatedTokenList) *NullablePaginatedTokenList { + return &NullablePaginatedTokenList{value: val, isSet: true} +} + +func (v NullablePaginatedTokenList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTokenList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_token_model_list.go b/packages/client-go/model_paginated_token_model_list.go new file mode 100644 index 0000000000..73189a5d12 --- /dev/null +++ b/packages/client-go/model_paginated_token_model_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTokenModelList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTokenModelList{} + +// PaginatedTokenModelList struct for PaginatedTokenModelList +type PaginatedTokenModelList struct { + Pagination Pagination `json:"pagination"` + Results []TokenModel `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTokenModelList PaginatedTokenModelList + +// NewPaginatedTokenModelList instantiates a new PaginatedTokenModelList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTokenModelList(pagination Pagination, results []TokenModel, autocomplete map[string]interface{}) *PaginatedTokenModelList { + this := PaginatedTokenModelList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTokenModelListWithDefaults instantiates a new PaginatedTokenModelList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTokenModelListWithDefaults() *PaginatedTokenModelList { + this := PaginatedTokenModelList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTokenModelList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenModelList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTokenModelList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTokenModelList) GetResults() []TokenModel { + if o == nil { + var ret []TokenModel + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenModelList) GetResultsOk() ([]TokenModel, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTokenModelList) SetResults(v []TokenModel) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTokenModelList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTokenModelList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTokenModelList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTokenModelList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTokenModelList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTokenModelList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTokenModelList := _PaginatedTokenModelList{} + + err = json.Unmarshal(data, &varPaginatedTokenModelList) + + if err != nil { + return err + } + + *o = PaginatedTokenModelList(varPaginatedTokenModelList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTokenModelList struct { + value *PaginatedTokenModelList + isSet bool +} + +func (v NullablePaginatedTokenModelList) Get() *PaginatedTokenModelList { + return v.value +} + +func (v *NullablePaginatedTokenModelList) Set(val *PaginatedTokenModelList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTokenModelList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTokenModelList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTokenModelList(val *PaginatedTokenModelList) *NullablePaginatedTokenModelList { + return &NullablePaginatedTokenModelList{value: val, isSet: true} +} + +func (v NullablePaginatedTokenModelList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTokenModelList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_totp_device_list.go b/packages/client-go/model_paginated_totp_device_list.go new file mode 100644 index 0000000000..7e52df125f --- /dev/null +++ b/packages/client-go/model_paginated_totp_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedTOTPDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedTOTPDeviceList{} + +// PaginatedTOTPDeviceList struct for PaginatedTOTPDeviceList +type PaginatedTOTPDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []TOTPDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedTOTPDeviceList PaginatedTOTPDeviceList + +// NewPaginatedTOTPDeviceList instantiates a new PaginatedTOTPDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedTOTPDeviceList(pagination Pagination, results []TOTPDevice, autocomplete map[string]interface{}) *PaginatedTOTPDeviceList { + this := PaginatedTOTPDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedTOTPDeviceListWithDefaults instantiates a new PaginatedTOTPDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedTOTPDeviceListWithDefaults() *PaginatedTOTPDeviceList { + this := PaginatedTOTPDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedTOTPDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedTOTPDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedTOTPDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedTOTPDeviceList) GetResults() []TOTPDevice { + if o == nil { + var ret []TOTPDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedTOTPDeviceList) GetResultsOk() ([]TOTPDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedTOTPDeviceList) SetResults(v []TOTPDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedTOTPDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedTOTPDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedTOTPDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedTOTPDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedTOTPDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedTOTPDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedTOTPDeviceList := _PaginatedTOTPDeviceList{} + + err = json.Unmarshal(data, &varPaginatedTOTPDeviceList) + + if err != nil { + return err + } + + *o = PaginatedTOTPDeviceList(varPaginatedTOTPDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedTOTPDeviceList struct { + value *PaginatedTOTPDeviceList + isSet bool +} + +func (v NullablePaginatedTOTPDeviceList) Get() *PaginatedTOTPDeviceList { + return v.value +} + +func (v *NullablePaginatedTOTPDeviceList) Set(val *PaginatedTOTPDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedTOTPDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedTOTPDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedTOTPDeviceList(val *PaginatedTOTPDeviceList) *NullablePaginatedTOTPDeviceList { + return &NullablePaginatedTOTPDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedTOTPDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedTOTPDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_unique_password_policy_list.go b/packages/client-go/model_paginated_unique_password_policy_list.go new file mode 100644 index 0000000000..31120497c4 --- /dev/null +++ b/packages/client-go/model_paginated_unique_password_policy_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUniquePasswordPolicyList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUniquePasswordPolicyList{} + +// PaginatedUniquePasswordPolicyList struct for PaginatedUniquePasswordPolicyList +type PaginatedUniquePasswordPolicyList struct { + Pagination Pagination `json:"pagination"` + Results []UniquePasswordPolicy `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUniquePasswordPolicyList PaginatedUniquePasswordPolicyList + +// NewPaginatedUniquePasswordPolicyList instantiates a new PaginatedUniquePasswordPolicyList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUniquePasswordPolicyList(pagination Pagination, results []UniquePasswordPolicy, autocomplete map[string]interface{}) *PaginatedUniquePasswordPolicyList { + this := PaginatedUniquePasswordPolicyList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUniquePasswordPolicyListWithDefaults instantiates a new PaginatedUniquePasswordPolicyList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUniquePasswordPolicyListWithDefaults() *PaginatedUniquePasswordPolicyList { + this := PaginatedUniquePasswordPolicyList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUniquePasswordPolicyList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUniquePasswordPolicyList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUniquePasswordPolicyList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUniquePasswordPolicyList) GetResults() []UniquePasswordPolicy { + if o == nil { + var ret []UniquePasswordPolicy + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUniquePasswordPolicyList) GetResultsOk() ([]UniquePasswordPolicy, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUniquePasswordPolicyList) SetResults(v []UniquePasswordPolicy) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUniquePasswordPolicyList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUniquePasswordPolicyList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUniquePasswordPolicyList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUniquePasswordPolicyList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUniquePasswordPolicyList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUniquePasswordPolicyList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUniquePasswordPolicyList := _PaginatedUniquePasswordPolicyList{} + + err = json.Unmarshal(data, &varPaginatedUniquePasswordPolicyList) + + if err != nil { + return err + } + + *o = PaginatedUniquePasswordPolicyList(varPaginatedUniquePasswordPolicyList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUniquePasswordPolicyList struct { + value *PaginatedUniquePasswordPolicyList + isSet bool +} + +func (v NullablePaginatedUniquePasswordPolicyList) Get() *PaginatedUniquePasswordPolicyList { + return v.value +} + +func (v *NullablePaginatedUniquePasswordPolicyList) Set(val *PaginatedUniquePasswordPolicyList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUniquePasswordPolicyList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUniquePasswordPolicyList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUniquePasswordPolicyList(val *PaginatedUniquePasswordPolicyList) *NullablePaginatedUniquePasswordPolicyList { + return &NullablePaginatedUniquePasswordPolicyList{value: val, isSet: true} +} + +func (v NullablePaginatedUniquePasswordPolicyList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUniquePasswordPolicyList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_consent_list.go b/packages/client-go/model_paginated_user_consent_list.go new file mode 100644 index 0000000000..c5c710972d --- /dev/null +++ b/packages/client-go/model_paginated_user_consent_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserConsentList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserConsentList{} + +// PaginatedUserConsentList struct for PaginatedUserConsentList +type PaginatedUserConsentList struct { + Pagination Pagination `json:"pagination"` + Results []UserConsent `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserConsentList PaginatedUserConsentList + +// NewPaginatedUserConsentList instantiates a new PaginatedUserConsentList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserConsentList(pagination Pagination, results []UserConsent, autocomplete map[string]interface{}) *PaginatedUserConsentList { + this := PaginatedUserConsentList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserConsentListWithDefaults instantiates a new PaginatedUserConsentList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserConsentListWithDefaults() *PaginatedUserConsentList { + this := PaginatedUserConsentList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserConsentList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserConsentList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserConsentList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserConsentList) GetResults() []UserConsent { + if o == nil { + var ret []UserConsent + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserConsentList) GetResultsOk() ([]UserConsent, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserConsentList) SetResults(v []UserConsent) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserConsentList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserConsentList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserConsentList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserConsentList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserConsentList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserConsentList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserConsentList := _PaginatedUserConsentList{} + + err = json.Unmarshal(data, &varPaginatedUserConsentList) + + if err != nil { + return err + } + + *o = PaginatedUserConsentList(varPaginatedUserConsentList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserConsentList struct { + value *PaginatedUserConsentList + isSet bool +} + +func (v NullablePaginatedUserConsentList) Get() *PaginatedUserConsentList { + return v.value +} + +func (v *NullablePaginatedUserConsentList) Set(val *PaginatedUserConsentList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserConsentList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserConsentList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserConsentList(val *PaginatedUserConsentList) *NullablePaginatedUserConsentList { + return &NullablePaginatedUserConsentList{value: val, isSet: true} +} + +func (v NullablePaginatedUserConsentList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserConsentList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_delete_stage_list.go b/packages/client-go/model_paginated_user_delete_stage_list.go new file mode 100644 index 0000000000..e29f03b34e --- /dev/null +++ b/packages/client-go/model_paginated_user_delete_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserDeleteStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserDeleteStageList{} + +// PaginatedUserDeleteStageList struct for PaginatedUserDeleteStageList +type PaginatedUserDeleteStageList struct { + Pagination Pagination `json:"pagination"` + Results []UserDeleteStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserDeleteStageList PaginatedUserDeleteStageList + +// NewPaginatedUserDeleteStageList instantiates a new PaginatedUserDeleteStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserDeleteStageList(pagination Pagination, results []UserDeleteStage, autocomplete map[string]interface{}) *PaginatedUserDeleteStageList { + this := PaginatedUserDeleteStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserDeleteStageListWithDefaults instantiates a new PaginatedUserDeleteStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserDeleteStageListWithDefaults() *PaginatedUserDeleteStageList { + this := PaginatedUserDeleteStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserDeleteStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserDeleteStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserDeleteStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserDeleteStageList) GetResults() []UserDeleteStage { + if o == nil { + var ret []UserDeleteStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserDeleteStageList) GetResultsOk() ([]UserDeleteStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserDeleteStageList) SetResults(v []UserDeleteStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserDeleteStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserDeleteStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserDeleteStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserDeleteStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserDeleteStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserDeleteStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserDeleteStageList := _PaginatedUserDeleteStageList{} + + err = json.Unmarshal(data, &varPaginatedUserDeleteStageList) + + if err != nil { + return err + } + + *o = PaginatedUserDeleteStageList(varPaginatedUserDeleteStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserDeleteStageList struct { + value *PaginatedUserDeleteStageList + isSet bool +} + +func (v NullablePaginatedUserDeleteStageList) Get() *PaginatedUserDeleteStageList { + return v.value +} + +func (v *NullablePaginatedUserDeleteStageList) Set(val *PaginatedUserDeleteStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserDeleteStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserDeleteStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserDeleteStageList(val *PaginatedUserDeleteStageList) *NullablePaginatedUserDeleteStageList { + return &NullablePaginatedUserDeleteStageList{value: val, isSet: true} +} + +func (v NullablePaginatedUserDeleteStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserDeleteStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_kerberos_source_connection_list.go b/packages/client-go/model_paginated_user_kerberos_source_connection_list.go new file mode 100644 index 0000000000..627375e8bc --- /dev/null +++ b/packages/client-go/model_paginated_user_kerberos_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserKerberosSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserKerberosSourceConnectionList{} + +// PaginatedUserKerberosSourceConnectionList struct for PaginatedUserKerberosSourceConnectionList +type PaginatedUserKerberosSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserKerberosSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserKerberosSourceConnectionList PaginatedUserKerberosSourceConnectionList + +// NewPaginatedUserKerberosSourceConnectionList instantiates a new PaginatedUserKerberosSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserKerberosSourceConnectionList(pagination Pagination, results []UserKerberosSourceConnection, autocomplete map[string]interface{}) *PaginatedUserKerberosSourceConnectionList { + this := PaginatedUserKerberosSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserKerberosSourceConnectionListWithDefaults instantiates a new PaginatedUserKerberosSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserKerberosSourceConnectionListWithDefaults() *PaginatedUserKerberosSourceConnectionList { + this := PaginatedUserKerberosSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserKerberosSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserKerberosSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserKerberosSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserKerberosSourceConnectionList) GetResults() []UserKerberosSourceConnection { + if o == nil { + var ret []UserKerberosSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserKerberosSourceConnectionList) GetResultsOk() ([]UserKerberosSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserKerberosSourceConnectionList) SetResults(v []UserKerberosSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserKerberosSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserKerberosSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserKerberosSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserKerberosSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserKerberosSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserKerberosSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserKerberosSourceConnectionList := _PaginatedUserKerberosSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserKerberosSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserKerberosSourceConnectionList(varPaginatedUserKerberosSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserKerberosSourceConnectionList struct { + value *PaginatedUserKerberosSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserKerberosSourceConnectionList) Get() *PaginatedUserKerberosSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserKerberosSourceConnectionList) Set(val *PaginatedUserKerberosSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserKerberosSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserKerberosSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserKerberosSourceConnectionList(val *PaginatedUserKerberosSourceConnectionList) *NullablePaginatedUserKerberosSourceConnectionList { + return &NullablePaginatedUserKerberosSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserKerberosSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserKerberosSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_ldap_source_connection_list.go b/packages/client-go/model_paginated_user_ldap_source_connection_list.go new file mode 100644 index 0000000000..c0a045b035 --- /dev/null +++ b/packages/client-go/model_paginated_user_ldap_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserLDAPSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserLDAPSourceConnectionList{} + +// PaginatedUserLDAPSourceConnectionList struct for PaginatedUserLDAPSourceConnectionList +type PaginatedUserLDAPSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserLDAPSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserLDAPSourceConnectionList PaginatedUserLDAPSourceConnectionList + +// NewPaginatedUserLDAPSourceConnectionList instantiates a new PaginatedUserLDAPSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserLDAPSourceConnectionList(pagination Pagination, results []UserLDAPSourceConnection, autocomplete map[string]interface{}) *PaginatedUserLDAPSourceConnectionList { + this := PaginatedUserLDAPSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserLDAPSourceConnectionListWithDefaults instantiates a new PaginatedUserLDAPSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserLDAPSourceConnectionListWithDefaults() *PaginatedUserLDAPSourceConnectionList { + this := PaginatedUserLDAPSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserLDAPSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLDAPSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserLDAPSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserLDAPSourceConnectionList) GetResults() []UserLDAPSourceConnection { + if o == nil { + var ret []UserLDAPSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLDAPSourceConnectionList) GetResultsOk() ([]UserLDAPSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserLDAPSourceConnectionList) SetResults(v []UserLDAPSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserLDAPSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLDAPSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserLDAPSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserLDAPSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserLDAPSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserLDAPSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserLDAPSourceConnectionList := _PaginatedUserLDAPSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserLDAPSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserLDAPSourceConnectionList(varPaginatedUserLDAPSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserLDAPSourceConnectionList struct { + value *PaginatedUserLDAPSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserLDAPSourceConnectionList) Get() *PaginatedUserLDAPSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserLDAPSourceConnectionList) Set(val *PaginatedUserLDAPSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserLDAPSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserLDAPSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserLDAPSourceConnectionList(val *PaginatedUserLDAPSourceConnectionList) *NullablePaginatedUserLDAPSourceConnectionList { + return &NullablePaginatedUserLDAPSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserLDAPSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserLDAPSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_list.go b/packages/client-go/model_paginated_user_list.go new file mode 100644 index 0000000000..f73039de5c --- /dev/null +++ b/packages/client-go/model_paginated_user_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserList{} + +// PaginatedUserList struct for PaginatedUserList +type PaginatedUserList struct { + Pagination Pagination `json:"pagination"` + Results []User `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserList PaginatedUserList + +// NewPaginatedUserList instantiates a new PaginatedUserList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserList(pagination Pagination, results []User, autocomplete map[string]interface{}) *PaginatedUserList { + this := PaginatedUserList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserListWithDefaults instantiates a new PaginatedUserList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserListWithDefaults() *PaginatedUserList { + this := PaginatedUserList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserList) GetResults() []User { + if o == nil { + var ret []User + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserList) GetResultsOk() ([]User, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserList) SetResults(v []User) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserList := _PaginatedUserList{} + + err = json.Unmarshal(data, &varPaginatedUserList) + + if err != nil { + return err + } + + *o = PaginatedUserList(varPaginatedUserList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserList struct { + value *PaginatedUserList + isSet bool +} + +func (v NullablePaginatedUserList) Get() *PaginatedUserList { + return v.value +} + +func (v *NullablePaginatedUserList) Set(val *PaginatedUserList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserList(val *PaginatedUserList) *NullablePaginatedUserList { + return &NullablePaginatedUserList{value: val, isSet: true} +} + +func (v NullablePaginatedUserList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_login_stage_list.go b/packages/client-go/model_paginated_user_login_stage_list.go new file mode 100644 index 0000000000..903aa7e227 --- /dev/null +++ b/packages/client-go/model_paginated_user_login_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserLoginStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserLoginStageList{} + +// PaginatedUserLoginStageList struct for PaginatedUserLoginStageList +type PaginatedUserLoginStageList struct { + Pagination Pagination `json:"pagination"` + Results []UserLoginStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserLoginStageList PaginatedUserLoginStageList + +// NewPaginatedUserLoginStageList instantiates a new PaginatedUserLoginStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserLoginStageList(pagination Pagination, results []UserLoginStage, autocomplete map[string]interface{}) *PaginatedUserLoginStageList { + this := PaginatedUserLoginStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserLoginStageListWithDefaults instantiates a new PaginatedUserLoginStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserLoginStageListWithDefaults() *PaginatedUserLoginStageList { + this := PaginatedUserLoginStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserLoginStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLoginStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserLoginStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserLoginStageList) GetResults() []UserLoginStage { + if o == nil { + var ret []UserLoginStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLoginStageList) GetResultsOk() ([]UserLoginStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserLoginStageList) SetResults(v []UserLoginStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserLoginStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLoginStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserLoginStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserLoginStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserLoginStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserLoginStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserLoginStageList := _PaginatedUserLoginStageList{} + + err = json.Unmarshal(data, &varPaginatedUserLoginStageList) + + if err != nil { + return err + } + + *o = PaginatedUserLoginStageList(varPaginatedUserLoginStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserLoginStageList struct { + value *PaginatedUserLoginStageList + isSet bool +} + +func (v NullablePaginatedUserLoginStageList) Get() *PaginatedUserLoginStageList { + return v.value +} + +func (v *NullablePaginatedUserLoginStageList) Set(val *PaginatedUserLoginStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserLoginStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserLoginStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserLoginStageList(val *PaginatedUserLoginStageList) *NullablePaginatedUserLoginStageList { + return &NullablePaginatedUserLoginStageList{value: val, isSet: true} +} + +func (v NullablePaginatedUserLoginStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserLoginStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_logout_stage_list.go b/packages/client-go/model_paginated_user_logout_stage_list.go new file mode 100644 index 0000000000..16b41ba38b --- /dev/null +++ b/packages/client-go/model_paginated_user_logout_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserLogoutStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserLogoutStageList{} + +// PaginatedUserLogoutStageList struct for PaginatedUserLogoutStageList +type PaginatedUserLogoutStageList struct { + Pagination Pagination `json:"pagination"` + Results []UserLogoutStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserLogoutStageList PaginatedUserLogoutStageList + +// NewPaginatedUserLogoutStageList instantiates a new PaginatedUserLogoutStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserLogoutStageList(pagination Pagination, results []UserLogoutStage, autocomplete map[string]interface{}) *PaginatedUserLogoutStageList { + this := PaginatedUserLogoutStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserLogoutStageListWithDefaults instantiates a new PaginatedUserLogoutStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserLogoutStageListWithDefaults() *PaginatedUserLogoutStageList { + this := PaginatedUserLogoutStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserLogoutStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLogoutStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserLogoutStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserLogoutStageList) GetResults() []UserLogoutStage { + if o == nil { + var ret []UserLogoutStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLogoutStageList) GetResultsOk() ([]UserLogoutStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserLogoutStageList) SetResults(v []UserLogoutStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserLogoutStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserLogoutStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserLogoutStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserLogoutStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserLogoutStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserLogoutStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserLogoutStageList := _PaginatedUserLogoutStageList{} + + err = json.Unmarshal(data, &varPaginatedUserLogoutStageList) + + if err != nil { + return err + } + + *o = PaginatedUserLogoutStageList(varPaginatedUserLogoutStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserLogoutStageList struct { + value *PaginatedUserLogoutStageList + isSet bool +} + +func (v NullablePaginatedUserLogoutStageList) Get() *PaginatedUserLogoutStageList { + return v.value +} + +func (v *NullablePaginatedUserLogoutStageList) Set(val *PaginatedUserLogoutStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserLogoutStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserLogoutStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserLogoutStageList(val *PaginatedUserLogoutStageList) *NullablePaginatedUserLogoutStageList { + return &NullablePaginatedUserLogoutStageList{value: val, isSet: true} +} + +func (v NullablePaginatedUserLogoutStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserLogoutStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_o_auth_source_connection_list.go b/packages/client-go/model_paginated_user_o_auth_source_connection_list.go new file mode 100644 index 0000000000..9b3e5ce222 --- /dev/null +++ b/packages/client-go/model_paginated_user_o_auth_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserOAuthSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserOAuthSourceConnectionList{} + +// PaginatedUserOAuthSourceConnectionList struct for PaginatedUserOAuthSourceConnectionList +type PaginatedUserOAuthSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserOAuthSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserOAuthSourceConnectionList PaginatedUserOAuthSourceConnectionList + +// NewPaginatedUserOAuthSourceConnectionList instantiates a new PaginatedUserOAuthSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserOAuthSourceConnectionList(pagination Pagination, results []UserOAuthSourceConnection, autocomplete map[string]interface{}) *PaginatedUserOAuthSourceConnectionList { + this := PaginatedUserOAuthSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserOAuthSourceConnectionListWithDefaults instantiates a new PaginatedUserOAuthSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserOAuthSourceConnectionListWithDefaults() *PaginatedUserOAuthSourceConnectionList { + this := PaginatedUserOAuthSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserOAuthSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserOAuthSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserOAuthSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserOAuthSourceConnectionList) GetResults() []UserOAuthSourceConnection { + if o == nil { + var ret []UserOAuthSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserOAuthSourceConnectionList) GetResultsOk() ([]UserOAuthSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserOAuthSourceConnectionList) SetResults(v []UserOAuthSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserOAuthSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserOAuthSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserOAuthSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserOAuthSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserOAuthSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserOAuthSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserOAuthSourceConnectionList := _PaginatedUserOAuthSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserOAuthSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserOAuthSourceConnectionList(varPaginatedUserOAuthSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserOAuthSourceConnectionList struct { + value *PaginatedUserOAuthSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserOAuthSourceConnectionList) Get() *PaginatedUserOAuthSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserOAuthSourceConnectionList) Set(val *PaginatedUserOAuthSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserOAuthSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserOAuthSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserOAuthSourceConnectionList(val *PaginatedUserOAuthSourceConnectionList) *NullablePaginatedUserOAuthSourceConnectionList { + return &NullablePaginatedUserOAuthSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserOAuthSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserOAuthSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_plex_source_connection_list.go b/packages/client-go/model_paginated_user_plex_source_connection_list.go new file mode 100644 index 0000000000..2982abd769 --- /dev/null +++ b/packages/client-go/model_paginated_user_plex_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserPlexSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserPlexSourceConnectionList{} + +// PaginatedUserPlexSourceConnectionList struct for PaginatedUserPlexSourceConnectionList +type PaginatedUserPlexSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserPlexSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserPlexSourceConnectionList PaginatedUserPlexSourceConnectionList + +// NewPaginatedUserPlexSourceConnectionList instantiates a new PaginatedUserPlexSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserPlexSourceConnectionList(pagination Pagination, results []UserPlexSourceConnection, autocomplete map[string]interface{}) *PaginatedUserPlexSourceConnectionList { + this := PaginatedUserPlexSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserPlexSourceConnectionListWithDefaults instantiates a new PaginatedUserPlexSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserPlexSourceConnectionListWithDefaults() *PaginatedUserPlexSourceConnectionList { + this := PaginatedUserPlexSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserPlexSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserPlexSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserPlexSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserPlexSourceConnectionList) GetResults() []UserPlexSourceConnection { + if o == nil { + var ret []UserPlexSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserPlexSourceConnectionList) GetResultsOk() ([]UserPlexSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserPlexSourceConnectionList) SetResults(v []UserPlexSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserPlexSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserPlexSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserPlexSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserPlexSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserPlexSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserPlexSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserPlexSourceConnectionList := _PaginatedUserPlexSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserPlexSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserPlexSourceConnectionList(varPaginatedUserPlexSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserPlexSourceConnectionList struct { + value *PaginatedUserPlexSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserPlexSourceConnectionList) Get() *PaginatedUserPlexSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserPlexSourceConnectionList) Set(val *PaginatedUserPlexSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserPlexSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserPlexSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserPlexSourceConnectionList(val *PaginatedUserPlexSourceConnectionList) *NullablePaginatedUserPlexSourceConnectionList { + return &NullablePaginatedUserPlexSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserPlexSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserPlexSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_saml_source_connection_list.go b/packages/client-go/model_paginated_user_saml_source_connection_list.go new file mode 100644 index 0000000000..72d9421436 --- /dev/null +++ b/packages/client-go/model_paginated_user_saml_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserSAMLSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserSAMLSourceConnectionList{} + +// PaginatedUserSAMLSourceConnectionList struct for PaginatedUserSAMLSourceConnectionList +type PaginatedUserSAMLSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserSAMLSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserSAMLSourceConnectionList PaginatedUserSAMLSourceConnectionList + +// NewPaginatedUserSAMLSourceConnectionList instantiates a new PaginatedUserSAMLSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserSAMLSourceConnectionList(pagination Pagination, results []UserSAMLSourceConnection, autocomplete map[string]interface{}) *PaginatedUserSAMLSourceConnectionList { + this := PaginatedUserSAMLSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserSAMLSourceConnectionListWithDefaults instantiates a new PaginatedUserSAMLSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserSAMLSourceConnectionListWithDefaults() *PaginatedUserSAMLSourceConnectionList { + this := PaginatedUserSAMLSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserSAMLSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSAMLSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserSAMLSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserSAMLSourceConnectionList) GetResults() []UserSAMLSourceConnection { + if o == nil { + var ret []UserSAMLSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSAMLSourceConnectionList) GetResultsOk() ([]UserSAMLSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserSAMLSourceConnectionList) SetResults(v []UserSAMLSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserSAMLSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSAMLSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserSAMLSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserSAMLSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserSAMLSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserSAMLSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserSAMLSourceConnectionList := _PaginatedUserSAMLSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserSAMLSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserSAMLSourceConnectionList(varPaginatedUserSAMLSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserSAMLSourceConnectionList struct { + value *PaginatedUserSAMLSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserSAMLSourceConnectionList) Get() *PaginatedUserSAMLSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserSAMLSourceConnectionList) Set(val *PaginatedUserSAMLSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserSAMLSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserSAMLSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserSAMLSourceConnectionList(val *PaginatedUserSAMLSourceConnectionList) *NullablePaginatedUserSAMLSourceConnectionList { + return &NullablePaginatedUserSAMLSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserSAMLSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserSAMLSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_source_connection_list.go b/packages/client-go/model_paginated_user_source_connection_list.go new file mode 100644 index 0000000000..6120cdc748 --- /dev/null +++ b/packages/client-go/model_paginated_user_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserSourceConnectionList{} + +// PaginatedUserSourceConnectionList struct for PaginatedUserSourceConnectionList +type PaginatedUserSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserSourceConnectionList PaginatedUserSourceConnectionList + +// NewPaginatedUserSourceConnectionList instantiates a new PaginatedUserSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserSourceConnectionList(pagination Pagination, results []UserSourceConnection, autocomplete map[string]interface{}) *PaginatedUserSourceConnectionList { + this := PaginatedUserSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserSourceConnectionListWithDefaults instantiates a new PaginatedUserSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserSourceConnectionListWithDefaults() *PaginatedUserSourceConnectionList { + this := PaginatedUserSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserSourceConnectionList) GetResults() []UserSourceConnection { + if o == nil { + var ret []UserSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSourceConnectionList) GetResultsOk() ([]UserSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserSourceConnectionList) SetResults(v []UserSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserSourceConnectionList := _PaginatedUserSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserSourceConnectionList(varPaginatedUserSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserSourceConnectionList struct { + value *PaginatedUserSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserSourceConnectionList) Get() *PaginatedUserSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserSourceConnectionList) Set(val *PaginatedUserSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserSourceConnectionList(val *PaginatedUserSourceConnectionList) *NullablePaginatedUserSourceConnectionList { + return &NullablePaginatedUserSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_telegram_source_connection_list.go b/packages/client-go/model_paginated_user_telegram_source_connection_list.go new file mode 100644 index 0000000000..014aa7513f --- /dev/null +++ b/packages/client-go/model_paginated_user_telegram_source_connection_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserTelegramSourceConnectionList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserTelegramSourceConnectionList{} + +// PaginatedUserTelegramSourceConnectionList struct for PaginatedUserTelegramSourceConnectionList +type PaginatedUserTelegramSourceConnectionList struct { + Pagination Pagination `json:"pagination"` + Results []UserTelegramSourceConnection `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserTelegramSourceConnectionList PaginatedUserTelegramSourceConnectionList + +// NewPaginatedUserTelegramSourceConnectionList instantiates a new PaginatedUserTelegramSourceConnectionList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserTelegramSourceConnectionList(pagination Pagination, results []UserTelegramSourceConnection, autocomplete map[string]interface{}) *PaginatedUserTelegramSourceConnectionList { + this := PaginatedUserTelegramSourceConnectionList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserTelegramSourceConnectionListWithDefaults instantiates a new PaginatedUserTelegramSourceConnectionList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserTelegramSourceConnectionListWithDefaults() *PaginatedUserTelegramSourceConnectionList { + this := PaginatedUserTelegramSourceConnectionList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserTelegramSourceConnectionList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserTelegramSourceConnectionList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserTelegramSourceConnectionList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserTelegramSourceConnectionList) GetResults() []UserTelegramSourceConnection { + if o == nil { + var ret []UserTelegramSourceConnection + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserTelegramSourceConnectionList) GetResultsOk() ([]UserTelegramSourceConnection, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserTelegramSourceConnectionList) SetResults(v []UserTelegramSourceConnection) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserTelegramSourceConnectionList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserTelegramSourceConnectionList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserTelegramSourceConnectionList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserTelegramSourceConnectionList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserTelegramSourceConnectionList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserTelegramSourceConnectionList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserTelegramSourceConnectionList := _PaginatedUserTelegramSourceConnectionList{} + + err = json.Unmarshal(data, &varPaginatedUserTelegramSourceConnectionList) + + if err != nil { + return err + } + + *o = PaginatedUserTelegramSourceConnectionList(varPaginatedUserTelegramSourceConnectionList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserTelegramSourceConnectionList struct { + value *PaginatedUserTelegramSourceConnectionList + isSet bool +} + +func (v NullablePaginatedUserTelegramSourceConnectionList) Get() *PaginatedUserTelegramSourceConnectionList { + return v.value +} + +func (v *NullablePaginatedUserTelegramSourceConnectionList) Set(val *PaginatedUserTelegramSourceConnectionList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserTelegramSourceConnectionList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserTelegramSourceConnectionList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserTelegramSourceConnectionList(val *PaginatedUserTelegramSourceConnectionList) *NullablePaginatedUserTelegramSourceConnectionList { + return &NullablePaginatedUserTelegramSourceConnectionList{value: val, isSet: true} +} + +func (v NullablePaginatedUserTelegramSourceConnectionList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserTelegramSourceConnectionList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_user_write_stage_list.go b/packages/client-go/model_paginated_user_write_stage_list.go new file mode 100644 index 0000000000..06590ffd81 --- /dev/null +++ b/packages/client-go/model_paginated_user_write_stage_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedUserWriteStageList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedUserWriteStageList{} + +// PaginatedUserWriteStageList struct for PaginatedUserWriteStageList +type PaginatedUserWriteStageList struct { + Pagination Pagination `json:"pagination"` + Results []UserWriteStage `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedUserWriteStageList PaginatedUserWriteStageList + +// NewPaginatedUserWriteStageList instantiates a new PaginatedUserWriteStageList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedUserWriteStageList(pagination Pagination, results []UserWriteStage, autocomplete map[string]interface{}) *PaginatedUserWriteStageList { + this := PaginatedUserWriteStageList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedUserWriteStageListWithDefaults instantiates a new PaginatedUserWriteStageList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedUserWriteStageListWithDefaults() *PaginatedUserWriteStageList { + this := PaginatedUserWriteStageList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedUserWriteStageList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserWriteStageList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedUserWriteStageList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedUserWriteStageList) GetResults() []UserWriteStage { + if o == nil { + var ret []UserWriteStage + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserWriteStageList) GetResultsOk() ([]UserWriteStage, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedUserWriteStageList) SetResults(v []UserWriteStage) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedUserWriteStageList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedUserWriteStageList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedUserWriteStageList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedUserWriteStageList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedUserWriteStageList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedUserWriteStageList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedUserWriteStageList := _PaginatedUserWriteStageList{} + + err = json.Unmarshal(data, &varPaginatedUserWriteStageList) + + if err != nil { + return err + } + + *o = PaginatedUserWriteStageList(varPaginatedUserWriteStageList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedUserWriteStageList struct { + value *PaginatedUserWriteStageList + isSet bool +} + +func (v NullablePaginatedUserWriteStageList) Get() *PaginatedUserWriteStageList { + return v.value +} + +func (v *NullablePaginatedUserWriteStageList) Set(val *PaginatedUserWriteStageList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedUserWriteStageList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedUserWriteStageList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedUserWriteStageList(val *PaginatedUserWriteStageList) *NullablePaginatedUserWriteStageList { + return &NullablePaginatedUserWriteStageList{value: val, isSet: true} +} + +func (v NullablePaginatedUserWriteStageList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedUserWriteStageList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_web_authn_device_list.go b/packages/client-go/model_paginated_web_authn_device_list.go new file mode 100644 index 0000000000..15cea8911c --- /dev/null +++ b/packages/client-go/model_paginated_web_authn_device_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedWebAuthnDeviceList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWebAuthnDeviceList{} + +// PaginatedWebAuthnDeviceList struct for PaginatedWebAuthnDeviceList +type PaginatedWebAuthnDeviceList struct { + Pagination Pagination `json:"pagination"` + Results []WebAuthnDevice `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWebAuthnDeviceList PaginatedWebAuthnDeviceList + +// NewPaginatedWebAuthnDeviceList instantiates a new PaginatedWebAuthnDeviceList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWebAuthnDeviceList(pagination Pagination, results []WebAuthnDevice, autocomplete map[string]interface{}) *PaginatedWebAuthnDeviceList { + this := PaginatedWebAuthnDeviceList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedWebAuthnDeviceListWithDefaults instantiates a new PaginatedWebAuthnDeviceList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWebAuthnDeviceListWithDefaults() *PaginatedWebAuthnDeviceList { + this := PaginatedWebAuthnDeviceList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedWebAuthnDeviceList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedWebAuthnDeviceList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedWebAuthnDeviceList) GetResults() []WebAuthnDevice { + if o == nil { + var ret []WebAuthnDevice + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceList) GetResultsOk() ([]WebAuthnDevice, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedWebAuthnDeviceList) SetResults(v []WebAuthnDevice) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedWebAuthnDeviceList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedWebAuthnDeviceList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedWebAuthnDeviceList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWebAuthnDeviceList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWebAuthnDeviceList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedWebAuthnDeviceList := _PaginatedWebAuthnDeviceList{} + + err = json.Unmarshal(data, &varPaginatedWebAuthnDeviceList) + + if err != nil { + return err + } + + *o = PaginatedWebAuthnDeviceList(varPaginatedWebAuthnDeviceList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWebAuthnDeviceList struct { + value *PaginatedWebAuthnDeviceList + isSet bool +} + +func (v NullablePaginatedWebAuthnDeviceList) Get() *PaginatedWebAuthnDeviceList { + return v.value +} + +func (v *NullablePaginatedWebAuthnDeviceList) Set(val *PaginatedWebAuthnDeviceList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWebAuthnDeviceList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWebAuthnDeviceList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWebAuthnDeviceList(val *PaginatedWebAuthnDeviceList) *NullablePaginatedWebAuthnDeviceList { + return &NullablePaginatedWebAuthnDeviceList{value: val, isSet: true} +} + +func (v NullablePaginatedWebAuthnDeviceList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWebAuthnDeviceList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_web_authn_device_type_list.go b/packages/client-go/model_paginated_web_authn_device_type_list.go new file mode 100644 index 0000000000..086ce55f2e --- /dev/null +++ b/packages/client-go/model_paginated_web_authn_device_type_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedWebAuthnDeviceTypeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWebAuthnDeviceTypeList{} + +// PaginatedWebAuthnDeviceTypeList struct for PaginatedWebAuthnDeviceTypeList +type PaginatedWebAuthnDeviceTypeList struct { + Pagination Pagination `json:"pagination"` + Results []WebAuthnDeviceType `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWebAuthnDeviceTypeList PaginatedWebAuthnDeviceTypeList + +// NewPaginatedWebAuthnDeviceTypeList instantiates a new PaginatedWebAuthnDeviceTypeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWebAuthnDeviceTypeList(pagination Pagination, results []WebAuthnDeviceType, autocomplete map[string]interface{}) *PaginatedWebAuthnDeviceTypeList { + this := PaginatedWebAuthnDeviceTypeList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedWebAuthnDeviceTypeListWithDefaults instantiates a new PaginatedWebAuthnDeviceTypeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWebAuthnDeviceTypeListWithDefaults() *PaginatedWebAuthnDeviceTypeList { + this := PaginatedWebAuthnDeviceTypeList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedWebAuthnDeviceTypeList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceTypeList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedWebAuthnDeviceTypeList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedWebAuthnDeviceTypeList) GetResults() []WebAuthnDeviceType { + if o == nil { + var ret []WebAuthnDeviceType + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceTypeList) GetResultsOk() ([]WebAuthnDeviceType, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedWebAuthnDeviceTypeList) SetResults(v []WebAuthnDeviceType) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedWebAuthnDeviceTypeList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedWebAuthnDeviceTypeList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedWebAuthnDeviceTypeList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedWebAuthnDeviceTypeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWebAuthnDeviceTypeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWebAuthnDeviceTypeList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedWebAuthnDeviceTypeList := _PaginatedWebAuthnDeviceTypeList{} + + err = json.Unmarshal(data, &varPaginatedWebAuthnDeviceTypeList) + + if err != nil { + return err + } + + *o = PaginatedWebAuthnDeviceTypeList(varPaginatedWebAuthnDeviceTypeList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWebAuthnDeviceTypeList struct { + value *PaginatedWebAuthnDeviceTypeList + isSet bool +} + +func (v NullablePaginatedWebAuthnDeviceTypeList) Get() *PaginatedWebAuthnDeviceTypeList { + return v.value +} + +func (v *NullablePaginatedWebAuthnDeviceTypeList) Set(val *PaginatedWebAuthnDeviceTypeList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWebAuthnDeviceTypeList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWebAuthnDeviceTypeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWebAuthnDeviceTypeList(val *PaginatedWebAuthnDeviceTypeList) *NullablePaginatedWebAuthnDeviceTypeList { + return &NullablePaginatedWebAuthnDeviceTypeList{value: val, isSet: true} +} + +func (v NullablePaginatedWebAuthnDeviceTypeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWebAuthnDeviceTypeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_paginated_ws_federation_provider_list.go b/packages/client-go/model_paginated_ws_federation_provider_list.go new file mode 100644 index 0000000000..9aa415a890 --- /dev/null +++ b/packages/client-go/model_paginated_ws_federation_provider_list.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PaginatedWSFederationProviderList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PaginatedWSFederationProviderList{} + +// PaginatedWSFederationProviderList struct for PaginatedWSFederationProviderList +type PaginatedWSFederationProviderList struct { + Pagination Pagination `json:"pagination"` + Results []WSFederationProvider `json:"results"` + Autocomplete map[string]interface{} `json:"autocomplete"` + AdditionalProperties map[string]interface{} +} + +type _PaginatedWSFederationProviderList PaginatedWSFederationProviderList + +// NewPaginatedWSFederationProviderList instantiates a new PaginatedWSFederationProviderList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPaginatedWSFederationProviderList(pagination Pagination, results []WSFederationProvider, autocomplete map[string]interface{}) *PaginatedWSFederationProviderList { + this := PaginatedWSFederationProviderList{} + this.Pagination = pagination + this.Results = results + this.Autocomplete = autocomplete + return &this +} + +// NewPaginatedWSFederationProviderListWithDefaults instantiates a new PaginatedWSFederationProviderList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginatedWSFederationProviderListWithDefaults() *PaginatedWSFederationProviderList { + this := PaginatedWSFederationProviderList{} + return &this +} + +// GetPagination returns the Pagination field value +func (o *PaginatedWSFederationProviderList) GetPagination() Pagination { + if o == nil { + var ret Pagination + return ret + } + + return o.Pagination +} + +// GetPaginationOk returns a tuple with the Pagination field value +// and a boolean to check if the value has been set. +func (o *PaginatedWSFederationProviderList) GetPaginationOk() (*Pagination, bool) { + if o == nil { + return nil, false + } + return &o.Pagination, true +} + +// SetPagination sets field value +func (o *PaginatedWSFederationProviderList) SetPagination(v Pagination) { + o.Pagination = v +} + +// GetResults returns the Results field value +func (o *PaginatedWSFederationProviderList) GetResults() []WSFederationProvider { + if o == nil { + var ret []WSFederationProvider + return ret + } + + return o.Results +} + +// GetResultsOk returns a tuple with the Results field value +// and a boolean to check if the value has been set. +func (o *PaginatedWSFederationProviderList) GetResultsOk() ([]WSFederationProvider, bool) { + if o == nil { + return nil, false + } + return o.Results, true +} + +// SetResults sets field value +func (o *PaginatedWSFederationProviderList) SetResults(v []WSFederationProvider) { + o.Results = v +} + +// GetAutocomplete returns the Autocomplete field value +func (o *PaginatedWSFederationProviderList) GetAutocomplete() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Autocomplete +} + +// GetAutocompleteOk returns a tuple with the Autocomplete field value +// and a boolean to check if the value has been set. +func (o *PaginatedWSFederationProviderList) GetAutocompleteOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Autocomplete, true +} + +// SetAutocomplete sets field value +func (o *PaginatedWSFederationProviderList) SetAutocomplete(v map[string]interface{}) { + o.Autocomplete = v +} + +func (o PaginatedWSFederationProviderList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PaginatedWSFederationProviderList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pagination"] = o.Pagination + toSerialize["results"] = o.Results + toSerialize["autocomplete"] = o.Autocomplete + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PaginatedWSFederationProviderList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pagination", + "results", + "autocomplete", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPaginatedWSFederationProviderList := _PaginatedWSFederationProviderList{} + + err = json.Unmarshal(data, &varPaginatedWSFederationProviderList) + + if err != nil { + return err + } + + *o = PaginatedWSFederationProviderList(varPaginatedWSFederationProviderList) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pagination") + delete(additionalProperties, "results") + delete(additionalProperties, "autocomplete") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePaginatedWSFederationProviderList struct { + value *PaginatedWSFederationProviderList + isSet bool +} + +func (v NullablePaginatedWSFederationProviderList) Get() *PaginatedWSFederationProviderList { + return v.value +} + +func (v *NullablePaginatedWSFederationProviderList) Set(val *PaginatedWSFederationProviderList) { + v.value = val + v.isSet = true +} + +func (v NullablePaginatedWSFederationProviderList) IsSet() bool { + return v.isSet +} + +func (v *NullablePaginatedWSFederationProviderList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePaginatedWSFederationProviderList(val *PaginatedWSFederationProviderList) *NullablePaginatedWSFederationProviderList { + return &NullablePaginatedWSFederationProviderList{value: val, isSet: true} +} + +func (v NullablePaginatedWSFederationProviderList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePaginatedWSFederationProviderList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_pagination.go b/packages/client-go/model_pagination.go new file mode 100644 index 0000000000..10fc38fb78 --- /dev/null +++ b/packages/client-go/model_pagination.go @@ -0,0 +1,341 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Pagination type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Pagination{} + +// Pagination struct for Pagination +type Pagination struct { + Next float32 `json:"next"` + Previous float32 `json:"previous"` + Count float32 `json:"count"` + Current float32 `json:"current"` + TotalPages float32 `json:"total_pages"` + StartIndex float32 `json:"start_index"` + EndIndex float32 `json:"end_index"` + AdditionalProperties map[string]interface{} +} + +type _Pagination Pagination + +// NewPagination instantiates a new Pagination object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPagination(next float32, previous float32, count float32, current float32, totalPages float32, startIndex float32, endIndex float32) *Pagination { + this := Pagination{} + this.Next = next + this.Previous = previous + this.Count = count + this.Current = current + this.TotalPages = totalPages + this.StartIndex = startIndex + this.EndIndex = endIndex + return &this +} + +// NewPaginationWithDefaults instantiates a new Pagination object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPaginationWithDefaults() *Pagination { + this := Pagination{} + return &this +} + +// GetNext returns the Next field value +func (o *Pagination) GetNext() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Next +} + +// GetNextOk returns a tuple with the Next field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetNextOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Next, true +} + +// SetNext sets field value +func (o *Pagination) SetNext(v float32) { + o.Next = v +} + +// GetPrevious returns the Previous field value +func (o *Pagination) GetPrevious() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Previous +} + +// GetPreviousOk returns a tuple with the Previous field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetPreviousOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Previous, true +} + +// SetPrevious sets field value +func (o *Pagination) SetPrevious(v float32) { + o.Previous = v +} + +// GetCount returns the Count field value +func (o *Pagination) GetCount() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Count +} + +// GetCountOk returns a tuple with the Count field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetCountOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Count, true +} + +// SetCount sets field value +func (o *Pagination) SetCount(v float32) { + o.Count = v +} + +// GetCurrent returns the Current field value +func (o *Pagination) GetCurrent() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.Current +} + +// GetCurrentOk returns a tuple with the Current field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetCurrentOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.Current, true +} + +// SetCurrent sets field value +func (o *Pagination) SetCurrent(v float32) { + o.Current = v +} + +// GetTotalPages returns the TotalPages field value +func (o *Pagination) GetTotalPages() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.TotalPages +} + +// GetTotalPagesOk returns a tuple with the TotalPages field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetTotalPagesOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.TotalPages, true +} + +// SetTotalPages sets field value +func (o *Pagination) SetTotalPages(v float32) { + o.TotalPages = v +} + +// GetStartIndex returns the StartIndex field value +func (o *Pagination) GetStartIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.StartIndex +} + +// GetStartIndexOk returns a tuple with the StartIndex field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetStartIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.StartIndex, true +} + +// SetStartIndex sets field value +func (o *Pagination) SetStartIndex(v float32) { + o.StartIndex = v +} + +// GetEndIndex returns the EndIndex field value +func (o *Pagination) GetEndIndex() float32 { + if o == nil { + var ret float32 + return ret + } + + return o.EndIndex +} + +// GetEndIndexOk returns a tuple with the EndIndex field value +// and a boolean to check if the value has been set. +func (o *Pagination) GetEndIndexOk() (*float32, bool) { + if o == nil { + return nil, false + } + return &o.EndIndex, true +} + +// SetEndIndex sets field value +func (o *Pagination) SetEndIndex(v float32) { + o.EndIndex = v +} + +func (o Pagination) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Pagination) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["next"] = o.Next + toSerialize["previous"] = o.Previous + toSerialize["count"] = o.Count + toSerialize["current"] = o.Current + toSerialize["total_pages"] = o.TotalPages + toSerialize["start_index"] = o.StartIndex + toSerialize["end_index"] = o.EndIndex + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Pagination) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "next", + "previous", + "count", + "current", + "total_pages", + "start_index", + "end_index", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPagination := _Pagination{} + + err = json.Unmarshal(data, &varPagination) + + if err != nil { + return err + } + + *o = Pagination(varPagination) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "next") + delete(additionalProperties, "previous") + delete(additionalProperties, "count") + delete(additionalProperties, "current") + delete(additionalProperties, "total_pages") + delete(additionalProperties, "start_index") + delete(additionalProperties, "end_index") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePagination struct { + value *Pagination + isSet bool +} + +func (v NullablePagination) Get() *Pagination { + return v.value +} + +func (v *NullablePagination) Set(val *Pagination) { + v.value = val + v.isSet = true +} + +func (v NullablePagination) IsSet() bool { + return v.isSet +} + +func (v *NullablePagination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePagination(val *Pagination) *NullablePagination { + return &NullablePagination{value: val, isSet: true} +} + +func (v NullablePagination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePagination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_partial_group.go b/packages/client-go/model_partial_group.go new file mode 100644 index 0000000000..032e5c7573 --- /dev/null +++ b/packages/client-go/model_partial_group.go @@ -0,0 +1,301 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PartialGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialGroup{} + +// PartialGroup Partial Group Serializer, does not include child relations. +type PartialGroup struct { + Pk string `json:"pk"` + // Get a numerical, int32 ID for the group + NumPk int32 `json:"num_pk"` + Name string `json:"name"` + // Users added to this group will be superusers. + IsSuperuser *bool `json:"is_superuser,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PartialGroup PartialGroup + +// NewPartialGroup instantiates a new PartialGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialGroup(pk string, numPk int32, name string) *PartialGroup { + this := PartialGroup{} + this.Pk = pk + this.NumPk = numPk + this.Name = name + return &this +} + +// NewPartialGroupWithDefaults instantiates a new PartialGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialGroupWithDefaults() *PartialGroup { + this := PartialGroup{} + return &this +} + +// GetPk returns the Pk field value +func (o *PartialGroup) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PartialGroup) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PartialGroup) SetPk(v string) { + o.Pk = v +} + +// GetNumPk returns the NumPk field value +func (o *PartialGroup) GetNumPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.NumPk +} + +// GetNumPkOk returns a tuple with the NumPk field value +// and a boolean to check if the value has been set. +func (o *PartialGroup) GetNumPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.NumPk, true +} + +// SetNumPk sets field value +func (o *PartialGroup) SetNumPk(v int32) { + o.NumPk = v +} + +// GetName returns the Name field value +func (o *PartialGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PartialGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PartialGroup) SetName(v string) { + o.Name = v +} + +// GetIsSuperuser returns the IsSuperuser field value if set, zero value otherwise. +func (o *PartialGroup) GetIsSuperuser() bool { + if o == nil || IsNil(o.IsSuperuser) { + var ret bool + return ret + } + return *o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialGroup) GetIsSuperuserOk() (*bool, bool) { + if o == nil || IsNil(o.IsSuperuser) { + return nil, false + } + return o.IsSuperuser, true +} + +// HasIsSuperuser returns a boolean if a field has been set. +func (o *PartialGroup) HasIsSuperuser() bool { + if o != nil && !IsNil(o.IsSuperuser) { + return true + } + + return false +} + +// SetIsSuperuser gets a reference to the given bool and assigns it to the IsSuperuser field. +func (o *PartialGroup) SetIsSuperuser(v bool) { + o.IsSuperuser = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PartialGroup) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PartialGroup) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PartialGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PartialGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["num_pk"] = o.NumPk + toSerialize["name"] = o.Name + if !IsNil(o.IsSuperuser) { + toSerialize["is_superuser"] = o.IsSuperuser + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "num_pk", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPartialGroup := _PartialGroup{} + + err = json.Unmarshal(data, &varPartialGroup) + + if err != nil { + return err + } + + *o = PartialGroup(varPartialGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "num_pk") + delete(additionalProperties, "name") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialGroup struct { + value *PartialGroup + isSet bool +} + +func (v NullablePartialGroup) Get() *PartialGroup { + return v.value +} + +func (v *NullablePartialGroup) Set(val *PartialGroup) { + v.value = val + v.isSet = true +} + +func (v NullablePartialGroup) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialGroup(val *PartialGroup) *NullablePartialGroup { + return &NullablePartialGroup{value: val, isSet: true} +} + +func (v NullablePartialGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_partial_user.go b/packages/client-go/model_partial_user.go new file mode 100644 index 0000000000..cba019414f --- /dev/null +++ b/packages/client-go/model_partial_user.go @@ -0,0 +1,417 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the PartialUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUser{} + +// PartialUser Partial User Serializer, does not include child relations. +type PartialUser struct { + Pk int32 `json:"pk"` + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username" validate:"regexp=^[\\\\w.@+-]+$"` + // User's display name. + Name string `json:"name"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + LastLogin NullableTime `json:"last_login,omitempty"` + Email *string `json:"email,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Uid string `json:"uid"` + AdditionalProperties map[string]interface{} +} + +type _PartialUser PartialUser + +// NewPartialUser instantiates a new PartialUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUser(pk int32, username string, name string, uid string) *PartialUser { + this := PartialUser{} + this.Pk = pk + this.Username = username + this.Name = name + this.Uid = uid + return &this +} + +// NewPartialUserWithDefaults instantiates a new PartialUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUserWithDefaults() *PartialUser { + this := PartialUser{} + return &this +} + +// GetPk returns the Pk field value +func (o *PartialUser) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PartialUser) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PartialUser) SetPk(v int32) { + o.Pk = v +} + +// GetUsername returns the Username field value +func (o *PartialUser) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *PartialUser) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *PartialUser) SetUsername(v string) { + o.Username = v +} + +// GetName returns the Name field value +func (o *PartialUser) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PartialUser) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PartialUser) SetName(v string) { + o.Name = v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *PartialUser) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUser) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *PartialUser) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *PartialUser) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PartialUser) GetLastLogin() time.Time { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret time.Time + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PartialUser) GetLastLoginOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *PartialUser) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableTime and assigns it to the LastLogin field. +func (o *PartialUser) SetLastLogin(v time.Time) { + o.LastLogin.Set(&v) +} + +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *PartialUser) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *PartialUser) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *PartialUser) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUser) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *PartialUser) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *PartialUser) SetEmail(v string) { + o.Email = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PartialUser) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUser) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PartialUser) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PartialUser) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetUid returns the Uid field value +func (o *PartialUser) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *PartialUser) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *PartialUser) SetUid(v string) { + o.Uid = v +} + +func (o PartialUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["username"] = o.Username + toSerialize["name"] = o.Name + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + toSerialize["uid"] = o.Uid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PartialUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "username", + "name", + "uid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPartialUser := _PartialUser{} + + err = json.Unmarshal(data, &varPartialUser) + + if err != nil { + return err + } + + *o = PartialUser(varPartialUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "is_active") + delete(additionalProperties, "last_login") + delete(additionalProperties, "email") + delete(additionalProperties, "attributes") + delete(additionalProperties, "uid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePartialUser struct { + value *PartialUser + isSet bool +} + +func (v NullablePartialUser) Get() *PartialUser { + return v.value +} + +func (v *NullablePartialUser) Set(val *PartialUser) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUser) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUser(val *PartialUser) *NullablePartialUser { + return &NullablePartialUser{value: val, isSet: true} +} + +func (v NullablePartialUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_challenge.go b/packages/client-go/model_password_challenge.go new file mode 100644 index 0000000000..a464caa0f8 --- /dev/null +++ b/packages/client-go/model_password_challenge.go @@ -0,0 +1,389 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordChallenge{} + +// PasswordChallenge Password challenge UI fields +type PasswordChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + RecoveryUrl *string `json:"recovery_url,omitempty"` + AllowShowPassword *bool `json:"allow_show_password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordChallenge PasswordChallenge + +// NewPasswordChallenge instantiates a new PasswordChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordChallenge(pendingUser string, pendingUserAvatar string) *PasswordChallenge { + this := PasswordChallenge{} + var component string = "ak-stage-password" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + var allowShowPassword bool = false + this.AllowShowPassword = &allowShowPassword + return &this +} + +// NewPasswordChallengeWithDefaults instantiates a new PasswordChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordChallengeWithDefaults() *PasswordChallenge { + this := PasswordChallenge{} + var component string = "ak-stage-password" + this.Component = &component + var allowShowPassword bool = false + this.AllowShowPassword = &allowShowPassword + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *PasswordChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *PasswordChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *PasswordChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PasswordChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PasswordChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PasswordChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *PasswordChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *PasswordChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *PasswordChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *PasswordChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *PasswordChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *PasswordChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *PasswordChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetRecoveryUrl returns the RecoveryUrl field value if set, zero value otherwise. +func (o *PasswordChallenge) GetRecoveryUrl() string { + if o == nil || IsNil(o.RecoveryUrl) { + var ret string + return ret + } + return *o.RecoveryUrl +} + +// GetRecoveryUrlOk returns a tuple with the RecoveryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetRecoveryUrlOk() (*string, bool) { + if o == nil || IsNil(o.RecoveryUrl) { + return nil, false + } + return o.RecoveryUrl, true +} + +// HasRecoveryUrl returns a boolean if a field has been set. +func (o *PasswordChallenge) HasRecoveryUrl() bool { + if o != nil && !IsNil(o.RecoveryUrl) { + return true + } + + return false +} + +// SetRecoveryUrl gets a reference to the given string and assigns it to the RecoveryUrl field. +func (o *PasswordChallenge) SetRecoveryUrl(v string) { + o.RecoveryUrl = &v +} + +// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise. +func (o *PasswordChallenge) GetAllowShowPassword() bool { + if o == nil || IsNil(o.AllowShowPassword) { + var ret bool + return ret + } + return *o.AllowShowPassword +} + +// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallenge) GetAllowShowPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.AllowShowPassword) { + return nil, false + } + return o.AllowShowPassword, true +} + +// HasAllowShowPassword returns a boolean if a field has been set. +func (o *PasswordChallenge) HasAllowShowPassword() bool { + if o != nil && !IsNil(o.AllowShowPassword) { + return true + } + + return false +} + +// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field. +func (o *PasswordChallenge) SetAllowShowPassword(v bool) { + o.AllowShowPassword = &v +} + +func (o PasswordChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if !IsNil(o.RecoveryUrl) { + toSerialize["recovery_url"] = o.RecoveryUrl + } + if !IsNil(o.AllowShowPassword) { + toSerialize["allow_show_password"] = o.AllowShowPassword + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordChallenge := _PasswordChallenge{} + + err = json.Unmarshal(data, &varPasswordChallenge) + + if err != nil { + return err + } + + *o = PasswordChallenge(varPasswordChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "recovery_url") + delete(additionalProperties, "allow_show_password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordChallenge struct { + value *PasswordChallenge + isSet bool +} + +func (v NullablePasswordChallenge) Get() *PasswordChallenge { + return v.value +} + +func (v *NullablePasswordChallenge) Set(val *PasswordChallenge) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordChallenge(val *PasswordChallenge) *NullablePasswordChallenge { + return &NullablePasswordChallenge{value: val, isSet: true} +} + +func (v NullablePasswordChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_challenge_response_request.go b/packages/client-go/model_password_challenge_response_request.go new file mode 100644 index 0000000000..0ccb7b0a67 --- /dev/null +++ b/packages/client-go/model_password_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordChallengeResponseRequest{} + +// PasswordChallengeResponseRequest Password challenge response +type PasswordChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + Password string `json:"password"` + AdditionalProperties map[string]interface{} +} + +type _PasswordChallengeResponseRequest PasswordChallengeResponseRequest + +// NewPasswordChallengeResponseRequest instantiates a new PasswordChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordChallengeResponseRequest(password string) *PasswordChallengeResponseRequest { + this := PasswordChallengeResponseRequest{} + var component string = "ak-stage-password" + this.Component = &component + this.Password = password + return &this +} + +// NewPasswordChallengeResponseRequestWithDefaults instantiates a new PasswordChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordChallengeResponseRequestWithDefaults() *PasswordChallengeResponseRequest { + this := PasswordChallengeResponseRequest{} + var component string = "ak-stage-password" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PasswordChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PasswordChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PasswordChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetPassword returns the Password field value +func (o *PasswordChallengeResponseRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *PasswordChallengeResponseRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *PasswordChallengeResponseRequest) SetPassword(v string) { + o.Password = v +} + +func (o PasswordChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["password"] = o.Password + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordChallengeResponseRequest := _PasswordChallengeResponseRequest{} + + err = json.Unmarshal(data, &varPasswordChallengeResponseRequest) + + if err != nil { + return err + } + + *o = PasswordChallengeResponseRequest(varPasswordChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordChallengeResponseRequest struct { + value *PasswordChallengeResponseRequest + isSet bool +} + +func (v NullablePasswordChallengeResponseRequest) Get() *PasswordChallengeResponseRequest { + return v.value +} + +func (v *NullablePasswordChallengeResponseRequest) Set(val *PasswordChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordChallengeResponseRequest(val *PasswordChallengeResponseRequest) *NullablePasswordChallengeResponseRequest { + return &NullablePasswordChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullablePasswordChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_expiry_policy.go b/packages/client-go/model_password_expiry_policy.go new file mode 100644 index 0000000000..4ed793e47b --- /dev/null +++ b/packages/client-go/model_password_expiry_policy.go @@ -0,0 +1,450 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordExpiryPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordExpiryPolicy{} + +// PasswordExpiryPolicy Password Expiry Policy Serializer +type PasswordExpiryPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + Days int32 `json:"days"` + DenyOnly *bool `json:"deny_only,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordExpiryPolicy PasswordExpiryPolicy + +// NewPasswordExpiryPolicy instantiates a new PasswordExpiryPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordExpiryPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32, days int32) *PasswordExpiryPolicy { + this := PasswordExpiryPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + this.Days = days + return &this +} + +// NewPasswordExpiryPolicyWithDefaults instantiates a new PasswordExpiryPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordExpiryPolicyWithDefaults() *PasswordExpiryPolicy { + this := PasswordExpiryPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *PasswordExpiryPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PasswordExpiryPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *PasswordExpiryPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordExpiryPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PasswordExpiryPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PasswordExpiryPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PasswordExpiryPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *PasswordExpiryPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PasswordExpiryPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PasswordExpiryPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PasswordExpiryPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PasswordExpiryPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PasswordExpiryPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PasswordExpiryPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PasswordExpiryPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *PasswordExpiryPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *PasswordExpiryPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetDays returns the Days field value +func (o *PasswordExpiryPolicy) GetDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Days +} + +// GetDaysOk returns a tuple with the Days field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Days, true +} + +// SetDays sets field value +func (o *PasswordExpiryPolicy) SetDays(v int32) { + o.Days = v +} + +// GetDenyOnly returns the DenyOnly field value if set, zero value otherwise. +func (o *PasswordExpiryPolicy) GetDenyOnly() bool { + if o == nil || IsNil(o.DenyOnly) { + var ret bool + return ret + } + return *o.DenyOnly +} + +// GetDenyOnlyOk returns a tuple with the DenyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicy) GetDenyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.DenyOnly) { + return nil, false + } + return o.DenyOnly, true +} + +// HasDenyOnly returns a boolean if a field has been set. +func (o *PasswordExpiryPolicy) HasDenyOnly() bool { + if o != nil && !IsNil(o.DenyOnly) { + return true + } + + return false +} + +// SetDenyOnly gets a reference to the given bool and assigns it to the DenyOnly field. +func (o *PasswordExpiryPolicy) SetDenyOnly(v bool) { + o.DenyOnly = &v +} + +func (o PasswordExpiryPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordExpiryPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + toSerialize["days"] = o.Days + if !IsNil(o.DenyOnly) { + toSerialize["deny_only"] = o.DenyOnly + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordExpiryPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + "days", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordExpiryPolicy := _PasswordExpiryPolicy{} + + err = json.Unmarshal(data, &varPasswordExpiryPolicy) + + if err != nil { + return err + } + + *o = PasswordExpiryPolicy(varPasswordExpiryPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "days") + delete(additionalProperties, "deny_only") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordExpiryPolicy struct { + value *PasswordExpiryPolicy + isSet bool +} + +func (v NullablePasswordExpiryPolicy) Get() *PasswordExpiryPolicy { + return v.value +} + +func (v *NullablePasswordExpiryPolicy) Set(val *PasswordExpiryPolicy) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordExpiryPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordExpiryPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordExpiryPolicy(val *PasswordExpiryPolicy) *NullablePasswordExpiryPolicy { + return &NullablePasswordExpiryPolicy{value: val, isSet: true} +} + +func (v NullablePasswordExpiryPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordExpiryPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_expiry_policy_request.go b/packages/client-go/model_password_expiry_policy_request.go new file mode 100644 index 0000000000..0f11ac2591 --- /dev/null +++ b/packages/client-go/model_password_expiry_policy_request.go @@ -0,0 +1,271 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordExpiryPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordExpiryPolicyRequest{} + +// PasswordExpiryPolicyRequest Password Expiry Policy Serializer +type PasswordExpiryPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Days int32 `json:"days"` + DenyOnly *bool `json:"deny_only,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordExpiryPolicyRequest PasswordExpiryPolicyRequest + +// NewPasswordExpiryPolicyRequest instantiates a new PasswordExpiryPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordExpiryPolicyRequest(name string, days int32) *PasswordExpiryPolicyRequest { + this := PasswordExpiryPolicyRequest{} + this.Name = name + this.Days = days + return &this +} + +// NewPasswordExpiryPolicyRequestWithDefaults instantiates a new PasswordExpiryPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordExpiryPolicyRequestWithDefaults() *PasswordExpiryPolicyRequest { + this := PasswordExpiryPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PasswordExpiryPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordExpiryPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PasswordExpiryPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PasswordExpiryPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PasswordExpiryPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetDays returns the Days field value +func (o *PasswordExpiryPolicyRequest) GetDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Days +} + +// GetDaysOk returns a tuple with the Days field value +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicyRequest) GetDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Days, true +} + +// SetDays sets field value +func (o *PasswordExpiryPolicyRequest) SetDays(v int32) { + o.Days = v +} + +// GetDenyOnly returns the DenyOnly field value if set, zero value otherwise. +func (o *PasswordExpiryPolicyRequest) GetDenyOnly() bool { + if o == nil || IsNil(o.DenyOnly) { + var ret bool + return ret + } + return *o.DenyOnly +} + +// GetDenyOnlyOk returns a tuple with the DenyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordExpiryPolicyRequest) GetDenyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.DenyOnly) { + return nil, false + } + return o.DenyOnly, true +} + +// HasDenyOnly returns a boolean if a field has been set. +func (o *PasswordExpiryPolicyRequest) HasDenyOnly() bool { + if o != nil && !IsNil(o.DenyOnly) { + return true + } + + return false +} + +// SetDenyOnly gets a reference to the given bool and assigns it to the DenyOnly field. +func (o *PasswordExpiryPolicyRequest) SetDenyOnly(v bool) { + o.DenyOnly = &v +} + +func (o PasswordExpiryPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordExpiryPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["days"] = o.Days + if !IsNil(o.DenyOnly) { + toSerialize["deny_only"] = o.DenyOnly + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordExpiryPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "days", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordExpiryPolicyRequest := _PasswordExpiryPolicyRequest{} + + err = json.Unmarshal(data, &varPasswordExpiryPolicyRequest) + + if err != nil { + return err + } + + *o = PasswordExpiryPolicyRequest(varPasswordExpiryPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "days") + delete(additionalProperties, "deny_only") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordExpiryPolicyRequest struct { + value *PasswordExpiryPolicyRequest + isSet bool +} + +func (v NullablePasswordExpiryPolicyRequest) Get() *PasswordExpiryPolicyRequest { + return v.value +} + +func (v *NullablePasswordExpiryPolicyRequest) Set(val *PasswordExpiryPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordExpiryPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordExpiryPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordExpiryPolicyRequest(val *PasswordExpiryPolicyRequest) *NullablePasswordExpiryPolicyRequest { + return &NullablePasswordExpiryPolicyRequest{value: val, isSet: true} +} + +func (v NullablePasswordExpiryPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordExpiryPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_policy.go b/packages/client-go/model_password_policy.go new file mode 100644 index 0000000000..3cff25ee65 --- /dev/null +++ b/packages/client-go/model_password_policy.go @@ -0,0 +1,868 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordPolicy{} + +// PasswordPolicy Password Policy Serializer +type PasswordPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + AmountDigits *int32 `json:"amount_digits,omitempty"` + AmountUppercase *int32 `json:"amount_uppercase,omitempty"` + AmountLowercase *int32 `json:"amount_lowercase,omitempty"` + AmountSymbols *int32 `json:"amount_symbols,omitempty"` + LengthMin *int32 `json:"length_min,omitempty"` + SymbolCharset *string `json:"symbol_charset,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + CheckStaticRules *bool `json:"check_static_rules,omitempty"` + CheckHaveIBeenPwned *bool `json:"check_have_i_been_pwned,omitempty"` + CheckZxcvbn *bool `json:"check_zxcvbn,omitempty"` + // How many times the password hash is allowed to be on haveibeenpwned + HibpAllowedCount *int32 `json:"hibp_allowed_count,omitempty"` + // If the zxcvbn score is equal or less than this value, the policy will fail. + ZxcvbnScoreThreshold *int32 `json:"zxcvbn_score_threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordPolicy PasswordPolicy + +// NewPasswordPolicy instantiates a new PasswordPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *PasswordPolicy { + this := PasswordPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewPasswordPolicyWithDefaults instantiates a new PasswordPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordPolicyWithDefaults() *PasswordPolicy { + this := PasswordPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *PasswordPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PasswordPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *PasswordPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PasswordPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PasswordPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PasswordPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *PasswordPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PasswordPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PasswordPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PasswordPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PasswordPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PasswordPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PasswordPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PasswordPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *PasswordPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *PasswordPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *PasswordPolicy) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *PasswordPolicy) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *PasswordPolicy) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetAmountDigits returns the AmountDigits field value if set, zero value otherwise. +func (o *PasswordPolicy) GetAmountDigits() int32 { + if o == nil || IsNil(o.AmountDigits) { + var ret int32 + return ret + } + return *o.AmountDigits +} + +// GetAmountDigitsOk returns a tuple with the AmountDigits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetAmountDigitsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountDigits) { + return nil, false + } + return o.AmountDigits, true +} + +// HasAmountDigits returns a boolean if a field has been set. +func (o *PasswordPolicy) HasAmountDigits() bool { + if o != nil && !IsNil(o.AmountDigits) { + return true + } + + return false +} + +// SetAmountDigits gets a reference to the given int32 and assigns it to the AmountDigits field. +func (o *PasswordPolicy) SetAmountDigits(v int32) { + o.AmountDigits = &v +} + +// GetAmountUppercase returns the AmountUppercase field value if set, zero value otherwise. +func (o *PasswordPolicy) GetAmountUppercase() int32 { + if o == nil || IsNil(o.AmountUppercase) { + var ret int32 + return ret + } + return *o.AmountUppercase +} + +// GetAmountUppercaseOk returns a tuple with the AmountUppercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetAmountUppercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountUppercase) { + return nil, false + } + return o.AmountUppercase, true +} + +// HasAmountUppercase returns a boolean if a field has been set. +func (o *PasswordPolicy) HasAmountUppercase() bool { + if o != nil && !IsNil(o.AmountUppercase) { + return true + } + + return false +} + +// SetAmountUppercase gets a reference to the given int32 and assigns it to the AmountUppercase field. +func (o *PasswordPolicy) SetAmountUppercase(v int32) { + o.AmountUppercase = &v +} + +// GetAmountLowercase returns the AmountLowercase field value if set, zero value otherwise. +func (o *PasswordPolicy) GetAmountLowercase() int32 { + if o == nil || IsNil(o.AmountLowercase) { + var ret int32 + return ret + } + return *o.AmountLowercase +} + +// GetAmountLowercaseOk returns a tuple with the AmountLowercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetAmountLowercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountLowercase) { + return nil, false + } + return o.AmountLowercase, true +} + +// HasAmountLowercase returns a boolean if a field has been set. +func (o *PasswordPolicy) HasAmountLowercase() bool { + if o != nil && !IsNil(o.AmountLowercase) { + return true + } + + return false +} + +// SetAmountLowercase gets a reference to the given int32 and assigns it to the AmountLowercase field. +func (o *PasswordPolicy) SetAmountLowercase(v int32) { + o.AmountLowercase = &v +} + +// GetAmountSymbols returns the AmountSymbols field value if set, zero value otherwise. +func (o *PasswordPolicy) GetAmountSymbols() int32 { + if o == nil || IsNil(o.AmountSymbols) { + var ret int32 + return ret + } + return *o.AmountSymbols +} + +// GetAmountSymbolsOk returns a tuple with the AmountSymbols field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetAmountSymbolsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountSymbols) { + return nil, false + } + return o.AmountSymbols, true +} + +// HasAmountSymbols returns a boolean if a field has been set. +func (o *PasswordPolicy) HasAmountSymbols() bool { + if o != nil && !IsNil(o.AmountSymbols) { + return true + } + + return false +} + +// SetAmountSymbols gets a reference to the given int32 and assigns it to the AmountSymbols field. +func (o *PasswordPolicy) SetAmountSymbols(v int32) { + o.AmountSymbols = &v +} + +// GetLengthMin returns the LengthMin field value if set, zero value otherwise. +func (o *PasswordPolicy) GetLengthMin() int32 { + if o == nil || IsNil(o.LengthMin) { + var ret int32 + return ret + } + return *o.LengthMin +} + +// GetLengthMinOk returns a tuple with the LengthMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetLengthMinOk() (*int32, bool) { + if o == nil || IsNil(o.LengthMin) { + return nil, false + } + return o.LengthMin, true +} + +// HasLengthMin returns a boolean if a field has been set. +func (o *PasswordPolicy) HasLengthMin() bool { + if o != nil && !IsNil(o.LengthMin) { + return true + } + + return false +} + +// SetLengthMin gets a reference to the given int32 and assigns it to the LengthMin field. +func (o *PasswordPolicy) SetLengthMin(v int32) { + o.LengthMin = &v +} + +// GetSymbolCharset returns the SymbolCharset field value if set, zero value otherwise. +func (o *PasswordPolicy) GetSymbolCharset() string { + if o == nil || IsNil(o.SymbolCharset) { + var ret string + return ret + } + return *o.SymbolCharset +} + +// GetSymbolCharsetOk returns a tuple with the SymbolCharset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetSymbolCharsetOk() (*string, bool) { + if o == nil || IsNil(o.SymbolCharset) { + return nil, false + } + return o.SymbolCharset, true +} + +// HasSymbolCharset returns a boolean if a field has been set. +func (o *PasswordPolicy) HasSymbolCharset() bool { + if o != nil && !IsNil(o.SymbolCharset) { + return true + } + + return false +} + +// SetSymbolCharset gets a reference to the given string and assigns it to the SymbolCharset field. +func (o *PasswordPolicy) SetSymbolCharset(v string) { + o.SymbolCharset = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *PasswordPolicy) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *PasswordPolicy) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *PasswordPolicy) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetCheckStaticRules returns the CheckStaticRules field value if set, zero value otherwise. +func (o *PasswordPolicy) GetCheckStaticRules() bool { + if o == nil || IsNil(o.CheckStaticRules) { + var ret bool + return ret + } + return *o.CheckStaticRules +} + +// GetCheckStaticRulesOk returns a tuple with the CheckStaticRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetCheckStaticRulesOk() (*bool, bool) { + if o == nil || IsNil(o.CheckStaticRules) { + return nil, false + } + return o.CheckStaticRules, true +} + +// HasCheckStaticRules returns a boolean if a field has been set. +func (o *PasswordPolicy) HasCheckStaticRules() bool { + if o != nil && !IsNil(o.CheckStaticRules) { + return true + } + + return false +} + +// SetCheckStaticRules gets a reference to the given bool and assigns it to the CheckStaticRules field. +func (o *PasswordPolicy) SetCheckStaticRules(v bool) { + o.CheckStaticRules = &v +} + +// GetCheckHaveIBeenPwned returns the CheckHaveIBeenPwned field value if set, zero value otherwise. +func (o *PasswordPolicy) GetCheckHaveIBeenPwned() bool { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + var ret bool + return ret + } + return *o.CheckHaveIBeenPwned +} + +// GetCheckHaveIBeenPwnedOk returns a tuple with the CheckHaveIBeenPwned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetCheckHaveIBeenPwnedOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + return nil, false + } + return o.CheckHaveIBeenPwned, true +} + +// HasCheckHaveIBeenPwned returns a boolean if a field has been set. +func (o *PasswordPolicy) HasCheckHaveIBeenPwned() bool { + if o != nil && !IsNil(o.CheckHaveIBeenPwned) { + return true + } + + return false +} + +// SetCheckHaveIBeenPwned gets a reference to the given bool and assigns it to the CheckHaveIBeenPwned field. +func (o *PasswordPolicy) SetCheckHaveIBeenPwned(v bool) { + o.CheckHaveIBeenPwned = &v +} + +// GetCheckZxcvbn returns the CheckZxcvbn field value if set, zero value otherwise. +func (o *PasswordPolicy) GetCheckZxcvbn() bool { + if o == nil || IsNil(o.CheckZxcvbn) { + var ret bool + return ret + } + return *o.CheckZxcvbn +} + +// GetCheckZxcvbnOk returns a tuple with the CheckZxcvbn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetCheckZxcvbnOk() (*bool, bool) { + if o == nil || IsNil(o.CheckZxcvbn) { + return nil, false + } + return o.CheckZxcvbn, true +} + +// HasCheckZxcvbn returns a boolean if a field has been set. +func (o *PasswordPolicy) HasCheckZxcvbn() bool { + if o != nil && !IsNil(o.CheckZxcvbn) { + return true + } + + return false +} + +// SetCheckZxcvbn gets a reference to the given bool and assigns it to the CheckZxcvbn field. +func (o *PasswordPolicy) SetCheckZxcvbn(v bool) { + o.CheckZxcvbn = &v +} + +// GetHibpAllowedCount returns the HibpAllowedCount field value if set, zero value otherwise. +func (o *PasswordPolicy) GetHibpAllowedCount() int32 { + if o == nil || IsNil(o.HibpAllowedCount) { + var ret int32 + return ret + } + return *o.HibpAllowedCount +} + +// GetHibpAllowedCountOk returns a tuple with the HibpAllowedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetHibpAllowedCountOk() (*int32, bool) { + if o == nil || IsNil(o.HibpAllowedCount) { + return nil, false + } + return o.HibpAllowedCount, true +} + +// HasHibpAllowedCount returns a boolean if a field has been set. +func (o *PasswordPolicy) HasHibpAllowedCount() bool { + if o != nil && !IsNil(o.HibpAllowedCount) { + return true + } + + return false +} + +// SetHibpAllowedCount gets a reference to the given int32 and assigns it to the HibpAllowedCount field. +func (o *PasswordPolicy) SetHibpAllowedCount(v int32) { + o.HibpAllowedCount = &v +} + +// GetZxcvbnScoreThreshold returns the ZxcvbnScoreThreshold field value if set, zero value otherwise. +func (o *PasswordPolicy) GetZxcvbnScoreThreshold() int32 { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + var ret int32 + return ret + } + return *o.ZxcvbnScoreThreshold +} + +// GetZxcvbnScoreThresholdOk returns a tuple with the ZxcvbnScoreThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicy) GetZxcvbnScoreThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + return nil, false + } + return o.ZxcvbnScoreThreshold, true +} + +// HasZxcvbnScoreThreshold returns a boolean if a field has been set. +func (o *PasswordPolicy) HasZxcvbnScoreThreshold() bool { + if o != nil && !IsNil(o.ZxcvbnScoreThreshold) { + return true + } + + return false +} + +// SetZxcvbnScoreThreshold gets a reference to the given int32 and assigns it to the ZxcvbnScoreThreshold field. +func (o *PasswordPolicy) SetZxcvbnScoreThreshold(v int32) { + o.ZxcvbnScoreThreshold = &v +} + +func (o PasswordPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.AmountDigits) { + toSerialize["amount_digits"] = o.AmountDigits + } + if !IsNil(o.AmountUppercase) { + toSerialize["amount_uppercase"] = o.AmountUppercase + } + if !IsNil(o.AmountLowercase) { + toSerialize["amount_lowercase"] = o.AmountLowercase + } + if !IsNil(o.AmountSymbols) { + toSerialize["amount_symbols"] = o.AmountSymbols + } + if !IsNil(o.LengthMin) { + toSerialize["length_min"] = o.LengthMin + } + if !IsNil(o.SymbolCharset) { + toSerialize["symbol_charset"] = o.SymbolCharset + } + if !IsNil(o.ErrorMessage) { + toSerialize["error_message"] = o.ErrorMessage + } + if !IsNil(o.CheckStaticRules) { + toSerialize["check_static_rules"] = o.CheckStaticRules + } + if !IsNil(o.CheckHaveIBeenPwned) { + toSerialize["check_have_i_been_pwned"] = o.CheckHaveIBeenPwned + } + if !IsNil(o.CheckZxcvbn) { + toSerialize["check_zxcvbn"] = o.CheckZxcvbn + } + if !IsNil(o.HibpAllowedCount) { + toSerialize["hibp_allowed_count"] = o.HibpAllowedCount + } + if !IsNil(o.ZxcvbnScoreThreshold) { + toSerialize["zxcvbn_score_threshold"] = o.ZxcvbnScoreThreshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordPolicy := _PasswordPolicy{} + + err = json.Unmarshal(data, &varPasswordPolicy) + + if err != nil { + return err + } + + *o = PasswordPolicy(varPasswordPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "password_field") + delete(additionalProperties, "amount_digits") + delete(additionalProperties, "amount_uppercase") + delete(additionalProperties, "amount_lowercase") + delete(additionalProperties, "amount_symbols") + delete(additionalProperties, "length_min") + delete(additionalProperties, "symbol_charset") + delete(additionalProperties, "error_message") + delete(additionalProperties, "check_static_rules") + delete(additionalProperties, "check_have_i_been_pwned") + delete(additionalProperties, "check_zxcvbn") + delete(additionalProperties, "hibp_allowed_count") + delete(additionalProperties, "zxcvbn_score_threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordPolicy struct { + value *PasswordPolicy + isSet bool +} + +func (v NullablePasswordPolicy) Get() *PasswordPolicy { + return v.value +} + +func (v *NullablePasswordPolicy) Set(val *PasswordPolicy) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordPolicy(val *PasswordPolicy) *NullablePasswordPolicy { + return &NullablePasswordPolicy{value: val, isSet: true} +} + +func (v NullablePasswordPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_policy_request.go b/packages/client-go/model_password_policy_request.go new file mode 100644 index 0000000000..ef218388df --- /dev/null +++ b/packages/client-go/model_password_policy_request.go @@ -0,0 +1,689 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordPolicyRequest{} + +// PasswordPolicyRequest Password Policy Serializer +type PasswordPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + AmountDigits *int32 `json:"amount_digits,omitempty"` + AmountUppercase *int32 `json:"amount_uppercase,omitempty"` + AmountLowercase *int32 `json:"amount_lowercase,omitempty"` + AmountSymbols *int32 `json:"amount_symbols,omitempty"` + LengthMin *int32 `json:"length_min,omitempty"` + SymbolCharset *string `json:"symbol_charset,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + CheckStaticRules *bool `json:"check_static_rules,omitempty"` + CheckHaveIBeenPwned *bool `json:"check_have_i_been_pwned,omitempty"` + CheckZxcvbn *bool `json:"check_zxcvbn,omitempty"` + // How many times the password hash is allowed to be on haveibeenpwned + HibpAllowedCount *int32 `json:"hibp_allowed_count,omitempty"` + // If the zxcvbn score is equal or less than this value, the policy will fail. + ZxcvbnScoreThreshold *int32 `json:"zxcvbn_score_threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordPolicyRequest PasswordPolicyRequest + +// NewPasswordPolicyRequest instantiates a new PasswordPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordPolicyRequest(name string) *PasswordPolicyRequest { + this := PasswordPolicyRequest{} + this.Name = name + return &this +} + +// NewPasswordPolicyRequestWithDefaults instantiates a new PasswordPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordPolicyRequestWithDefaults() *PasswordPolicyRequest { + this := PasswordPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PasswordPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PasswordPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *PasswordPolicyRequest) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetAmountDigits returns the AmountDigits field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetAmountDigits() int32 { + if o == nil || IsNil(o.AmountDigits) { + var ret int32 + return ret + } + return *o.AmountDigits +} + +// GetAmountDigitsOk returns a tuple with the AmountDigits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetAmountDigitsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountDigits) { + return nil, false + } + return o.AmountDigits, true +} + +// HasAmountDigits returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasAmountDigits() bool { + if o != nil && !IsNil(o.AmountDigits) { + return true + } + + return false +} + +// SetAmountDigits gets a reference to the given int32 and assigns it to the AmountDigits field. +func (o *PasswordPolicyRequest) SetAmountDigits(v int32) { + o.AmountDigits = &v +} + +// GetAmountUppercase returns the AmountUppercase field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetAmountUppercase() int32 { + if o == nil || IsNil(o.AmountUppercase) { + var ret int32 + return ret + } + return *o.AmountUppercase +} + +// GetAmountUppercaseOk returns a tuple with the AmountUppercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetAmountUppercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountUppercase) { + return nil, false + } + return o.AmountUppercase, true +} + +// HasAmountUppercase returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasAmountUppercase() bool { + if o != nil && !IsNil(o.AmountUppercase) { + return true + } + + return false +} + +// SetAmountUppercase gets a reference to the given int32 and assigns it to the AmountUppercase field. +func (o *PasswordPolicyRequest) SetAmountUppercase(v int32) { + o.AmountUppercase = &v +} + +// GetAmountLowercase returns the AmountLowercase field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetAmountLowercase() int32 { + if o == nil || IsNil(o.AmountLowercase) { + var ret int32 + return ret + } + return *o.AmountLowercase +} + +// GetAmountLowercaseOk returns a tuple with the AmountLowercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetAmountLowercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountLowercase) { + return nil, false + } + return o.AmountLowercase, true +} + +// HasAmountLowercase returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasAmountLowercase() bool { + if o != nil && !IsNil(o.AmountLowercase) { + return true + } + + return false +} + +// SetAmountLowercase gets a reference to the given int32 and assigns it to the AmountLowercase field. +func (o *PasswordPolicyRequest) SetAmountLowercase(v int32) { + o.AmountLowercase = &v +} + +// GetAmountSymbols returns the AmountSymbols field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetAmountSymbols() int32 { + if o == nil || IsNil(o.AmountSymbols) { + var ret int32 + return ret + } + return *o.AmountSymbols +} + +// GetAmountSymbolsOk returns a tuple with the AmountSymbols field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetAmountSymbolsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountSymbols) { + return nil, false + } + return o.AmountSymbols, true +} + +// HasAmountSymbols returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasAmountSymbols() bool { + if o != nil && !IsNil(o.AmountSymbols) { + return true + } + + return false +} + +// SetAmountSymbols gets a reference to the given int32 and assigns it to the AmountSymbols field. +func (o *PasswordPolicyRequest) SetAmountSymbols(v int32) { + o.AmountSymbols = &v +} + +// GetLengthMin returns the LengthMin field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetLengthMin() int32 { + if o == nil || IsNil(o.LengthMin) { + var ret int32 + return ret + } + return *o.LengthMin +} + +// GetLengthMinOk returns a tuple with the LengthMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetLengthMinOk() (*int32, bool) { + if o == nil || IsNil(o.LengthMin) { + return nil, false + } + return o.LengthMin, true +} + +// HasLengthMin returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasLengthMin() bool { + if o != nil && !IsNil(o.LengthMin) { + return true + } + + return false +} + +// SetLengthMin gets a reference to the given int32 and assigns it to the LengthMin field. +func (o *PasswordPolicyRequest) SetLengthMin(v int32) { + o.LengthMin = &v +} + +// GetSymbolCharset returns the SymbolCharset field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetSymbolCharset() string { + if o == nil || IsNil(o.SymbolCharset) { + var ret string + return ret + } + return *o.SymbolCharset +} + +// GetSymbolCharsetOk returns a tuple with the SymbolCharset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetSymbolCharsetOk() (*string, bool) { + if o == nil || IsNil(o.SymbolCharset) { + return nil, false + } + return o.SymbolCharset, true +} + +// HasSymbolCharset returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasSymbolCharset() bool { + if o != nil && !IsNil(o.SymbolCharset) { + return true + } + + return false +} + +// SetSymbolCharset gets a reference to the given string and assigns it to the SymbolCharset field. +func (o *PasswordPolicyRequest) SetSymbolCharset(v string) { + o.SymbolCharset = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *PasswordPolicyRequest) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetCheckStaticRules returns the CheckStaticRules field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetCheckStaticRules() bool { + if o == nil || IsNil(o.CheckStaticRules) { + var ret bool + return ret + } + return *o.CheckStaticRules +} + +// GetCheckStaticRulesOk returns a tuple with the CheckStaticRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetCheckStaticRulesOk() (*bool, bool) { + if o == nil || IsNil(o.CheckStaticRules) { + return nil, false + } + return o.CheckStaticRules, true +} + +// HasCheckStaticRules returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasCheckStaticRules() bool { + if o != nil && !IsNil(o.CheckStaticRules) { + return true + } + + return false +} + +// SetCheckStaticRules gets a reference to the given bool and assigns it to the CheckStaticRules field. +func (o *PasswordPolicyRequest) SetCheckStaticRules(v bool) { + o.CheckStaticRules = &v +} + +// GetCheckHaveIBeenPwned returns the CheckHaveIBeenPwned field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetCheckHaveIBeenPwned() bool { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + var ret bool + return ret + } + return *o.CheckHaveIBeenPwned +} + +// GetCheckHaveIBeenPwnedOk returns a tuple with the CheckHaveIBeenPwned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetCheckHaveIBeenPwnedOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + return nil, false + } + return o.CheckHaveIBeenPwned, true +} + +// HasCheckHaveIBeenPwned returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasCheckHaveIBeenPwned() bool { + if o != nil && !IsNil(o.CheckHaveIBeenPwned) { + return true + } + + return false +} + +// SetCheckHaveIBeenPwned gets a reference to the given bool and assigns it to the CheckHaveIBeenPwned field. +func (o *PasswordPolicyRequest) SetCheckHaveIBeenPwned(v bool) { + o.CheckHaveIBeenPwned = &v +} + +// GetCheckZxcvbn returns the CheckZxcvbn field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetCheckZxcvbn() bool { + if o == nil || IsNil(o.CheckZxcvbn) { + var ret bool + return ret + } + return *o.CheckZxcvbn +} + +// GetCheckZxcvbnOk returns a tuple with the CheckZxcvbn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetCheckZxcvbnOk() (*bool, bool) { + if o == nil || IsNil(o.CheckZxcvbn) { + return nil, false + } + return o.CheckZxcvbn, true +} + +// HasCheckZxcvbn returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasCheckZxcvbn() bool { + if o != nil && !IsNil(o.CheckZxcvbn) { + return true + } + + return false +} + +// SetCheckZxcvbn gets a reference to the given bool and assigns it to the CheckZxcvbn field. +func (o *PasswordPolicyRequest) SetCheckZxcvbn(v bool) { + o.CheckZxcvbn = &v +} + +// GetHibpAllowedCount returns the HibpAllowedCount field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetHibpAllowedCount() int32 { + if o == nil || IsNil(o.HibpAllowedCount) { + var ret int32 + return ret + } + return *o.HibpAllowedCount +} + +// GetHibpAllowedCountOk returns a tuple with the HibpAllowedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetHibpAllowedCountOk() (*int32, bool) { + if o == nil || IsNil(o.HibpAllowedCount) { + return nil, false + } + return o.HibpAllowedCount, true +} + +// HasHibpAllowedCount returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasHibpAllowedCount() bool { + if o != nil && !IsNil(o.HibpAllowedCount) { + return true + } + + return false +} + +// SetHibpAllowedCount gets a reference to the given int32 and assigns it to the HibpAllowedCount field. +func (o *PasswordPolicyRequest) SetHibpAllowedCount(v int32) { + o.HibpAllowedCount = &v +} + +// GetZxcvbnScoreThreshold returns the ZxcvbnScoreThreshold field value if set, zero value otherwise. +func (o *PasswordPolicyRequest) GetZxcvbnScoreThreshold() int32 { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + var ret int32 + return ret + } + return *o.ZxcvbnScoreThreshold +} + +// GetZxcvbnScoreThresholdOk returns a tuple with the ZxcvbnScoreThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordPolicyRequest) GetZxcvbnScoreThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + return nil, false + } + return o.ZxcvbnScoreThreshold, true +} + +// HasZxcvbnScoreThreshold returns a boolean if a field has been set. +func (o *PasswordPolicyRequest) HasZxcvbnScoreThreshold() bool { + if o != nil && !IsNil(o.ZxcvbnScoreThreshold) { + return true + } + + return false +} + +// SetZxcvbnScoreThreshold gets a reference to the given int32 and assigns it to the ZxcvbnScoreThreshold field. +func (o *PasswordPolicyRequest) SetZxcvbnScoreThreshold(v int32) { + o.ZxcvbnScoreThreshold = &v +} + +func (o PasswordPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.AmountDigits) { + toSerialize["amount_digits"] = o.AmountDigits + } + if !IsNil(o.AmountUppercase) { + toSerialize["amount_uppercase"] = o.AmountUppercase + } + if !IsNil(o.AmountLowercase) { + toSerialize["amount_lowercase"] = o.AmountLowercase + } + if !IsNil(o.AmountSymbols) { + toSerialize["amount_symbols"] = o.AmountSymbols + } + if !IsNil(o.LengthMin) { + toSerialize["length_min"] = o.LengthMin + } + if !IsNil(o.SymbolCharset) { + toSerialize["symbol_charset"] = o.SymbolCharset + } + if !IsNil(o.ErrorMessage) { + toSerialize["error_message"] = o.ErrorMessage + } + if !IsNil(o.CheckStaticRules) { + toSerialize["check_static_rules"] = o.CheckStaticRules + } + if !IsNil(o.CheckHaveIBeenPwned) { + toSerialize["check_have_i_been_pwned"] = o.CheckHaveIBeenPwned + } + if !IsNil(o.CheckZxcvbn) { + toSerialize["check_zxcvbn"] = o.CheckZxcvbn + } + if !IsNil(o.HibpAllowedCount) { + toSerialize["hibp_allowed_count"] = o.HibpAllowedCount + } + if !IsNil(o.ZxcvbnScoreThreshold) { + toSerialize["zxcvbn_score_threshold"] = o.ZxcvbnScoreThreshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordPolicyRequest := _PasswordPolicyRequest{} + + err = json.Unmarshal(data, &varPasswordPolicyRequest) + + if err != nil { + return err + } + + *o = PasswordPolicyRequest(varPasswordPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "password_field") + delete(additionalProperties, "amount_digits") + delete(additionalProperties, "amount_uppercase") + delete(additionalProperties, "amount_lowercase") + delete(additionalProperties, "amount_symbols") + delete(additionalProperties, "length_min") + delete(additionalProperties, "symbol_charset") + delete(additionalProperties, "error_message") + delete(additionalProperties, "check_static_rules") + delete(additionalProperties, "check_have_i_been_pwned") + delete(additionalProperties, "check_zxcvbn") + delete(additionalProperties, "hibp_allowed_count") + delete(additionalProperties, "zxcvbn_score_threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordPolicyRequest struct { + value *PasswordPolicyRequest + isSet bool +} + +func (v NullablePasswordPolicyRequest) Get() *PasswordPolicyRequest { + return v.value +} + +func (v *NullablePasswordPolicyRequest) Set(val *PasswordPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordPolicyRequest(val *PasswordPolicyRequest) *NullablePasswordPolicyRequest { + return &NullablePasswordPolicyRequest{value: val, isSet: true} +} + +func (v NullablePasswordPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_stage.go b/packages/client-go/model_password_stage.go new file mode 100644 index 0000000000..b7e2ab5ef7 --- /dev/null +++ b/packages/client-go/model_password_stage.go @@ -0,0 +1,500 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordStage{} + +// PasswordStage PasswordStage Serializer +type PasswordStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Selection of backends to test the password against. + Backends []BackendsEnum `json:"backends"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + // How many attempts a user has before the flow is canceled. To lock the user out, use a reputation policy and a user_write stage. + FailedAttemptsBeforeCancel *int32 `json:"failed_attempts_before_cancel,omitempty"` + // When enabled, provides a 'show password' button with the password input field. + AllowShowPassword *bool `json:"allow_show_password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordStage PasswordStage + +// NewPasswordStage instantiates a new PasswordStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, backends []BackendsEnum) *PasswordStage { + this := PasswordStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Backends = backends + return &this +} + +// NewPasswordStageWithDefaults instantiates a new PasswordStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordStageWithDefaults() *PasswordStage { + this := PasswordStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *PasswordStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PasswordStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *PasswordStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *PasswordStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PasswordStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PasswordStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PasswordStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PasswordStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PasswordStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PasswordStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PasswordStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *PasswordStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *PasswordStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetBackends returns the Backends field value +func (o *PasswordStage) GetBackends() []BackendsEnum { + if o == nil { + var ret []BackendsEnum + return ret + } + + return o.Backends +} + +// GetBackendsOk returns a tuple with the Backends field value +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetBackendsOk() ([]BackendsEnum, bool) { + if o == nil { + return nil, false + } + return o.Backends, true +} + +// SetBackends sets field value +func (o *PasswordStage) SetBackends(v []BackendsEnum) { + o.Backends = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PasswordStage) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PasswordStage) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PasswordStage) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PasswordStage) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PasswordStage) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PasswordStage) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFailedAttemptsBeforeCancel returns the FailedAttemptsBeforeCancel field value if set, zero value otherwise. +func (o *PasswordStage) GetFailedAttemptsBeforeCancel() int32 { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + var ret int32 + return ret + } + return *o.FailedAttemptsBeforeCancel +} + +// GetFailedAttemptsBeforeCancelOk returns a tuple with the FailedAttemptsBeforeCancel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetFailedAttemptsBeforeCancelOk() (*int32, bool) { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + return nil, false + } + return o.FailedAttemptsBeforeCancel, true +} + +// HasFailedAttemptsBeforeCancel returns a boolean if a field has been set. +func (o *PasswordStage) HasFailedAttemptsBeforeCancel() bool { + if o != nil && !IsNil(o.FailedAttemptsBeforeCancel) { + return true + } + + return false +} + +// SetFailedAttemptsBeforeCancel gets a reference to the given int32 and assigns it to the FailedAttemptsBeforeCancel field. +func (o *PasswordStage) SetFailedAttemptsBeforeCancel(v int32) { + o.FailedAttemptsBeforeCancel = &v +} + +// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise. +func (o *PasswordStage) GetAllowShowPassword() bool { + if o == nil || IsNil(o.AllowShowPassword) { + var ret bool + return ret + } + return *o.AllowShowPassword +} + +// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordStage) GetAllowShowPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.AllowShowPassword) { + return nil, false + } + return o.AllowShowPassword, true +} + +// HasAllowShowPassword returns a boolean if a field has been set. +func (o *PasswordStage) HasAllowShowPassword() bool { + if o != nil && !IsNil(o.AllowShowPassword) { + return true + } + + return false +} + +// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field. +func (o *PasswordStage) SetAllowShowPassword(v bool) { + o.AllowShowPassword = &v +} + +func (o PasswordStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["backends"] = o.Backends + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FailedAttemptsBeforeCancel) { + toSerialize["failed_attempts_before_cancel"] = o.FailedAttemptsBeforeCancel + } + if !IsNil(o.AllowShowPassword) { + toSerialize["allow_show_password"] = o.AllowShowPassword + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "backends", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordStage := _PasswordStage{} + + err = json.Unmarshal(data, &varPasswordStage) + + if err != nil { + return err + } + + *o = PasswordStage(varPasswordStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "backends") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "failed_attempts_before_cancel") + delete(additionalProperties, "allow_show_password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordStage struct { + value *PasswordStage + isSet bool +} + +func (v NullablePasswordStage) Get() *PasswordStage { + return v.value +} + +func (v *NullablePasswordStage) Set(val *PasswordStage) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordStage) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordStage(val *PasswordStage) *NullablePasswordStage { + return &NullablePasswordStage{value: val, isSet: true} +} + +func (v NullablePasswordStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_password_stage_request.go b/packages/client-go/model_password_stage_request.go new file mode 100644 index 0000000000..7086417874 --- /dev/null +++ b/packages/client-go/model_password_stage_request.go @@ -0,0 +1,322 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PasswordStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PasswordStageRequest{} + +// PasswordStageRequest PasswordStage Serializer +type PasswordStageRequest struct { + Name string `json:"name"` + // Selection of backends to test the password against. + Backends []BackendsEnum `json:"backends"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + // How many attempts a user has before the flow is canceled. To lock the user out, use a reputation policy and a user_write stage. + FailedAttemptsBeforeCancel *int32 `json:"failed_attempts_before_cancel,omitempty"` + // When enabled, provides a 'show password' button with the password input field. + AllowShowPassword *bool `json:"allow_show_password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PasswordStageRequest PasswordStageRequest + +// NewPasswordStageRequest instantiates a new PasswordStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPasswordStageRequest(name string, backends []BackendsEnum) *PasswordStageRequest { + this := PasswordStageRequest{} + this.Name = name + this.Backends = backends + return &this +} + +// NewPasswordStageRequestWithDefaults instantiates a new PasswordStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPasswordStageRequestWithDefaults() *PasswordStageRequest { + this := PasswordStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PasswordStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PasswordStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PasswordStageRequest) SetName(v string) { + o.Name = v +} + +// GetBackends returns the Backends field value +func (o *PasswordStageRequest) GetBackends() []BackendsEnum { + if o == nil { + var ret []BackendsEnum + return ret + } + + return o.Backends +} + +// GetBackendsOk returns a tuple with the Backends field value +// and a boolean to check if the value has been set. +func (o *PasswordStageRequest) GetBackendsOk() ([]BackendsEnum, bool) { + if o == nil { + return nil, false + } + return o.Backends, true +} + +// SetBackends sets field value +func (o *PasswordStageRequest) SetBackends(v []BackendsEnum) { + o.Backends = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PasswordStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PasswordStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PasswordStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PasswordStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PasswordStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PasswordStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFailedAttemptsBeforeCancel returns the FailedAttemptsBeforeCancel field value if set, zero value otherwise. +func (o *PasswordStageRequest) GetFailedAttemptsBeforeCancel() int32 { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + var ret int32 + return ret + } + return *o.FailedAttemptsBeforeCancel +} + +// GetFailedAttemptsBeforeCancelOk returns a tuple with the FailedAttemptsBeforeCancel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordStageRequest) GetFailedAttemptsBeforeCancelOk() (*int32, bool) { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + return nil, false + } + return o.FailedAttemptsBeforeCancel, true +} + +// HasFailedAttemptsBeforeCancel returns a boolean if a field has been set. +func (o *PasswordStageRequest) HasFailedAttemptsBeforeCancel() bool { + if o != nil && !IsNil(o.FailedAttemptsBeforeCancel) { + return true + } + + return false +} + +// SetFailedAttemptsBeforeCancel gets a reference to the given int32 and assigns it to the FailedAttemptsBeforeCancel field. +func (o *PasswordStageRequest) SetFailedAttemptsBeforeCancel(v int32) { + o.FailedAttemptsBeforeCancel = &v +} + +// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise. +func (o *PasswordStageRequest) GetAllowShowPassword() bool { + if o == nil || IsNil(o.AllowShowPassword) { + var ret bool + return ret + } + return *o.AllowShowPassword +} + +// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PasswordStageRequest) GetAllowShowPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.AllowShowPassword) { + return nil, false + } + return o.AllowShowPassword, true +} + +// HasAllowShowPassword returns a boolean if a field has been set. +func (o *PasswordStageRequest) HasAllowShowPassword() bool { + if o != nil && !IsNil(o.AllowShowPassword) { + return true + } + + return false +} + +// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field. +func (o *PasswordStageRequest) SetAllowShowPassword(v bool) { + o.AllowShowPassword = &v +} + +func (o PasswordStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PasswordStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["backends"] = o.Backends + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FailedAttemptsBeforeCancel) { + toSerialize["failed_attempts_before_cancel"] = o.FailedAttemptsBeforeCancel + } + if !IsNil(o.AllowShowPassword) { + toSerialize["allow_show_password"] = o.AllowShowPassword + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PasswordStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "backends", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPasswordStageRequest := _PasswordStageRequest{} + + err = json.Unmarshal(data, &varPasswordStageRequest) + + if err != nil { + return err + } + + *o = PasswordStageRequest(varPasswordStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "backends") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "failed_attempts_before_cancel") + delete(additionalProperties, "allow_show_password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePasswordStageRequest struct { + value *PasswordStageRequest + isSet bool +} + +func (v NullablePasswordStageRequest) Get() *PasswordStageRequest { + return v.value +} + +func (v *NullablePasswordStageRequest) Set(val *PasswordStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePasswordStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePasswordStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePasswordStageRequest(val *PasswordStageRequest) *NullablePasswordStageRequest { + return &NullablePasswordStageRequest{value: val, isSet: true} +} + +func (v NullablePasswordStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePasswordStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_agent_connector_request.go b/packages/client-go/model_patched_agent_connector_request.go new file mode 100644 index 0000000000..cc0b2732df --- /dev/null +++ b/packages/client-go/model_patched_agent_connector_request.go @@ -0,0 +1,657 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAgentConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAgentConnectorRequest{} + +// PatchedAgentConnectorRequest struct for PatchedAgentConnectorRequest +type PatchedAgentConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name *string `json:"name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + SnapshotExpiry *string `json:"snapshot_expiry,omitempty"` + AuthSessionDuration *string `json:"auth_session_duration,omitempty"` + AuthTerminateSessionOnExpiry *bool `json:"auth_terminate_session_on_expiry,omitempty"` + RefreshInterval *string `json:"refresh_interval,omitempty"` + AuthorizationFlow NullableString `json:"authorization_flow,omitempty"` + NssUidOffset *int32 `json:"nss_uid_offset,omitempty"` + NssGidOffset *int32 `json:"nss_gid_offset,omitempty"` + ChallengeKey NullableString `json:"challenge_key,omitempty"` + ChallengeIdleTimeout *string `json:"challenge_idle_timeout,omitempty"` + ChallengeTriggerCheckIn *bool `json:"challenge_trigger_check_in,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAgentConnectorRequest PatchedAgentConnectorRequest + +// NewPatchedAgentConnectorRequest instantiates a new PatchedAgentConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAgentConnectorRequest() *PatchedAgentConnectorRequest { + this := PatchedAgentConnectorRequest{} + return &this +} + +// NewPatchedAgentConnectorRequestWithDefaults instantiates a new PatchedAgentConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAgentConnectorRequestWithDefaults() *PatchedAgentConnectorRequest { + this := PatchedAgentConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *PatchedAgentConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAgentConnectorRequest) SetName(v string) { + o.Name = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedAgentConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetSnapshotExpiry returns the SnapshotExpiry field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetSnapshotExpiry() string { + if o == nil || IsNil(o.SnapshotExpiry) { + var ret string + return ret + } + return *o.SnapshotExpiry +} + +// GetSnapshotExpiryOk returns a tuple with the SnapshotExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetSnapshotExpiryOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotExpiry) { + return nil, false + } + return o.SnapshotExpiry, true +} + +// HasSnapshotExpiry returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasSnapshotExpiry() bool { + if o != nil && !IsNil(o.SnapshotExpiry) { + return true + } + + return false +} + +// SetSnapshotExpiry gets a reference to the given string and assigns it to the SnapshotExpiry field. +func (o *PatchedAgentConnectorRequest) SetSnapshotExpiry(v string) { + o.SnapshotExpiry = &v +} + +// GetAuthSessionDuration returns the AuthSessionDuration field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetAuthSessionDuration() string { + if o == nil || IsNil(o.AuthSessionDuration) { + var ret string + return ret + } + return *o.AuthSessionDuration +} + +// GetAuthSessionDurationOk returns a tuple with the AuthSessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetAuthSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.AuthSessionDuration) { + return nil, false + } + return o.AuthSessionDuration, true +} + +// HasAuthSessionDuration returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasAuthSessionDuration() bool { + if o != nil && !IsNil(o.AuthSessionDuration) { + return true + } + + return false +} + +// SetAuthSessionDuration gets a reference to the given string and assigns it to the AuthSessionDuration field. +func (o *PatchedAgentConnectorRequest) SetAuthSessionDuration(v string) { + o.AuthSessionDuration = &v +} + +// GetAuthTerminateSessionOnExpiry returns the AuthTerminateSessionOnExpiry field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetAuthTerminateSessionOnExpiry() bool { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + var ret bool + return ret + } + return *o.AuthTerminateSessionOnExpiry +} + +// GetAuthTerminateSessionOnExpiryOk returns a tuple with the AuthTerminateSessionOnExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetAuthTerminateSessionOnExpiryOk() (*bool, bool) { + if o == nil || IsNil(o.AuthTerminateSessionOnExpiry) { + return nil, false + } + return o.AuthTerminateSessionOnExpiry, true +} + +// HasAuthTerminateSessionOnExpiry returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasAuthTerminateSessionOnExpiry() bool { + if o != nil && !IsNil(o.AuthTerminateSessionOnExpiry) { + return true + } + + return false +} + +// SetAuthTerminateSessionOnExpiry gets a reference to the given bool and assigns it to the AuthTerminateSessionOnExpiry field. +func (o *PatchedAgentConnectorRequest) SetAuthTerminateSessionOnExpiry(v bool) { + o.AuthTerminateSessionOnExpiry = &v +} + +// GetRefreshInterval returns the RefreshInterval field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetRefreshInterval() string { + if o == nil || IsNil(o.RefreshInterval) { + var ret string + return ret + } + return *o.RefreshInterval +} + +// GetRefreshIntervalOk returns a tuple with the RefreshInterval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetRefreshIntervalOk() (*string, bool) { + if o == nil || IsNil(o.RefreshInterval) { + return nil, false + } + return o.RefreshInterval, true +} + +// HasRefreshInterval returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasRefreshInterval() bool { + if o != nil && !IsNil(o.RefreshInterval) { + return true + } + + return false +} + +// SetRefreshInterval gets a reference to the given string and assigns it to the RefreshInterval field. +func (o *PatchedAgentConnectorRequest) SetRefreshInterval(v string) { + o.RefreshInterval = &v +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAgentConnectorRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow.Get()) { + var ret string + return ret + } + return *o.AuthorizationFlow.Get() +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAgentConnectorRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationFlow.Get(), o.AuthorizationFlow.IsSet() +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasAuthorizationFlow() bool { + if o != nil && o.AuthorizationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given NullableString and assigns it to the AuthorizationFlow field. +func (o *PatchedAgentConnectorRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow.Set(&v) +} + +// SetAuthorizationFlowNil sets the value for AuthorizationFlow to be an explicit nil +func (o *PatchedAgentConnectorRequest) SetAuthorizationFlowNil() { + o.AuthorizationFlow.Set(nil) +} + +// UnsetAuthorizationFlow ensures that no value is present for AuthorizationFlow, not even an explicit nil +func (o *PatchedAgentConnectorRequest) UnsetAuthorizationFlow() { + o.AuthorizationFlow.Unset() +} + +// GetNssUidOffset returns the NssUidOffset field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetNssUidOffset() int32 { + if o == nil || IsNil(o.NssUidOffset) { + var ret int32 + return ret + } + return *o.NssUidOffset +} + +// GetNssUidOffsetOk returns a tuple with the NssUidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetNssUidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssUidOffset) { + return nil, false + } + return o.NssUidOffset, true +} + +// HasNssUidOffset returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasNssUidOffset() bool { + if o != nil && !IsNil(o.NssUidOffset) { + return true + } + + return false +} + +// SetNssUidOffset gets a reference to the given int32 and assigns it to the NssUidOffset field. +func (o *PatchedAgentConnectorRequest) SetNssUidOffset(v int32) { + o.NssUidOffset = &v +} + +// GetNssGidOffset returns the NssGidOffset field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetNssGidOffset() int32 { + if o == nil || IsNil(o.NssGidOffset) { + var ret int32 + return ret + } + return *o.NssGidOffset +} + +// GetNssGidOffsetOk returns a tuple with the NssGidOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetNssGidOffsetOk() (*int32, bool) { + if o == nil || IsNil(o.NssGidOffset) { + return nil, false + } + return o.NssGidOffset, true +} + +// HasNssGidOffset returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasNssGidOffset() bool { + if o != nil && !IsNil(o.NssGidOffset) { + return true + } + + return false +} + +// SetNssGidOffset gets a reference to the given int32 and assigns it to the NssGidOffset field. +func (o *PatchedAgentConnectorRequest) SetNssGidOffset(v int32) { + o.NssGidOffset = &v +} + +// GetChallengeKey returns the ChallengeKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAgentConnectorRequest) GetChallengeKey() string { + if o == nil || IsNil(o.ChallengeKey.Get()) { + var ret string + return ret + } + return *o.ChallengeKey.Get() +} + +// GetChallengeKeyOk returns a tuple with the ChallengeKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAgentConnectorRequest) GetChallengeKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ChallengeKey.Get(), o.ChallengeKey.IsSet() +} + +// HasChallengeKey returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasChallengeKey() bool { + if o != nil && o.ChallengeKey.IsSet() { + return true + } + + return false +} + +// SetChallengeKey gets a reference to the given NullableString and assigns it to the ChallengeKey field. +func (o *PatchedAgentConnectorRequest) SetChallengeKey(v string) { + o.ChallengeKey.Set(&v) +} + +// SetChallengeKeyNil sets the value for ChallengeKey to be an explicit nil +func (o *PatchedAgentConnectorRequest) SetChallengeKeyNil() { + o.ChallengeKey.Set(nil) +} + +// UnsetChallengeKey ensures that no value is present for ChallengeKey, not even an explicit nil +func (o *PatchedAgentConnectorRequest) UnsetChallengeKey() { + o.ChallengeKey.Unset() +} + +// GetChallengeIdleTimeout returns the ChallengeIdleTimeout field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetChallengeIdleTimeout() string { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + var ret string + return ret + } + return *o.ChallengeIdleTimeout +} + +// GetChallengeIdleTimeoutOk returns a tuple with the ChallengeIdleTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetChallengeIdleTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ChallengeIdleTimeout) { + return nil, false + } + return o.ChallengeIdleTimeout, true +} + +// HasChallengeIdleTimeout returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasChallengeIdleTimeout() bool { + if o != nil && !IsNil(o.ChallengeIdleTimeout) { + return true + } + + return false +} + +// SetChallengeIdleTimeout gets a reference to the given string and assigns it to the ChallengeIdleTimeout field. +func (o *PatchedAgentConnectorRequest) SetChallengeIdleTimeout(v string) { + o.ChallengeIdleTimeout = &v +} + +// GetChallengeTriggerCheckIn returns the ChallengeTriggerCheckIn field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetChallengeTriggerCheckIn() bool { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + var ret bool + return ret + } + return *o.ChallengeTriggerCheckIn +} + +// GetChallengeTriggerCheckInOk returns a tuple with the ChallengeTriggerCheckIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetChallengeTriggerCheckInOk() (*bool, bool) { + if o == nil || IsNil(o.ChallengeTriggerCheckIn) { + return nil, false + } + return o.ChallengeTriggerCheckIn, true +} + +// HasChallengeTriggerCheckIn returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasChallengeTriggerCheckIn() bool { + if o != nil && !IsNil(o.ChallengeTriggerCheckIn) { + return true + } + + return false +} + +// SetChallengeTriggerCheckIn gets a reference to the given bool and assigns it to the ChallengeTriggerCheckIn field. +func (o *PatchedAgentConnectorRequest) SetChallengeTriggerCheckIn(v bool) { + o.ChallengeTriggerCheckIn = &v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *PatchedAgentConnectorRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAgentConnectorRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *PatchedAgentConnectorRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *PatchedAgentConnectorRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o PatchedAgentConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAgentConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.SnapshotExpiry) { + toSerialize["snapshot_expiry"] = o.SnapshotExpiry + } + if !IsNil(o.AuthSessionDuration) { + toSerialize["auth_session_duration"] = o.AuthSessionDuration + } + if !IsNil(o.AuthTerminateSessionOnExpiry) { + toSerialize["auth_terminate_session_on_expiry"] = o.AuthTerminateSessionOnExpiry + } + if !IsNil(o.RefreshInterval) { + toSerialize["refresh_interval"] = o.RefreshInterval + } + if o.AuthorizationFlow.IsSet() { + toSerialize["authorization_flow"] = o.AuthorizationFlow.Get() + } + if !IsNil(o.NssUidOffset) { + toSerialize["nss_uid_offset"] = o.NssUidOffset + } + if !IsNil(o.NssGidOffset) { + toSerialize["nss_gid_offset"] = o.NssGidOffset + } + if o.ChallengeKey.IsSet() { + toSerialize["challenge_key"] = o.ChallengeKey.Get() + } + if !IsNil(o.ChallengeIdleTimeout) { + toSerialize["challenge_idle_timeout"] = o.ChallengeIdleTimeout + } + if !IsNil(o.ChallengeTriggerCheckIn) { + toSerialize["challenge_trigger_check_in"] = o.ChallengeTriggerCheckIn + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAgentConnectorRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAgentConnectorRequest := _PatchedAgentConnectorRequest{} + + err = json.Unmarshal(data, &varPatchedAgentConnectorRequest) + + if err != nil { + return err + } + + *o = PatchedAgentConnectorRequest(varPatchedAgentConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "snapshot_expiry") + delete(additionalProperties, "auth_session_duration") + delete(additionalProperties, "auth_terminate_session_on_expiry") + delete(additionalProperties, "refresh_interval") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "nss_uid_offset") + delete(additionalProperties, "nss_gid_offset") + delete(additionalProperties, "challenge_key") + delete(additionalProperties, "challenge_idle_timeout") + delete(additionalProperties, "challenge_trigger_check_in") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAgentConnectorRequest struct { + value *PatchedAgentConnectorRequest + isSet bool +} + +func (v NullablePatchedAgentConnectorRequest) Get() *PatchedAgentConnectorRequest { + return v.value +} + +func (v *NullablePatchedAgentConnectorRequest) Set(val *PatchedAgentConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAgentConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAgentConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAgentConnectorRequest(val *PatchedAgentConnectorRequest) *NullablePatchedAgentConnectorRequest { + return &NullablePatchedAgentConnectorRequest{value: val, isSet: true} +} + +func (v NullablePatchedAgentConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAgentConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_application_entitlement_request.go b/packages/client-go/model_patched_application_entitlement_request.go new file mode 100644 index 0000000000..1220b7811e --- /dev/null +++ b/packages/client-go/model_patched_application_entitlement_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedApplicationEntitlementRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedApplicationEntitlementRequest{} + +// PatchedApplicationEntitlementRequest ApplicationEntitlement Serializer +type PatchedApplicationEntitlementRequest struct { + Name *string `json:"name,omitempty"` + App *string `json:"app,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedApplicationEntitlementRequest PatchedApplicationEntitlementRequest + +// NewPatchedApplicationEntitlementRequest instantiates a new PatchedApplicationEntitlementRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedApplicationEntitlementRequest() *PatchedApplicationEntitlementRequest { + this := PatchedApplicationEntitlementRequest{} + return &this +} + +// NewPatchedApplicationEntitlementRequestWithDefaults instantiates a new PatchedApplicationEntitlementRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedApplicationEntitlementRequestWithDefaults() *PatchedApplicationEntitlementRequest { + this := PatchedApplicationEntitlementRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedApplicationEntitlementRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationEntitlementRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedApplicationEntitlementRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedApplicationEntitlementRequest) SetName(v string) { + o.Name = &v +} + +// GetApp returns the App field value if set, zero value otherwise. +func (o *PatchedApplicationEntitlementRequest) GetApp() string { + if o == nil || IsNil(o.App) { + var ret string + return ret + } + return *o.App +} + +// GetAppOk returns a tuple with the App field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationEntitlementRequest) GetAppOk() (*string, bool) { + if o == nil || IsNil(o.App) { + return nil, false + } + return o.App, true +} + +// HasApp returns a boolean if a field has been set. +func (o *PatchedApplicationEntitlementRequest) HasApp() bool { + if o != nil && !IsNil(o.App) { + return true + } + + return false +} + +// SetApp gets a reference to the given string and assigns it to the App field. +func (o *PatchedApplicationEntitlementRequest) SetApp(v string) { + o.App = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedApplicationEntitlementRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationEntitlementRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedApplicationEntitlementRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedApplicationEntitlementRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedApplicationEntitlementRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedApplicationEntitlementRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.App) { + toSerialize["app"] = o.App + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedApplicationEntitlementRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedApplicationEntitlementRequest := _PatchedApplicationEntitlementRequest{} + + err = json.Unmarshal(data, &varPatchedApplicationEntitlementRequest) + + if err != nil { + return err + } + + *o = PatchedApplicationEntitlementRequest(varPatchedApplicationEntitlementRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "app") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedApplicationEntitlementRequest struct { + value *PatchedApplicationEntitlementRequest + isSet bool +} + +func (v NullablePatchedApplicationEntitlementRequest) Get() *PatchedApplicationEntitlementRequest { + return v.value +} + +func (v *NullablePatchedApplicationEntitlementRequest) Set(val *PatchedApplicationEntitlementRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedApplicationEntitlementRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedApplicationEntitlementRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedApplicationEntitlementRequest(val *PatchedApplicationEntitlementRequest) *NullablePatchedApplicationEntitlementRequest { + return &NullablePatchedApplicationEntitlementRequest{value: val, isSet: true} +} + +func (v NullablePatchedApplicationEntitlementRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedApplicationEntitlementRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_application_request.go b/packages/client-go/model_patched_application_request.go new file mode 100644 index 0000000000..ef6c20cdcc --- /dev/null +++ b/packages/client-go/model_patched_application_request.go @@ -0,0 +1,538 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedApplicationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedApplicationRequest{} + +// PatchedApplicationRequest Application Serializer +type PatchedApplicationRequest struct { + // Application's display Name. + Name *string `json:"name,omitempty"` + // Internal application name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Provider NullableInt32 `json:"provider,omitempty"` + BackchannelProviders []int32 `json:"backchannel_providers,omitempty"` + // Open launch URL in a new browser tab or window. + OpenInNewTab *bool `json:"open_in_new_tab,omitempty"` + MetaLaunchUrl *string `json:"meta_launch_url,omitempty"` + MetaIcon *string `json:"meta_icon,omitempty"` + MetaDescription *string `json:"meta_description,omitempty"` + MetaPublisher *string `json:"meta_publisher,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + Group *string `json:"group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedApplicationRequest PatchedApplicationRequest + +// NewPatchedApplicationRequest instantiates a new PatchedApplicationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedApplicationRequest() *PatchedApplicationRequest { + this := PatchedApplicationRequest{} + return &this +} + +// NewPatchedApplicationRequestWithDefaults instantiates a new PatchedApplicationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedApplicationRequestWithDefaults() *PatchedApplicationRequest { + this := PatchedApplicationRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedApplicationRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedApplicationRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedApplicationRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider.Get()) { + var ret int32 + return ret + } + return *o.Provider.Get() +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedApplicationRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.Provider.Get(), o.Provider.IsSet() +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasProvider() bool { + if o != nil && o.Provider.IsSet() { + return true + } + + return false +} + +// SetProvider gets a reference to the given NullableInt32 and assigns it to the Provider field. +func (o *PatchedApplicationRequest) SetProvider(v int32) { + o.Provider.Set(&v) +} + +// SetProviderNil sets the value for Provider to be an explicit nil +func (o *PatchedApplicationRequest) SetProviderNil() { + o.Provider.Set(nil) +} + +// UnsetProvider ensures that no value is present for Provider, not even an explicit nil +func (o *PatchedApplicationRequest) UnsetProvider() { + o.Provider.Unset() +} + +// GetBackchannelProviders returns the BackchannelProviders field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetBackchannelProviders() []int32 { + if o == nil || IsNil(o.BackchannelProviders) { + var ret []int32 + return ret + } + return o.BackchannelProviders +} + +// GetBackchannelProvidersOk returns a tuple with the BackchannelProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetBackchannelProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.BackchannelProviders) { + return nil, false + } + return o.BackchannelProviders, true +} + +// HasBackchannelProviders returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasBackchannelProviders() bool { + if o != nil && !IsNil(o.BackchannelProviders) { + return true + } + + return false +} + +// SetBackchannelProviders gets a reference to the given []int32 and assigns it to the BackchannelProviders field. +func (o *PatchedApplicationRequest) SetBackchannelProviders(v []int32) { + o.BackchannelProviders = v +} + +// GetOpenInNewTab returns the OpenInNewTab field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetOpenInNewTab() bool { + if o == nil || IsNil(o.OpenInNewTab) { + var ret bool + return ret + } + return *o.OpenInNewTab +} + +// GetOpenInNewTabOk returns a tuple with the OpenInNewTab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetOpenInNewTabOk() (*bool, bool) { + if o == nil || IsNil(o.OpenInNewTab) { + return nil, false + } + return o.OpenInNewTab, true +} + +// HasOpenInNewTab returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasOpenInNewTab() bool { + if o != nil && !IsNil(o.OpenInNewTab) { + return true + } + + return false +} + +// SetOpenInNewTab gets a reference to the given bool and assigns it to the OpenInNewTab field. +func (o *PatchedApplicationRequest) SetOpenInNewTab(v bool) { + o.OpenInNewTab = &v +} + +// GetMetaLaunchUrl returns the MetaLaunchUrl field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetMetaLaunchUrl() string { + if o == nil || IsNil(o.MetaLaunchUrl) { + var ret string + return ret + } + return *o.MetaLaunchUrl +} + +// GetMetaLaunchUrlOk returns a tuple with the MetaLaunchUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetMetaLaunchUrlOk() (*string, bool) { + if o == nil || IsNil(o.MetaLaunchUrl) { + return nil, false + } + return o.MetaLaunchUrl, true +} + +// HasMetaLaunchUrl returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasMetaLaunchUrl() bool { + if o != nil && !IsNil(o.MetaLaunchUrl) { + return true + } + + return false +} + +// SetMetaLaunchUrl gets a reference to the given string and assigns it to the MetaLaunchUrl field. +func (o *PatchedApplicationRequest) SetMetaLaunchUrl(v string) { + o.MetaLaunchUrl = &v +} + +// GetMetaIcon returns the MetaIcon field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetMetaIcon() string { + if o == nil || IsNil(o.MetaIcon) { + var ret string + return ret + } + return *o.MetaIcon +} + +// GetMetaIconOk returns a tuple with the MetaIcon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetMetaIconOk() (*string, bool) { + if o == nil || IsNil(o.MetaIcon) { + return nil, false + } + return o.MetaIcon, true +} + +// HasMetaIcon returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasMetaIcon() bool { + if o != nil && !IsNil(o.MetaIcon) { + return true + } + + return false +} + +// SetMetaIcon gets a reference to the given string and assigns it to the MetaIcon field. +func (o *PatchedApplicationRequest) SetMetaIcon(v string) { + o.MetaIcon = &v +} + +// GetMetaDescription returns the MetaDescription field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetMetaDescription() string { + if o == nil || IsNil(o.MetaDescription) { + var ret string + return ret + } + return *o.MetaDescription +} + +// GetMetaDescriptionOk returns a tuple with the MetaDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetMetaDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.MetaDescription) { + return nil, false + } + return o.MetaDescription, true +} + +// HasMetaDescription returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasMetaDescription() bool { + if o != nil && !IsNil(o.MetaDescription) { + return true + } + + return false +} + +// SetMetaDescription gets a reference to the given string and assigns it to the MetaDescription field. +func (o *PatchedApplicationRequest) SetMetaDescription(v string) { + o.MetaDescription = &v +} + +// GetMetaPublisher returns the MetaPublisher field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetMetaPublisher() string { + if o == nil || IsNil(o.MetaPublisher) { + var ret string + return ret + } + return *o.MetaPublisher +} + +// GetMetaPublisherOk returns a tuple with the MetaPublisher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetMetaPublisherOk() (*string, bool) { + if o == nil || IsNil(o.MetaPublisher) { + return nil, false + } + return o.MetaPublisher, true +} + +// HasMetaPublisher returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasMetaPublisher() bool { + if o != nil && !IsNil(o.MetaPublisher) { + return true + } + + return false +} + +// SetMetaPublisher gets a reference to the given string and assigns it to the MetaPublisher field. +func (o *PatchedApplicationRequest) SetMetaPublisher(v string) { + o.MetaPublisher = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedApplicationRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedApplicationRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedApplicationRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedApplicationRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedApplicationRequest) SetGroup(v string) { + o.Group = &v +} + +func (o PatchedApplicationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedApplicationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if o.Provider.IsSet() { + toSerialize["provider"] = o.Provider.Get() + } + if !IsNil(o.BackchannelProviders) { + toSerialize["backchannel_providers"] = o.BackchannelProviders + } + if !IsNil(o.OpenInNewTab) { + toSerialize["open_in_new_tab"] = o.OpenInNewTab + } + if !IsNil(o.MetaLaunchUrl) { + toSerialize["meta_launch_url"] = o.MetaLaunchUrl + } + if !IsNil(o.MetaIcon) { + toSerialize["meta_icon"] = o.MetaIcon + } + if !IsNil(o.MetaDescription) { + toSerialize["meta_description"] = o.MetaDescription + } + if !IsNil(o.MetaPublisher) { + toSerialize["meta_publisher"] = o.MetaPublisher + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedApplicationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedApplicationRequest := _PatchedApplicationRequest{} + + err = json.Unmarshal(data, &varPatchedApplicationRequest) + + if err != nil { + return err + } + + *o = PatchedApplicationRequest(varPatchedApplicationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "provider") + delete(additionalProperties, "backchannel_providers") + delete(additionalProperties, "open_in_new_tab") + delete(additionalProperties, "meta_launch_url") + delete(additionalProperties, "meta_icon") + delete(additionalProperties, "meta_description") + delete(additionalProperties, "meta_publisher") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedApplicationRequest struct { + value *PatchedApplicationRequest + isSet bool +} + +func (v NullablePatchedApplicationRequest) Get() *PatchedApplicationRequest { + return v.value +} + +func (v *NullablePatchedApplicationRequest) Set(val *PatchedApplicationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedApplicationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedApplicationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedApplicationRequest(val *PatchedApplicationRequest) *NullablePatchedApplicationRequest { + return &NullablePatchedApplicationRequest{value: val, isSet: true} +} + +func (v NullablePatchedApplicationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedApplicationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_duo_stage_request.go b/packages/client-go/model_patched_authenticator_duo_stage_request.go new file mode 100644 index 0000000000..08a67ac63b --- /dev/null +++ b/packages/client-go/model_patched_authenticator_duo_stage_request.go @@ -0,0 +1,425 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorDuoStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorDuoStageRequest{} + +// PatchedAuthenticatorDuoStageRequest AuthenticatorDuoStage Serializer +type PatchedAuthenticatorDuoStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + ApiHostname *string `json:"api_hostname,omitempty"` + AdminIntegrationKey *string `json:"admin_integration_key,omitempty"` + AdminSecretKey *string `json:"admin_secret_key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorDuoStageRequest PatchedAuthenticatorDuoStageRequest + +// NewPatchedAuthenticatorDuoStageRequest instantiates a new PatchedAuthenticatorDuoStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorDuoStageRequest() *PatchedAuthenticatorDuoStageRequest { + this := PatchedAuthenticatorDuoStageRequest{} + return &this +} + +// NewPatchedAuthenticatorDuoStageRequestWithDefaults instantiates a new PatchedAuthenticatorDuoStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorDuoStageRequestWithDefaults() *PatchedAuthenticatorDuoStageRequest { + this := PatchedAuthenticatorDuoStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorDuoStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorDuoStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorDuoStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorDuoStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorDuoStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorDuoStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorDuoStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PatchedAuthenticatorDuoStageRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *PatchedAuthenticatorDuoStageRequest) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetApiHostname returns the ApiHostname field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetApiHostname() string { + if o == nil || IsNil(o.ApiHostname) { + var ret string + return ret + } + return *o.ApiHostname +} + +// GetApiHostnameOk returns a tuple with the ApiHostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetApiHostnameOk() (*string, bool) { + if o == nil || IsNil(o.ApiHostname) { + return nil, false + } + return o.ApiHostname, true +} + +// HasApiHostname returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasApiHostname() bool { + if o != nil && !IsNil(o.ApiHostname) { + return true + } + + return false +} + +// SetApiHostname gets a reference to the given string and assigns it to the ApiHostname field. +func (o *PatchedAuthenticatorDuoStageRequest) SetApiHostname(v string) { + o.ApiHostname = &v +} + +// GetAdminIntegrationKey returns the AdminIntegrationKey field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetAdminIntegrationKey() string { + if o == nil || IsNil(o.AdminIntegrationKey) { + var ret string + return ret + } + return *o.AdminIntegrationKey +} + +// GetAdminIntegrationKeyOk returns a tuple with the AdminIntegrationKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetAdminIntegrationKeyOk() (*string, bool) { + if o == nil || IsNil(o.AdminIntegrationKey) { + return nil, false + } + return o.AdminIntegrationKey, true +} + +// HasAdminIntegrationKey returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasAdminIntegrationKey() bool { + if o != nil && !IsNil(o.AdminIntegrationKey) { + return true + } + + return false +} + +// SetAdminIntegrationKey gets a reference to the given string and assigns it to the AdminIntegrationKey field. +func (o *PatchedAuthenticatorDuoStageRequest) SetAdminIntegrationKey(v string) { + o.AdminIntegrationKey = &v +} + +// GetAdminSecretKey returns the AdminSecretKey field value if set, zero value otherwise. +func (o *PatchedAuthenticatorDuoStageRequest) GetAdminSecretKey() string { + if o == nil || IsNil(o.AdminSecretKey) { + var ret string + return ret + } + return *o.AdminSecretKey +} + +// GetAdminSecretKeyOk returns a tuple with the AdminSecretKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorDuoStageRequest) GetAdminSecretKeyOk() (*string, bool) { + if o == nil || IsNil(o.AdminSecretKey) { + return nil, false + } + return o.AdminSecretKey, true +} + +// HasAdminSecretKey returns a boolean if a field has been set. +func (o *PatchedAuthenticatorDuoStageRequest) HasAdminSecretKey() bool { + if o != nil && !IsNil(o.AdminSecretKey) { + return true + } + + return false +} + +// SetAdminSecretKey gets a reference to the given string and assigns it to the AdminSecretKey field. +func (o *PatchedAuthenticatorDuoStageRequest) SetAdminSecretKey(v string) { + o.AdminSecretKey = &v +} + +func (o PatchedAuthenticatorDuoStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorDuoStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.ApiHostname) { + toSerialize["api_hostname"] = o.ApiHostname + } + if !IsNil(o.AdminIntegrationKey) { + toSerialize["admin_integration_key"] = o.AdminIntegrationKey + } + if !IsNil(o.AdminSecretKey) { + toSerialize["admin_secret_key"] = o.AdminSecretKey + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorDuoStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorDuoStageRequest := _PatchedAuthenticatorDuoStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorDuoStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorDuoStageRequest(varPatchedAuthenticatorDuoStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "api_hostname") + delete(additionalProperties, "admin_integration_key") + delete(additionalProperties, "admin_secret_key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorDuoStageRequest struct { + value *PatchedAuthenticatorDuoStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorDuoStageRequest) Get() *PatchedAuthenticatorDuoStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorDuoStageRequest) Set(val *PatchedAuthenticatorDuoStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorDuoStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorDuoStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorDuoStageRequest(val *PatchedAuthenticatorDuoStageRequest) *NullablePatchedAuthenticatorDuoStageRequest { + return &NullablePatchedAuthenticatorDuoStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorDuoStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorDuoStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_email_stage_request.go b/packages/client-go/model_patched_authenticator_email_stage_request.go new file mode 100644 index 0000000000..812b8adb2b --- /dev/null +++ b/packages/client-go/model_patched_authenticator_email_stage_request.go @@ -0,0 +1,686 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorEmailStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorEmailStageRequest{} + +// PatchedAuthenticatorEmailStageRequest AuthenticatorEmailStage Serializer +type PatchedAuthenticatorEmailStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + Subject *string `json:"subject,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Template *string `json:"template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorEmailStageRequest PatchedAuthenticatorEmailStageRequest + +// NewPatchedAuthenticatorEmailStageRequest instantiates a new PatchedAuthenticatorEmailStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorEmailStageRequest() *PatchedAuthenticatorEmailStageRequest { + this := PatchedAuthenticatorEmailStageRequest{} + return &this +} + +// NewPatchedAuthenticatorEmailStageRequestWithDefaults instantiates a new PatchedAuthenticatorEmailStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorEmailStageRequestWithDefaults() *PatchedAuthenticatorEmailStageRequest { + this := PatchedAuthenticatorEmailStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorEmailStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorEmailStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorEmailStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorEmailStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorEmailStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorEmailStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorEmailStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *PatchedAuthenticatorEmailStageRequest) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *PatchedAuthenticatorEmailStageRequest) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *PatchedAuthenticatorEmailStageRequest) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *PatchedAuthenticatorEmailStageRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *PatchedAuthenticatorEmailStageRequest) SetPassword(v string) { + o.Password = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *PatchedAuthenticatorEmailStageRequest) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *PatchedAuthenticatorEmailStageRequest) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PatchedAuthenticatorEmailStageRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *PatchedAuthenticatorEmailStageRequest) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *PatchedAuthenticatorEmailStageRequest) SetSubject(v string) { + o.Subject = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *PatchedAuthenticatorEmailStageRequest) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEmailStageRequest) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEmailStageRequest) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEmailStageRequest) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *PatchedAuthenticatorEmailStageRequest) SetTemplate(v string) { + o.Template = &v +} + +func (o PatchedAuthenticatorEmailStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorEmailStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorEmailStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorEmailStageRequest := _PatchedAuthenticatorEmailStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorEmailStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorEmailStageRequest(varPatchedAuthenticatorEmailStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "subject") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorEmailStageRequest struct { + value *PatchedAuthenticatorEmailStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorEmailStageRequest) Get() *PatchedAuthenticatorEmailStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorEmailStageRequest) Set(val *PatchedAuthenticatorEmailStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorEmailStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorEmailStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorEmailStageRequest(val *PatchedAuthenticatorEmailStageRequest) *NullablePatchedAuthenticatorEmailStageRequest { + return &NullablePatchedAuthenticatorEmailStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorEmailStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorEmailStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_endpoint_gdtc_stage_request.go b/packages/client-go/model_patched_authenticator_endpoint_gdtc_stage_request.go new file mode 100644 index 0000000000..df5dd4665a --- /dev/null +++ b/packages/client-go/model_patched_authenticator_endpoint_gdtc_stage_request.go @@ -0,0 +1,277 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorEndpointGDTCStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorEndpointGDTCStageRequest{} + +// PatchedAuthenticatorEndpointGDTCStageRequest AuthenticatorEndpointGDTCStage Serializer +type PatchedAuthenticatorEndpointGDTCStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Credentials map[string]interface{} `json:"credentials,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorEndpointGDTCStageRequest PatchedAuthenticatorEndpointGDTCStageRequest + +// NewPatchedAuthenticatorEndpointGDTCStageRequest instantiates a new PatchedAuthenticatorEndpointGDTCStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorEndpointGDTCStageRequest() *PatchedAuthenticatorEndpointGDTCStageRequest { + this := PatchedAuthenticatorEndpointGDTCStageRequest{} + return &this +} + +// NewPatchedAuthenticatorEndpointGDTCStageRequestWithDefaults instantiates a new PatchedAuthenticatorEndpointGDTCStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorEndpointGDTCStageRequestWithDefaults() *PatchedAuthenticatorEndpointGDTCStageRequest { + this := PatchedAuthenticatorEndpointGDTCStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetCredentials() map[string]interface{} { + if o == nil || IsNil(o.Credentials) { + var ret map[string]interface{} + return ret + } + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Credentials) { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given map[string]interface{} and assigns it to the Credentials field. +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +func (o PatchedAuthenticatorEndpointGDTCStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorEndpointGDTCStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorEndpointGDTCStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorEndpointGDTCStageRequest := _PatchedAuthenticatorEndpointGDTCStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorEndpointGDTCStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorEndpointGDTCStageRequest(varPatchedAuthenticatorEndpointGDTCStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorEndpointGDTCStageRequest struct { + value *PatchedAuthenticatorEndpointGDTCStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorEndpointGDTCStageRequest) Get() *PatchedAuthenticatorEndpointGDTCStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorEndpointGDTCStageRequest) Set(val *PatchedAuthenticatorEndpointGDTCStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorEndpointGDTCStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorEndpointGDTCStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorEndpointGDTCStageRequest(val *PatchedAuthenticatorEndpointGDTCStageRequest) *NullablePatchedAuthenticatorEndpointGDTCStageRequest { + return &NullablePatchedAuthenticatorEndpointGDTCStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorEndpointGDTCStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorEndpointGDTCStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_sms_stage_request.go b/packages/client-go/model_patched_authenticator_sms_stage_request.go new file mode 100644 index 0000000000..01178ab1ac --- /dev/null +++ b/packages/client-go/model_patched_authenticator_sms_stage_request.go @@ -0,0 +1,549 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorSMSStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorSMSStageRequest{} + +// PatchedAuthenticatorSMSStageRequest AuthenticatorSMSStage Serializer +type PatchedAuthenticatorSMSStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Provider *ProviderEnum `json:"provider,omitempty"` + FromNumber *string `json:"from_number,omitempty"` + AccountSid *string `json:"account_sid,omitempty"` + Auth *string `json:"auth,omitempty"` + AuthPassword *string `json:"auth_password,omitempty"` + AuthType *AuthTypeEnum `json:"auth_type,omitempty"` + // When enabled, the Phone number is only used during enrollment to verify the users authenticity. Only a hash of the phone number is saved to ensure it is not reused in the future. + VerifyOnly *bool `json:"verify_only,omitempty"` + // Optionally modify the payload being sent to custom providers. + Mapping NullableString `json:"mapping,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorSMSStageRequest PatchedAuthenticatorSMSStageRequest + +// NewPatchedAuthenticatorSMSStageRequest instantiates a new PatchedAuthenticatorSMSStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorSMSStageRequest() *PatchedAuthenticatorSMSStageRequest { + this := PatchedAuthenticatorSMSStageRequest{} + return &this +} + +// NewPatchedAuthenticatorSMSStageRequestWithDefaults instantiates a new PatchedAuthenticatorSMSStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorSMSStageRequestWithDefaults() *PatchedAuthenticatorSMSStageRequest { + this := PatchedAuthenticatorSMSStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorSMSStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorSMSStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorSMSStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorSMSStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorSMSStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorSMSStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorSMSStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetProvider() ProviderEnum { + if o == nil || IsNil(o.Provider) { + var ret ProviderEnum + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetProviderOk() (*ProviderEnum, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given ProviderEnum and assigns it to the Provider field. +func (o *PatchedAuthenticatorSMSStageRequest) SetProvider(v ProviderEnum) { + o.Provider = &v +} + +// GetFromNumber returns the FromNumber field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetFromNumber() string { + if o == nil || IsNil(o.FromNumber) { + var ret string + return ret + } + return *o.FromNumber +} + +// GetFromNumberOk returns a tuple with the FromNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetFromNumberOk() (*string, bool) { + if o == nil || IsNil(o.FromNumber) { + return nil, false + } + return o.FromNumber, true +} + +// HasFromNumber returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasFromNumber() bool { + if o != nil && !IsNil(o.FromNumber) { + return true + } + + return false +} + +// SetFromNumber gets a reference to the given string and assigns it to the FromNumber field. +func (o *PatchedAuthenticatorSMSStageRequest) SetFromNumber(v string) { + o.FromNumber = &v +} + +// GetAccountSid returns the AccountSid field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetAccountSid() string { + if o == nil || IsNil(o.AccountSid) { + var ret string + return ret + } + return *o.AccountSid +} + +// GetAccountSidOk returns a tuple with the AccountSid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetAccountSidOk() (*string, bool) { + if o == nil || IsNil(o.AccountSid) { + return nil, false + } + return o.AccountSid, true +} + +// HasAccountSid returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasAccountSid() bool { + if o != nil && !IsNil(o.AccountSid) { + return true + } + + return false +} + +// SetAccountSid gets a reference to the given string and assigns it to the AccountSid field. +func (o *PatchedAuthenticatorSMSStageRequest) SetAccountSid(v string) { + o.AccountSid = &v +} + +// GetAuth returns the Auth field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuth() string { + if o == nil || IsNil(o.Auth) { + var ret string + return ret + } + return *o.Auth +} + +// GetAuthOk returns a tuple with the Auth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuthOk() (*string, bool) { + if o == nil || IsNil(o.Auth) { + return nil, false + } + return o.Auth, true +} + +// HasAuth returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasAuth() bool { + if o != nil && !IsNil(o.Auth) { + return true + } + + return false +} + +// SetAuth gets a reference to the given string and assigns it to the Auth field. +func (o *PatchedAuthenticatorSMSStageRequest) SetAuth(v string) { + o.Auth = &v +} + +// GetAuthPassword returns the AuthPassword field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuthPassword() string { + if o == nil || IsNil(o.AuthPassword) { + var ret string + return ret + } + return *o.AuthPassword +} + +// GetAuthPasswordOk returns a tuple with the AuthPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuthPasswordOk() (*string, bool) { + if o == nil || IsNil(o.AuthPassword) { + return nil, false + } + return o.AuthPassword, true +} + +// HasAuthPassword returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasAuthPassword() bool { + if o != nil && !IsNil(o.AuthPassword) { + return true + } + + return false +} + +// SetAuthPassword gets a reference to the given string and assigns it to the AuthPassword field. +func (o *PatchedAuthenticatorSMSStageRequest) SetAuthPassword(v string) { + o.AuthPassword = &v +} + +// GetAuthType returns the AuthType field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuthType() AuthTypeEnum { + if o == nil || IsNil(o.AuthType) { + var ret AuthTypeEnum + return ret + } + return *o.AuthType +} + +// GetAuthTypeOk returns a tuple with the AuthType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetAuthTypeOk() (*AuthTypeEnum, bool) { + if o == nil || IsNil(o.AuthType) { + return nil, false + } + return o.AuthType, true +} + +// HasAuthType returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasAuthType() bool { + if o != nil && !IsNil(o.AuthType) { + return true + } + + return false +} + +// SetAuthType gets a reference to the given AuthTypeEnum and assigns it to the AuthType field. +func (o *PatchedAuthenticatorSMSStageRequest) SetAuthType(v AuthTypeEnum) { + o.AuthType = &v +} + +// GetVerifyOnly returns the VerifyOnly field value if set, zero value otherwise. +func (o *PatchedAuthenticatorSMSStageRequest) GetVerifyOnly() bool { + if o == nil || IsNil(o.VerifyOnly) { + var ret bool + return ret + } + return *o.VerifyOnly +} + +// GetVerifyOnlyOk returns a tuple with the VerifyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorSMSStageRequest) GetVerifyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyOnly) { + return nil, false + } + return o.VerifyOnly, true +} + +// HasVerifyOnly returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasVerifyOnly() bool { + if o != nil && !IsNil(o.VerifyOnly) { + return true + } + + return false +} + +// SetVerifyOnly gets a reference to the given bool and assigns it to the VerifyOnly field. +func (o *PatchedAuthenticatorSMSStageRequest) SetVerifyOnly(v bool) { + o.VerifyOnly = &v +} + +// GetMapping returns the Mapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorSMSStageRequest) GetMapping() string { + if o == nil || IsNil(o.Mapping.Get()) { + var ret string + return ret + } + return *o.Mapping.Get() +} + +// GetMappingOk returns a tuple with the Mapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorSMSStageRequest) GetMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Mapping.Get(), o.Mapping.IsSet() +} + +// HasMapping returns a boolean if a field has been set. +func (o *PatchedAuthenticatorSMSStageRequest) HasMapping() bool { + if o != nil && o.Mapping.IsSet() { + return true + } + + return false +} + +// SetMapping gets a reference to the given NullableString and assigns it to the Mapping field. +func (o *PatchedAuthenticatorSMSStageRequest) SetMapping(v string) { + o.Mapping.Set(&v) +} + +// SetMappingNil sets the value for Mapping to be an explicit nil +func (o *PatchedAuthenticatorSMSStageRequest) SetMappingNil() { + o.Mapping.Set(nil) +} + +// UnsetMapping ensures that no value is present for Mapping, not even an explicit nil +func (o *PatchedAuthenticatorSMSStageRequest) UnsetMapping() { + o.Mapping.Unset() +} + +func (o PatchedAuthenticatorSMSStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorSMSStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.FromNumber) { + toSerialize["from_number"] = o.FromNumber + } + if !IsNil(o.AccountSid) { + toSerialize["account_sid"] = o.AccountSid + } + if !IsNil(o.Auth) { + toSerialize["auth"] = o.Auth + } + if !IsNil(o.AuthPassword) { + toSerialize["auth_password"] = o.AuthPassword + } + if !IsNil(o.AuthType) { + toSerialize["auth_type"] = o.AuthType + } + if !IsNil(o.VerifyOnly) { + toSerialize["verify_only"] = o.VerifyOnly + } + if o.Mapping.IsSet() { + toSerialize["mapping"] = o.Mapping.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorSMSStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorSMSStageRequest := _PatchedAuthenticatorSMSStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorSMSStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorSMSStageRequest(varPatchedAuthenticatorSMSStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "provider") + delete(additionalProperties, "from_number") + delete(additionalProperties, "account_sid") + delete(additionalProperties, "auth") + delete(additionalProperties, "auth_password") + delete(additionalProperties, "auth_type") + delete(additionalProperties, "verify_only") + delete(additionalProperties, "mapping") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorSMSStageRequest struct { + value *PatchedAuthenticatorSMSStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorSMSStageRequest) Get() *PatchedAuthenticatorSMSStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorSMSStageRequest) Set(val *PatchedAuthenticatorSMSStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorSMSStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorSMSStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorSMSStageRequest(val *PatchedAuthenticatorSMSStageRequest) *NullablePatchedAuthenticatorSMSStageRequest { + return &NullablePatchedAuthenticatorSMSStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorSMSStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorSMSStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_static_stage_request.go b/packages/client-go/model_patched_authenticator_static_stage_request.go new file mode 100644 index 0000000000..851c465690 --- /dev/null +++ b/packages/client-go/model_patched_authenticator_static_stage_request.go @@ -0,0 +1,314 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorStaticStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorStaticStageRequest{} + +// PatchedAuthenticatorStaticStageRequest AuthenticatorStaticStage Serializer +type PatchedAuthenticatorStaticStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + TokenCount *int32 `json:"token_count,omitempty"` + TokenLength *int32 `json:"token_length,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorStaticStageRequest PatchedAuthenticatorStaticStageRequest + +// NewPatchedAuthenticatorStaticStageRequest instantiates a new PatchedAuthenticatorStaticStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorStaticStageRequest() *PatchedAuthenticatorStaticStageRequest { + this := PatchedAuthenticatorStaticStageRequest{} + return &this +} + +// NewPatchedAuthenticatorStaticStageRequestWithDefaults instantiates a new PatchedAuthenticatorStaticStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorStaticStageRequestWithDefaults() *PatchedAuthenticatorStaticStageRequest { + this := PatchedAuthenticatorStaticStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorStaticStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorStaticStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorStaticStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorStaticStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorStaticStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorStaticStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorStaticStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorStaticStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorStaticStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorStaticStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorStaticStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorStaticStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorStaticStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorStaticStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetTokenCount returns the TokenCount field value if set, zero value otherwise. +func (o *PatchedAuthenticatorStaticStageRequest) GetTokenCount() int32 { + if o == nil || IsNil(o.TokenCount) { + var ret int32 + return ret + } + return *o.TokenCount +} + +// GetTokenCountOk returns a tuple with the TokenCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorStaticStageRequest) GetTokenCountOk() (*int32, bool) { + if o == nil || IsNil(o.TokenCount) { + return nil, false + } + return o.TokenCount, true +} + +// HasTokenCount returns a boolean if a field has been set. +func (o *PatchedAuthenticatorStaticStageRequest) HasTokenCount() bool { + if o != nil && !IsNil(o.TokenCount) { + return true + } + + return false +} + +// SetTokenCount gets a reference to the given int32 and assigns it to the TokenCount field. +func (o *PatchedAuthenticatorStaticStageRequest) SetTokenCount(v int32) { + o.TokenCount = &v +} + +// GetTokenLength returns the TokenLength field value if set, zero value otherwise. +func (o *PatchedAuthenticatorStaticStageRequest) GetTokenLength() int32 { + if o == nil || IsNil(o.TokenLength) { + var ret int32 + return ret + } + return *o.TokenLength +} + +// GetTokenLengthOk returns a tuple with the TokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorStaticStageRequest) GetTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.TokenLength) { + return nil, false + } + return o.TokenLength, true +} + +// HasTokenLength returns a boolean if a field has been set. +func (o *PatchedAuthenticatorStaticStageRequest) HasTokenLength() bool { + if o != nil && !IsNil(o.TokenLength) { + return true + } + + return false +} + +// SetTokenLength gets a reference to the given int32 and assigns it to the TokenLength field. +func (o *PatchedAuthenticatorStaticStageRequest) SetTokenLength(v int32) { + o.TokenLength = &v +} + +func (o PatchedAuthenticatorStaticStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorStaticStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.TokenCount) { + toSerialize["token_count"] = o.TokenCount + } + if !IsNil(o.TokenLength) { + toSerialize["token_length"] = o.TokenLength + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorStaticStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorStaticStageRequest := _PatchedAuthenticatorStaticStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorStaticStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorStaticStageRequest(varPatchedAuthenticatorStaticStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "token_count") + delete(additionalProperties, "token_length") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorStaticStageRequest struct { + value *PatchedAuthenticatorStaticStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorStaticStageRequest) Get() *PatchedAuthenticatorStaticStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorStaticStageRequest) Set(val *PatchedAuthenticatorStaticStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorStaticStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorStaticStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorStaticStageRequest(val *PatchedAuthenticatorStaticStageRequest) *NullablePatchedAuthenticatorStaticStageRequest { + return &NullablePatchedAuthenticatorStaticStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorStaticStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorStaticStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_totp_stage_request.go b/packages/client-go/model_patched_authenticator_totp_stage_request.go new file mode 100644 index 0000000000..7aede1e475 --- /dev/null +++ b/packages/client-go/model_patched_authenticator_totp_stage_request.go @@ -0,0 +1,277 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorTOTPStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorTOTPStageRequest{} + +// PatchedAuthenticatorTOTPStageRequest AuthenticatorTOTPStage Serializer +type PatchedAuthenticatorTOTPStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + Digits *DigitsEnum `json:"digits,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorTOTPStageRequest PatchedAuthenticatorTOTPStageRequest + +// NewPatchedAuthenticatorTOTPStageRequest instantiates a new PatchedAuthenticatorTOTPStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorTOTPStageRequest() *PatchedAuthenticatorTOTPStageRequest { + this := PatchedAuthenticatorTOTPStageRequest{} + return &this +} + +// NewPatchedAuthenticatorTOTPStageRequestWithDefaults instantiates a new PatchedAuthenticatorTOTPStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorTOTPStageRequestWithDefaults() *PatchedAuthenticatorTOTPStageRequest { + this := PatchedAuthenticatorTOTPStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorTOTPStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorTOTPStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorTOTPStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorTOTPStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorTOTPStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorTOTPStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorTOTPStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorTOTPStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorTOTPStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetDigits returns the Digits field value if set, zero value otherwise. +func (o *PatchedAuthenticatorTOTPStageRequest) GetDigits() DigitsEnum { + if o == nil || IsNil(o.Digits) { + var ret DigitsEnum + return ret + } + return *o.Digits +} + +// GetDigitsOk returns a tuple with the Digits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) GetDigitsOk() (*DigitsEnum, bool) { + if o == nil || IsNil(o.Digits) { + return nil, false + } + return o.Digits, true +} + +// HasDigits returns a boolean if a field has been set. +func (o *PatchedAuthenticatorTOTPStageRequest) HasDigits() bool { + if o != nil && !IsNil(o.Digits) { + return true + } + + return false +} + +// SetDigits gets a reference to the given DigitsEnum and assigns it to the Digits field. +func (o *PatchedAuthenticatorTOTPStageRequest) SetDigits(v DigitsEnum) { + o.Digits = &v +} + +func (o PatchedAuthenticatorTOTPStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorTOTPStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.Digits) { + toSerialize["digits"] = o.Digits + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorTOTPStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorTOTPStageRequest := _PatchedAuthenticatorTOTPStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorTOTPStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorTOTPStageRequest(varPatchedAuthenticatorTOTPStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "digits") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorTOTPStageRequest struct { + value *PatchedAuthenticatorTOTPStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorTOTPStageRequest) Get() *PatchedAuthenticatorTOTPStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorTOTPStageRequest) Set(val *PatchedAuthenticatorTOTPStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorTOTPStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorTOTPStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorTOTPStageRequest(val *PatchedAuthenticatorTOTPStageRequest) *NullablePatchedAuthenticatorTOTPStageRequest { + return &NullablePatchedAuthenticatorTOTPStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorTOTPStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorTOTPStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_validate_stage_request.go b/packages/client-go/model_patched_authenticator_validate_stage_request.go new file mode 100644 index 0000000000..c24e5c113a --- /dev/null +++ b/packages/client-go/model_patched_authenticator_validate_stage_request.go @@ -0,0 +1,417 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorValidateStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorValidateStageRequest{} + +// PatchedAuthenticatorValidateStageRequest AuthenticatorValidateStage Serializer +type PatchedAuthenticatorValidateStageRequest struct { + Name *string `json:"name,omitempty"` + NotConfiguredAction *NotConfiguredActionEnum `json:"not_configured_action,omitempty"` + // Device classes which can be used to authenticate + DeviceClasses []DeviceClassesEnum `json:"device_classes,omitempty"` + // Stages used to configure Authenticator when user doesn't have any compatible devices. After this configuration Stage passes, the user is not prompted again. + ConfigurationStages []string `json:"configuration_stages,omitempty"` + // If any of the user's device has been used within this threshold, this stage will be skipped + LastAuthThreshold *string `json:"last_auth_threshold,omitempty"` + // Enforce user verification for WebAuthn devices. + WebauthnUserVerification *UserVerificationEnum `json:"webauthn_user_verification,omitempty"` + WebauthnHints []WebAuthnHintEnum `json:"webauthn_hints,omitempty"` + WebauthnAllowedDeviceTypes []string `json:"webauthn_allowed_device_types,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorValidateStageRequest PatchedAuthenticatorValidateStageRequest + +// NewPatchedAuthenticatorValidateStageRequest instantiates a new PatchedAuthenticatorValidateStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorValidateStageRequest() *PatchedAuthenticatorValidateStageRequest { + this := PatchedAuthenticatorValidateStageRequest{} + return &this +} + +// NewPatchedAuthenticatorValidateStageRequestWithDefaults instantiates a new PatchedAuthenticatorValidateStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorValidateStageRequestWithDefaults() *PatchedAuthenticatorValidateStageRequest { + this := PatchedAuthenticatorValidateStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorValidateStageRequest) SetName(v string) { + o.Name = &v +} + +// GetNotConfiguredAction returns the NotConfiguredAction field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetNotConfiguredAction() NotConfiguredActionEnum { + if o == nil || IsNil(o.NotConfiguredAction) { + var ret NotConfiguredActionEnum + return ret + } + return *o.NotConfiguredAction +} + +// GetNotConfiguredActionOk returns a tuple with the NotConfiguredAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetNotConfiguredActionOk() (*NotConfiguredActionEnum, bool) { + if o == nil || IsNil(o.NotConfiguredAction) { + return nil, false + } + return o.NotConfiguredAction, true +} + +// HasNotConfiguredAction returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasNotConfiguredAction() bool { + if o != nil && !IsNil(o.NotConfiguredAction) { + return true + } + + return false +} + +// SetNotConfiguredAction gets a reference to the given NotConfiguredActionEnum and assigns it to the NotConfiguredAction field. +func (o *PatchedAuthenticatorValidateStageRequest) SetNotConfiguredAction(v NotConfiguredActionEnum) { + o.NotConfiguredAction = &v +} + +// GetDeviceClasses returns the DeviceClasses field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetDeviceClasses() []DeviceClassesEnum { + if o == nil || IsNil(o.DeviceClasses) { + var ret []DeviceClassesEnum + return ret + } + return o.DeviceClasses +} + +// GetDeviceClassesOk returns a tuple with the DeviceClasses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetDeviceClassesOk() ([]DeviceClassesEnum, bool) { + if o == nil || IsNil(o.DeviceClasses) { + return nil, false + } + return o.DeviceClasses, true +} + +// HasDeviceClasses returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasDeviceClasses() bool { + if o != nil && !IsNil(o.DeviceClasses) { + return true + } + + return false +} + +// SetDeviceClasses gets a reference to the given []DeviceClassesEnum and assigns it to the DeviceClasses field. +func (o *PatchedAuthenticatorValidateStageRequest) SetDeviceClasses(v []DeviceClassesEnum) { + o.DeviceClasses = v +} + +// GetConfigurationStages returns the ConfigurationStages field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetConfigurationStages() []string { + if o == nil || IsNil(o.ConfigurationStages) { + var ret []string + return ret + } + return o.ConfigurationStages +} + +// GetConfigurationStagesOk returns a tuple with the ConfigurationStages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetConfigurationStagesOk() ([]string, bool) { + if o == nil || IsNil(o.ConfigurationStages) { + return nil, false + } + return o.ConfigurationStages, true +} + +// HasConfigurationStages returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasConfigurationStages() bool { + if o != nil && !IsNil(o.ConfigurationStages) { + return true + } + + return false +} + +// SetConfigurationStages gets a reference to the given []string and assigns it to the ConfigurationStages field. +func (o *PatchedAuthenticatorValidateStageRequest) SetConfigurationStages(v []string) { + o.ConfigurationStages = v +} + +// GetLastAuthThreshold returns the LastAuthThreshold field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetLastAuthThreshold() string { + if o == nil || IsNil(o.LastAuthThreshold) { + var ret string + return ret + } + return *o.LastAuthThreshold +} + +// GetLastAuthThresholdOk returns a tuple with the LastAuthThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetLastAuthThresholdOk() (*string, bool) { + if o == nil || IsNil(o.LastAuthThreshold) { + return nil, false + } + return o.LastAuthThreshold, true +} + +// HasLastAuthThreshold returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasLastAuthThreshold() bool { + if o != nil && !IsNil(o.LastAuthThreshold) { + return true + } + + return false +} + +// SetLastAuthThreshold gets a reference to the given string and assigns it to the LastAuthThreshold field. +func (o *PatchedAuthenticatorValidateStageRequest) SetLastAuthThreshold(v string) { + o.LastAuthThreshold = &v +} + +// GetWebauthnUserVerification returns the WebauthnUserVerification field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.WebauthnUserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.WebauthnUserVerification +} + +// GetWebauthnUserVerificationOk returns a tuple with the WebauthnUserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.WebauthnUserVerification) { + return nil, false + } + return o.WebauthnUserVerification, true +} + +// HasWebauthnUserVerification returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasWebauthnUserVerification() bool { + if o != nil && !IsNil(o.WebauthnUserVerification) { + return true + } + + return false +} + +// SetWebauthnUserVerification gets a reference to the given UserVerificationEnum and assigns it to the WebauthnUserVerification field. +func (o *PatchedAuthenticatorValidateStageRequest) SetWebauthnUserVerification(v UserVerificationEnum) { + o.WebauthnUserVerification = &v +} + +// GetWebauthnHints returns the WebauthnHints field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.WebauthnHints) { + var ret []WebAuthnHintEnum + return ret + } + return o.WebauthnHints +} + +// GetWebauthnHintsOk returns a tuple with the WebauthnHints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.WebauthnHints) { + return nil, false + } + return o.WebauthnHints, true +} + +// HasWebauthnHints returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasWebauthnHints() bool { + if o != nil && !IsNil(o.WebauthnHints) { + return true + } + + return false +} + +// SetWebauthnHints gets a reference to the given []WebAuthnHintEnum and assigns it to the WebauthnHints field. +func (o *PatchedAuthenticatorValidateStageRequest) SetWebauthnHints(v []WebAuthnHintEnum) { + o.WebauthnHints = v +} + +// GetWebauthnAllowedDeviceTypes returns the WebauthnAllowedDeviceTypes field value if set, zero value otherwise. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnAllowedDeviceTypes() []string { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + var ret []string + return ret + } + return o.WebauthnAllowedDeviceTypes +} + +// GetWebauthnAllowedDeviceTypesOk returns a tuple with the WebauthnAllowedDeviceTypes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorValidateStageRequest) GetWebauthnAllowedDeviceTypesOk() ([]string, bool) { + if o == nil || IsNil(o.WebauthnAllowedDeviceTypes) { + return nil, false + } + return o.WebauthnAllowedDeviceTypes, true +} + +// HasWebauthnAllowedDeviceTypes returns a boolean if a field has been set. +func (o *PatchedAuthenticatorValidateStageRequest) HasWebauthnAllowedDeviceTypes() bool { + if o != nil && !IsNil(o.WebauthnAllowedDeviceTypes) { + return true + } + + return false +} + +// SetWebauthnAllowedDeviceTypes gets a reference to the given []string and assigns it to the WebauthnAllowedDeviceTypes field. +func (o *PatchedAuthenticatorValidateStageRequest) SetWebauthnAllowedDeviceTypes(v []string) { + o.WebauthnAllowedDeviceTypes = v +} + +func (o PatchedAuthenticatorValidateStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorValidateStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NotConfiguredAction) { + toSerialize["not_configured_action"] = o.NotConfiguredAction + } + if !IsNil(o.DeviceClasses) { + toSerialize["device_classes"] = o.DeviceClasses + } + if !IsNil(o.ConfigurationStages) { + toSerialize["configuration_stages"] = o.ConfigurationStages + } + if !IsNil(o.LastAuthThreshold) { + toSerialize["last_auth_threshold"] = o.LastAuthThreshold + } + if !IsNil(o.WebauthnUserVerification) { + toSerialize["webauthn_user_verification"] = o.WebauthnUserVerification + } + if !IsNil(o.WebauthnHints) { + toSerialize["webauthn_hints"] = o.WebauthnHints + } + if !IsNil(o.WebauthnAllowedDeviceTypes) { + toSerialize["webauthn_allowed_device_types"] = o.WebauthnAllowedDeviceTypes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorValidateStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorValidateStageRequest := _PatchedAuthenticatorValidateStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorValidateStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorValidateStageRequest(varPatchedAuthenticatorValidateStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "not_configured_action") + delete(additionalProperties, "device_classes") + delete(additionalProperties, "configuration_stages") + delete(additionalProperties, "last_auth_threshold") + delete(additionalProperties, "webauthn_user_verification") + delete(additionalProperties, "webauthn_hints") + delete(additionalProperties, "webauthn_allowed_device_types") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorValidateStageRequest struct { + value *PatchedAuthenticatorValidateStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorValidateStageRequest) Get() *PatchedAuthenticatorValidateStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorValidateStageRequest) Set(val *PatchedAuthenticatorValidateStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorValidateStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorValidateStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorValidateStageRequest(val *PatchedAuthenticatorValidateStageRequest) *NullablePatchedAuthenticatorValidateStageRequest { + return &NullablePatchedAuthenticatorValidateStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorValidateStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorValidateStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_authenticator_web_authn_stage_request.go b/packages/client-go/model_patched_authenticator_web_authn_stage_request.go new file mode 100644 index 0000000000..a76517ab2c --- /dev/null +++ b/packages/client-go/model_patched_authenticator_web_authn_stage_request.go @@ -0,0 +1,473 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedAuthenticatorWebAuthnStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedAuthenticatorWebAuthnStageRequest{} + +// PatchedAuthenticatorWebAuthnStageRequest AuthenticatorWebAuthnStage Serializer +type PatchedAuthenticatorWebAuthnStageRequest struct { + Name *string `json:"name,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + FriendlyName *string `json:"friendly_name,omitempty"` + UserVerification *UserVerificationEnum `json:"user_verification,omitempty"` + AuthenticatorAttachment NullableAuthenticatorAttachmentEnum `json:"authenticator_attachment,omitempty"` + ResidentKeyRequirement *ResidentKeyRequirementEnum `json:"resident_key_requirement,omitempty"` + Hints []WebAuthnHintEnum `json:"hints,omitempty"` + DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` + MaxAttempts *int32 `json:"max_attempts,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedAuthenticatorWebAuthnStageRequest PatchedAuthenticatorWebAuthnStageRequest + +// NewPatchedAuthenticatorWebAuthnStageRequest instantiates a new PatchedAuthenticatorWebAuthnStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedAuthenticatorWebAuthnStageRequest() *PatchedAuthenticatorWebAuthnStageRequest { + this := PatchedAuthenticatorWebAuthnStageRequest{} + return &this +} + +// NewPatchedAuthenticatorWebAuthnStageRequestWithDefaults instantiates a new PatchedAuthenticatorWebAuthnStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedAuthenticatorWebAuthnStageRequestWithDefaults() *PatchedAuthenticatorWebAuthnStageRequest { + this := PatchedAuthenticatorWebAuthnStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedAuthenticatorWebAuthnStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName) { + var ret string + return ret + } + return *o.FriendlyName +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil || IsNil(o.FriendlyName) { + return nil, false + } + return o.FriendlyName, true +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasFriendlyName() bool { + if o != nil && !IsNil(o.FriendlyName) { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given string and assigns it to the FriendlyName field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetFriendlyName(v string) { + o.FriendlyName = &v +} + +// GetUserVerification returns the UserVerification field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetUserVerification() UserVerificationEnum { + if o == nil || IsNil(o.UserVerification) { + var ret UserVerificationEnum + return ret + } + return *o.UserVerification +} + +// GetUserVerificationOk returns a tuple with the UserVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetUserVerificationOk() (*UserVerificationEnum, bool) { + if o == nil || IsNil(o.UserVerification) { + return nil, false + } + return o.UserVerification, true +} + +// HasUserVerification returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasUserVerification() bool { + if o != nil && !IsNil(o.UserVerification) { + return true + } + + return false +} + +// SetUserVerification gets a reference to the given UserVerificationEnum and assigns it to the UserVerification field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetUserVerification(v UserVerificationEnum) { + o.UserVerification = &v +} + +// GetAuthenticatorAttachment returns the AuthenticatorAttachment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetAuthenticatorAttachment() AuthenticatorAttachmentEnum { + if o == nil || IsNil(o.AuthenticatorAttachment.Get()) { + var ret AuthenticatorAttachmentEnum + return ret + } + return *o.AuthenticatorAttachment.Get() +} + +// GetAuthenticatorAttachmentOk returns a tuple with the AuthenticatorAttachment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetAuthenticatorAttachmentOk() (*AuthenticatorAttachmentEnum, bool) { + if o == nil { + return nil, false + } + return o.AuthenticatorAttachment.Get(), o.AuthenticatorAttachment.IsSet() +} + +// HasAuthenticatorAttachment returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasAuthenticatorAttachment() bool { + if o != nil && o.AuthenticatorAttachment.IsSet() { + return true + } + + return false +} + +// SetAuthenticatorAttachment gets a reference to the given NullableAuthenticatorAttachmentEnum and assigns it to the AuthenticatorAttachment field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetAuthenticatorAttachment(v AuthenticatorAttachmentEnum) { + o.AuthenticatorAttachment.Set(&v) +} + +// SetAuthenticatorAttachmentNil sets the value for AuthenticatorAttachment to be an explicit nil +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetAuthenticatorAttachmentNil() { + o.AuthenticatorAttachment.Set(nil) +} + +// UnsetAuthenticatorAttachment ensures that no value is present for AuthenticatorAttachment, not even an explicit nil +func (o *PatchedAuthenticatorWebAuthnStageRequest) UnsetAuthenticatorAttachment() { + o.AuthenticatorAttachment.Unset() +} + +// GetResidentKeyRequirement returns the ResidentKeyRequirement field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetResidentKeyRequirement() ResidentKeyRequirementEnum { + if o == nil || IsNil(o.ResidentKeyRequirement) { + var ret ResidentKeyRequirementEnum + return ret + } + return *o.ResidentKeyRequirement +} + +// GetResidentKeyRequirementOk returns a tuple with the ResidentKeyRequirement field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetResidentKeyRequirementOk() (*ResidentKeyRequirementEnum, bool) { + if o == nil || IsNil(o.ResidentKeyRequirement) { + return nil, false + } + return o.ResidentKeyRequirement, true +} + +// HasResidentKeyRequirement returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasResidentKeyRequirement() bool { + if o != nil && !IsNil(o.ResidentKeyRequirement) { + return true + } + + return false +} + +// SetResidentKeyRequirement gets a reference to the given ResidentKeyRequirementEnum and assigns it to the ResidentKeyRequirement field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetResidentKeyRequirement(v ResidentKeyRequirementEnum) { + o.ResidentKeyRequirement = &v +} + +// GetHints returns the Hints field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetHints() []WebAuthnHintEnum { + if o == nil || IsNil(o.Hints) { + var ret []WebAuthnHintEnum + return ret + } + return o.Hints +} + +// GetHintsOk returns a tuple with the Hints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetHintsOk() ([]WebAuthnHintEnum, bool) { + if o == nil || IsNil(o.Hints) { + return nil, false + } + return o.Hints, true +} + +// HasHints returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasHints() bool { + if o != nil && !IsNil(o.Hints) { + return true + } + + return false +} + +// SetHints gets a reference to the given []WebAuthnHintEnum and assigns it to the Hints field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetHints(v []WebAuthnHintEnum) { + o.Hints = v +} + +// GetDeviceTypeRestrictions returns the DeviceTypeRestrictions field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetDeviceTypeRestrictions() []string { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + var ret []string + return ret + } + return o.DeviceTypeRestrictions +} + +// GetDeviceTypeRestrictionsOk returns a tuple with the DeviceTypeRestrictions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetDeviceTypeRestrictionsOk() ([]string, bool) { + if o == nil || IsNil(o.DeviceTypeRestrictions) { + return nil, false + } + return o.DeviceTypeRestrictions, true +} + +// HasDeviceTypeRestrictions returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasDeviceTypeRestrictions() bool { + if o != nil && !IsNil(o.DeviceTypeRestrictions) { + return true + } + + return false +} + +// SetDeviceTypeRestrictions gets a reference to the given []string and assigns it to the DeviceTypeRestrictions field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetDeviceTypeRestrictions(v []string) { + o.DeviceTypeRestrictions = v +} + +// GetMaxAttempts returns the MaxAttempts field value if set, zero value otherwise. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetMaxAttempts() int32 { + if o == nil || IsNil(o.MaxAttempts) { + var ret int32 + return ret + } + return *o.MaxAttempts +} + +// GetMaxAttemptsOk returns a tuple with the MaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) GetMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.MaxAttempts) { + return nil, false + } + return o.MaxAttempts, true +} + +// HasMaxAttempts returns a boolean if a field has been set. +func (o *PatchedAuthenticatorWebAuthnStageRequest) HasMaxAttempts() bool { + if o != nil && !IsNil(o.MaxAttempts) { + return true + } + + return false +} + +// SetMaxAttempts gets a reference to the given int32 and assigns it to the MaxAttempts field. +func (o *PatchedAuthenticatorWebAuthnStageRequest) SetMaxAttempts(v int32) { + o.MaxAttempts = &v +} + +func (o PatchedAuthenticatorWebAuthnStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedAuthenticatorWebAuthnStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FriendlyName) { + toSerialize["friendly_name"] = o.FriendlyName + } + if !IsNil(o.UserVerification) { + toSerialize["user_verification"] = o.UserVerification + } + if o.AuthenticatorAttachment.IsSet() { + toSerialize["authenticator_attachment"] = o.AuthenticatorAttachment.Get() + } + if !IsNil(o.ResidentKeyRequirement) { + toSerialize["resident_key_requirement"] = o.ResidentKeyRequirement + } + if !IsNil(o.Hints) { + toSerialize["hints"] = o.Hints + } + if !IsNil(o.DeviceTypeRestrictions) { + toSerialize["device_type_restrictions"] = o.DeviceTypeRestrictions + } + if !IsNil(o.MaxAttempts) { + toSerialize["max_attempts"] = o.MaxAttempts + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedAuthenticatorWebAuthnStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedAuthenticatorWebAuthnStageRequest := _PatchedAuthenticatorWebAuthnStageRequest{} + + err = json.Unmarshal(data, &varPatchedAuthenticatorWebAuthnStageRequest) + + if err != nil { + return err + } + + *o = PatchedAuthenticatorWebAuthnStageRequest(varPatchedAuthenticatorWebAuthnStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "friendly_name") + delete(additionalProperties, "user_verification") + delete(additionalProperties, "authenticator_attachment") + delete(additionalProperties, "resident_key_requirement") + delete(additionalProperties, "hints") + delete(additionalProperties, "device_type_restrictions") + delete(additionalProperties, "max_attempts") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedAuthenticatorWebAuthnStageRequest struct { + value *PatchedAuthenticatorWebAuthnStageRequest + isSet bool +} + +func (v NullablePatchedAuthenticatorWebAuthnStageRequest) Get() *PatchedAuthenticatorWebAuthnStageRequest { + return v.value +} + +func (v *NullablePatchedAuthenticatorWebAuthnStageRequest) Set(val *PatchedAuthenticatorWebAuthnStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedAuthenticatorWebAuthnStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedAuthenticatorWebAuthnStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedAuthenticatorWebAuthnStageRequest(val *PatchedAuthenticatorWebAuthnStageRequest) *NullablePatchedAuthenticatorWebAuthnStageRequest { + return &NullablePatchedAuthenticatorWebAuthnStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedAuthenticatorWebAuthnStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedAuthenticatorWebAuthnStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_blueprint_instance_request.go b/packages/client-go/model_patched_blueprint_instance_request.go new file mode 100644 index 0000000000..4b49d11bb7 --- /dev/null +++ b/packages/client-go/model_patched_blueprint_instance_request.go @@ -0,0 +1,306 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedBlueprintInstanceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedBlueprintInstanceRequest{} + +// PatchedBlueprintInstanceRequest Info about a single blueprint instance file +type PatchedBlueprintInstanceRequest struct { + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Content *string `json:"content,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedBlueprintInstanceRequest PatchedBlueprintInstanceRequest + +// NewPatchedBlueprintInstanceRequest instantiates a new PatchedBlueprintInstanceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedBlueprintInstanceRequest() *PatchedBlueprintInstanceRequest { + this := PatchedBlueprintInstanceRequest{} + var path string = "" + this.Path = &path + return &this +} + +// NewPatchedBlueprintInstanceRequestWithDefaults instantiates a new PatchedBlueprintInstanceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedBlueprintInstanceRequestWithDefaults() *PatchedBlueprintInstanceRequest { + this := PatchedBlueprintInstanceRequest{} + var path string = "" + this.Path = &path + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedBlueprintInstanceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBlueprintInstanceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedBlueprintInstanceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedBlueprintInstanceRequest) SetName(v string) { + o.Name = &v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *PatchedBlueprintInstanceRequest) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBlueprintInstanceRequest) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *PatchedBlueprintInstanceRequest) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *PatchedBlueprintInstanceRequest) SetPath(v string) { + o.Path = &v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PatchedBlueprintInstanceRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBlueprintInstanceRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PatchedBlueprintInstanceRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *PatchedBlueprintInstanceRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedBlueprintInstanceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBlueprintInstanceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedBlueprintInstanceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedBlueprintInstanceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetContent returns the Content field value if set, zero value otherwise. +func (o *PatchedBlueprintInstanceRequest) GetContent() string { + if o == nil || IsNil(o.Content) { + var ret string + return ret + } + return *o.Content +} + +// GetContentOk returns a tuple with the Content field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBlueprintInstanceRequest) GetContentOk() (*string, bool) { + if o == nil || IsNil(o.Content) { + return nil, false + } + return o.Content, true +} + +// HasContent returns a boolean if a field has been set. +func (o *PatchedBlueprintInstanceRequest) HasContent() bool { + if o != nil && !IsNil(o.Content) { + return true + } + + return false +} + +// SetContent gets a reference to the given string and assigns it to the Content field. +func (o *PatchedBlueprintInstanceRequest) SetContent(v string) { + o.Content = &v +} + +func (o PatchedBlueprintInstanceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedBlueprintInstanceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Content) { + toSerialize["content"] = o.Content + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedBlueprintInstanceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedBlueprintInstanceRequest := _PatchedBlueprintInstanceRequest{} + + err = json.Unmarshal(data, &varPatchedBlueprintInstanceRequest) + + if err != nil { + return err + } + + *o = PatchedBlueprintInstanceRequest(varPatchedBlueprintInstanceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "path") + delete(additionalProperties, "context") + delete(additionalProperties, "enabled") + delete(additionalProperties, "content") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedBlueprintInstanceRequest struct { + value *PatchedBlueprintInstanceRequest + isSet bool +} + +func (v NullablePatchedBlueprintInstanceRequest) Get() *PatchedBlueprintInstanceRequest { + return v.value +} + +func (v *NullablePatchedBlueprintInstanceRequest) Set(val *PatchedBlueprintInstanceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedBlueprintInstanceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedBlueprintInstanceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedBlueprintInstanceRequest(val *PatchedBlueprintInstanceRequest) *NullablePatchedBlueprintInstanceRequest { + return &NullablePatchedBlueprintInstanceRequest{value: val, isSet: true} +} + +func (v NullablePatchedBlueprintInstanceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedBlueprintInstanceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_brand_request.go b/packages/client-go/model_patched_brand_request.go new file mode 100644 index 0000000000..59e547dda5 --- /dev/null +++ b/packages/client-go/model_patched_brand_request.go @@ -0,0 +1,838 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedBrandRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedBrandRequest{} + +// PatchedBrandRequest Brand Serializer +type PatchedBrandRequest struct { + // Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` + Domain *string `json:"domain,omitempty"` + Default *bool `json:"default,omitempty"` + BrandingTitle *string `json:"branding_title,omitempty"` + BrandingLogo *string `json:"branding_logo,omitempty"` + BrandingFavicon *string `json:"branding_favicon,omitempty"` + BrandingCustomCss *string `json:"branding_custom_css,omitempty"` + BrandingDefaultFlowBackground *string `json:"branding_default_flow_background,omitempty"` + FlowAuthentication NullableString `json:"flow_authentication,omitempty"` + FlowInvalidation NullableString `json:"flow_invalidation,omitempty"` + FlowRecovery NullableString `json:"flow_recovery,omitempty"` + FlowUnenrollment NullableString `json:"flow_unenrollment,omitempty"` + FlowUserSettings NullableString `json:"flow_user_settings,omitempty"` + FlowDeviceCode NullableString `json:"flow_device_code,omitempty"` + // When set, external users will be redirected to this application after authenticating. + DefaultApplication NullableString `json:"default_application,omitempty"` + // Web Certificate used by the authentik Core webserver. + WebCertificate NullableString `json:"web_certificate,omitempty"` + // Certificates used for client authentication. + ClientCertificates []string `json:"client_certificates,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedBrandRequest PatchedBrandRequest + +// NewPatchedBrandRequest instantiates a new PatchedBrandRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedBrandRequest() *PatchedBrandRequest { + this := PatchedBrandRequest{} + return &this +} + +// NewPatchedBrandRequestWithDefaults instantiates a new PatchedBrandRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedBrandRequestWithDefaults() *PatchedBrandRequest { + this := PatchedBrandRequest{} + return &this +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *PatchedBrandRequest) SetDomain(v string) { + o.Domain = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *PatchedBrandRequest) SetDefault(v bool) { + o.Default = &v +} + +// GetBrandingTitle returns the BrandingTitle field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetBrandingTitle() string { + if o == nil || IsNil(o.BrandingTitle) { + var ret string + return ret + } + return *o.BrandingTitle +} + +// GetBrandingTitleOk returns a tuple with the BrandingTitle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetBrandingTitleOk() (*string, bool) { + if o == nil || IsNil(o.BrandingTitle) { + return nil, false + } + return o.BrandingTitle, true +} + +// HasBrandingTitle returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasBrandingTitle() bool { + if o != nil && !IsNil(o.BrandingTitle) { + return true + } + + return false +} + +// SetBrandingTitle gets a reference to the given string and assigns it to the BrandingTitle field. +func (o *PatchedBrandRequest) SetBrandingTitle(v string) { + o.BrandingTitle = &v +} + +// GetBrandingLogo returns the BrandingLogo field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetBrandingLogo() string { + if o == nil || IsNil(o.BrandingLogo) { + var ret string + return ret + } + return *o.BrandingLogo +} + +// GetBrandingLogoOk returns a tuple with the BrandingLogo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetBrandingLogoOk() (*string, bool) { + if o == nil || IsNil(o.BrandingLogo) { + return nil, false + } + return o.BrandingLogo, true +} + +// HasBrandingLogo returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasBrandingLogo() bool { + if o != nil && !IsNil(o.BrandingLogo) { + return true + } + + return false +} + +// SetBrandingLogo gets a reference to the given string and assigns it to the BrandingLogo field. +func (o *PatchedBrandRequest) SetBrandingLogo(v string) { + o.BrandingLogo = &v +} + +// GetBrandingFavicon returns the BrandingFavicon field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetBrandingFavicon() string { + if o == nil || IsNil(o.BrandingFavicon) { + var ret string + return ret + } + return *o.BrandingFavicon +} + +// GetBrandingFaviconOk returns a tuple with the BrandingFavicon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetBrandingFaviconOk() (*string, bool) { + if o == nil || IsNil(o.BrandingFavicon) { + return nil, false + } + return o.BrandingFavicon, true +} + +// HasBrandingFavicon returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasBrandingFavicon() bool { + if o != nil && !IsNil(o.BrandingFavicon) { + return true + } + + return false +} + +// SetBrandingFavicon gets a reference to the given string and assigns it to the BrandingFavicon field. +func (o *PatchedBrandRequest) SetBrandingFavicon(v string) { + o.BrandingFavicon = &v +} + +// GetBrandingCustomCss returns the BrandingCustomCss field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetBrandingCustomCss() string { + if o == nil || IsNil(o.BrandingCustomCss) { + var ret string + return ret + } + return *o.BrandingCustomCss +} + +// GetBrandingCustomCssOk returns a tuple with the BrandingCustomCss field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetBrandingCustomCssOk() (*string, bool) { + if o == nil || IsNil(o.BrandingCustomCss) { + return nil, false + } + return o.BrandingCustomCss, true +} + +// HasBrandingCustomCss returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasBrandingCustomCss() bool { + if o != nil && !IsNil(o.BrandingCustomCss) { + return true + } + + return false +} + +// SetBrandingCustomCss gets a reference to the given string and assigns it to the BrandingCustomCss field. +func (o *PatchedBrandRequest) SetBrandingCustomCss(v string) { + o.BrandingCustomCss = &v +} + +// GetBrandingDefaultFlowBackground returns the BrandingDefaultFlowBackground field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetBrandingDefaultFlowBackground() string { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + var ret string + return ret + } + return *o.BrandingDefaultFlowBackground +} + +// GetBrandingDefaultFlowBackgroundOk returns a tuple with the BrandingDefaultFlowBackground field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetBrandingDefaultFlowBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.BrandingDefaultFlowBackground) { + return nil, false + } + return o.BrandingDefaultFlowBackground, true +} + +// HasBrandingDefaultFlowBackground returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasBrandingDefaultFlowBackground() bool { + if o != nil && !IsNil(o.BrandingDefaultFlowBackground) { + return true + } + + return false +} + +// SetBrandingDefaultFlowBackground gets a reference to the given string and assigns it to the BrandingDefaultFlowBackground field. +func (o *PatchedBrandRequest) SetBrandingDefaultFlowBackground(v string) { + o.BrandingDefaultFlowBackground = &v +} + +// GetFlowAuthentication returns the FlowAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowAuthentication() string { + if o == nil || IsNil(o.FlowAuthentication.Get()) { + var ret string + return ret + } + return *o.FlowAuthentication.Get() +} + +// GetFlowAuthenticationOk returns a tuple with the FlowAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowAuthentication.Get(), o.FlowAuthentication.IsSet() +} + +// HasFlowAuthentication returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowAuthentication() bool { + if o != nil && o.FlowAuthentication.IsSet() { + return true + } + + return false +} + +// SetFlowAuthentication gets a reference to the given NullableString and assigns it to the FlowAuthentication field. +func (o *PatchedBrandRequest) SetFlowAuthentication(v string) { + o.FlowAuthentication.Set(&v) +} + +// SetFlowAuthenticationNil sets the value for FlowAuthentication to be an explicit nil +func (o *PatchedBrandRequest) SetFlowAuthenticationNil() { + o.FlowAuthentication.Set(nil) +} + +// UnsetFlowAuthentication ensures that no value is present for FlowAuthentication, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowAuthentication() { + o.FlowAuthentication.Unset() +} + +// GetFlowInvalidation returns the FlowInvalidation field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowInvalidation() string { + if o == nil || IsNil(o.FlowInvalidation.Get()) { + var ret string + return ret + } + return *o.FlowInvalidation.Get() +} + +// GetFlowInvalidationOk returns a tuple with the FlowInvalidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowInvalidationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowInvalidation.Get(), o.FlowInvalidation.IsSet() +} + +// HasFlowInvalidation returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowInvalidation() bool { + if o != nil && o.FlowInvalidation.IsSet() { + return true + } + + return false +} + +// SetFlowInvalidation gets a reference to the given NullableString and assigns it to the FlowInvalidation field. +func (o *PatchedBrandRequest) SetFlowInvalidation(v string) { + o.FlowInvalidation.Set(&v) +} + +// SetFlowInvalidationNil sets the value for FlowInvalidation to be an explicit nil +func (o *PatchedBrandRequest) SetFlowInvalidationNil() { + o.FlowInvalidation.Set(nil) +} + +// UnsetFlowInvalidation ensures that no value is present for FlowInvalidation, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowInvalidation() { + o.FlowInvalidation.Unset() +} + +// GetFlowRecovery returns the FlowRecovery field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowRecovery() string { + if o == nil || IsNil(o.FlowRecovery.Get()) { + var ret string + return ret + } + return *o.FlowRecovery.Get() +} + +// GetFlowRecoveryOk returns a tuple with the FlowRecovery field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowRecoveryOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowRecovery.Get(), o.FlowRecovery.IsSet() +} + +// HasFlowRecovery returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowRecovery() bool { + if o != nil && o.FlowRecovery.IsSet() { + return true + } + + return false +} + +// SetFlowRecovery gets a reference to the given NullableString and assigns it to the FlowRecovery field. +func (o *PatchedBrandRequest) SetFlowRecovery(v string) { + o.FlowRecovery.Set(&v) +} + +// SetFlowRecoveryNil sets the value for FlowRecovery to be an explicit nil +func (o *PatchedBrandRequest) SetFlowRecoveryNil() { + o.FlowRecovery.Set(nil) +} + +// UnsetFlowRecovery ensures that no value is present for FlowRecovery, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowRecovery() { + o.FlowRecovery.Unset() +} + +// GetFlowUnenrollment returns the FlowUnenrollment field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowUnenrollment() string { + if o == nil || IsNil(o.FlowUnenrollment.Get()) { + var ret string + return ret + } + return *o.FlowUnenrollment.Get() +} + +// GetFlowUnenrollmentOk returns a tuple with the FlowUnenrollment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowUnenrollmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUnenrollment.Get(), o.FlowUnenrollment.IsSet() +} + +// HasFlowUnenrollment returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowUnenrollment() bool { + if o != nil && o.FlowUnenrollment.IsSet() { + return true + } + + return false +} + +// SetFlowUnenrollment gets a reference to the given NullableString and assigns it to the FlowUnenrollment field. +func (o *PatchedBrandRequest) SetFlowUnenrollment(v string) { + o.FlowUnenrollment.Set(&v) +} + +// SetFlowUnenrollmentNil sets the value for FlowUnenrollment to be an explicit nil +func (o *PatchedBrandRequest) SetFlowUnenrollmentNil() { + o.FlowUnenrollment.Set(nil) +} + +// UnsetFlowUnenrollment ensures that no value is present for FlowUnenrollment, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowUnenrollment() { + o.FlowUnenrollment.Unset() +} + +// GetFlowUserSettings returns the FlowUserSettings field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowUserSettings() string { + if o == nil || IsNil(o.FlowUserSettings.Get()) { + var ret string + return ret + } + return *o.FlowUserSettings.Get() +} + +// GetFlowUserSettingsOk returns a tuple with the FlowUserSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowUserSettingsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowUserSettings.Get(), o.FlowUserSettings.IsSet() +} + +// HasFlowUserSettings returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowUserSettings() bool { + if o != nil && o.FlowUserSettings.IsSet() { + return true + } + + return false +} + +// SetFlowUserSettings gets a reference to the given NullableString and assigns it to the FlowUserSettings field. +func (o *PatchedBrandRequest) SetFlowUserSettings(v string) { + o.FlowUserSettings.Set(&v) +} + +// SetFlowUserSettingsNil sets the value for FlowUserSettings to be an explicit nil +func (o *PatchedBrandRequest) SetFlowUserSettingsNil() { + o.FlowUserSettings.Set(nil) +} + +// UnsetFlowUserSettings ensures that no value is present for FlowUserSettings, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowUserSettings() { + o.FlowUserSettings.Unset() +} + +// GetFlowDeviceCode returns the FlowDeviceCode field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetFlowDeviceCode() string { + if o == nil || IsNil(o.FlowDeviceCode.Get()) { + var ret string + return ret + } + return *o.FlowDeviceCode.Get() +} + +// GetFlowDeviceCodeOk returns a tuple with the FlowDeviceCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetFlowDeviceCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FlowDeviceCode.Get(), o.FlowDeviceCode.IsSet() +} + +// HasFlowDeviceCode returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasFlowDeviceCode() bool { + if o != nil && o.FlowDeviceCode.IsSet() { + return true + } + + return false +} + +// SetFlowDeviceCode gets a reference to the given NullableString and assigns it to the FlowDeviceCode field. +func (o *PatchedBrandRequest) SetFlowDeviceCode(v string) { + o.FlowDeviceCode.Set(&v) +} + +// SetFlowDeviceCodeNil sets the value for FlowDeviceCode to be an explicit nil +func (o *PatchedBrandRequest) SetFlowDeviceCodeNil() { + o.FlowDeviceCode.Set(nil) +} + +// UnsetFlowDeviceCode ensures that no value is present for FlowDeviceCode, not even an explicit nil +func (o *PatchedBrandRequest) UnsetFlowDeviceCode() { + o.FlowDeviceCode.Unset() +} + +// GetDefaultApplication returns the DefaultApplication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetDefaultApplication() string { + if o == nil || IsNil(o.DefaultApplication.Get()) { + var ret string + return ret + } + return *o.DefaultApplication.Get() +} + +// GetDefaultApplicationOk returns a tuple with the DefaultApplication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetDefaultApplicationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultApplication.Get(), o.DefaultApplication.IsSet() +} + +// HasDefaultApplication returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasDefaultApplication() bool { + if o != nil && o.DefaultApplication.IsSet() { + return true + } + + return false +} + +// SetDefaultApplication gets a reference to the given NullableString and assigns it to the DefaultApplication field. +func (o *PatchedBrandRequest) SetDefaultApplication(v string) { + o.DefaultApplication.Set(&v) +} + +// SetDefaultApplicationNil sets the value for DefaultApplication to be an explicit nil +func (o *PatchedBrandRequest) SetDefaultApplicationNil() { + o.DefaultApplication.Set(nil) +} + +// UnsetDefaultApplication ensures that no value is present for DefaultApplication, not even an explicit nil +func (o *PatchedBrandRequest) UnsetDefaultApplication() { + o.DefaultApplication.Unset() +} + +// GetWebCertificate returns the WebCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedBrandRequest) GetWebCertificate() string { + if o == nil || IsNil(o.WebCertificate.Get()) { + var ret string + return ret + } + return *o.WebCertificate.Get() +} + +// GetWebCertificateOk returns a tuple with the WebCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedBrandRequest) GetWebCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebCertificate.Get(), o.WebCertificate.IsSet() +} + +// HasWebCertificate returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasWebCertificate() bool { + if o != nil && o.WebCertificate.IsSet() { + return true + } + + return false +} + +// SetWebCertificate gets a reference to the given NullableString and assigns it to the WebCertificate field. +func (o *PatchedBrandRequest) SetWebCertificate(v string) { + o.WebCertificate.Set(&v) +} + +// SetWebCertificateNil sets the value for WebCertificate to be an explicit nil +func (o *PatchedBrandRequest) SetWebCertificateNil() { + o.WebCertificate.Set(nil) +} + +// UnsetWebCertificate ensures that no value is present for WebCertificate, not even an explicit nil +func (o *PatchedBrandRequest) UnsetWebCertificate() { + o.WebCertificate.Unset() +} + +// GetClientCertificates returns the ClientCertificates field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetClientCertificates() []string { + if o == nil || IsNil(o.ClientCertificates) { + var ret []string + return ret + } + return o.ClientCertificates +} + +// GetClientCertificatesOk returns a tuple with the ClientCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetClientCertificatesOk() ([]string, bool) { + if o == nil || IsNil(o.ClientCertificates) { + return nil, false + } + return o.ClientCertificates, true +} + +// HasClientCertificates returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasClientCertificates() bool { + if o != nil && !IsNil(o.ClientCertificates) { + return true + } + + return false +} + +// SetClientCertificates gets a reference to the given []string and assigns it to the ClientCertificates field. +func (o *PatchedBrandRequest) SetClientCertificates(v []string) { + o.ClientCertificates = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedBrandRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedBrandRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedBrandRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedBrandRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedBrandRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedBrandRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.BrandingTitle) { + toSerialize["branding_title"] = o.BrandingTitle + } + if !IsNil(o.BrandingLogo) { + toSerialize["branding_logo"] = o.BrandingLogo + } + if !IsNil(o.BrandingFavicon) { + toSerialize["branding_favicon"] = o.BrandingFavicon + } + if !IsNil(o.BrandingCustomCss) { + toSerialize["branding_custom_css"] = o.BrandingCustomCss + } + if !IsNil(o.BrandingDefaultFlowBackground) { + toSerialize["branding_default_flow_background"] = o.BrandingDefaultFlowBackground + } + if o.FlowAuthentication.IsSet() { + toSerialize["flow_authentication"] = o.FlowAuthentication.Get() + } + if o.FlowInvalidation.IsSet() { + toSerialize["flow_invalidation"] = o.FlowInvalidation.Get() + } + if o.FlowRecovery.IsSet() { + toSerialize["flow_recovery"] = o.FlowRecovery.Get() + } + if o.FlowUnenrollment.IsSet() { + toSerialize["flow_unenrollment"] = o.FlowUnenrollment.Get() + } + if o.FlowUserSettings.IsSet() { + toSerialize["flow_user_settings"] = o.FlowUserSettings.Get() + } + if o.FlowDeviceCode.IsSet() { + toSerialize["flow_device_code"] = o.FlowDeviceCode.Get() + } + if o.DefaultApplication.IsSet() { + toSerialize["default_application"] = o.DefaultApplication.Get() + } + if o.WebCertificate.IsSet() { + toSerialize["web_certificate"] = o.WebCertificate.Get() + } + if !IsNil(o.ClientCertificates) { + toSerialize["client_certificates"] = o.ClientCertificates + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedBrandRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedBrandRequest := _PatchedBrandRequest{} + + err = json.Unmarshal(data, &varPatchedBrandRequest) + + if err != nil { + return err + } + + *o = PatchedBrandRequest(varPatchedBrandRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "domain") + delete(additionalProperties, "default") + delete(additionalProperties, "branding_title") + delete(additionalProperties, "branding_logo") + delete(additionalProperties, "branding_favicon") + delete(additionalProperties, "branding_custom_css") + delete(additionalProperties, "branding_default_flow_background") + delete(additionalProperties, "flow_authentication") + delete(additionalProperties, "flow_invalidation") + delete(additionalProperties, "flow_recovery") + delete(additionalProperties, "flow_unenrollment") + delete(additionalProperties, "flow_user_settings") + delete(additionalProperties, "flow_device_code") + delete(additionalProperties, "default_application") + delete(additionalProperties, "web_certificate") + delete(additionalProperties, "client_certificates") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedBrandRequest struct { + value *PatchedBrandRequest + isSet bool +} + +func (v NullablePatchedBrandRequest) Get() *PatchedBrandRequest { + return v.value +} + +func (v *NullablePatchedBrandRequest) Set(val *PatchedBrandRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedBrandRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedBrandRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedBrandRequest(val *PatchedBrandRequest) *NullablePatchedBrandRequest { + return &NullablePatchedBrandRequest{value: val, isSet: true} +} + +func (v NullablePatchedBrandRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedBrandRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_captcha_stage_request.go b/packages/client-go/model_patched_captcha_stage_request.go new file mode 100644 index 0000000000..98525ce11a --- /dev/null +++ b/packages/client-go/model_patched_captcha_stage_request.go @@ -0,0 +1,453 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedCaptchaStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedCaptchaStageRequest{} + +// PatchedCaptchaStageRequest CaptchaStage Serializer +type PatchedCaptchaStageRequest struct { + Name *string `json:"name,omitempty"` + // Public key, acquired your captcha Provider. + PublicKey *string `json:"public_key,omitempty"` + // Private key, acquired your captcha Provider. + PrivateKey *string `json:"private_key,omitempty"` + JsUrl *string `json:"js_url,omitempty"` + ApiUrl *string `json:"api_url,omitempty"` + Interactive *bool `json:"interactive,omitempty"` + ScoreMinThreshold *float64 `json:"score_min_threshold,omitempty"` + ScoreMaxThreshold *float64 `json:"score_max_threshold,omitempty"` + // When enabled and the received captcha score is outside of the given threshold, the stage will show an error message. When not enabled, the flow will continue, but the data from the captcha will be available in the context for policy decisions + ErrorOnInvalidScore *bool `json:"error_on_invalid_score,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedCaptchaStageRequest PatchedCaptchaStageRequest + +// NewPatchedCaptchaStageRequest instantiates a new PatchedCaptchaStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedCaptchaStageRequest() *PatchedCaptchaStageRequest { + this := PatchedCaptchaStageRequest{} + return &this +} + +// NewPatchedCaptchaStageRequestWithDefaults instantiates a new PatchedCaptchaStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedCaptchaStageRequestWithDefaults() *PatchedCaptchaStageRequest { + this := PatchedCaptchaStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedCaptchaStageRequest) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetPublicKey() string { + if o == nil || IsNil(o.PublicKey) { + var ret string + return ret + } + return *o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetPublicKeyOk() (*string, bool) { + if o == nil || IsNil(o.PublicKey) { + return nil, false + } + return o.PublicKey, true +} + +// HasPublicKey returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasPublicKey() bool { + if o != nil && !IsNil(o.PublicKey) { + return true + } + + return false +} + +// SetPublicKey gets a reference to the given string and assigns it to the PublicKey field. +func (o *PatchedCaptchaStageRequest) SetPublicKey(v string) { + o.PublicKey = &v +} + +// GetPrivateKey returns the PrivateKey field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetPrivateKey() string { + if o == nil || IsNil(o.PrivateKey) { + var ret string + return ret + } + return *o.PrivateKey +} + +// GetPrivateKeyOk returns a tuple with the PrivateKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetPrivateKeyOk() (*string, bool) { + if o == nil || IsNil(o.PrivateKey) { + return nil, false + } + return o.PrivateKey, true +} + +// HasPrivateKey returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasPrivateKey() bool { + if o != nil && !IsNil(o.PrivateKey) { + return true + } + + return false +} + +// SetPrivateKey gets a reference to the given string and assigns it to the PrivateKey field. +func (o *PatchedCaptchaStageRequest) SetPrivateKey(v string) { + o.PrivateKey = &v +} + +// GetJsUrl returns the JsUrl field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetJsUrl() string { + if o == nil || IsNil(o.JsUrl) { + var ret string + return ret + } + return *o.JsUrl +} + +// GetJsUrlOk returns a tuple with the JsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetJsUrlOk() (*string, bool) { + if o == nil || IsNil(o.JsUrl) { + return nil, false + } + return o.JsUrl, true +} + +// HasJsUrl returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasJsUrl() bool { + if o != nil && !IsNil(o.JsUrl) { + return true + } + + return false +} + +// SetJsUrl gets a reference to the given string and assigns it to the JsUrl field. +func (o *PatchedCaptchaStageRequest) SetJsUrl(v string) { + o.JsUrl = &v +} + +// GetApiUrl returns the ApiUrl field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetApiUrl() string { + if o == nil || IsNil(o.ApiUrl) { + var ret string + return ret + } + return *o.ApiUrl +} + +// GetApiUrlOk returns a tuple with the ApiUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetApiUrlOk() (*string, bool) { + if o == nil || IsNil(o.ApiUrl) { + return nil, false + } + return o.ApiUrl, true +} + +// HasApiUrl returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasApiUrl() bool { + if o != nil && !IsNil(o.ApiUrl) { + return true + } + + return false +} + +// SetApiUrl gets a reference to the given string and assigns it to the ApiUrl field. +func (o *PatchedCaptchaStageRequest) SetApiUrl(v string) { + o.ApiUrl = &v +} + +// GetInteractive returns the Interactive field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetInteractive() bool { + if o == nil || IsNil(o.Interactive) { + var ret bool + return ret + } + return *o.Interactive +} + +// GetInteractiveOk returns a tuple with the Interactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetInteractiveOk() (*bool, bool) { + if o == nil || IsNil(o.Interactive) { + return nil, false + } + return o.Interactive, true +} + +// HasInteractive returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasInteractive() bool { + if o != nil && !IsNil(o.Interactive) { + return true + } + + return false +} + +// SetInteractive gets a reference to the given bool and assigns it to the Interactive field. +func (o *PatchedCaptchaStageRequest) SetInteractive(v bool) { + o.Interactive = &v +} + +// GetScoreMinThreshold returns the ScoreMinThreshold field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetScoreMinThreshold() float64 { + if o == nil || IsNil(o.ScoreMinThreshold) { + var ret float64 + return ret + } + return *o.ScoreMinThreshold +} + +// GetScoreMinThresholdOk returns a tuple with the ScoreMinThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetScoreMinThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMinThreshold) { + return nil, false + } + return o.ScoreMinThreshold, true +} + +// HasScoreMinThreshold returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasScoreMinThreshold() bool { + if o != nil && !IsNil(o.ScoreMinThreshold) { + return true + } + + return false +} + +// SetScoreMinThreshold gets a reference to the given float64 and assigns it to the ScoreMinThreshold field. +func (o *PatchedCaptchaStageRequest) SetScoreMinThreshold(v float64) { + o.ScoreMinThreshold = &v +} + +// GetScoreMaxThreshold returns the ScoreMaxThreshold field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetScoreMaxThreshold() float64 { + if o == nil || IsNil(o.ScoreMaxThreshold) { + var ret float64 + return ret + } + return *o.ScoreMaxThreshold +} + +// GetScoreMaxThresholdOk returns a tuple with the ScoreMaxThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetScoreMaxThresholdOk() (*float64, bool) { + if o == nil || IsNil(o.ScoreMaxThreshold) { + return nil, false + } + return o.ScoreMaxThreshold, true +} + +// HasScoreMaxThreshold returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasScoreMaxThreshold() bool { + if o != nil && !IsNil(o.ScoreMaxThreshold) { + return true + } + + return false +} + +// SetScoreMaxThreshold gets a reference to the given float64 and assigns it to the ScoreMaxThreshold field. +func (o *PatchedCaptchaStageRequest) SetScoreMaxThreshold(v float64) { + o.ScoreMaxThreshold = &v +} + +// GetErrorOnInvalidScore returns the ErrorOnInvalidScore field value if set, zero value otherwise. +func (o *PatchedCaptchaStageRequest) GetErrorOnInvalidScore() bool { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + var ret bool + return ret + } + return *o.ErrorOnInvalidScore +} + +// GetErrorOnInvalidScoreOk returns a tuple with the ErrorOnInvalidScore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCaptchaStageRequest) GetErrorOnInvalidScoreOk() (*bool, bool) { + if o == nil || IsNil(o.ErrorOnInvalidScore) { + return nil, false + } + return o.ErrorOnInvalidScore, true +} + +// HasErrorOnInvalidScore returns a boolean if a field has been set. +func (o *PatchedCaptchaStageRequest) HasErrorOnInvalidScore() bool { + if o != nil && !IsNil(o.ErrorOnInvalidScore) { + return true + } + + return false +} + +// SetErrorOnInvalidScore gets a reference to the given bool and assigns it to the ErrorOnInvalidScore field. +func (o *PatchedCaptchaStageRequest) SetErrorOnInvalidScore(v bool) { + o.ErrorOnInvalidScore = &v +} + +func (o PatchedCaptchaStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedCaptchaStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PublicKey) { + toSerialize["public_key"] = o.PublicKey + } + if !IsNil(o.PrivateKey) { + toSerialize["private_key"] = o.PrivateKey + } + if !IsNil(o.JsUrl) { + toSerialize["js_url"] = o.JsUrl + } + if !IsNil(o.ApiUrl) { + toSerialize["api_url"] = o.ApiUrl + } + if !IsNil(o.Interactive) { + toSerialize["interactive"] = o.Interactive + } + if !IsNil(o.ScoreMinThreshold) { + toSerialize["score_min_threshold"] = o.ScoreMinThreshold + } + if !IsNil(o.ScoreMaxThreshold) { + toSerialize["score_max_threshold"] = o.ScoreMaxThreshold + } + if !IsNil(o.ErrorOnInvalidScore) { + toSerialize["error_on_invalid_score"] = o.ErrorOnInvalidScore + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedCaptchaStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedCaptchaStageRequest := _PatchedCaptchaStageRequest{} + + err = json.Unmarshal(data, &varPatchedCaptchaStageRequest) + + if err != nil { + return err + } + + *o = PatchedCaptchaStageRequest(varPatchedCaptchaStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "public_key") + delete(additionalProperties, "private_key") + delete(additionalProperties, "js_url") + delete(additionalProperties, "api_url") + delete(additionalProperties, "interactive") + delete(additionalProperties, "score_min_threshold") + delete(additionalProperties, "score_max_threshold") + delete(additionalProperties, "error_on_invalid_score") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedCaptchaStageRequest struct { + value *PatchedCaptchaStageRequest + isSet bool +} + +func (v NullablePatchedCaptchaStageRequest) Get() *PatchedCaptchaStageRequest { + return v.value +} + +func (v *NullablePatchedCaptchaStageRequest) Set(val *PatchedCaptchaStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedCaptchaStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedCaptchaStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedCaptchaStageRequest(val *PatchedCaptchaStageRequest) *NullablePatchedCaptchaStageRequest { + return &NullablePatchedCaptchaStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedCaptchaStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedCaptchaStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_certificate_key_pair_request.go b/packages/client-go/model_patched_certificate_key_pair_request.go new file mode 100644 index 0000000000..c2d9676ce7 --- /dev/null +++ b/packages/client-go/model_patched_certificate_key_pair_request.go @@ -0,0 +1,230 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedCertificateKeyPairRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedCertificateKeyPairRequest{} + +// PatchedCertificateKeyPairRequest CertificateKeyPair Serializer +type PatchedCertificateKeyPairRequest struct { + Name *string `json:"name,omitempty"` + // PEM-encoded Certificate data + CertificateData *string `json:"certificate_data,omitempty"` + // Optional Private Key. If this is set, you can use this keypair for encryption. + KeyData *string `json:"key_data,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedCertificateKeyPairRequest PatchedCertificateKeyPairRequest + +// NewPatchedCertificateKeyPairRequest instantiates a new PatchedCertificateKeyPairRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedCertificateKeyPairRequest() *PatchedCertificateKeyPairRequest { + this := PatchedCertificateKeyPairRequest{} + return &this +} + +// NewPatchedCertificateKeyPairRequestWithDefaults instantiates a new PatchedCertificateKeyPairRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedCertificateKeyPairRequestWithDefaults() *PatchedCertificateKeyPairRequest { + this := PatchedCertificateKeyPairRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedCertificateKeyPairRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCertificateKeyPairRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedCertificateKeyPairRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedCertificateKeyPairRequest) SetName(v string) { + o.Name = &v +} + +// GetCertificateData returns the CertificateData field value if set, zero value otherwise. +func (o *PatchedCertificateKeyPairRequest) GetCertificateData() string { + if o == nil || IsNil(o.CertificateData) { + var ret string + return ret + } + return *o.CertificateData +} + +// GetCertificateDataOk returns a tuple with the CertificateData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCertificateKeyPairRequest) GetCertificateDataOk() (*string, bool) { + if o == nil || IsNil(o.CertificateData) { + return nil, false + } + return o.CertificateData, true +} + +// HasCertificateData returns a boolean if a field has been set. +func (o *PatchedCertificateKeyPairRequest) HasCertificateData() bool { + if o != nil && !IsNil(o.CertificateData) { + return true + } + + return false +} + +// SetCertificateData gets a reference to the given string and assigns it to the CertificateData field. +func (o *PatchedCertificateKeyPairRequest) SetCertificateData(v string) { + o.CertificateData = &v +} + +// GetKeyData returns the KeyData field value if set, zero value otherwise. +func (o *PatchedCertificateKeyPairRequest) GetKeyData() string { + if o == nil || IsNil(o.KeyData) { + var ret string + return ret + } + return *o.KeyData +} + +// GetKeyDataOk returns a tuple with the KeyData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedCertificateKeyPairRequest) GetKeyDataOk() (*string, bool) { + if o == nil || IsNil(o.KeyData) { + return nil, false + } + return o.KeyData, true +} + +// HasKeyData returns a boolean if a field has been set. +func (o *PatchedCertificateKeyPairRequest) HasKeyData() bool { + if o != nil && !IsNil(o.KeyData) { + return true + } + + return false +} + +// SetKeyData gets a reference to the given string and assigns it to the KeyData field. +func (o *PatchedCertificateKeyPairRequest) SetKeyData(v string) { + o.KeyData = &v +} + +func (o PatchedCertificateKeyPairRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedCertificateKeyPairRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.CertificateData) { + toSerialize["certificate_data"] = o.CertificateData + } + if !IsNil(o.KeyData) { + toSerialize["key_data"] = o.KeyData + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedCertificateKeyPairRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedCertificateKeyPairRequest := _PatchedCertificateKeyPairRequest{} + + err = json.Unmarshal(data, &varPatchedCertificateKeyPairRequest) + + if err != nil { + return err + } + + *o = PatchedCertificateKeyPairRequest(varPatchedCertificateKeyPairRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "certificate_data") + delete(additionalProperties, "key_data") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedCertificateKeyPairRequest struct { + value *PatchedCertificateKeyPairRequest + isSet bool +} + +func (v NullablePatchedCertificateKeyPairRequest) Get() *PatchedCertificateKeyPairRequest { + return v.value +} + +func (v *NullablePatchedCertificateKeyPairRequest) Set(val *PatchedCertificateKeyPairRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedCertificateKeyPairRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedCertificateKeyPairRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedCertificateKeyPairRequest(val *PatchedCertificateKeyPairRequest) *NullablePatchedCertificateKeyPairRequest { + return &NullablePatchedCertificateKeyPairRequest{value: val, isSet: true} +} + +func (v NullablePatchedCertificateKeyPairRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedCertificateKeyPairRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_connection_token_request.go b/packages/client-go/model_patched_connection_token_request.go new file mode 100644 index 0000000000..729c1ffb56 --- /dev/null +++ b/packages/client-go/model_patched_connection_token_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedConnectionTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedConnectionTokenRequest{} + +// PatchedConnectionTokenRequest ConnectionToken Serializer +type PatchedConnectionTokenRequest struct { + Pk *string `json:"pk,omitempty"` + Provider *int32 `json:"provider,omitempty"` + Endpoint *string `json:"endpoint,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedConnectionTokenRequest PatchedConnectionTokenRequest + +// NewPatchedConnectionTokenRequest instantiates a new PatchedConnectionTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedConnectionTokenRequest() *PatchedConnectionTokenRequest { + this := PatchedConnectionTokenRequest{} + return &this +} + +// NewPatchedConnectionTokenRequestWithDefaults instantiates a new PatchedConnectionTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedConnectionTokenRequestWithDefaults() *PatchedConnectionTokenRequest { + this := PatchedConnectionTokenRequest{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *PatchedConnectionTokenRequest) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConnectionTokenRequest) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *PatchedConnectionTokenRequest) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *PatchedConnectionTokenRequest) SetPk(v string) { + o.Pk = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedConnectionTokenRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider) { + var ret int32 + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConnectionTokenRequest) GetProviderOk() (*int32, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedConnectionTokenRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given int32 and assigns it to the Provider field. +func (o *PatchedConnectionTokenRequest) SetProvider(v int32) { + o.Provider = &v +} + +// GetEndpoint returns the Endpoint field value if set, zero value otherwise. +func (o *PatchedConnectionTokenRequest) GetEndpoint() string { + if o == nil || IsNil(o.Endpoint) { + var ret string + return ret + } + return *o.Endpoint +} + +// GetEndpointOk returns a tuple with the Endpoint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConnectionTokenRequest) GetEndpointOk() (*string, bool) { + if o == nil || IsNil(o.Endpoint) { + return nil, false + } + return o.Endpoint, true +} + +// HasEndpoint returns a boolean if a field has been set. +func (o *PatchedConnectionTokenRequest) HasEndpoint() bool { + if o != nil && !IsNil(o.Endpoint) { + return true + } + + return false +} + +// SetEndpoint gets a reference to the given string and assigns it to the Endpoint field. +func (o *PatchedConnectionTokenRequest) SetEndpoint(v string) { + o.Endpoint = &v +} + +func (o PatchedConnectionTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedConnectionTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Endpoint) { + toSerialize["endpoint"] = o.Endpoint + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedConnectionTokenRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedConnectionTokenRequest := _PatchedConnectionTokenRequest{} + + err = json.Unmarshal(data, &varPatchedConnectionTokenRequest) + + if err != nil { + return err + } + + *o = PatchedConnectionTokenRequest(varPatchedConnectionTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "endpoint") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedConnectionTokenRequest struct { + value *PatchedConnectionTokenRequest + isSet bool +} + +func (v NullablePatchedConnectionTokenRequest) Get() *PatchedConnectionTokenRequest { + return v.value +} + +func (v *NullablePatchedConnectionTokenRequest) Set(val *PatchedConnectionTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedConnectionTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedConnectionTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedConnectionTokenRequest(val *PatchedConnectionTokenRequest) *NullablePatchedConnectionTokenRequest { + return &NullablePatchedConnectionTokenRequest{value: val, isSet: true} +} + +func (v NullablePatchedConnectionTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedConnectionTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_consent_stage_request.go b/packages/client-go/model_patched_consent_stage_request.go new file mode 100644 index 0000000000..c1d9b7f00c --- /dev/null +++ b/packages/client-go/model_patched_consent_stage_request.go @@ -0,0 +1,229 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedConsentStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedConsentStageRequest{} + +// PatchedConsentStageRequest ConsentStage Serializer +type PatchedConsentStageRequest struct { + Name *string `json:"name,omitempty"` + Mode *ConsentStageModeEnum `json:"mode,omitempty"` + // Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). + ConsentExpireIn *string `json:"consent_expire_in,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedConsentStageRequest PatchedConsentStageRequest + +// NewPatchedConsentStageRequest instantiates a new PatchedConsentStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedConsentStageRequest() *PatchedConsentStageRequest { + this := PatchedConsentStageRequest{} + return &this +} + +// NewPatchedConsentStageRequestWithDefaults instantiates a new PatchedConsentStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedConsentStageRequestWithDefaults() *PatchedConsentStageRequest { + this := PatchedConsentStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedConsentStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConsentStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedConsentStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedConsentStageRequest) SetName(v string) { + o.Name = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedConsentStageRequest) GetMode() ConsentStageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret ConsentStageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConsentStageRequest) GetModeOk() (*ConsentStageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedConsentStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ConsentStageModeEnum and assigns it to the Mode field. +func (o *PatchedConsentStageRequest) SetMode(v ConsentStageModeEnum) { + o.Mode = &v +} + +// GetConsentExpireIn returns the ConsentExpireIn field value if set, zero value otherwise. +func (o *PatchedConsentStageRequest) GetConsentExpireIn() string { + if o == nil || IsNil(o.ConsentExpireIn) { + var ret string + return ret + } + return *o.ConsentExpireIn +} + +// GetConsentExpireInOk returns a tuple with the ConsentExpireIn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedConsentStageRequest) GetConsentExpireInOk() (*string, bool) { + if o == nil || IsNil(o.ConsentExpireIn) { + return nil, false + } + return o.ConsentExpireIn, true +} + +// HasConsentExpireIn returns a boolean if a field has been set. +func (o *PatchedConsentStageRequest) HasConsentExpireIn() bool { + if o != nil && !IsNil(o.ConsentExpireIn) { + return true + } + + return false +} + +// SetConsentExpireIn gets a reference to the given string and assigns it to the ConsentExpireIn field. +func (o *PatchedConsentStageRequest) SetConsentExpireIn(v string) { + o.ConsentExpireIn = &v +} + +func (o PatchedConsentStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedConsentStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.ConsentExpireIn) { + toSerialize["consent_expire_in"] = o.ConsentExpireIn + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedConsentStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedConsentStageRequest := _PatchedConsentStageRequest{} + + err = json.Unmarshal(data, &varPatchedConsentStageRequest) + + if err != nil { + return err + } + + *o = PatchedConsentStageRequest(varPatchedConsentStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "consent_expire_in") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedConsentStageRequest struct { + value *PatchedConsentStageRequest + isSet bool +} + +func (v NullablePatchedConsentStageRequest) Get() *PatchedConsentStageRequest { + return v.value +} + +func (v *NullablePatchedConsentStageRequest) Set(val *PatchedConsentStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedConsentStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedConsentStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedConsentStageRequest(val *PatchedConsentStageRequest) *NullablePatchedConsentStageRequest { + return &NullablePatchedConsentStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedConsentStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedConsentStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_deny_stage_request.go b/packages/client-go/model_patched_deny_stage_request.go new file mode 100644 index 0000000000..a8acc5ef00 --- /dev/null +++ b/packages/client-go/model_patched_deny_stage_request.go @@ -0,0 +1,191 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDenyStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDenyStageRequest{} + +// PatchedDenyStageRequest DenyStage Serializer +type PatchedDenyStageRequest struct { + Name *string `json:"name,omitempty"` + DenyMessage *string `json:"deny_message,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDenyStageRequest PatchedDenyStageRequest + +// NewPatchedDenyStageRequest instantiates a new PatchedDenyStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDenyStageRequest() *PatchedDenyStageRequest { + this := PatchedDenyStageRequest{} + return &this +} + +// NewPatchedDenyStageRequestWithDefaults instantiates a new PatchedDenyStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDenyStageRequestWithDefaults() *PatchedDenyStageRequest { + this := PatchedDenyStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDenyStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDenyStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDenyStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDenyStageRequest) SetName(v string) { + o.Name = &v +} + +// GetDenyMessage returns the DenyMessage field value if set, zero value otherwise. +func (o *PatchedDenyStageRequest) GetDenyMessage() string { + if o == nil || IsNil(o.DenyMessage) { + var ret string + return ret + } + return *o.DenyMessage +} + +// GetDenyMessageOk returns a tuple with the DenyMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDenyStageRequest) GetDenyMessageOk() (*string, bool) { + if o == nil || IsNil(o.DenyMessage) { + return nil, false + } + return o.DenyMessage, true +} + +// HasDenyMessage returns a boolean if a field has been set. +func (o *PatchedDenyStageRequest) HasDenyMessage() bool { + if o != nil && !IsNil(o.DenyMessage) { + return true + } + + return false +} + +// SetDenyMessage gets a reference to the given string and assigns it to the DenyMessage field. +func (o *PatchedDenyStageRequest) SetDenyMessage(v string) { + o.DenyMessage = &v +} + +func (o PatchedDenyStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDenyStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.DenyMessage) { + toSerialize["deny_message"] = o.DenyMessage + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDenyStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDenyStageRequest := _PatchedDenyStageRequest{} + + err = json.Unmarshal(data, &varPatchedDenyStageRequest) + + if err != nil { + return err + } + + *o = PatchedDenyStageRequest(varPatchedDenyStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "deny_message") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDenyStageRequest struct { + value *PatchedDenyStageRequest + isSet bool +} + +func (v NullablePatchedDenyStageRequest) Get() *PatchedDenyStageRequest { + return v.value +} + +func (v *NullablePatchedDenyStageRequest) Set(val *PatchedDenyStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDenyStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDenyStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDenyStageRequest(val *PatchedDenyStageRequest) *NullablePatchedDenyStageRequest { + return &NullablePatchedDenyStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedDenyStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDenyStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_device_access_group_request.go b/packages/client-go/model_patched_device_access_group_request.go new file mode 100644 index 0000000000..f8c6dc8043 --- /dev/null +++ b/packages/client-go/model_patched_device_access_group_request.go @@ -0,0 +1,191 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDeviceAccessGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDeviceAccessGroupRequest{} + +// PatchedDeviceAccessGroupRequest struct for PatchedDeviceAccessGroupRequest +type PatchedDeviceAccessGroupRequest struct { + Name *string `json:"name,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDeviceAccessGroupRequest PatchedDeviceAccessGroupRequest + +// NewPatchedDeviceAccessGroupRequest instantiates a new PatchedDeviceAccessGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDeviceAccessGroupRequest() *PatchedDeviceAccessGroupRequest { + this := PatchedDeviceAccessGroupRequest{} + return &this +} + +// NewPatchedDeviceAccessGroupRequestWithDefaults instantiates a new PatchedDeviceAccessGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDeviceAccessGroupRequestWithDefaults() *PatchedDeviceAccessGroupRequest { + this := PatchedDeviceAccessGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDeviceAccessGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceAccessGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDeviceAccessGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDeviceAccessGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedDeviceAccessGroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceAccessGroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedDeviceAccessGroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedDeviceAccessGroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedDeviceAccessGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDeviceAccessGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDeviceAccessGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDeviceAccessGroupRequest := _PatchedDeviceAccessGroupRequest{} + + err = json.Unmarshal(data, &varPatchedDeviceAccessGroupRequest) + + if err != nil { + return err + } + + *o = PatchedDeviceAccessGroupRequest(varPatchedDeviceAccessGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDeviceAccessGroupRequest struct { + value *PatchedDeviceAccessGroupRequest + isSet bool +} + +func (v NullablePatchedDeviceAccessGroupRequest) Get() *PatchedDeviceAccessGroupRequest { + return v.value +} + +func (v *NullablePatchedDeviceAccessGroupRequest) Set(val *PatchedDeviceAccessGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDeviceAccessGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDeviceAccessGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDeviceAccessGroupRequest(val *PatchedDeviceAccessGroupRequest) *NullablePatchedDeviceAccessGroupRequest { + return &NullablePatchedDeviceAccessGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedDeviceAccessGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDeviceAccessGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_device_user_binding_request.go b/packages/client-go/model_patched_device_user_binding_request.go new file mode 100644 index 0000000000..8811fc23d5 --- /dev/null +++ b/packages/client-go/model_patched_device_user_binding_request.go @@ -0,0 +1,523 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDeviceUserBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDeviceUserBindingRequest{} + +// PatchedDeviceUserBindingRequest PolicyBinding Serializer +type PatchedDeviceUserBindingRequest struct { + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Target *string `json:"target,omitempty"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order *int32 `json:"order,omitempty"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + IsPrimary *bool `json:"is_primary,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDeviceUserBindingRequest PatchedDeviceUserBindingRequest + +// NewPatchedDeviceUserBindingRequest instantiates a new PatchedDeviceUserBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDeviceUserBindingRequest() *PatchedDeviceUserBindingRequest { + this := PatchedDeviceUserBindingRequest{} + return &this +} + +// NewPatchedDeviceUserBindingRequestWithDefaults instantiates a new PatchedDeviceUserBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDeviceUserBindingRequestWithDefaults() *PatchedDeviceUserBindingRequest { + this := PatchedDeviceUserBindingRequest{} + return &this +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDeviceUserBindingRequest) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDeviceUserBindingRequest) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *PatchedDeviceUserBindingRequest) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *PatchedDeviceUserBindingRequest) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *PatchedDeviceUserBindingRequest) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDeviceUserBindingRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDeviceUserBindingRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *PatchedDeviceUserBindingRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedDeviceUserBindingRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedDeviceUserBindingRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDeviceUserBindingRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDeviceUserBindingRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PatchedDeviceUserBindingRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PatchedDeviceUserBindingRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PatchedDeviceUserBindingRequest) UnsetUser() { + o.User.Unset() +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetTarget() string { + if o == nil || IsNil(o.Target) { + var ret string + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetTargetOk() (*string, bool) { + if o == nil || IsNil(o.Target) { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasTarget() bool { + if o != nil && !IsNil(o.Target) { + return true + } + + return false +} + +// SetTarget gets a reference to the given string and assigns it to the Target field. +func (o *PatchedDeviceUserBindingRequest) SetTarget(v string) { + o.Target = &v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *PatchedDeviceUserBindingRequest) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedDeviceUserBindingRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *PatchedDeviceUserBindingRequest) SetOrder(v int32) { + o.Order = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PatchedDeviceUserBindingRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *PatchedDeviceUserBindingRequest) SetFailureResult(v bool) { + o.FailureResult = &v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *PatchedDeviceUserBindingRequest) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDeviceUserBindingRequest) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *PatchedDeviceUserBindingRequest) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *PatchedDeviceUserBindingRequest) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +func (o PatchedDeviceUserBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDeviceUserBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Target) { + toSerialize["target"] = o.Target + } + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDeviceUserBindingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDeviceUserBindingRequest := _PatchedDeviceUserBindingRequest{} + + err = json.Unmarshal(data, &varPatchedDeviceUserBindingRequest) + + if err != nil { + return err + } + + *o = PatchedDeviceUserBindingRequest(varPatchedDeviceUserBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + delete(additionalProperties, "is_primary") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDeviceUserBindingRequest struct { + value *PatchedDeviceUserBindingRequest + isSet bool +} + +func (v NullablePatchedDeviceUserBindingRequest) Get() *PatchedDeviceUserBindingRequest { + return v.value +} + +func (v *NullablePatchedDeviceUserBindingRequest) Set(val *PatchedDeviceUserBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDeviceUserBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDeviceUserBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDeviceUserBindingRequest(val *PatchedDeviceUserBindingRequest) *NullablePatchedDeviceUserBindingRequest { + return &NullablePatchedDeviceUserBindingRequest{value: val, isSet: true} +} + +func (v NullablePatchedDeviceUserBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDeviceUserBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_docker_service_connection_request.go b/packages/client-go/model_patched_docker_service_connection_request.go new file mode 100644 index 0000000000..c80b4fd6a7 --- /dev/null +++ b/packages/client-go/model_patched_docker_service_connection_request.go @@ -0,0 +1,328 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDockerServiceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDockerServiceConnectionRequest{} + +// PatchedDockerServiceConnectionRequest DockerServiceConnection Serializer +type PatchedDockerServiceConnectionRequest struct { + Name *string `json:"name,omitempty"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + // Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. + Url *string `json:"url,omitempty"` + // CA which the endpoint's Certificate is verified against. Can be left empty for no validation. + TlsVerification NullableString `json:"tls_verification,omitempty"` + // Certificate/Key used for authentication. Can be left empty for no authentication. + TlsAuthentication NullableString `json:"tls_authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDockerServiceConnectionRequest PatchedDockerServiceConnectionRequest + +// NewPatchedDockerServiceConnectionRequest instantiates a new PatchedDockerServiceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDockerServiceConnectionRequest() *PatchedDockerServiceConnectionRequest { + this := PatchedDockerServiceConnectionRequest{} + return &this +} + +// NewPatchedDockerServiceConnectionRequestWithDefaults instantiates a new PatchedDockerServiceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDockerServiceConnectionRequestWithDefaults() *PatchedDockerServiceConnectionRequest { + this := PatchedDockerServiceConnectionRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDockerServiceConnectionRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDockerServiceConnectionRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDockerServiceConnectionRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDockerServiceConnectionRequest) SetName(v string) { + o.Name = &v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *PatchedDockerServiceConnectionRequest) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDockerServiceConnectionRequest) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *PatchedDockerServiceConnectionRequest) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *PatchedDockerServiceConnectionRequest) SetLocal(v bool) { + o.Local = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *PatchedDockerServiceConnectionRequest) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDockerServiceConnectionRequest) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *PatchedDockerServiceConnectionRequest) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *PatchedDockerServiceConnectionRequest) SetUrl(v string) { + o.Url = &v +} + +// GetTlsVerification returns the TlsVerification field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDockerServiceConnectionRequest) GetTlsVerification() string { + if o == nil || IsNil(o.TlsVerification.Get()) { + var ret string + return ret + } + return *o.TlsVerification.Get() +} + +// GetTlsVerificationOk returns a tuple with the TlsVerification field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDockerServiceConnectionRequest) GetTlsVerificationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsVerification.Get(), o.TlsVerification.IsSet() +} + +// HasTlsVerification returns a boolean if a field has been set. +func (o *PatchedDockerServiceConnectionRequest) HasTlsVerification() bool { + if o != nil && o.TlsVerification.IsSet() { + return true + } + + return false +} + +// SetTlsVerification gets a reference to the given NullableString and assigns it to the TlsVerification field. +func (o *PatchedDockerServiceConnectionRequest) SetTlsVerification(v string) { + o.TlsVerification.Set(&v) +} + +// SetTlsVerificationNil sets the value for TlsVerification to be an explicit nil +func (o *PatchedDockerServiceConnectionRequest) SetTlsVerificationNil() { + o.TlsVerification.Set(nil) +} + +// UnsetTlsVerification ensures that no value is present for TlsVerification, not even an explicit nil +func (o *PatchedDockerServiceConnectionRequest) UnsetTlsVerification() { + o.TlsVerification.Unset() +} + +// GetTlsAuthentication returns the TlsAuthentication field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedDockerServiceConnectionRequest) GetTlsAuthentication() string { + if o == nil || IsNil(o.TlsAuthentication.Get()) { + var ret string + return ret + } + return *o.TlsAuthentication.Get() +} + +// GetTlsAuthenticationOk returns a tuple with the TlsAuthentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedDockerServiceConnectionRequest) GetTlsAuthenticationOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TlsAuthentication.Get(), o.TlsAuthentication.IsSet() +} + +// HasTlsAuthentication returns a boolean if a field has been set. +func (o *PatchedDockerServiceConnectionRequest) HasTlsAuthentication() bool { + if o != nil && o.TlsAuthentication.IsSet() { + return true + } + + return false +} + +// SetTlsAuthentication gets a reference to the given NullableString and assigns it to the TlsAuthentication field. +func (o *PatchedDockerServiceConnectionRequest) SetTlsAuthentication(v string) { + o.TlsAuthentication.Set(&v) +} + +// SetTlsAuthenticationNil sets the value for TlsAuthentication to be an explicit nil +func (o *PatchedDockerServiceConnectionRequest) SetTlsAuthenticationNil() { + o.TlsAuthentication.Set(nil) +} + +// UnsetTlsAuthentication ensures that no value is present for TlsAuthentication, not even an explicit nil +func (o *PatchedDockerServiceConnectionRequest) UnsetTlsAuthentication() { + o.TlsAuthentication.Unset() +} + +func (o PatchedDockerServiceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDockerServiceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if o.TlsVerification.IsSet() { + toSerialize["tls_verification"] = o.TlsVerification.Get() + } + if o.TlsAuthentication.IsSet() { + toSerialize["tls_authentication"] = o.TlsAuthentication.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDockerServiceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDockerServiceConnectionRequest := _PatchedDockerServiceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedDockerServiceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedDockerServiceConnectionRequest(varPatchedDockerServiceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "url") + delete(additionalProperties, "tls_verification") + delete(additionalProperties, "tls_authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDockerServiceConnectionRequest struct { + value *PatchedDockerServiceConnectionRequest + isSet bool +} + +func (v NullablePatchedDockerServiceConnectionRequest) Get() *PatchedDockerServiceConnectionRequest { + return v.value +} + +func (v *NullablePatchedDockerServiceConnectionRequest) Set(val *PatchedDockerServiceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDockerServiceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDockerServiceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDockerServiceConnectionRequest(val *PatchedDockerServiceConnectionRequest) *NullablePatchedDockerServiceConnectionRequest { + return &NullablePatchedDockerServiceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedDockerServiceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDockerServiceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_domain_request.go b/packages/client-go/model_patched_domain_request.go new file mode 100644 index 0000000000..55b9845a21 --- /dev/null +++ b/packages/client-go/model_patched_domain_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDomainRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDomainRequest{} + +// PatchedDomainRequest Domain Serializer +type PatchedDomainRequest struct { + Domain *string `json:"domain,omitempty"` + IsPrimary *bool `json:"is_primary,omitempty"` + Tenant *string `json:"tenant,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDomainRequest PatchedDomainRequest + +// NewPatchedDomainRequest instantiates a new PatchedDomainRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDomainRequest() *PatchedDomainRequest { + this := PatchedDomainRequest{} + return &this +} + +// NewPatchedDomainRequestWithDefaults instantiates a new PatchedDomainRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDomainRequestWithDefaults() *PatchedDomainRequest { + this := PatchedDomainRequest{} + return &this +} + +// GetDomain returns the Domain field value if set, zero value otherwise. +func (o *PatchedDomainRequest) GetDomain() string { + if o == nil || IsNil(o.Domain) { + var ret string + return ret + } + return *o.Domain +} + +// GetDomainOk returns a tuple with the Domain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDomainRequest) GetDomainOk() (*string, bool) { + if o == nil || IsNil(o.Domain) { + return nil, false + } + return o.Domain, true +} + +// HasDomain returns a boolean if a field has been set. +func (o *PatchedDomainRequest) HasDomain() bool { + if o != nil && !IsNil(o.Domain) { + return true + } + + return false +} + +// SetDomain gets a reference to the given string and assigns it to the Domain field. +func (o *PatchedDomainRequest) SetDomain(v string) { + o.Domain = &v +} + +// GetIsPrimary returns the IsPrimary field value if set, zero value otherwise. +func (o *PatchedDomainRequest) GetIsPrimary() bool { + if o == nil || IsNil(o.IsPrimary) { + var ret bool + return ret + } + return *o.IsPrimary +} + +// GetIsPrimaryOk returns a tuple with the IsPrimary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDomainRequest) GetIsPrimaryOk() (*bool, bool) { + if o == nil || IsNil(o.IsPrimary) { + return nil, false + } + return o.IsPrimary, true +} + +// HasIsPrimary returns a boolean if a field has been set. +func (o *PatchedDomainRequest) HasIsPrimary() bool { + if o != nil && !IsNil(o.IsPrimary) { + return true + } + + return false +} + +// SetIsPrimary gets a reference to the given bool and assigns it to the IsPrimary field. +func (o *PatchedDomainRequest) SetIsPrimary(v bool) { + o.IsPrimary = &v +} + +// GetTenant returns the Tenant field value if set, zero value otherwise. +func (o *PatchedDomainRequest) GetTenant() string { + if o == nil || IsNil(o.Tenant) { + var ret string + return ret + } + return *o.Tenant +} + +// GetTenantOk returns a tuple with the Tenant field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDomainRequest) GetTenantOk() (*string, bool) { + if o == nil || IsNil(o.Tenant) { + return nil, false + } + return o.Tenant, true +} + +// HasTenant returns a boolean if a field has been set. +func (o *PatchedDomainRequest) HasTenant() bool { + if o != nil && !IsNil(o.Tenant) { + return true + } + + return false +} + +// SetTenant gets a reference to the given string and assigns it to the Tenant field. +func (o *PatchedDomainRequest) SetTenant(v string) { + o.Tenant = &v +} + +func (o PatchedDomainRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDomainRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Domain) { + toSerialize["domain"] = o.Domain + } + if !IsNil(o.IsPrimary) { + toSerialize["is_primary"] = o.IsPrimary + } + if !IsNil(o.Tenant) { + toSerialize["tenant"] = o.Tenant + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDomainRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDomainRequest := _PatchedDomainRequest{} + + err = json.Unmarshal(data, &varPatchedDomainRequest) + + if err != nil { + return err + } + + *o = PatchedDomainRequest(varPatchedDomainRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "domain") + delete(additionalProperties, "is_primary") + delete(additionalProperties, "tenant") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDomainRequest struct { + value *PatchedDomainRequest + isSet bool +} + +func (v NullablePatchedDomainRequest) Get() *PatchedDomainRequest { + return v.value +} + +func (v *NullablePatchedDomainRequest) Set(val *PatchedDomainRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDomainRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDomainRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDomainRequest(val *PatchedDomainRequest) *NullablePatchedDomainRequest { + return &NullablePatchedDomainRequest{value: val, isSet: true} +} + +func (v NullablePatchedDomainRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDomainRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_dummy_policy_request.go b/packages/client-go/model_patched_dummy_policy_request.go new file mode 100644 index 0000000000..a7221d9d9a --- /dev/null +++ b/packages/client-go/model_patched_dummy_policy_request.go @@ -0,0 +1,303 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDummyPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDummyPolicyRequest{} + +// PatchedDummyPolicyRequest Dummy Policy Serializer +type PatchedDummyPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Result *bool `json:"result,omitempty"` + WaitMin *int32 `json:"wait_min,omitempty"` + WaitMax *int32 `json:"wait_max,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDummyPolicyRequest PatchedDummyPolicyRequest + +// NewPatchedDummyPolicyRequest instantiates a new PatchedDummyPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDummyPolicyRequest() *PatchedDummyPolicyRequest { + this := PatchedDummyPolicyRequest{} + return &this +} + +// NewPatchedDummyPolicyRequestWithDefaults instantiates a new PatchedDummyPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDummyPolicyRequestWithDefaults() *PatchedDummyPolicyRequest { + this := PatchedDummyPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDummyPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDummyPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDummyPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedDummyPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedDummyPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedDummyPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *PatchedDummyPolicyRequest) GetResult() bool { + if o == nil || IsNil(o.Result) { + var ret bool + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyPolicyRequest) GetResultOk() (*bool, bool) { + if o == nil || IsNil(o.Result) { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *PatchedDummyPolicyRequest) HasResult() bool { + if o != nil && !IsNil(o.Result) { + return true + } + + return false +} + +// SetResult gets a reference to the given bool and assigns it to the Result field. +func (o *PatchedDummyPolicyRequest) SetResult(v bool) { + o.Result = &v +} + +// GetWaitMin returns the WaitMin field value if set, zero value otherwise. +func (o *PatchedDummyPolicyRequest) GetWaitMin() int32 { + if o == nil || IsNil(o.WaitMin) { + var ret int32 + return ret + } + return *o.WaitMin +} + +// GetWaitMinOk returns a tuple with the WaitMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyPolicyRequest) GetWaitMinOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMin) { + return nil, false + } + return o.WaitMin, true +} + +// HasWaitMin returns a boolean if a field has been set. +func (o *PatchedDummyPolicyRequest) HasWaitMin() bool { + if o != nil && !IsNil(o.WaitMin) { + return true + } + + return false +} + +// SetWaitMin gets a reference to the given int32 and assigns it to the WaitMin field. +func (o *PatchedDummyPolicyRequest) SetWaitMin(v int32) { + o.WaitMin = &v +} + +// GetWaitMax returns the WaitMax field value if set, zero value otherwise. +func (o *PatchedDummyPolicyRequest) GetWaitMax() int32 { + if o == nil || IsNil(o.WaitMax) { + var ret int32 + return ret + } + return *o.WaitMax +} + +// GetWaitMaxOk returns a tuple with the WaitMax field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyPolicyRequest) GetWaitMaxOk() (*int32, bool) { + if o == nil || IsNil(o.WaitMax) { + return nil, false + } + return o.WaitMax, true +} + +// HasWaitMax returns a boolean if a field has been set. +func (o *PatchedDummyPolicyRequest) HasWaitMax() bool { + if o != nil && !IsNil(o.WaitMax) { + return true + } + + return false +} + +// SetWaitMax gets a reference to the given int32 and assigns it to the WaitMax field. +func (o *PatchedDummyPolicyRequest) SetWaitMax(v int32) { + o.WaitMax = &v +} + +func (o PatchedDummyPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDummyPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Result) { + toSerialize["result"] = o.Result + } + if !IsNil(o.WaitMin) { + toSerialize["wait_min"] = o.WaitMin + } + if !IsNil(o.WaitMax) { + toSerialize["wait_max"] = o.WaitMax + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDummyPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDummyPolicyRequest := _PatchedDummyPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedDummyPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedDummyPolicyRequest(varPatchedDummyPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "result") + delete(additionalProperties, "wait_min") + delete(additionalProperties, "wait_max") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDummyPolicyRequest struct { + value *PatchedDummyPolicyRequest + isSet bool +} + +func (v NullablePatchedDummyPolicyRequest) Get() *PatchedDummyPolicyRequest { + return v.value +} + +func (v *NullablePatchedDummyPolicyRequest) Set(val *PatchedDummyPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDummyPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDummyPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDummyPolicyRequest(val *PatchedDummyPolicyRequest) *NullablePatchedDummyPolicyRequest { + return &NullablePatchedDummyPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedDummyPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDummyPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_dummy_stage_request.go b/packages/client-go/model_patched_dummy_stage_request.go new file mode 100644 index 0000000000..4c64483685 --- /dev/null +++ b/packages/client-go/model_patched_dummy_stage_request.go @@ -0,0 +1,191 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDummyStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDummyStageRequest{} + +// PatchedDummyStageRequest DummyStage Serializer +type PatchedDummyStageRequest struct { + Name *string `json:"name,omitempty"` + ThrowError *bool `json:"throw_error,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDummyStageRequest PatchedDummyStageRequest + +// NewPatchedDummyStageRequest instantiates a new PatchedDummyStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDummyStageRequest() *PatchedDummyStageRequest { + this := PatchedDummyStageRequest{} + return &this +} + +// NewPatchedDummyStageRequestWithDefaults instantiates a new PatchedDummyStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDummyStageRequestWithDefaults() *PatchedDummyStageRequest { + this := PatchedDummyStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDummyStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDummyStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDummyStageRequest) SetName(v string) { + o.Name = &v +} + +// GetThrowError returns the ThrowError field value if set, zero value otherwise. +func (o *PatchedDummyStageRequest) GetThrowError() bool { + if o == nil || IsNil(o.ThrowError) { + var ret bool + return ret + } + return *o.ThrowError +} + +// GetThrowErrorOk returns a tuple with the ThrowError field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDummyStageRequest) GetThrowErrorOk() (*bool, bool) { + if o == nil || IsNil(o.ThrowError) { + return nil, false + } + return o.ThrowError, true +} + +// HasThrowError returns a boolean if a field has been set. +func (o *PatchedDummyStageRequest) HasThrowError() bool { + if o != nil && !IsNil(o.ThrowError) { + return true + } + + return false +} + +// SetThrowError gets a reference to the given bool and assigns it to the ThrowError field. +func (o *PatchedDummyStageRequest) SetThrowError(v bool) { + o.ThrowError = &v +} + +func (o PatchedDummyStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDummyStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ThrowError) { + toSerialize["throw_error"] = o.ThrowError + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDummyStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDummyStageRequest := _PatchedDummyStageRequest{} + + err = json.Unmarshal(data, &varPatchedDummyStageRequest) + + if err != nil { + return err + } + + *o = PatchedDummyStageRequest(varPatchedDummyStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "throw_error") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDummyStageRequest struct { + value *PatchedDummyStageRequest + isSet bool +} + +func (v NullablePatchedDummyStageRequest) Get() *PatchedDummyStageRequest { + return v.value +} + +func (v *NullablePatchedDummyStageRequest) Set(val *PatchedDummyStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDummyStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDummyStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDummyStageRequest(val *PatchedDummyStageRequest) *NullablePatchedDummyStageRequest { + return &NullablePatchedDummyStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedDummyStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDummyStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_duo_device_request.go b/packages/client-go/model_patched_duo_device_request.go new file mode 100644 index 0000000000..b1186d802e --- /dev/null +++ b/packages/client-go/model_patched_duo_device_request.go @@ -0,0 +1,155 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedDuoDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedDuoDeviceRequest{} + +// PatchedDuoDeviceRequest Serializer for Duo authenticator devices +type PatchedDuoDeviceRequest struct { + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedDuoDeviceRequest PatchedDuoDeviceRequest + +// NewPatchedDuoDeviceRequest instantiates a new PatchedDuoDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedDuoDeviceRequest() *PatchedDuoDeviceRequest { + this := PatchedDuoDeviceRequest{} + return &this +} + +// NewPatchedDuoDeviceRequestWithDefaults instantiates a new PatchedDuoDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedDuoDeviceRequestWithDefaults() *PatchedDuoDeviceRequest { + this := PatchedDuoDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedDuoDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedDuoDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedDuoDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedDuoDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedDuoDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedDuoDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedDuoDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedDuoDeviceRequest := _PatchedDuoDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedDuoDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedDuoDeviceRequest(varPatchedDuoDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedDuoDeviceRequest struct { + value *PatchedDuoDeviceRequest + isSet bool +} + +func (v NullablePatchedDuoDeviceRequest) Get() *PatchedDuoDeviceRequest { + return v.value +} + +func (v *NullablePatchedDuoDeviceRequest) Set(val *PatchedDuoDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedDuoDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedDuoDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedDuoDeviceRequest(val *PatchedDuoDeviceRequest) *NullablePatchedDuoDeviceRequest { + return &NullablePatchedDuoDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedDuoDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedDuoDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_email_device_request.go b/packages/client-go/model_patched_email_device_request.go new file mode 100644 index 0000000000..89d04800f5 --- /dev/null +++ b/packages/client-go/model_patched_email_device_request.go @@ -0,0 +1,155 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedEmailDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEmailDeviceRequest{} + +// PatchedEmailDeviceRequest Serializer for email authenticator devices +type PatchedEmailDeviceRequest struct { + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEmailDeviceRequest PatchedEmailDeviceRequest + +// NewPatchedEmailDeviceRequest instantiates a new PatchedEmailDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEmailDeviceRequest() *PatchedEmailDeviceRequest { + this := PatchedEmailDeviceRequest{} + return &this +} + +// NewPatchedEmailDeviceRequestWithDefaults instantiates a new PatchedEmailDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEmailDeviceRequestWithDefaults() *PatchedEmailDeviceRequest { + this := PatchedEmailDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEmailDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEmailDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEmailDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedEmailDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEmailDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEmailDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEmailDeviceRequest := _PatchedEmailDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedEmailDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedEmailDeviceRequest(varPatchedEmailDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEmailDeviceRequest struct { + value *PatchedEmailDeviceRequest + isSet bool +} + +func (v NullablePatchedEmailDeviceRequest) Get() *PatchedEmailDeviceRequest { + return v.value +} + +func (v *NullablePatchedEmailDeviceRequest) Set(val *PatchedEmailDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEmailDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEmailDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEmailDeviceRequest(val *PatchedEmailDeviceRequest) *NullablePatchedEmailDeviceRequest { + return &NullablePatchedEmailDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedEmailDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEmailDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_email_stage_request.go b/packages/client-go/model_patched_email_stage_request.go new file mode 100644 index 0000000000..fce2c0fc12 --- /dev/null +++ b/packages/client-go/model_patched_email_stage_request.go @@ -0,0 +1,713 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedEmailStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEmailStageRequest{} + +// PatchedEmailStageRequest EmailStage Serializer +type PatchedEmailStageRequest struct { + Name *string `json:"name,omitempty"` + // When enabled, global Email connection settings will be used and connection settings below will be ignored. + UseGlobalSettings *bool `json:"use_global_settings,omitempty"` + Host *string `json:"host,omitempty"` + Port *int32 `json:"port,omitempty"` + Username *string `json:"username,omitempty"` + Password *string `json:"password,omitempty"` + UseTls *bool `json:"use_tls,omitempty"` + UseSsl *bool `json:"use_ssl,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + FromAddress *string `json:"from_address,omitempty"` + // Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). + TokenExpiry *string `json:"token_expiry,omitempty"` + Subject *string `json:"subject,omitempty"` + Template *string `json:"template,omitempty"` + // Activate users upon completion of stage. + ActivateUserOnSuccess *bool `json:"activate_user_on_success,omitempty"` + RecoveryMaxAttempts *int32 `json:"recovery_max_attempts,omitempty"` + // The time window used to count recent account recovery attempts. If the number of attempts exceed recovery_max_attempts within this period, further attempts will be rate-limited. (Format: hours=1;minutes=2;seconds=3). + RecoveryCacheTimeout *string `json:"recovery_cache_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEmailStageRequest PatchedEmailStageRequest + +// NewPatchedEmailStageRequest instantiates a new PatchedEmailStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEmailStageRequest() *PatchedEmailStageRequest { + this := PatchedEmailStageRequest{} + return &this +} + +// NewPatchedEmailStageRequestWithDefaults instantiates a new PatchedEmailStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEmailStageRequestWithDefaults() *PatchedEmailStageRequest { + this := PatchedEmailStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEmailStageRequest) SetName(v string) { + o.Name = &v +} + +// GetUseGlobalSettings returns the UseGlobalSettings field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetUseGlobalSettings() bool { + if o == nil || IsNil(o.UseGlobalSettings) { + var ret bool + return ret + } + return *o.UseGlobalSettings +} + +// GetUseGlobalSettingsOk returns a tuple with the UseGlobalSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetUseGlobalSettingsOk() (*bool, bool) { + if o == nil || IsNil(o.UseGlobalSettings) { + return nil, false + } + return o.UseGlobalSettings, true +} + +// HasUseGlobalSettings returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasUseGlobalSettings() bool { + if o != nil && !IsNil(o.UseGlobalSettings) { + return true + } + + return false +} + +// SetUseGlobalSettings gets a reference to the given bool and assigns it to the UseGlobalSettings field. +func (o *PatchedEmailStageRequest) SetUseGlobalSettings(v bool) { + o.UseGlobalSettings = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *PatchedEmailStageRequest) SetHost(v string) { + o.Host = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetPort() int32 { + if o == nil || IsNil(o.Port) { + var ret int32 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetPortOk() (*int32, bool) { + if o == nil || IsNil(o.Port) { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasPort() bool { + if o != nil && !IsNil(o.Port) { + return true + } + + return false +} + +// SetPort gets a reference to the given int32 and assigns it to the Port field. +func (o *PatchedEmailStageRequest) SetPort(v int32) { + o.Port = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *PatchedEmailStageRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPassword returns the Password field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetPassword() string { + if o == nil || IsNil(o.Password) { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetPasswordOk() (*string, bool) { + if o == nil || IsNil(o.Password) { + return nil, false + } + return o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasPassword() bool { + if o != nil && !IsNil(o.Password) { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *PatchedEmailStageRequest) SetPassword(v string) { + o.Password = &v +} + +// GetUseTls returns the UseTls field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetUseTls() bool { + if o == nil || IsNil(o.UseTls) { + var ret bool + return ret + } + return *o.UseTls +} + +// GetUseTlsOk returns a tuple with the UseTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetUseTlsOk() (*bool, bool) { + if o == nil || IsNil(o.UseTls) { + return nil, false + } + return o.UseTls, true +} + +// HasUseTls returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasUseTls() bool { + if o != nil && !IsNil(o.UseTls) { + return true + } + + return false +} + +// SetUseTls gets a reference to the given bool and assigns it to the UseTls field. +func (o *PatchedEmailStageRequest) SetUseTls(v bool) { + o.UseTls = &v +} + +// GetUseSsl returns the UseSsl field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetUseSsl() bool { + if o == nil || IsNil(o.UseSsl) { + var ret bool + return ret + } + return *o.UseSsl +} + +// GetUseSslOk returns a tuple with the UseSsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetUseSslOk() (*bool, bool) { + if o == nil || IsNil(o.UseSsl) { + return nil, false + } + return o.UseSsl, true +} + +// HasUseSsl returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasUseSsl() bool { + if o != nil && !IsNil(o.UseSsl) { + return true + } + + return false +} + +// SetUseSsl gets a reference to the given bool and assigns it to the UseSsl field. +func (o *PatchedEmailStageRequest) SetUseSsl(v bool) { + o.UseSsl = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PatchedEmailStageRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFromAddress returns the FromAddress field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetFromAddress() string { + if o == nil || IsNil(o.FromAddress) { + var ret string + return ret + } + return *o.FromAddress +} + +// GetFromAddressOk returns a tuple with the FromAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetFromAddressOk() (*string, bool) { + if o == nil || IsNil(o.FromAddress) { + return nil, false + } + return o.FromAddress, true +} + +// HasFromAddress returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasFromAddress() bool { + if o != nil && !IsNil(o.FromAddress) { + return true + } + + return false +} + +// SetFromAddress gets a reference to the given string and assigns it to the FromAddress field. +func (o *PatchedEmailStageRequest) SetFromAddress(v string) { + o.FromAddress = &v +} + +// GetTokenExpiry returns the TokenExpiry field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetTokenExpiry() string { + if o == nil || IsNil(o.TokenExpiry) { + var ret string + return ret + } + return *o.TokenExpiry +} + +// GetTokenExpiryOk returns a tuple with the TokenExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetTokenExpiryOk() (*string, bool) { + if o == nil || IsNil(o.TokenExpiry) { + return nil, false + } + return o.TokenExpiry, true +} + +// HasTokenExpiry returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasTokenExpiry() bool { + if o != nil && !IsNil(o.TokenExpiry) { + return true + } + + return false +} + +// SetTokenExpiry gets a reference to the given string and assigns it to the TokenExpiry field. +func (o *PatchedEmailStageRequest) SetTokenExpiry(v string) { + o.TokenExpiry = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetSubject() string { + if o == nil || IsNil(o.Subject) { + var ret string + return ret + } + return *o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetSubjectOk() (*string, bool) { + if o == nil || IsNil(o.Subject) { + return nil, false + } + return o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasSubject() bool { + if o != nil && !IsNil(o.Subject) { + return true + } + + return false +} + +// SetSubject gets a reference to the given string and assigns it to the Subject field. +func (o *PatchedEmailStageRequest) SetSubject(v string) { + o.Subject = &v +} + +// GetTemplate returns the Template field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetTemplate() string { + if o == nil || IsNil(o.Template) { + var ret string + return ret + } + return *o.Template +} + +// GetTemplateOk returns a tuple with the Template field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetTemplateOk() (*string, bool) { + if o == nil || IsNil(o.Template) { + return nil, false + } + return o.Template, true +} + +// HasTemplate returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasTemplate() bool { + if o != nil && !IsNil(o.Template) { + return true + } + + return false +} + +// SetTemplate gets a reference to the given string and assigns it to the Template field. +func (o *PatchedEmailStageRequest) SetTemplate(v string) { + o.Template = &v +} + +// GetActivateUserOnSuccess returns the ActivateUserOnSuccess field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetActivateUserOnSuccess() bool { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + var ret bool + return ret + } + return *o.ActivateUserOnSuccess +} + +// GetActivateUserOnSuccessOk returns a tuple with the ActivateUserOnSuccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetActivateUserOnSuccessOk() (*bool, bool) { + if o == nil || IsNil(o.ActivateUserOnSuccess) { + return nil, false + } + return o.ActivateUserOnSuccess, true +} + +// HasActivateUserOnSuccess returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasActivateUserOnSuccess() bool { + if o != nil && !IsNil(o.ActivateUserOnSuccess) { + return true + } + + return false +} + +// SetActivateUserOnSuccess gets a reference to the given bool and assigns it to the ActivateUserOnSuccess field. +func (o *PatchedEmailStageRequest) SetActivateUserOnSuccess(v bool) { + o.ActivateUserOnSuccess = &v +} + +// GetRecoveryMaxAttempts returns the RecoveryMaxAttempts field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetRecoveryMaxAttempts() int32 { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + var ret int32 + return ret + } + return *o.RecoveryMaxAttempts +} + +// GetRecoveryMaxAttemptsOk returns a tuple with the RecoveryMaxAttempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetRecoveryMaxAttemptsOk() (*int32, bool) { + if o == nil || IsNil(o.RecoveryMaxAttempts) { + return nil, false + } + return o.RecoveryMaxAttempts, true +} + +// HasRecoveryMaxAttempts returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasRecoveryMaxAttempts() bool { + if o != nil && !IsNil(o.RecoveryMaxAttempts) { + return true + } + + return false +} + +// SetRecoveryMaxAttempts gets a reference to the given int32 and assigns it to the RecoveryMaxAttempts field. +func (o *PatchedEmailStageRequest) SetRecoveryMaxAttempts(v int32) { + o.RecoveryMaxAttempts = &v +} + +// GetRecoveryCacheTimeout returns the RecoveryCacheTimeout field value if set, zero value otherwise. +func (o *PatchedEmailStageRequest) GetRecoveryCacheTimeout() string { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + var ret string + return ret + } + return *o.RecoveryCacheTimeout +} + +// GetRecoveryCacheTimeoutOk returns a tuple with the RecoveryCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEmailStageRequest) GetRecoveryCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.RecoveryCacheTimeout) { + return nil, false + } + return o.RecoveryCacheTimeout, true +} + +// HasRecoveryCacheTimeout returns a boolean if a field has been set. +func (o *PatchedEmailStageRequest) HasRecoveryCacheTimeout() bool { + if o != nil && !IsNil(o.RecoveryCacheTimeout) { + return true + } + + return false +} + +// SetRecoveryCacheTimeout gets a reference to the given string and assigns it to the RecoveryCacheTimeout field. +func (o *PatchedEmailStageRequest) SetRecoveryCacheTimeout(v string) { + o.RecoveryCacheTimeout = &v +} + +func (o PatchedEmailStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEmailStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.UseGlobalSettings) { + toSerialize["use_global_settings"] = o.UseGlobalSettings + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Port) { + toSerialize["port"] = o.Port + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Password) { + toSerialize["password"] = o.Password + } + if !IsNil(o.UseTls) { + toSerialize["use_tls"] = o.UseTls + } + if !IsNil(o.UseSsl) { + toSerialize["use_ssl"] = o.UseSsl + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FromAddress) { + toSerialize["from_address"] = o.FromAddress + } + if !IsNil(o.TokenExpiry) { + toSerialize["token_expiry"] = o.TokenExpiry + } + if !IsNil(o.Subject) { + toSerialize["subject"] = o.Subject + } + if !IsNil(o.Template) { + toSerialize["template"] = o.Template + } + if !IsNil(o.ActivateUserOnSuccess) { + toSerialize["activate_user_on_success"] = o.ActivateUserOnSuccess + } + if !IsNil(o.RecoveryMaxAttempts) { + toSerialize["recovery_max_attempts"] = o.RecoveryMaxAttempts + } + if !IsNil(o.RecoveryCacheTimeout) { + toSerialize["recovery_cache_timeout"] = o.RecoveryCacheTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEmailStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEmailStageRequest := _PatchedEmailStageRequest{} + + err = json.Unmarshal(data, &varPatchedEmailStageRequest) + + if err != nil { + return err + } + + *o = PatchedEmailStageRequest(varPatchedEmailStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "use_global_settings") + delete(additionalProperties, "host") + delete(additionalProperties, "port") + delete(additionalProperties, "username") + delete(additionalProperties, "password") + delete(additionalProperties, "use_tls") + delete(additionalProperties, "use_ssl") + delete(additionalProperties, "timeout") + delete(additionalProperties, "from_address") + delete(additionalProperties, "token_expiry") + delete(additionalProperties, "subject") + delete(additionalProperties, "template") + delete(additionalProperties, "activate_user_on_success") + delete(additionalProperties, "recovery_max_attempts") + delete(additionalProperties, "recovery_cache_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEmailStageRequest struct { + value *PatchedEmailStageRequest + isSet bool +} + +func (v NullablePatchedEmailStageRequest) Get() *PatchedEmailStageRequest { + return v.value +} + +func (v *NullablePatchedEmailStageRequest) Set(val *PatchedEmailStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEmailStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEmailStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEmailStageRequest(val *PatchedEmailStageRequest) *NullablePatchedEmailStageRequest { + return &NullablePatchedEmailStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedEmailStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEmailStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_endpoint_device_request.go b/packages/client-go/model_patched_endpoint_device_request.go new file mode 100644 index 0000000000..4db3e7a540 --- /dev/null +++ b/packages/client-go/model_patched_endpoint_device_request.go @@ -0,0 +1,399 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedEndpointDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEndpointDeviceRequest{} + +// PatchedEndpointDeviceRequest struct for PatchedEndpointDeviceRequest +type PatchedEndpointDeviceRequest struct { + DeviceUuid *string `json:"device_uuid,omitempty"` + Name *string `json:"name,omitempty"` + AccessGroup NullableString `json:"access_group,omitempty"` + AccessGroupObj *DeviceAccessGroupRequest `json:"access_group_obj,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEndpointDeviceRequest PatchedEndpointDeviceRequest + +// NewPatchedEndpointDeviceRequest instantiates a new PatchedEndpointDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEndpointDeviceRequest() *PatchedEndpointDeviceRequest { + this := PatchedEndpointDeviceRequest{} + return &this +} + +// NewPatchedEndpointDeviceRequestWithDefaults instantiates a new PatchedEndpointDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEndpointDeviceRequestWithDefaults() *PatchedEndpointDeviceRequest { + this := PatchedEndpointDeviceRequest{} + return &this +} + +// GetDeviceUuid returns the DeviceUuid field value if set, zero value otherwise. +func (o *PatchedEndpointDeviceRequest) GetDeviceUuid() string { + if o == nil || IsNil(o.DeviceUuid) { + var ret string + return ret + } + return *o.DeviceUuid +} + +// GetDeviceUuidOk returns a tuple with the DeviceUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointDeviceRequest) GetDeviceUuidOk() (*string, bool) { + if o == nil || IsNil(o.DeviceUuid) { + return nil, false + } + return o.DeviceUuid, true +} + +// HasDeviceUuid returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasDeviceUuid() bool { + if o != nil && !IsNil(o.DeviceUuid) { + return true + } + + return false +} + +// SetDeviceUuid gets a reference to the given string and assigns it to the DeviceUuid field. +func (o *PatchedEndpointDeviceRequest) SetDeviceUuid(v string) { + o.DeviceUuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEndpointDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEndpointDeviceRequest) SetName(v string) { + o.Name = &v +} + +// GetAccessGroup returns the AccessGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEndpointDeviceRequest) GetAccessGroup() string { + if o == nil || IsNil(o.AccessGroup.Get()) { + var ret string + return ret + } + return *o.AccessGroup.Get() +} + +// GetAccessGroupOk returns a tuple with the AccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEndpointDeviceRequest) GetAccessGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessGroup.Get(), o.AccessGroup.IsSet() +} + +// HasAccessGroup returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasAccessGroup() bool { + if o != nil && o.AccessGroup.IsSet() { + return true + } + + return false +} + +// SetAccessGroup gets a reference to the given NullableString and assigns it to the AccessGroup field. +func (o *PatchedEndpointDeviceRequest) SetAccessGroup(v string) { + o.AccessGroup.Set(&v) +} + +// SetAccessGroupNil sets the value for AccessGroup to be an explicit nil +func (o *PatchedEndpointDeviceRequest) SetAccessGroupNil() { + o.AccessGroup.Set(nil) +} + +// UnsetAccessGroup ensures that no value is present for AccessGroup, not even an explicit nil +func (o *PatchedEndpointDeviceRequest) UnsetAccessGroup() { + o.AccessGroup.Unset() +} + +// GetAccessGroupObj returns the AccessGroupObj field value if set, zero value otherwise. +func (o *PatchedEndpointDeviceRequest) GetAccessGroupObj() DeviceAccessGroupRequest { + if o == nil || IsNil(o.AccessGroupObj) { + var ret DeviceAccessGroupRequest + return ret + } + return *o.AccessGroupObj +} + +// GetAccessGroupObjOk returns a tuple with the AccessGroupObj field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointDeviceRequest) GetAccessGroupObjOk() (*DeviceAccessGroupRequest, bool) { + if o == nil || IsNil(o.AccessGroupObj) { + return nil, false + } + return o.AccessGroupObj, true +} + +// HasAccessGroupObj returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasAccessGroupObj() bool { + if o != nil && !IsNil(o.AccessGroupObj) { + return true + } + + return false +} + +// SetAccessGroupObj gets a reference to the given DeviceAccessGroupRequest and assigns it to the AccessGroupObj field. +func (o *PatchedEndpointDeviceRequest) SetAccessGroupObj(v DeviceAccessGroupRequest) { + o.AccessGroupObj = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *PatchedEndpointDeviceRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointDeviceRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *PatchedEndpointDeviceRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEndpointDeviceRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEndpointDeviceRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *PatchedEndpointDeviceRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *PatchedEndpointDeviceRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *PatchedEndpointDeviceRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedEndpointDeviceRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointDeviceRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedEndpointDeviceRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedEndpointDeviceRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEndpointDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeviceUuid) { + toSerialize["device_uuid"] = o.DeviceUuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AccessGroup.IsSet() { + toSerialize["access_group"] = o.AccessGroup.Get() + } + if !IsNil(o.AccessGroupObj) { + toSerialize["access_group_obj"] = o.AccessGroupObj + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEndpointDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEndpointDeviceRequest := _PatchedEndpointDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedEndpointDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedEndpointDeviceRequest(varPatchedEndpointDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "access_group") + delete(additionalProperties, "access_group_obj") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEndpointDeviceRequest struct { + value *PatchedEndpointDeviceRequest + isSet bool +} + +func (v NullablePatchedEndpointDeviceRequest) Get() *PatchedEndpointDeviceRequest { + return v.value +} + +func (v *NullablePatchedEndpointDeviceRequest) Set(val *PatchedEndpointDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEndpointDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEndpointDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEndpointDeviceRequest(val *PatchedEndpointDeviceRequest) *NullablePatchedEndpointDeviceRequest { + return &NullablePatchedEndpointDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEndpointDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_endpoint_request.go b/packages/client-go/model_patched_endpoint_request.go new file mode 100644 index 0000000000..46757b02cc --- /dev/null +++ b/packages/client-go/model_patched_endpoint_request.go @@ -0,0 +1,413 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedEndpointRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEndpointRequest{} + +// PatchedEndpointRequest Endpoint Serializer +type PatchedEndpointRequest struct { + Name *string `json:"name,omitempty"` + Provider *int32 `json:"provider,omitempty"` + Protocol *ProtocolEnum `json:"protocol,omitempty"` + Host *string `json:"host,omitempty"` + Settings map[string]interface{} `json:"settings,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + AuthMode *EndpointAuthModeEnum `json:"auth_mode,omitempty"` + MaximumConnections *int32 `json:"maximum_connections,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEndpointRequest PatchedEndpointRequest + +// NewPatchedEndpointRequest instantiates a new PatchedEndpointRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEndpointRequest() *PatchedEndpointRequest { + this := PatchedEndpointRequest{} + return &this +} + +// NewPatchedEndpointRequestWithDefaults instantiates a new PatchedEndpointRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEndpointRequestWithDefaults() *PatchedEndpointRequest { + this := PatchedEndpointRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEndpointRequest) SetName(v string) { + o.Name = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetProvider() int32 { + if o == nil || IsNil(o.Provider) { + var ret int32 + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetProviderOk() (*int32, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given int32 and assigns it to the Provider field. +func (o *PatchedEndpointRequest) SetProvider(v int32) { + o.Provider = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetProtocol() ProtocolEnum { + if o == nil || IsNil(o.Protocol) { + var ret ProtocolEnum + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetProtocolOk() (*ProtocolEnum, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given ProtocolEnum and assigns it to the Protocol field. +func (o *PatchedEndpointRequest) SetProtocol(v ProtocolEnum) { + o.Protocol = &v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetHost() string { + if o == nil || IsNil(o.Host) { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetHostOk() (*string, bool) { + if o == nil || IsNil(o.Host) { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasHost() bool { + if o != nil && !IsNil(o.Host) { + return true + } + + return false +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *PatchedEndpointRequest) SetHost(v string) { + o.Host = &v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *PatchedEndpointRequest) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedEndpointRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetAuthMode returns the AuthMode field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetAuthMode() EndpointAuthModeEnum { + if o == nil || IsNil(o.AuthMode) { + var ret EndpointAuthModeEnum + return ret + } + return *o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetAuthModeOk() (*EndpointAuthModeEnum, bool) { + if o == nil || IsNil(o.AuthMode) { + return nil, false + } + return o.AuthMode, true +} + +// HasAuthMode returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasAuthMode() bool { + if o != nil && !IsNil(o.AuthMode) { + return true + } + + return false +} + +// SetAuthMode gets a reference to the given EndpointAuthModeEnum and assigns it to the AuthMode field. +func (o *PatchedEndpointRequest) SetAuthMode(v EndpointAuthModeEnum) { + o.AuthMode = &v +} + +// GetMaximumConnections returns the MaximumConnections field value if set, zero value otherwise. +func (o *PatchedEndpointRequest) GetMaximumConnections() int32 { + if o == nil || IsNil(o.MaximumConnections) { + var ret int32 + return ret + } + return *o.MaximumConnections +} + +// GetMaximumConnectionsOk returns a tuple with the MaximumConnections field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointRequest) GetMaximumConnectionsOk() (*int32, bool) { + if o == nil || IsNil(o.MaximumConnections) { + return nil, false + } + return o.MaximumConnections, true +} + +// HasMaximumConnections returns a boolean if a field has been set. +func (o *PatchedEndpointRequest) HasMaximumConnections() bool { + if o != nil && !IsNil(o.MaximumConnections) { + return true + } + + return false +} + +// SetMaximumConnections gets a reference to the given int32 and assigns it to the MaximumConnections field. +func (o *PatchedEndpointRequest) SetMaximumConnections(v int32) { + o.MaximumConnections = &v +} + +func (o PatchedEndpointRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEndpointRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + if !IsNil(o.Host) { + toSerialize["host"] = o.Host + } + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.AuthMode) { + toSerialize["auth_mode"] = o.AuthMode + } + if !IsNil(o.MaximumConnections) { + toSerialize["maximum_connections"] = o.MaximumConnections + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEndpointRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEndpointRequest := _PatchedEndpointRequest{} + + err = json.Unmarshal(data, &varPatchedEndpointRequest) + + if err != nil { + return err + } + + *o = PatchedEndpointRequest(varPatchedEndpointRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "provider") + delete(additionalProperties, "protocol") + delete(additionalProperties, "host") + delete(additionalProperties, "settings") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "maximum_connections") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEndpointRequest struct { + value *PatchedEndpointRequest + isSet bool +} + +func (v NullablePatchedEndpointRequest) Get() *PatchedEndpointRequest { + return v.value +} + +func (v *NullablePatchedEndpointRequest) Set(val *PatchedEndpointRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEndpointRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEndpointRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEndpointRequest(val *PatchedEndpointRequest) *NullablePatchedEndpointRequest { + return &NullablePatchedEndpointRequest{value: val, isSet: true} +} + +func (v NullablePatchedEndpointRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEndpointRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_endpoint_stage_request.go b/packages/client-go/model_patched_endpoint_stage_request.go new file mode 100644 index 0000000000..66f6b1918d --- /dev/null +++ b/packages/client-go/model_patched_endpoint_stage_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedEndpointStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEndpointStageRequest{} + +// PatchedEndpointStageRequest EndpointStage Serializer +type PatchedEndpointStageRequest struct { + Name *string `json:"name,omitempty"` + Connector *string `json:"connector,omitempty"` + Mode *StageModeEnum `json:"mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEndpointStageRequest PatchedEndpointStageRequest + +// NewPatchedEndpointStageRequest instantiates a new PatchedEndpointStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEndpointStageRequest() *PatchedEndpointStageRequest { + this := PatchedEndpointStageRequest{} + return &this +} + +// NewPatchedEndpointStageRequestWithDefaults instantiates a new PatchedEndpointStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEndpointStageRequestWithDefaults() *PatchedEndpointStageRequest { + this := PatchedEndpointStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEndpointStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEndpointStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEndpointStageRequest) SetName(v string) { + o.Name = &v +} + +// GetConnector returns the Connector field value if set, zero value otherwise. +func (o *PatchedEndpointStageRequest) GetConnector() string { + if o == nil || IsNil(o.Connector) { + var ret string + return ret + } + return *o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointStageRequest) GetConnectorOk() (*string, bool) { + if o == nil || IsNil(o.Connector) { + return nil, false + } + return o.Connector, true +} + +// HasConnector returns a boolean if a field has been set. +func (o *PatchedEndpointStageRequest) HasConnector() bool { + if o != nil && !IsNil(o.Connector) { + return true + } + + return false +} + +// SetConnector gets a reference to the given string and assigns it to the Connector field. +func (o *PatchedEndpointStageRequest) SetConnector(v string) { + o.Connector = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedEndpointStageRequest) GetMode() StageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret StageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEndpointStageRequest) GetModeOk() (*StageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedEndpointStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given StageModeEnum and assigns it to the Mode field. +func (o *PatchedEndpointStageRequest) SetMode(v StageModeEnum) { + o.Mode = &v +} + +func (o PatchedEndpointStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEndpointStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Connector) { + toSerialize["connector"] = o.Connector + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEndpointStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEndpointStageRequest := _PatchedEndpointStageRequest{} + + err = json.Unmarshal(data, &varPatchedEndpointStageRequest) + + if err != nil { + return err + } + + *o = PatchedEndpointStageRequest(varPatchedEndpointStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "connector") + delete(additionalProperties, "mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEndpointStageRequest struct { + value *PatchedEndpointStageRequest + isSet bool +} + +func (v NullablePatchedEndpointStageRequest) Get() *PatchedEndpointStageRequest { + return v.value +} + +func (v *NullablePatchedEndpointStageRequest) Set(val *PatchedEndpointStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEndpointStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEndpointStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEndpointStageRequest(val *PatchedEndpointStageRequest) *NullablePatchedEndpointStageRequest { + return &NullablePatchedEndpointStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedEndpointStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEndpointStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_enrollment_token_request.go b/packages/client-go/model_patched_enrollment_token_request.go new file mode 100644 index 0000000000..42fb0e8ff4 --- /dev/null +++ b/packages/client-go/model_patched_enrollment_token_request.go @@ -0,0 +1,325 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedEnrollmentTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEnrollmentTokenRequest{} + +// PatchedEnrollmentTokenRequest struct for PatchedEnrollmentTokenRequest +type PatchedEnrollmentTokenRequest struct { + DeviceGroup NullableString `json:"device_group,omitempty"` + Connector *string `json:"connector,omitempty"` + Name *string `json:"name,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEnrollmentTokenRequest PatchedEnrollmentTokenRequest + +// NewPatchedEnrollmentTokenRequest instantiates a new PatchedEnrollmentTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEnrollmentTokenRequest() *PatchedEnrollmentTokenRequest { + this := PatchedEnrollmentTokenRequest{} + return &this +} + +// NewPatchedEnrollmentTokenRequestWithDefaults instantiates a new PatchedEnrollmentTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEnrollmentTokenRequestWithDefaults() *PatchedEnrollmentTokenRequest { + this := PatchedEnrollmentTokenRequest{} + return &this +} + +// GetDeviceGroup returns the DeviceGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEnrollmentTokenRequest) GetDeviceGroup() string { + if o == nil || IsNil(o.DeviceGroup.Get()) { + var ret string + return ret + } + return *o.DeviceGroup.Get() +} + +// GetDeviceGroupOk returns a tuple with the DeviceGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEnrollmentTokenRequest) GetDeviceGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DeviceGroup.Get(), o.DeviceGroup.IsSet() +} + +// HasDeviceGroup returns a boolean if a field has been set. +func (o *PatchedEnrollmentTokenRequest) HasDeviceGroup() bool { + if o != nil && o.DeviceGroup.IsSet() { + return true + } + + return false +} + +// SetDeviceGroup gets a reference to the given NullableString and assigns it to the DeviceGroup field. +func (o *PatchedEnrollmentTokenRequest) SetDeviceGroup(v string) { + o.DeviceGroup.Set(&v) +} + +// SetDeviceGroupNil sets the value for DeviceGroup to be an explicit nil +func (o *PatchedEnrollmentTokenRequest) SetDeviceGroupNil() { + o.DeviceGroup.Set(nil) +} + +// UnsetDeviceGroup ensures that no value is present for DeviceGroup, not even an explicit nil +func (o *PatchedEnrollmentTokenRequest) UnsetDeviceGroup() { + o.DeviceGroup.Unset() +} + +// GetConnector returns the Connector field value if set, zero value otherwise. +func (o *PatchedEnrollmentTokenRequest) GetConnector() string { + if o == nil || IsNil(o.Connector) { + var ret string + return ret + } + return *o.Connector +} + +// GetConnectorOk returns a tuple with the Connector field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEnrollmentTokenRequest) GetConnectorOk() (*string, bool) { + if o == nil || IsNil(o.Connector) { + return nil, false + } + return o.Connector, true +} + +// HasConnector returns a boolean if a field has been set. +func (o *PatchedEnrollmentTokenRequest) HasConnector() bool { + if o != nil && !IsNil(o.Connector) { + return true + } + + return false +} + +// SetConnector gets a reference to the given string and assigns it to the Connector field. +func (o *PatchedEnrollmentTokenRequest) SetConnector(v string) { + o.Connector = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEnrollmentTokenRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEnrollmentTokenRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEnrollmentTokenRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEnrollmentTokenRequest) SetName(v string) { + o.Name = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *PatchedEnrollmentTokenRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEnrollmentTokenRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *PatchedEnrollmentTokenRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *PatchedEnrollmentTokenRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEnrollmentTokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEnrollmentTokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedEnrollmentTokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *PatchedEnrollmentTokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *PatchedEnrollmentTokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *PatchedEnrollmentTokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +func (o PatchedEnrollmentTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEnrollmentTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DeviceGroup.IsSet() { + toSerialize["device_group"] = o.DeviceGroup.Get() + } + if !IsNil(o.Connector) { + toSerialize["connector"] = o.Connector + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEnrollmentTokenRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEnrollmentTokenRequest := _PatchedEnrollmentTokenRequest{} + + err = json.Unmarshal(data, &varPatchedEnrollmentTokenRequest) + + if err != nil { + return err + } + + *o = PatchedEnrollmentTokenRequest(varPatchedEnrollmentTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "device_group") + delete(additionalProperties, "connector") + delete(additionalProperties, "name") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEnrollmentTokenRequest struct { + value *PatchedEnrollmentTokenRequest + isSet bool +} + +func (v NullablePatchedEnrollmentTokenRequest) Get() *PatchedEnrollmentTokenRequest { + return v.value +} + +func (v *NullablePatchedEnrollmentTokenRequest) Set(val *PatchedEnrollmentTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEnrollmentTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEnrollmentTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEnrollmentTokenRequest(val *PatchedEnrollmentTokenRequest) *NullablePatchedEnrollmentTokenRequest { + return &NullablePatchedEnrollmentTokenRequest{value: val, isSet: true} +} + +func (v NullablePatchedEnrollmentTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEnrollmentTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_event_matcher_policy_request.go b/packages/client-go/model_patched_event_matcher_policy_request.go new file mode 100644 index 0000000000..7d137673cc --- /dev/null +++ b/packages/client-go/model_patched_event_matcher_policy_request.go @@ -0,0 +1,388 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedEventMatcherPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEventMatcherPolicyRequest{} + +// PatchedEventMatcherPolicyRequest Event Matcher Policy Serializer +type PatchedEventMatcherPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Match created events with this action type. When left empty, all action types will be matched. + Action NullableEventActions `json:"action,omitempty"` + // Matches Event's Client IP (strict matching, for network matching use an Expression Policy) + ClientIp NullableString `json:"client_ip,omitempty"` + // Match events created by selected application. When left empty, all applications are matched. + App NullableAppEnum `json:"app,omitempty"` + // Match events created by selected model. When left empty, all models are matched. When an app is selected, all the application's models are matched. + Model NullableModelEnum `json:"model,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEventMatcherPolicyRequest PatchedEventMatcherPolicyRequest + +// NewPatchedEventMatcherPolicyRequest instantiates a new PatchedEventMatcherPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEventMatcherPolicyRequest() *PatchedEventMatcherPolicyRequest { + this := PatchedEventMatcherPolicyRequest{} + return &this +} + +// NewPatchedEventMatcherPolicyRequestWithDefaults instantiates a new PatchedEventMatcherPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEventMatcherPolicyRequestWithDefaults() *PatchedEventMatcherPolicyRequest { + this := PatchedEventMatcherPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedEventMatcherPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventMatcherPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedEventMatcherPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedEventMatcherPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventMatcherPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedEventMatcherPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetAction returns the Action field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEventMatcherPolicyRequest) GetAction() EventActions { + if o == nil || IsNil(o.Action.Get()) { + var ret EventActions + return ret + } + return *o.Action.Get() +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEventMatcherPolicyRequest) GetActionOk() (*EventActions, bool) { + if o == nil { + return nil, false + } + return o.Action.Get(), o.Action.IsSet() +} + +// HasAction returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasAction() bool { + if o != nil && o.Action.IsSet() { + return true + } + + return false +} + +// SetAction gets a reference to the given NullableEventActions and assigns it to the Action field. +func (o *PatchedEventMatcherPolicyRequest) SetAction(v EventActions) { + o.Action.Set(&v) +} + +// SetActionNil sets the value for Action to be an explicit nil +func (o *PatchedEventMatcherPolicyRequest) SetActionNil() { + o.Action.Set(nil) +} + +// UnsetAction ensures that no value is present for Action, not even an explicit nil +func (o *PatchedEventMatcherPolicyRequest) UnsetAction() { + o.Action.Unset() +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEventMatcherPolicyRequest) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEventMatcherPolicyRequest) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *PatchedEventMatcherPolicyRequest) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *PatchedEventMatcherPolicyRequest) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *PatchedEventMatcherPolicyRequest) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetApp returns the App field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEventMatcherPolicyRequest) GetApp() AppEnum { + if o == nil || IsNil(o.App.Get()) { + var ret AppEnum + return ret + } + return *o.App.Get() +} + +// GetAppOk returns a tuple with the App field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEventMatcherPolicyRequest) GetAppOk() (*AppEnum, bool) { + if o == nil { + return nil, false + } + return o.App.Get(), o.App.IsSet() +} + +// HasApp returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasApp() bool { + if o != nil && o.App.IsSet() { + return true + } + + return false +} + +// SetApp gets a reference to the given NullableAppEnum and assigns it to the App field. +func (o *PatchedEventMatcherPolicyRequest) SetApp(v AppEnum) { + o.App.Set(&v) +} + +// SetAppNil sets the value for App to be an explicit nil +func (o *PatchedEventMatcherPolicyRequest) SetAppNil() { + o.App.Set(nil) +} + +// UnsetApp ensures that no value is present for App, not even an explicit nil +func (o *PatchedEventMatcherPolicyRequest) UnsetApp() { + o.App.Unset() +} + +// GetModel returns the Model field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEventMatcherPolicyRequest) GetModel() ModelEnum { + if o == nil || IsNil(o.Model.Get()) { + var ret ModelEnum + return ret + } + return *o.Model.Get() +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEventMatcherPolicyRequest) GetModelOk() (*ModelEnum, bool) { + if o == nil { + return nil, false + } + return o.Model.Get(), o.Model.IsSet() +} + +// HasModel returns a boolean if a field has been set. +func (o *PatchedEventMatcherPolicyRequest) HasModel() bool { + if o != nil && o.Model.IsSet() { + return true + } + + return false +} + +// SetModel gets a reference to the given NullableModelEnum and assigns it to the Model field. +func (o *PatchedEventMatcherPolicyRequest) SetModel(v ModelEnum) { + o.Model.Set(&v) +} + +// SetModelNil sets the value for Model to be an explicit nil +func (o *PatchedEventMatcherPolicyRequest) SetModelNil() { + o.Model.Set(nil) +} + +// UnsetModel ensures that no value is present for Model, not even an explicit nil +func (o *PatchedEventMatcherPolicyRequest) UnsetModel() { + o.Model.Unset() +} + +func (o PatchedEventMatcherPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEventMatcherPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if o.Action.IsSet() { + toSerialize["action"] = o.Action.Get() + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + if o.App.IsSet() { + toSerialize["app"] = o.App.Get() + } + if o.Model.IsSet() { + toSerialize["model"] = o.Model.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEventMatcherPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEventMatcherPolicyRequest := _PatchedEventMatcherPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedEventMatcherPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedEventMatcherPolicyRequest(varPatchedEventMatcherPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "action") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "app") + delete(additionalProperties, "model") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEventMatcherPolicyRequest struct { + value *PatchedEventMatcherPolicyRequest + isSet bool +} + +func (v NullablePatchedEventMatcherPolicyRequest) Get() *PatchedEventMatcherPolicyRequest { + return v.value +} + +func (v *NullablePatchedEventMatcherPolicyRequest) Set(val *PatchedEventMatcherPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEventMatcherPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEventMatcherPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEventMatcherPolicyRequest(val *PatchedEventMatcherPolicyRequest) *NullablePatchedEventMatcherPolicyRequest { + return &NullablePatchedEventMatcherPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedEventMatcherPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEventMatcherPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_event_request.go b/packages/client-go/model_patched_event_request.go new file mode 100644 index 0000000000..c71d23b1ba --- /dev/null +++ b/packages/client-go/model_patched_event_request.go @@ -0,0 +1,388 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedEventRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedEventRequest{} + +// PatchedEventRequest Event Serializer +type PatchedEventRequest struct { + User map[string]interface{} `json:"user,omitempty"` + Action *EventActions `json:"action,omitempty"` + App *string `json:"app,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + ClientIp NullableString `json:"client_ip,omitempty"` + Expires *time.Time `json:"expires,omitempty"` + Brand map[string]interface{} `json:"brand,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedEventRequest PatchedEventRequest + +// NewPatchedEventRequest instantiates a new PatchedEventRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedEventRequest() *PatchedEventRequest { + this := PatchedEventRequest{} + return &this +} + +// NewPatchedEventRequestWithDefaults instantiates a new PatchedEventRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedEventRequestWithDefaults() *PatchedEventRequest { + this := PatchedEventRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetUser() map[string]interface{} { + if o == nil || IsNil(o.User) { + var ret map[string]interface{} + return ret + } + return o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetUserOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.User) { + return map[string]interface{}{}, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given map[string]interface{} and assigns it to the User field. +func (o *PatchedEventRequest) SetUser(v map[string]interface{}) { + o.User = v +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetAction() EventActions { + if o == nil || IsNil(o.Action) { + var ret EventActions + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetActionOk() (*EventActions, bool) { + if o == nil || IsNil(o.Action) { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasAction() bool { + if o != nil && !IsNil(o.Action) { + return true + } + + return false +} + +// SetAction gets a reference to the given EventActions and assigns it to the Action field. +func (o *PatchedEventRequest) SetAction(v EventActions) { + o.Action = &v +} + +// GetApp returns the App field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetApp() string { + if o == nil || IsNil(o.App) { + var ret string + return ret + } + return *o.App +} + +// GetAppOk returns a tuple with the App field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetAppOk() (*string, bool) { + if o == nil || IsNil(o.App) { + return nil, false + } + return o.App, true +} + +// HasApp returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasApp() bool { + if o != nil && !IsNil(o.App) { + return true + } + + return false +} + +// SetApp gets a reference to the given string and assigns it to the App field. +func (o *PatchedEventRequest) SetApp(v string) { + o.App = &v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *PatchedEventRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetClientIp returns the ClientIp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedEventRequest) GetClientIp() string { + if o == nil || IsNil(o.ClientIp.Get()) { + var ret string + return ret + } + return *o.ClientIp.Get() +} + +// GetClientIpOk returns a tuple with the ClientIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedEventRequest) GetClientIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientIp.Get(), o.ClientIp.IsSet() +} + +// HasClientIp returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasClientIp() bool { + if o != nil && o.ClientIp.IsSet() { + return true + } + + return false +} + +// SetClientIp gets a reference to the given NullableString and assigns it to the ClientIp field. +func (o *PatchedEventRequest) SetClientIp(v string) { + o.ClientIp.Set(&v) +} + +// SetClientIpNil sets the value for ClientIp to be an explicit nil +func (o *PatchedEventRequest) SetClientIpNil() { + o.ClientIp.Set(nil) +} + +// UnsetClientIp ensures that no value is present for ClientIp, not even an explicit nil +func (o *PatchedEventRequest) UnsetClientIp() { + o.ClientIp.Unset() +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *PatchedEventRequest) SetExpires(v time.Time) { + o.Expires = &v +} + +// GetBrand returns the Brand field value if set, zero value otherwise. +func (o *PatchedEventRequest) GetBrand() map[string]interface{} { + if o == nil || IsNil(o.Brand) { + var ret map[string]interface{} + return ret + } + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedEventRequest) GetBrandOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Brand) { + return map[string]interface{}{}, false + } + return o.Brand, true +} + +// HasBrand returns a boolean if a field has been set. +func (o *PatchedEventRequest) HasBrand() bool { + if o != nil && !IsNil(o.Brand) { + return true + } + + return false +} + +// SetBrand gets a reference to the given map[string]interface{} and assigns it to the Brand field. +func (o *PatchedEventRequest) SetBrand(v map[string]interface{}) { + o.Brand = v +} + +func (o PatchedEventRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedEventRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Action) { + toSerialize["action"] = o.Action + } + if !IsNil(o.App) { + toSerialize["app"] = o.App + } + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if o.ClientIp.IsSet() { + toSerialize["client_ip"] = o.ClientIp.Get() + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + if !IsNil(o.Brand) { + toSerialize["brand"] = o.Brand + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedEventRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedEventRequest := _PatchedEventRequest{} + + err = json.Unmarshal(data, &varPatchedEventRequest) + + if err != nil { + return err + } + + *o = PatchedEventRequest(varPatchedEventRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "action") + delete(additionalProperties, "app") + delete(additionalProperties, "context") + delete(additionalProperties, "client_ip") + delete(additionalProperties, "expires") + delete(additionalProperties, "brand") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedEventRequest struct { + value *PatchedEventRequest + isSet bool +} + +func (v NullablePatchedEventRequest) Get() *PatchedEventRequest { + return v.value +} + +func (v *NullablePatchedEventRequest) Set(val *PatchedEventRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedEventRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedEventRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedEventRequest(val *PatchedEventRequest) *NullablePatchedEventRequest { + return &NullablePatchedEventRequest{value: val, isSet: true} +} + +func (v NullablePatchedEventRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedEventRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_expression_policy_request.go b/packages/client-go/model_patched_expression_policy_request.go new file mode 100644 index 0000000000..2e19a08fa7 --- /dev/null +++ b/packages/client-go/model_patched_expression_policy_request.go @@ -0,0 +1,229 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedExpressionPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedExpressionPolicyRequest{} + +// PatchedExpressionPolicyRequest Group Membership Policy Serializer +type PatchedExpressionPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedExpressionPolicyRequest PatchedExpressionPolicyRequest + +// NewPatchedExpressionPolicyRequest instantiates a new PatchedExpressionPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedExpressionPolicyRequest() *PatchedExpressionPolicyRequest { + this := PatchedExpressionPolicyRequest{} + return &this +} + +// NewPatchedExpressionPolicyRequestWithDefaults instantiates a new PatchedExpressionPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedExpressionPolicyRequestWithDefaults() *PatchedExpressionPolicyRequest { + this := PatchedExpressionPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedExpressionPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedExpressionPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedExpressionPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedExpressionPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedExpressionPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedExpressionPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedExpressionPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedExpressionPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedExpressionPolicyRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedExpressionPolicyRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedExpressionPolicyRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedExpressionPolicyRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedExpressionPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedExpressionPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedExpressionPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedExpressionPolicyRequest := _PatchedExpressionPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedExpressionPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedExpressionPolicyRequest(varPatchedExpressionPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedExpressionPolicyRequest struct { + value *PatchedExpressionPolicyRequest + isSet bool +} + +func (v NullablePatchedExpressionPolicyRequest) Get() *PatchedExpressionPolicyRequest { + return v.value +} + +func (v *NullablePatchedExpressionPolicyRequest) Set(val *PatchedExpressionPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedExpressionPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedExpressionPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedExpressionPolicyRequest(val *PatchedExpressionPolicyRequest) *NullablePatchedExpressionPolicyRequest { + return &NullablePatchedExpressionPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedExpressionPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedExpressionPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_fleet_connector_request.go b/packages/client-go/model_patched_fleet_connector_request.go new file mode 100644 index 0000000000..46a4b0dc26 --- /dev/null +++ b/packages/client-go/model_patched_fleet_connector_request.go @@ -0,0 +1,425 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedFleetConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedFleetConnectorRequest{} + +// PatchedFleetConnectorRequest FleetConnector Serializer +type PatchedFleetConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name *string `json:"name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Url *string `json:"url,omitempty"` + Token *string `json:"token,omitempty"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + HeadersMapping NullableString `json:"headers_mapping,omitempty"` + MapUsers *bool `json:"map_users,omitempty"` + MapTeamsAccessGroup *bool `json:"map_teams_access_group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedFleetConnectorRequest PatchedFleetConnectorRequest + +// NewPatchedFleetConnectorRequest instantiates a new PatchedFleetConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedFleetConnectorRequest() *PatchedFleetConnectorRequest { + this := PatchedFleetConnectorRequest{} + return &this +} + +// NewPatchedFleetConnectorRequestWithDefaults instantiates a new PatchedFleetConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedFleetConnectorRequestWithDefaults() *PatchedFleetConnectorRequest { + this := PatchedFleetConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *PatchedFleetConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedFleetConnectorRequest) SetName(v string) { + o.Name = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedFleetConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *PatchedFleetConnectorRequest) SetUrl(v string) { + o.Url = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *PatchedFleetConnectorRequest) SetToken(v string) { + o.Token = &v +} + +// GetHeadersMapping returns the HeadersMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedFleetConnectorRequest) GetHeadersMapping() string { + if o == nil || IsNil(o.HeadersMapping.Get()) { + var ret string + return ret + } + return *o.HeadersMapping.Get() +} + +// GetHeadersMappingOk returns a tuple with the HeadersMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedFleetConnectorRequest) GetHeadersMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HeadersMapping.Get(), o.HeadersMapping.IsSet() +} + +// HasHeadersMapping returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasHeadersMapping() bool { + if o != nil && o.HeadersMapping.IsSet() { + return true + } + + return false +} + +// SetHeadersMapping gets a reference to the given NullableString and assigns it to the HeadersMapping field. +func (o *PatchedFleetConnectorRequest) SetHeadersMapping(v string) { + o.HeadersMapping.Set(&v) +} + +// SetHeadersMappingNil sets the value for HeadersMapping to be an explicit nil +func (o *PatchedFleetConnectorRequest) SetHeadersMappingNil() { + o.HeadersMapping.Set(nil) +} + +// UnsetHeadersMapping ensures that no value is present for HeadersMapping, not even an explicit nil +func (o *PatchedFleetConnectorRequest) UnsetHeadersMapping() { + o.HeadersMapping.Unset() +} + +// GetMapUsers returns the MapUsers field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetMapUsers() bool { + if o == nil || IsNil(o.MapUsers) { + var ret bool + return ret + } + return *o.MapUsers +} + +// GetMapUsersOk returns a tuple with the MapUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetMapUsersOk() (*bool, bool) { + if o == nil || IsNil(o.MapUsers) { + return nil, false + } + return o.MapUsers, true +} + +// HasMapUsers returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasMapUsers() bool { + if o != nil && !IsNil(o.MapUsers) { + return true + } + + return false +} + +// SetMapUsers gets a reference to the given bool and assigns it to the MapUsers field. +func (o *PatchedFleetConnectorRequest) SetMapUsers(v bool) { + o.MapUsers = &v +} + +// GetMapTeamsAccessGroup returns the MapTeamsAccessGroup field value if set, zero value otherwise. +func (o *PatchedFleetConnectorRequest) GetMapTeamsAccessGroup() bool { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + var ret bool + return ret + } + return *o.MapTeamsAccessGroup +} + +// GetMapTeamsAccessGroupOk returns a tuple with the MapTeamsAccessGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFleetConnectorRequest) GetMapTeamsAccessGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MapTeamsAccessGroup) { + return nil, false + } + return o.MapTeamsAccessGroup, true +} + +// HasMapTeamsAccessGroup returns a boolean if a field has been set. +func (o *PatchedFleetConnectorRequest) HasMapTeamsAccessGroup() bool { + if o != nil && !IsNil(o.MapTeamsAccessGroup) { + return true + } + + return false +} + +// SetMapTeamsAccessGroup gets a reference to the given bool and assigns it to the MapTeamsAccessGroup field. +func (o *PatchedFleetConnectorRequest) SetMapTeamsAccessGroup(v bool) { + o.MapTeamsAccessGroup = &v +} + +func (o PatchedFleetConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedFleetConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if o.HeadersMapping.IsSet() { + toSerialize["headers_mapping"] = o.HeadersMapping.Get() + } + if !IsNil(o.MapUsers) { + toSerialize["map_users"] = o.MapUsers + } + if !IsNil(o.MapTeamsAccessGroup) { + toSerialize["map_teams_access_group"] = o.MapTeamsAccessGroup + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedFleetConnectorRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedFleetConnectorRequest := _PatchedFleetConnectorRequest{} + + err = json.Unmarshal(data, &varPatchedFleetConnectorRequest) + + if err != nil { + return err + } + + *o = PatchedFleetConnectorRequest(varPatchedFleetConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "url") + delete(additionalProperties, "token") + delete(additionalProperties, "headers_mapping") + delete(additionalProperties, "map_users") + delete(additionalProperties, "map_teams_access_group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedFleetConnectorRequest struct { + value *PatchedFleetConnectorRequest + isSet bool +} + +func (v NullablePatchedFleetConnectorRequest) Get() *PatchedFleetConnectorRequest { + return v.value +} + +func (v *NullablePatchedFleetConnectorRequest) Set(val *PatchedFleetConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedFleetConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedFleetConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedFleetConnectorRequest(val *PatchedFleetConnectorRequest) *NullablePatchedFleetConnectorRequest { + return &NullablePatchedFleetConnectorRequest{value: val, isSet: true} +} + +func (v NullablePatchedFleetConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedFleetConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_flow_request.go b/packages/client-go/model_patched_flow_request.go new file mode 100644 index 0000000000..1306cf1021 --- /dev/null +++ b/packages/client-go/model_patched_flow_request.go @@ -0,0 +1,494 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedFlowRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedFlowRequest{} + +// PatchedFlowRequest Flow Serializer +type PatchedFlowRequest struct { + Name *string `json:"name,omitempty"` + // Visible in the URL. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + // Shown as the Title in Flow pages. + Title *string `json:"title,omitempty"` + // Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik. + Designation *FlowDesignationEnum `json:"designation,omitempty"` + // Background shown during execution + Background *string `json:"background,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Enable compatibility mode, increases compatibility with password managers on mobile devices. + CompatibilityMode *bool `json:"compatibility_mode,omitempty"` + Layout *FlowLayoutEnum `json:"layout,omitempty"` + // Configure what should happen when a flow denies access to a user. + DeniedAction *DeniedActionEnum `json:"denied_action,omitempty"` + // Required level of authentication and authorization to access a flow. + Authentication *AuthenticationEnum `json:"authentication,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedFlowRequest PatchedFlowRequest + +// NewPatchedFlowRequest instantiates a new PatchedFlowRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedFlowRequest() *PatchedFlowRequest { + this := PatchedFlowRequest{} + return &this +} + +// NewPatchedFlowRequestWithDefaults instantiates a new PatchedFlowRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedFlowRequestWithDefaults() *PatchedFlowRequest { + this := PatchedFlowRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedFlowRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedFlowRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetTitle() string { + if o == nil || IsNil(o.Title) { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetTitleOk() (*string, bool) { + if o == nil || IsNil(o.Title) { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasTitle() bool { + if o != nil && !IsNil(o.Title) { + return true + } + + return false +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *PatchedFlowRequest) SetTitle(v string) { + o.Title = &v +} + +// GetDesignation returns the Designation field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetDesignation() FlowDesignationEnum { + if o == nil || IsNil(o.Designation) { + var ret FlowDesignationEnum + return ret + } + return *o.Designation +} + +// GetDesignationOk returns a tuple with the Designation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetDesignationOk() (*FlowDesignationEnum, bool) { + if o == nil || IsNil(o.Designation) { + return nil, false + } + return o.Designation, true +} + +// HasDesignation returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasDesignation() bool { + if o != nil && !IsNil(o.Designation) { + return true + } + + return false +} + +// SetDesignation gets a reference to the given FlowDesignationEnum and assigns it to the Designation field. +func (o *PatchedFlowRequest) SetDesignation(v FlowDesignationEnum) { + o.Designation = &v +} + +// GetBackground returns the Background field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetBackground() string { + if o == nil || IsNil(o.Background) { + var ret string + return ret + } + return *o.Background +} + +// GetBackgroundOk returns a tuple with the Background field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetBackgroundOk() (*string, bool) { + if o == nil || IsNil(o.Background) { + return nil, false + } + return o.Background, true +} + +// HasBackground returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasBackground() bool { + if o != nil && !IsNil(o.Background) { + return true + } + + return false +} + +// SetBackground gets a reference to the given string and assigns it to the Background field. +func (o *PatchedFlowRequest) SetBackground(v string) { + o.Background = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedFlowRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetCompatibilityMode() bool { + if o == nil || IsNil(o.CompatibilityMode) { + var ret bool + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetCompatibilityModeOk() (*bool, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given bool and assigns it to the CompatibilityMode field. +func (o *PatchedFlowRequest) SetCompatibilityMode(v bool) { + o.CompatibilityMode = &v +} + +// GetLayout returns the Layout field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetLayout() FlowLayoutEnum { + if o == nil || IsNil(o.Layout) { + var ret FlowLayoutEnum + return ret + } + return *o.Layout +} + +// GetLayoutOk returns a tuple with the Layout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetLayoutOk() (*FlowLayoutEnum, bool) { + if o == nil || IsNil(o.Layout) { + return nil, false + } + return o.Layout, true +} + +// HasLayout returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasLayout() bool { + if o != nil && !IsNil(o.Layout) { + return true + } + + return false +} + +// SetLayout gets a reference to the given FlowLayoutEnum and assigns it to the Layout field. +func (o *PatchedFlowRequest) SetLayout(v FlowLayoutEnum) { + o.Layout = &v +} + +// GetDeniedAction returns the DeniedAction field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetDeniedAction() DeniedActionEnum { + if o == nil || IsNil(o.DeniedAction) { + var ret DeniedActionEnum + return ret + } + return *o.DeniedAction +} + +// GetDeniedActionOk returns a tuple with the DeniedAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetDeniedActionOk() (*DeniedActionEnum, bool) { + if o == nil || IsNil(o.DeniedAction) { + return nil, false + } + return o.DeniedAction, true +} + +// HasDeniedAction returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasDeniedAction() bool { + if o != nil && !IsNil(o.DeniedAction) { + return true + } + + return false +} + +// SetDeniedAction gets a reference to the given DeniedActionEnum and assigns it to the DeniedAction field. +func (o *PatchedFlowRequest) SetDeniedAction(v DeniedActionEnum) { + o.DeniedAction = &v +} + +// GetAuthentication returns the Authentication field value if set, zero value otherwise. +func (o *PatchedFlowRequest) GetAuthentication() AuthenticationEnum { + if o == nil || IsNil(o.Authentication) { + var ret AuthenticationEnum + return ret + } + return *o.Authentication +} + +// GetAuthenticationOk returns a tuple with the Authentication field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowRequest) GetAuthenticationOk() (*AuthenticationEnum, bool) { + if o == nil || IsNil(o.Authentication) { + return nil, false + } + return o.Authentication, true +} + +// HasAuthentication returns a boolean if a field has been set. +func (o *PatchedFlowRequest) HasAuthentication() bool { + if o != nil && !IsNil(o.Authentication) { + return true + } + + return false +} + +// SetAuthentication gets a reference to the given AuthenticationEnum and assigns it to the Authentication field. +func (o *PatchedFlowRequest) SetAuthentication(v AuthenticationEnum) { + o.Authentication = &v +} + +func (o PatchedFlowRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedFlowRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Title) { + toSerialize["title"] = o.Title + } + if !IsNil(o.Designation) { + toSerialize["designation"] = o.Designation + } + if !IsNil(o.Background) { + toSerialize["background"] = o.Background + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + if !IsNil(o.Layout) { + toSerialize["layout"] = o.Layout + } + if !IsNil(o.DeniedAction) { + toSerialize["denied_action"] = o.DeniedAction + } + if !IsNil(o.Authentication) { + toSerialize["authentication"] = o.Authentication + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedFlowRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedFlowRequest := _PatchedFlowRequest{} + + err = json.Unmarshal(data, &varPatchedFlowRequest) + + if err != nil { + return err + } + + *o = PatchedFlowRequest(varPatchedFlowRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "title") + delete(additionalProperties, "designation") + delete(additionalProperties, "background") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "layout") + delete(additionalProperties, "denied_action") + delete(additionalProperties, "authentication") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedFlowRequest struct { + value *PatchedFlowRequest + isSet bool +} + +func (v NullablePatchedFlowRequest) Get() *PatchedFlowRequest { + return v.value +} + +func (v *NullablePatchedFlowRequest) Set(val *PatchedFlowRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedFlowRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedFlowRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedFlowRequest(val *PatchedFlowRequest) *NullablePatchedFlowRequest { + return &NullablePatchedFlowRequest{value: val, isSet: true} +} + +func (v NullablePatchedFlowRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedFlowRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_flow_stage_binding_request.go b/packages/client-go/model_patched_flow_stage_binding_request.go new file mode 100644 index 0000000000..907d1cac9a --- /dev/null +++ b/packages/client-go/model_patched_flow_stage_binding_request.go @@ -0,0 +1,379 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedFlowStageBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedFlowStageBindingRequest{} + +// PatchedFlowStageBindingRequest FlowStageBinding Serializer +type PatchedFlowStageBindingRequest struct { + Target *string `json:"target,omitempty"` + Stage *string `json:"stage,omitempty"` + // Evaluate policies during the Flow planning process. + EvaluateOnPlan *bool `json:"evaluate_on_plan,omitempty"` + // Evaluate policies when the Stage is presented to the user. + ReEvaluatePolicies *bool `json:"re_evaluate_policies,omitempty"` + Order *int32 `json:"order,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // Configure how the flow executor should handle an invalid response to a challenge. RETRY returns the error message and a similar challenge to the executor. RESTART restarts the flow from the beginning, and RESTART_WITH_CONTEXT restarts the flow while keeping the current context. + InvalidResponseAction *InvalidResponseActionEnum `json:"invalid_response_action,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedFlowStageBindingRequest PatchedFlowStageBindingRequest + +// NewPatchedFlowStageBindingRequest instantiates a new PatchedFlowStageBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedFlowStageBindingRequest() *PatchedFlowStageBindingRequest { + this := PatchedFlowStageBindingRequest{} + return &this +} + +// NewPatchedFlowStageBindingRequestWithDefaults instantiates a new PatchedFlowStageBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedFlowStageBindingRequestWithDefaults() *PatchedFlowStageBindingRequest { + this := PatchedFlowStageBindingRequest{} + return &this +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetTarget() string { + if o == nil || IsNil(o.Target) { + var ret string + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetTargetOk() (*string, bool) { + if o == nil || IsNil(o.Target) { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasTarget() bool { + if o != nil && !IsNil(o.Target) { + return true + } + + return false +} + +// SetTarget gets a reference to the given string and assigns it to the Target field. +func (o *PatchedFlowStageBindingRequest) SetTarget(v string) { + o.Target = &v +} + +// GetStage returns the Stage field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetStage() string { + if o == nil || IsNil(o.Stage) { + var ret string + return ret + } + return *o.Stage +} + +// GetStageOk returns a tuple with the Stage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetStageOk() (*string, bool) { + if o == nil || IsNil(o.Stage) { + return nil, false + } + return o.Stage, true +} + +// HasStage returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasStage() bool { + if o != nil && !IsNil(o.Stage) { + return true + } + + return false +} + +// SetStage gets a reference to the given string and assigns it to the Stage field. +func (o *PatchedFlowStageBindingRequest) SetStage(v string) { + o.Stage = &v +} + +// GetEvaluateOnPlan returns the EvaluateOnPlan field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetEvaluateOnPlan() bool { + if o == nil || IsNil(o.EvaluateOnPlan) { + var ret bool + return ret + } + return *o.EvaluateOnPlan +} + +// GetEvaluateOnPlanOk returns a tuple with the EvaluateOnPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetEvaluateOnPlanOk() (*bool, bool) { + if o == nil || IsNil(o.EvaluateOnPlan) { + return nil, false + } + return o.EvaluateOnPlan, true +} + +// HasEvaluateOnPlan returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasEvaluateOnPlan() bool { + if o != nil && !IsNil(o.EvaluateOnPlan) { + return true + } + + return false +} + +// SetEvaluateOnPlan gets a reference to the given bool and assigns it to the EvaluateOnPlan field. +func (o *PatchedFlowStageBindingRequest) SetEvaluateOnPlan(v bool) { + o.EvaluateOnPlan = &v +} + +// GetReEvaluatePolicies returns the ReEvaluatePolicies field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetReEvaluatePolicies() bool { + if o == nil || IsNil(o.ReEvaluatePolicies) { + var ret bool + return ret + } + return *o.ReEvaluatePolicies +} + +// GetReEvaluatePoliciesOk returns a tuple with the ReEvaluatePolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetReEvaluatePoliciesOk() (*bool, bool) { + if o == nil || IsNil(o.ReEvaluatePolicies) { + return nil, false + } + return o.ReEvaluatePolicies, true +} + +// HasReEvaluatePolicies returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasReEvaluatePolicies() bool { + if o != nil && !IsNil(o.ReEvaluatePolicies) { + return true + } + + return false +} + +// SetReEvaluatePolicies gets a reference to the given bool and assigns it to the ReEvaluatePolicies field. +func (o *PatchedFlowStageBindingRequest) SetReEvaluatePolicies(v bool) { + o.ReEvaluatePolicies = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *PatchedFlowStageBindingRequest) SetOrder(v int32) { + o.Order = &v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedFlowStageBindingRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetInvalidResponseAction returns the InvalidResponseAction field value if set, zero value otherwise. +func (o *PatchedFlowStageBindingRequest) GetInvalidResponseAction() InvalidResponseActionEnum { + if o == nil || IsNil(o.InvalidResponseAction) { + var ret InvalidResponseActionEnum + return ret + } + return *o.InvalidResponseAction +} + +// GetInvalidResponseActionOk returns a tuple with the InvalidResponseAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedFlowStageBindingRequest) GetInvalidResponseActionOk() (*InvalidResponseActionEnum, bool) { + if o == nil || IsNil(o.InvalidResponseAction) { + return nil, false + } + return o.InvalidResponseAction, true +} + +// HasInvalidResponseAction returns a boolean if a field has been set. +func (o *PatchedFlowStageBindingRequest) HasInvalidResponseAction() bool { + if o != nil && !IsNil(o.InvalidResponseAction) { + return true + } + + return false +} + +// SetInvalidResponseAction gets a reference to the given InvalidResponseActionEnum and assigns it to the InvalidResponseAction field. +func (o *PatchedFlowStageBindingRequest) SetInvalidResponseAction(v InvalidResponseActionEnum) { + o.InvalidResponseAction = &v +} + +func (o PatchedFlowStageBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedFlowStageBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Target) { + toSerialize["target"] = o.Target + } + if !IsNil(o.Stage) { + toSerialize["stage"] = o.Stage + } + if !IsNil(o.EvaluateOnPlan) { + toSerialize["evaluate_on_plan"] = o.EvaluateOnPlan + } + if !IsNil(o.ReEvaluatePolicies) { + toSerialize["re_evaluate_policies"] = o.ReEvaluatePolicies + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.InvalidResponseAction) { + toSerialize["invalid_response_action"] = o.InvalidResponseAction + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedFlowStageBindingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedFlowStageBindingRequest := _PatchedFlowStageBindingRequest{} + + err = json.Unmarshal(data, &varPatchedFlowStageBindingRequest) + + if err != nil { + return err + } + + *o = PatchedFlowStageBindingRequest(varPatchedFlowStageBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "target") + delete(additionalProperties, "stage") + delete(additionalProperties, "evaluate_on_plan") + delete(additionalProperties, "re_evaluate_policies") + delete(additionalProperties, "order") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "invalid_response_action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedFlowStageBindingRequest struct { + value *PatchedFlowStageBindingRequest + isSet bool +} + +func (v NullablePatchedFlowStageBindingRequest) Get() *PatchedFlowStageBindingRequest { + return v.value +} + +func (v *NullablePatchedFlowStageBindingRequest) Set(val *PatchedFlowStageBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedFlowStageBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedFlowStageBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedFlowStageBindingRequest(val *PatchedFlowStageBindingRequest) *NullablePatchedFlowStageBindingRequest { + return &NullablePatchedFlowStageBindingRequest{value: val, isSet: true} +} + +func (v NullablePatchedFlowStageBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedFlowStageBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_geo_ip_policy_request.go b/packages/client-go/model_patched_geo_ip_policy_request.go new file mode 100644 index 0000000000..10fcccaa28 --- /dev/null +++ b/packages/client-go/model_patched_geo_ip_policy_request.go @@ -0,0 +1,488 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGeoIPPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGeoIPPolicyRequest{} + +// PatchedGeoIPPolicyRequest GeoIP Policy Serializer +type PatchedGeoIPPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Asns []int32 `json:"asns,omitempty"` + Countries []CountryCodeEnum `json:"countries,omitempty"` + CheckHistoryDistance *bool `json:"check_history_distance,omitempty"` + HistoryMaxDistanceKm *int64 `json:"history_max_distance_km,omitempty"` + DistanceToleranceKm *int32 `json:"distance_tolerance_km,omitempty"` + HistoryLoginCount *int32 `json:"history_login_count,omitempty"` + CheckImpossibleTravel *bool `json:"check_impossible_travel,omitempty"` + ImpossibleToleranceKm *int32 `json:"impossible_tolerance_km,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGeoIPPolicyRequest PatchedGeoIPPolicyRequest + +// NewPatchedGeoIPPolicyRequest instantiates a new PatchedGeoIPPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGeoIPPolicyRequest() *PatchedGeoIPPolicyRequest { + this := PatchedGeoIPPolicyRequest{} + return &this +} + +// NewPatchedGeoIPPolicyRequestWithDefaults instantiates a new PatchedGeoIPPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGeoIPPolicyRequestWithDefaults() *PatchedGeoIPPolicyRequest { + this := PatchedGeoIPPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGeoIPPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedGeoIPPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetAsns returns the Asns field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetAsns() []int32 { + if o == nil || IsNil(o.Asns) { + var ret []int32 + return ret + } + return o.Asns +} + +// GetAsnsOk returns a tuple with the Asns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetAsnsOk() ([]int32, bool) { + if o == nil || IsNil(o.Asns) { + return nil, false + } + return o.Asns, true +} + +// HasAsns returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasAsns() bool { + if o != nil && !IsNil(o.Asns) { + return true + } + + return false +} + +// SetAsns gets a reference to the given []int32 and assigns it to the Asns field. +func (o *PatchedGeoIPPolicyRequest) SetAsns(v []int32) { + o.Asns = v +} + +// GetCountries returns the Countries field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetCountries() []CountryCodeEnum { + if o == nil || IsNil(o.Countries) { + var ret []CountryCodeEnum + return ret + } + return o.Countries +} + +// GetCountriesOk returns a tuple with the Countries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetCountriesOk() ([]CountryCodeEnum, bool) { + if o == nil || IsNil(o.Countries) { + return nil, false + } + return o.Countries, true +} + +// HasCountries returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasCountries() bool { + if o != nil && !IsNil(o.Countries) { + return true + } + + return false +} + +// SetCountries gets a reference to the given []CountryCodeEnum and assigns it to the Countries field. +func (o *PatchedGeoIPPolicyRequest) SetCountries(v []CountryCodeEnum) { + o.Countries = v +} + +// GetCheckHistoryDistance returns the CheckHistoryDistance field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetCheckHistoryDistance() bool { + if o == nil || IsNil(o.CheckHistoryDistance) { + var ret bool + return ret + } + return *o.CheckHistoryDistance +} + +// GetCheckHistoryDistanceOk returns a tuple with the CheckHistoryDistance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetCheckHistoryDistanceOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHistoryDistance) { + return nil, false + } + return o.CheckHistoryDistance, true +} + +// HasCheckHistoryDistance returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasCheckHistoryDistance() bool { + if o != nil && !IsNil(o.CheckHistoryDistance) { + return true + } + + return false +} + +// SetCheckHistoryDistance gets a reference to the given bool and assigns it to the CheckHistoryDistance field. +func (o *PatchedGeoIPPolicyRequest) SetCheckHistoryDistance(v bool) { + o.CheckHistoryDistance = &v +} + +// GetHistoryMaxDistanceKm returns the HistoryMaxDistanceKm field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetHistoryMaxDistanceKm() int64 { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + var ret int64 + return ret + } + return *o.HistoryMaxDistanceKm +} + +// GetHistoryMaxDistanceKmOk returns a tuple with the HistoryMaxDistanceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetHistoryMaxDistanceKmOk() (*int64, bool) { + if o == nil || IsNil(o.HistoryMaxDistanceKm) { + return nil, false + } + return o.HistoryMaxDistanceKm, true +} + +// HasHistoryMaxDistanceKm returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasHistoryMaxDistanceKm() bool { + if o != nil && !IsNil(o.HistoryMaxDistanceKm) { + return true + } + + return false +} + +// SetHistoryMaxDistanceKm gets a reference to the given int64 and assigns it to the HistoryMaxDistanceKm field. +func (o *PatchedGeoIPPolicyRequest) SetHistoryMaxDistanceKm(v int64) { + o.HistoryMaxDistanceKm = &v +} + +// GetDistanceToleranceKm returns the DistanceToleranceKm field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetDistanceToleranceKm() int32 { + if o == nil || IsNil(o.DistanceToleranceKm) { + var ret int32 + return ret + } + return *o.DistanceToleranceKm +} + +// GetDistanceToleranceKmOk returns a tuple with the DistanceToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetDistanceToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.DistanceToleranceKm) { + return nil, false + } + return o.DistanceToleranceKm, true +} + +// HasDistanceToleranceKm returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasDistanceToleranceKm() bool { + if o != nil && !IsNil(o.DistanceToleranceKm) { + return true + } + + return false +} + +// SetDistanceToleranceKm gets a reference to the given int32 and assigns it to the DistanceToleranceKm field. +func (o *PatchedGeoIPPolicyRequest) SetDistanceToleranceKm(v int32) { + o.DistanceToleranceKm = &v +} + +// GetHistoryLoginCount returns the HistoryLoginCount field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetHistoryLoginCount() int32 { + if o == nil || IsNil(o.HistoryLoginCount) { + var ret int32 + return ret + } + return *o.HistoryLoginCount +} + +// GetHistoryLoginCountOk returns a tuple with the HistoryLoginCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetHistoryLoginCountOk() (*int32, bool) { + if o == nil || IsNil(o.HistoryLoginCount) { + return nil, false + } + return o.HistoryLoginCount, true +} + +// HasHistoryLoginCount returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasHistoryLoginCount() bool { + if o != nil && !IsNil(o.HistoryLoginCount) { + return true + } + + return false +} + +// SetHistoryLoginCount gets a reference to the given int32 and assigns it to the HistoryLoginCount field. +func (o *PatchedGeoIPPolicyRequest) SetHistoryLoginCount(v int32) { + o.HistoryLoginCount = &v +} + +// GetCheckImpossibleTravel returns the CheckImpossibleTravel field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetCheckImpossibleTravel() bool { + if o == nil || IsNil(o.CheckImpossibleTravel) { + var ret bool + return ret + } + return *o.CheckImpossibleTravel +} + +// GetCheckImpossibleTravelOk returns a tuple with the CheckImpossibleTravel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetCheckImpossibleTravelOk() (*bool, bool) { + if o == nil || IsNil(o.CheckImpossibleTravel) { + return nil, false + } + return o.CheckImpossibleTravel, true +} + +// HasCheckImpossibleTravel returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasCheckImpossibleTravel() bool { + if o != nil && !IsNil(o.CheckImpossibleTravel) { + return true + } + + return false +} + +// SetCheckImpossibleTravel gets a reference to the given bool and assigns it to the CheckImpossibleTravel field. +func (o *PatchedGeoIPPolicyRequest) SetCheckImpossibleTravel(v bool) { + o.CheckImpossibleTravel = &v +} + +// GetImpossibleToleranceKm returns the ImpossibleToleranceKm field value if set, zero value otherwise. +func (o *PatchedGeoIPPolicyRequest) GetImpossibleToleranceKm() int32 { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + var ret int32 + return ret + } + return *o.ImpossibleToleranceKm +} + +// GetImpossibleToleranceKmOk returns a tuple with the ImpossibleToleranceKm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGeoIPPolicyRequest) GetImpossibleToleranceKmOk() (*int32, bool) { + if o == nil || IsNil(o.ImpossibleToleranceKm) { + return nil, false + } + return o.ImpossibleToleranceKm, true +} + +// HasImpossibleToleranceKm returns a boolean if a field has been set. +func (o *PatchedGeoIPPolicyRequest) HasImpossibleToleranceKm() bool { + if o != nil && !IsNil(o.ImpossibleToleranceKm) { + return true + } + + return false +} + +// SetImpossibleToleranceKm gets a reference to the given int32 and assigns it to the ImpossibleToleranceKm field. +func (o *PatchedGeoIPPolicyRequest) SetImpossibleToleranceKm(v int32) { + o.ImpossibleToleranceKm = &v +} + +func (o PatchedGeoIPPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGeoIPPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Asns) { + toSerialize["asns"] = o.Asns + } + if !IsNil(o.Countries) { + toSerialize["countries"] = o.Countries + } + if !IsNil(o.CheckHistoryDistance) { + toSerialize["check_history_distance"] = o.CheckHistoryDistance + } + if !IsNil(o.HistoryMaxDistanceKm) { + toSerialize["history_max_distance_km"] = o.HistoryMaxDistanceKm + } + if !IsNil(o.DistanceToleranceKm) { + toSerialize["distance_tolerance_km"] = o.DistanceToleranceKm + } + if !IsNil(o.HistoryLoginCount) { + toSerialize["history_login_count"] = o.HistoryLoginCount + } + if !IsNil(o.CheckImpossibleTravel) { + toSerialize["check_impossible_travel"] = o.CheckImpossibleTravel + } + if !IsNil(o.ImpossibleToleranceKm) { + toSerialize["impossible_tolerance_km"] = o.ImpossibleToleranceKm + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGeoIPPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGeoIPPolicyRequest := _PatchedGeoIPPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedGeoIPPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedGeoIPPolicyRequest(varPatchedGeoIPPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "asns") + delete(additionalProperties, "countries") + delete(additionalProperties, "check_history_distance") + delete(additionalProperties, "history_max_distance_km") + delete(additionalProperties, "distance_tolerance_km") + delete(additionalProperties, "history_login_count") + delete(additionalProperties, "check_impossible_travel") + delete(additionalProperties, "impossible_tolerance_km") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGeoIPPolicyRequest struct { + value *PatchedGeoIPPolicyRequest + isSet bool +} + +func (v NullablePatchedGeoIPPolicyRequest) Get() *PatchedGeoIPPolicyRequest { + return v.value +} + +func (v *NullablePatchedGeoIPPolicyRequest) Set(val *PatchedGeoIPPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGeoIPPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGeoIPPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGeoIPPolicyRequest(val *PatchedGeoIPPolicyRequest) *NullablePatchedGeoIPPolicyRequest { + return &NullablePatchedGeoIPPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedGeoIPPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGeoIPPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_google_chrome_connector_request.go b/packages/client-go/model_patched_google_chrome_connector_request.go new file mode 100644 index 0000000000..3b9fde8f8e --- /dev/null +++ b/packages/client-go/model_patched_google_chrome_connector_request.go @@ -0,0 +1,265 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGoogleChromeConnectorRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGoogleChromeConnectorRequest{} + +// PatchedGoogleChromeConnectorRequest GoogleChromeConnector Serializer +type PatchedGoogleChromeConnectorRequest struct { + ConnectorUuid *string `json:"connector_uuid,omitempty"` + Name *string `json:"name,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Credentials map[string]interface{} `json:"credentials,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGoogleChromeConnectorRequest PatchedGoogleChromeConnectorRequest + +// NewPatchedGoogleChromeConnectorRequest instantiates a new PatchedGoogleChromeConnectorRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGoogleChromeConnectorRequest() *PatchedGoogleChromeConnectorRequest { + this := PatchedGoogleChromeConnectorRequest{} + return &this +} + +// NewPatchedGoogleChromeConnectorRequestWithDefaults instantiates a new PatchedGoogleChromeConnectorRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGoogleChromeConnectorRequestWithDefaults() *PatchedGoogleChromeConnectorRequest { + this := PatchedGoogleChromeConnectorRequest{} + return &this +} + +// GetConnectorUuid returns the ConnectorUuid field value if set, zero value otherwise. +func (o *PatchedGoogleChromeConnectorRequest) GetConnectorUuid() string { + if o == nil || IsNil(o.ConnectorUuid) { + var ret string + return ret + } + return *o.ConnectorUuid +} + +// GetConnectorUuidOk returns a tuple with the ConnectorUuid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleChromeConnectorRequest) GetConnectorUuidOk() (*string, bool) { + if o == nil || IsNil(o.ConnectorUuid) { + return nil, false + } + return o.ConnectorUuid, true +} + +// HasConnectorUuid returns a boolean if a field has been set. +func (o *PatchedGoogleChromeConnectorRequest) HasConnectorUuid() bool { + if o != nil && !IsNil(o.ConnectorUuid) { + return true + } + + return false +} + +// SetConnectorUuid gets a reference to the given string and assigns it to the ConnectorUuid field. +func (o *PatchedGoogleChromeConnectorRequest) SetConnectorUuid(v string) { + o.ConnectorUuid = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGoogleChromeConnectorRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleChromeConnectorRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGoogleChromeConnectorRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGoogleChromeConnectorRequest) SetName(v string) { + o.Name = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedGoogleChromeConnectorRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleChromeConnectorRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedGoogleChromeConnectorRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedGoogleChromeConnectorRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *PatchedGoogleChromeConnectorRequest) GetCredentials() map[string]interface{} { + if o == nil || IsNil(o.Credentials) { + var ret map[string]interface{} + return ret + } + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleChromeConnectorRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Credentials) { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *PatchedGoogleChromeConnectorRequest) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given map[string]interface{} and assigns it to the Credentials field. +func (o *PatchedGoogleChromeConnectorRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +func (o PatchedGoogleChromeConnectorRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGoogleChromeConnectorRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConnectorUuid) { + toSerialize["connector_uuid"] = o.ConnectorUuid + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGoogleChromeConnectorRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGoogleChromeConnectorRequest := _PatchedGoogleChromeConnectorRequest{} + + err = json.Unmarshal(data, &varPatchedGoogleChromeConnectorRequest) + + if err != nil { + return err + } + + *o = PatchedGoogleChromeConnectorRequest(varPatchedGoogleChromeConnectorRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "connector_uuid") + delete(additionalProperties, "name") + delete(additionalProperties, "enabled") + delete(additionalProperties, "credentials") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGoogleChromeConnectorRequest struct { + value *PatchedGoogleChromeConnectorRequest + isSet bool +} + +func (v NullablePatchedGoogleChromeConnectorRequest) Get() *PatchedGoogleChromeConnectorRequest { + return v.value +} + +func (v *NullablePatchedGoogleChromeConnectorRequest) Set(val *PatchedGoogleChromeConnectorRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGoogleChromeConnectorRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGoogleChromeConnectorRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGoogleChromeConnectorRequest(val *PatchedGoogleChromeConnectorRequest) *NullablePatchedGoogleChromeConnectorRequest { + return &NullablePatchedGoogleChromeConnectorRequest{value: val, isSet: true} +} + +func (v NullablePatchedGoogleChromeConnectorRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGoogleChromeConnectorRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_google_endpoint_device_request.go b/packages/client-go/model_patched_google_endpoint_device_request.go new file mode 100644 index 0000000000..04e5701a69 --- /dev/null +++ b/packages/client-go/model_patched_google_endpoint_device_request.go @@ -0,0 +1,192 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGoogleEndpointDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGoogleEndpointDeviceRequest{} + +// PatchedGoogleEndpointDeviceRequest Serializer for Endpoint authenticator devices +type PatchedGoogleEndpointDeviceRequest struct { + Pk *string `json:"pk,omitempty"` + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGoogleEndpointDeviceRequest PatchedGoogleEndpointDeviceRequest + +// NewPatchedGoogleEndpointDeviceRequest instantiates a new PatchedGoogleEndpointDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGoogleEndpointDeviceRequest() *PatchedGoogleEndpointDeviceRequest { + this := PatchedGoogleEndpointDeviceRequest{} + return &this +} + +// NewPatchedGoogleEndpointDeviceRequestWithDefaults instantiates a new PatchedGoogleEndpointDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGoogleEndpointDeviceRequestWithDefaults() *PatchedGoogleEndpointDeviceRequest { + this := PatchedGoogleEndpointDeviceRequest{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *PatchedGoogleEndpointDeviceRequest) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleEndpointDeviceRequest) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *PatchedGoogleEndpointDeviceRequest) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *PatchedGoogleEndpointDeviceRequest) SetPk(v string) { + o.Pk = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGoogleEndpointDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleEndpointDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGoogleEndpointDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGoogleEndpointDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedGoogleEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGoogleEndpointDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGoogleEndpointDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGoogleEndpointDeviceRequest := _PatchedGoogleEndpointDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedGoogleEndpointDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedGoogleEndpointDeviceRequest(varPatchedGoogleEndpointDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGoogleEndpointDeviceRequest struct { + value *PatchedGoogleEndpointDeviceRequest + isSet bool +} + +func (v NullablePatchedGoogleEndpointDeviceRequest) Get() *PatchedGoogleEndpointDeviceRequest { + return v.value +} + +func (v *NullablePatchedGoogleEndpointDeviceRequest) Set(val *PatchedGoogleEndpointDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGoogleEndpointDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGoogleEndpointDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGoogleEndpointDeviceRequest(val *PatchedGoogleEndpointDeviceRequest) *NullablePatchedGoogleEndpointDeviceRequest { + return &NullablePatchedGoogleEndpointDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedGoogleEndpointDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGoogleEndpointDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_google_workspace_provider_mapping_request.go b/packages/client-go/model_patched_google_workspace_provider_mapping_request.go new file mode 100644 index 0000000000..33d51f3cbd --- /dev/null +++ b/packages/client-go/model_patched_google_workspace_provider_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGoogleWorkspaceProviderMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGoogleWorkspaceProviderMappingRequest{} + +// PatchedGoogleWorkspaceProviderMappingRequest GoogleWorkspaceProviderMapping Serializer +type PatchedGoogleWorkspaceProviderMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGoogleWorkspaceProviderMappingRequest PatchedGoogleWorkspaceProviderMappingRequest + +// NewPatchedGoogleWorkspaceProviderMappingRequest instantiates a new PatchedGoogleWorkspaceProviderMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGoogleWorkspaceProviderMappingRequest() *PatchedGoogleWorkspaceProviderMappingRequest { + this := PatchedGoogleWorkspaceProviderMappingRequest{} + return &this +} + +// NewPatchedGoogleWorkspaceProviderMappingRequestWithDefaults instantiates a new PatchedGoogleWorkspaceProviderMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGoogleWorkspaceProviderMappingRequestWithDefaults() *PatchedGoogleWorkspaceProviderMappingRequest { + this := PatchedGoogleWorkspaceProviderMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedGoogleWorkspaceProviderMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedGoogleWorkspaceProviderMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedGoogleWorkspaceProviderMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedGoogleWorkspaceProviderMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGoogleWorkspaceProviderMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGoogleWorkspaceProviderMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGoogleWorkspaceProviderMappingRequest := _PatchedGoogleWorkspaceProviderMappingRequest{} + + err = json.Unmarshal(data, &varPatchedGoogleWorkspaceProviderMappingRequest) + + if err != nil { + return err + } + + *o = PatchedGoogleWorkspaceProviderMappingRequest(varPatchedGoogleWorkspaceProviderMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGoogleWorkspaceProviderMappingRequest struct { + value *PatchedGoogleWorkspaceProviderMappingRequest + isSet bool +} + +func (v NullablePatchedGoogleWorkspaceProviderMappingRequest) Get() *PatchedGoogleWorkspaceProviderMappingRequest { + return v.value +} + +func (v *NullablePatchedGoogleWorkspaceProviderMappingRequest) Set(val *PatchedGoogleWorkspaceProviderMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGoogleWorkspaceProviderMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGoogleWorkspaceProviderMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGoogleWorkspaceProviderMappingRequest(val *PatchedGoogleWorkspaceProviderMappingRequest) *NullablePatchedGoogleWorkspaceProviderMappingRequest { + return &NullablePatchedGoogleWorkspaceProviderMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedGoogleWorkspaceProviderMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGoogleWorkspaceProviderMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_google_workspace_provider_request.go b/packages/client-go/model_patched_google_workspace_provider_request.go new file mode 100644 index 0000000000..2ee30f94a7 --- /dev/null +++ b/packages/client-go/model_patched_google_workspace_provider_request.go @@ -0,0 +1,650 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGoogleWorkspaceProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGoogleWorkspaceProviderRequest{} + +// PatchedGoogleWorkspaceProviderRequest GoogleWorkspaceProvider Serializer +type PatchedGoogleWorkspaceProviderRequest struct { + Name *string `json:"name,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + DelegatedSubject *string `json:"delegated_subject,omitempty"` + Credentials map[string]interface{} `json:"credentials,omitempty"` + Scopes *string `json:"scopes,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + DefaultGroupEmailDomain *string `json:"default_group_email_domain,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGoogleWorkspaceProviderRequest PatchedGoogleWorkspaceProviderRequest + +// NewPatchedGoogleWorkspaceProviderRequest instantiates a new PatchedGoogleWorkspaceProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGoogleWorkspaceProviderRequest() *PatchedGoogleWorkspaceProviderRequest { + this := PatchedGoogleWorkspaceProviderRequest{} + return &this +} + +// NewPatchedGoogleWorkspaceProviderRequestWithDefaults instantiates a new PatchedGoogleWorkspaceProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGoogleWorkspaceProviderRequestWithDefaults() *PatchedGoogleWorkspaceProviderRequest { + this := PatchedGoogleWorkspaceProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetDelegatedSubject returns the DelegatedSubject field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDelegatedSubject() string { + if o == nil || IsNil(o.DelegatedSubject) { + var ret string + return ret + } + return *o.DelegatedSubject +} + +// GetDelegatedSubjectOk returns a tuple with the DelegatedSubject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDelegatedSubjectOk() (*string, bool) { + if o == nil || IsNil(o.DelegatedSubject) { + return nil, false + } + return o.DelegatedSubject, true +} + +// HasDelegatedSubject returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasDelegatedSubject() bool { + if o != nil && !IsNil(o.DelegatedSubject) { + return true + } + + return false +} + +// SetDelegatedSubject gets a reference to the given string and assigns it to the DelegatedSubject field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetDelegatedSubject(v string) { + o.DelegatedSubject = &v +} + +// GetCredentials returns the Credentials field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetCredentials() map[string]interface{} { + if o == nil || IsNil(o.Credentials) { + var ret map[string]interface{} + return ret + } + return o.Credentials +} + +// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetCredentialsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Credentials) { + return map[string]interface{}{}, false + } + return o.Credentials, true +} + +// HasCredentials returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasCredentials() bool { + if o != nil && !IsNil(o.Credentials) { + return true + } + + return false +} + +// SetCredentials gets a reference to the given map[string]interface{} and assigns it to the Credentials field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetCredentials(v map[string]interface{}) { + o.Credentials = v +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetScopes() string { + if o == nil || IsNil(o.Scopes) { + var ret string + return ret + } + return *o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetScopesOk() (*string, bool) { + if o == nil || IsNil(o.Scopes) { + return nil, false + } + return o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasScopes() bool { + if o != nil && !IsNil(o.Scopes) { + return true + } + + return false +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetScopes(v string) { + o.Scopes = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedGoogleWorkspaceProviderRequest) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedGoogleWorkspaceProviderRequest) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *PatchedGoogleWorkspaceProviderRequest) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *PatchedGoogleWorkspaceProviderRequest) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetDefaultGroupEmailDomain returns the DefaultGroupEmailDomain field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDefaultGroupEmailDomain() string { + if o == nil || IsNil(o.DefaultGroupEmailDomain) { + var ret string + return ret + } + return *o.DefaultGroupEmailDomain +} + +// GetDefaultGroupEmailDomainOk returns a tuple with the DefaultGroupEmailDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDefaultGroupEmailDomainOk() (*string, bool) { + if o == nil || IsNil(o.DefaultGroupEmailDomain) { + return nil, false + } + return o.DefaultGroupEmailDomain, true +} + +// HasDefaultGroupEmailDomain returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasDefaultGroupEmailDomain() bool { + if o != nil && !IsNil(o.DefaultGroupEmailDomain) { + return true + } + + return false +} + +// SetDefaultGroupEmailDomain gets a reference to the given string and assigns it to the DefaultGroupEmailDomain field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetDefaultGroupEmailDomain(v string) { + o.DefaultGroupEmailDomain = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *PatchedGoogleWorkspaceProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *PatchedGoogleWorkspaceProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o PatchedGoogleWorkspaceProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGoogleWorkspaceProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + if !IsNil(o.DelegatedSubject) { + toSerialize["delegated_subject"] = o.DelegatedSubject + } + if !IsNil(o.Credentials) { + toSerialize["credentials"] = o.Credentials + } + if !IsNil(o.Scopes) { + toSerialize["scopes"] = o.Scopes + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + if !IsNil(o.DefaultGroupEmailDomain) { + toSerialize["default_group_email_domain"] = o.DefaultGroupEmailDomain + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGoogleWorkspaceProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGoogleWorkspaceProviderRequest := _PatchedGoogleWorkspaceProviderRequest{} + + err = json.Unmarshal(data, &varPatchedGoogleWorkspaceProviderRequest) + + if err != nil { + return err + } + + *o = PatchedGoogleWorkspaceProviderRequest(varPatchedGoogleWorkspaceProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "delegated_subject") + delete(additionalProperties, "credentials") + delete(additionalProperties, "scopes") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "default_group_email_domain") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGoogleWorkspaceProviderRequest struct { + value *PatchedGoogleWorkspaceProviderRequest + isSet bool +} + +func (v NullablePatchedGoogleWorkspaceProviderRequest) Get() *PatchedGoogleWorkspaceProviderRequest { + return v.value +} + +func (v *NullablePatchedGoogleWorkspaceProviderRequest) Set(val *PatchedGoogleWorkspaceProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGoogleWorkspaceProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGoogleWorkspaceProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGoogleWorkspaceProviderRequest(val *PatchedGoogleWorkspaceProviderRequest) *NullablePatchedGoogleWorkspaceProviderRequest { + return &NullablePatchedGoogleWorkspaceProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedGoogleWorkspaceProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGoogleWorkspaceProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_kerberos_source_connection_request.go b/packages/client-go/model_patched_group_kerberos_source_connection_request.go new file mode 100644 index 0000000000..2f39c27de2 --- /dev/null +++ b/packages/client-go/model_patched_group_kerberos_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupKerberosSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupKerberosSourceConnectionRequest{} + +// PatchedGroupKerberosSourceConnectionRequest Group Source Connection +type PatchedGroupKerberosSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupKerberosSourceConnectionRequest PatchedGroupKerberosSourceConnectionRequest + +// NewPatchedGroupKerberosSourceConnectionRequest instantiates a new PatchedGroupKerberosSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupKerberosSourceConnectionRequest() *PatchedGroupKerberosSourceConnectionRequest { + this := PatchedGroupKerberosSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupKerberosSourceConnectionRequestWithDefaults instantiates a new PatchedGroupKerberosSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupKerberosSourceConnectionRequestWithDefaults() *PatchedGroupKerberosSourceConnectionRequest { + this := PatchedGroupKerberosSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupKerberosSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupKerberosSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupKerberosSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupKerberosSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupKerberosSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupKerberosSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupKerberosSourceConnectionRequest := _PatchedGroupKerberosSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupKerberosSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupKerberosSourceConnectionRequest(varPatchedGroupKerberosSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupKerberosSourceConnectionRequest struct { + value *PatchedGroupKerberosSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupKerberosSourceConnectionRequest) Get() *PatchedGroupKerberosSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupKerberosSourceConnectionRequest) Set(val *PatchedGroupKerberosSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupKerberosSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupKerberosSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupKerberosSourceConnectionRequest(val *PatchedGroupKerberosSourceConnectionRequest) *NullablePatchedGroupKerberosSourceConnectionRequest { + return &NullablePatchedGroupKerberosSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupKerberosSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_ldap_source_connection_request.go b/packages/client-go/model_patched_group_ldap_source_connection_request.go new file mode 100644 index 0000000000..6142de000e --- /dev/null +++ b/packages/client-go/model_patched_group_ldap_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupLDAPSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupLDAPSourceConnectionRequest{} + +// PatchedGroupLDAPSourceConnectionRequest Group Source Connection +type PatchedGroupLDAPSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupLDAPSourceConnectionRequest PatchedGroupLDAPSourceConnectionRequest + +// NewPatchedGroupLDAPSourceConnectionRequest instantiates a new PatchedGroupLDAPSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupLDAPSourceConnectionRequest() *PatchedGroupLDAPSourceConnectionRequest { + this := PatchedGroupLDAPSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupLDAPSourceConnectionRequestWithDefaults instantiates a new PatchedGroupLDAPSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupLDAPSourceConnectionRequestWithDefaults() *PatchedGroupLDAPSourceConnectionRequest { + this := PatchedGroupLDAPSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupLDAPSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupLDAPSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupLDAPSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupLDAPSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupLDAPSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupLDAPSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupLDAPSourceConnectionRequest := _PatchedGroupLDAPSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupLDAPSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupLDAPSourceConnectionRequest(varPatchedGroupLDAPSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupLDAPSourceConnectionRequest struct { + value *PatchedGroupLDAPSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupLDAPSourceConnectionRequest) Get() *PatchedGroupLDAPSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupLDAPSourceConnectionRequest) Set(val *PatchedGroupLDAPSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupLDAPSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupLDAPSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupLDAPSourceConnectionRequest(val *PatchedGroupLDAPSourceConnectionRequest) *NullablePatchedGroupLDAPSourceConnectionRequest { + return &NullablePatchedGroupLDAPSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupLDAPSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_o_auth_source_connection_request.go b/packages/client-go/model_patched_group_o_auth_source_connection_request.go new file mode 100644 index 0000000000..df20c152f0 --- /dev/null +++ b/packages/client-go/model_patched_group_o_auth_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupOAuthSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupOAuthSourceConnectionRequest{} + +// PatchedGroupOAuthSourceConnectionRequest Group Source Connection +type PatchedGroupOAuthSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupOAuthSourceConnectionRequest PatchedGroupOAuthSourceConnectionRequest + +// NewPatchedGroupOAuthSourceConnectionRequest instantiates a new PatchedGroupOAuthSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupOAuthSourceConnectionRequest() *PatchedGroupOAuthSourceConnectionRequest { + this := PatchedGroupOAuthSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupOAuthSourceConnectionRequestWithDefaults instantiates a new PatchedGroupOAuthSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupOAuthSourceConnectionRequestWithDefaults() *PatchedGroupOAuthSourceConnectionRequest { + this := PatchedGroupOAuthSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupOAuthSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupOAuthSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupOAuthSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupOAuthSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupOAuthSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupOAuthSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupOAuthSourceConnectionRequest := _PatchedGroupOAuthSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupOAuthSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupOAuthSourceConnectionRequest(varPatchedGroupOAuthSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupOAuthSourceConnectionRequest struct { + value *PatchedGroupOAuthSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupOAuthSourceConnectionRequest) Get() *PatchedGroupOAuthSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupOAuthSourceConnectionRequest) Set(val *PatchedGroupOAuthSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupOAuthSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupOAuthSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupOAuthSourceConnectionRequest(val *PatchedGroupOAuthSourceConnectionRequest) *NullablePatchedGroupOAuthSourceConnectionRequest { + return &NullablePatchedGroupOAuthSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupOAuthSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_plex_source_connection_request.go b/packages/client-go/model_patched_group_plex_source_connection_request.go new file mode 100644 index 0000000000..9bff25e722 --- /dev/null +++ b/packages/client-go/model_patched_group_plex_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupPlexSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupPlexSourceConnectionRequest{} + +// PatchedGroupPlexSourceConnectionRequest Group Source Connection +type PatchedGroupPlexSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupPlexSourceConnectionRequest PatchedGroupPlexSourceConnectionRequest + +// NewPatchedGroupPlexSourceConnectionRequest instantiates a new PatchedGroupPlexSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupPlexSourceConnectionRequest() *PatchedGroupPlexSourceConnectionRequest { + this := PatchedGroupPlexSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupPlexSourceConnectionRequestWithDefaults instantiates a new PatchedGroupPlexSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupPlexSourceConnectionRequestWithDefaults() *PatchedGroupPlexSourceConnectionRequest { + this := PatchedGroupPlexSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupPlexSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupPlexSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupPlexSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupPlexSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupPlexSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupPlexSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupPlexSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupPlexSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupPlexSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupPlexSourceConnectionRequest := _PatchedGroupPlexSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupPlexSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupPlexSourceConnectionRequest(varPatchedGroupPlexSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupPlexSourceConnectionRequest struct { + value *PatchedGroupPlexSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupPlexSourceConnectionRequest) Get() *PatchedGroupPlexSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupPlexSourceConnectionRequest) Set(val *PatchedGroupPlexSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupPlexSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupPlexSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupPlexSourceConnectionRequest(val *PatchedGroupPlexSourceConnectionRequest) *NullablePatchedGroupPlexSourceConnectionRequest { + return &NullablePatchedGroupPlexSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupPlexSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_request.go b/packages/client-go/model_patched_group_request.go new file mode 100644 index 0000000000..927836b5ee --- /dev/null +++ b/packages/client-go/model_patched_group_request.go @@ -0,0 +1,340 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupRequest{} + +// PatchedGroupRequest Group Serializer +type PatchedGroupRequest struct { + Name *string `json:"name,omitempty"` + // Users added to this group will be superusers. + IsSuperuser *bool `json:"is_superuser,omitempty"` + Parents []string `json:"parents,omitempty"` + Users []int32 `json:"users,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Roles []string `json:"roles,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupRequest PatchedGroupRequest + +// NewPatchedGroupRequest instantiates a new PatchedGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupRequest() *PatchedGroupRequest { + this := PatchedGroupRequest{} + return &this +} + +// NewPatchedGroupRequestWithDefaults instantiates a new PatchedGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupRequestWithDefaults() *PatchedGroupRequest { + this := PatchedGroupRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedGroupRequest) SetName(v string) { + o.Name = &v +} + +// GetIsSuperuser returns the IsSuperuser field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetIsSuperuser() bool { + if o == nil || IsNil(o.IsSuperuser) { + var ret bool + return ret + } + return *o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetIsSuperuserOk() (*bool, bool) { + if o == nil || IsNil(o.IsSuperuser) { + return nil, false + } + return o.IsSuperuser, true +} + +// HasIsSuperuser returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasIsSuperuser() bool { + if o != nil && !IsNil(o.IsSuperuser) { + return true + } + + return false +} + +// SetIsSuperuser gets a reference to the given bool and assigns it to the IsSuperuser field. +func (o *PatchedGroupRequest) SetIsSuperuser(v bool) { + o.IsSuperuser = &v +} + +// GetParents returns the Parents field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetParents() []string { + if o == nil || IsNil(o.Parents) { + var ret []string + return ret + } + return o.Parents +} + +// GetParentsOk returns a tuple with the Parents field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetParentsOk() ([]string, bool) { + if o == nil || IsNil(o.Parents) { + return nil, false + } + return o.Parents, true +} + +// HasParents returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasParents() bool { + if o != nil && !IsNil(o.Parents) { + return true + } + + return false +} + +// SetParents gets a reference to the given []string and assigns it to the Parents field. +func (o *PatchedGroupRequest) SetParents(v []string) { + o.Parents = v +} + +// GetUsers returns the Users field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetUsers() []int32 { + if o == nil || IsNil(o.Users) { + var ret []int32 + return ret + } + return o.Users +} + +// GetUsersOk returns a tuple with the Users field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetUsersOk() ([]int32, bool) { + if o == nil || IsNil(o.Users) { + return nil, false + } + return o.Users, true +} + +// HasUsers returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasUsers() bool { + if o != nil && !IsNil(o.Users) { + return true + } + + return false +} + +// SetUsers gets a reference to the given []int32 and assigns it to the Users field. +func (o *PatchedGroupRequest) SetUsers(v []int32) { + o.Users = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedGroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PatchedGroupRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupRequest) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PatchedGroupRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *PatchedGroupRequest) SetRoles(v []string) { + o.Roles = v +} + +func (o PatchedGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.IsSuperuser) { + toSerialize["is_superuser"] = o.IsSuperuser + } + if !IsNil(o.Parents) { + toSerialize["parents"] = o.Parents + } + if !IsNil(o.Users) { + toSerialize["users"] = o.Users + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupRequest := _PatchedGroupRequest{} + + err = json.Unmarshal(data, &varPatchedGroupRequest) + + if err != nil { + return err + } + + *o = PatchedGroupRequest(varPatchedGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "parents") + delete(additionalProperties, "users") + delete(additionalProperties, "attributes") + delete(additionalProperties, "roles") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupRequest struct { + value *PatchedGroupRequest + isSet bool +} + +func (v NullablePatchedGroupRequest) Get() *PatchedGroupRequest { + return v.value +} + +func (v *NullablePatchedGroupRequest) Set(val *PatchedGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupRequest(val *PatchedGroupRequest) *NullablePatchedGroupRequest { + return &NullablePatchedGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_saml_source_connection_request.go b/packages/client-go/model_patched_group_saml_source_connection_request.go new file mode 100644 index 0000000000..26f90554ce --- /dev/null +++ b/packages/client-go/model_patched_group_saml_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupSAMLSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupSAMLSourceConnectionRequest{} + +// PatchedGroupSAMLSourceConnectionRequest Group Source Connection +type PatchedGroupSAMLSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupSAMLSourceConnectionRequest PatchedGroupSAMLSourceConnectionRequest + +// NewPatchedGroupSAMLSourceConnectionRequest instantiates a new PatchedGroupSAMLSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupSAMLSourceConnectionRequest() *PatchedGroupSAMLSourceConnectionRequest { + this := PatchedGroupSAMLSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupSAMLSourceConnectionRequestWithDefaults instantiates a new PatchedGroupSAMLSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupSAMLSourceConnectionRequestWithDefaults() *PatchedGroupSAMLSourceConnectionRequest { + this := PatchedGroupSAMLSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupSAMLSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupSAMLSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupSAMLSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupSAMLSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupSAMLSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupSAMLSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupSAMLSourceConnectionRequest := _PatchedGroupSAMLSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupSAMLSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupSAMLSourceConnectionRequest(varPatchedGroupSAMLSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupSAMLSourceConnectionRequest struct { + value *PatchedGroupSAMLSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupSAMLSourceConnectionRequest) Get() *PatchedGroupSAMLSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupSAMLSourceConnectionRequest) Set(val *PatchedGroupSAMLSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupSAMLSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupSAMLSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupSAMLSourceConnectionRequest(val *PatchedGroupSAMLSourceConnectionRequest) *NullablePatchedGroupSAMLSourceConnectionRequest { + return &NullablePatchedGroupSAMLSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupSAMLSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_source_connection_request.go b/packages/client-go/model_patched_group_source_connection_request.go new file mode 100644 index 0000000000..7b76da81a1 --- /dev/null +++ b/packages/client-go/model_patched_group_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupSourceConnectionRequest{} + +// PatchedGroupSourceConnectionRequest Group Source Connection +type PatchedGroupSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupSourceConnectionRequest PatchedGroupSourceConnectionRequest + +// NewPatchedGroupSourceConnectionRequest instantiates a new PatchedGroupSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupSourceConnectionRequest() *PatchedGroupSourceConnectionRequest { + this := PatchedGroupSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupSourceConnectionRequestWithDefaults instantiates a new PatchedGroupSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupSourceConnectionRequestWithDefaults() *PatchedGroupSourceConnectionRequest { + this := PatchedGroupSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupSourceConnectionRequest := _PatchedGroupSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupSourceConnectionRequest(varPatchedGroupSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupSourceConnectionRequest struct { + value *PatchedGroupSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupSourceConnectionRequest) Get() *PatchedGroupSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupSourceConnectionRequest) Set(val *PatchedGroupSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupSourceConnectionRequest(val *PatchedGroupSourceConnectionRequest) *NullablePatchedGroupSourceConnectionRequest { + return &NullablePatchedGroupSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_group_telegram_source_connection_request.go b/packages/client-go/model_patched_group_telegram_source_connection_request.go new file mode 100644 index 0000000000..3477c9cc65 --- /dev/null +++ b/packages/client-go/model_patched_group_telegram_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedGroupTelegramSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedGroupTelegramSourceConnectionRequest{} + +// PatchedGroupTelegramSourceConnectionRequest Group Source Connection +type PatchedGroupTelegramSourceConnectionRequest struct { + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedGroupTelegramSourceConnectionRequest PatchedGroupTelegramSourceConnectionRequest + +// NewPatchedGroupTelegramSourceConnectionRequest instantiates a new PatchedGroupTelegramSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedGroupTelegramSourceConnectionRequest() *PatchedGroupTelegramSourceConnectionRequest { + this := PatchedGroupTelegramSourceConnectionRequest{} + return &this +} + +// NewPatchedGroupTelegramSourceConnectionRequestWithDefaults instantiates a new PatchedGroupTelegramSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedGroupTelegramSourceConnectionRequestWithDefaults() *PatchedGroupTelegramSourceConnectionRequest { + this := PatchedGroupTelegramSourceConnectionRequest{} + return &this +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedGroupTelegramSourceConnectionRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedGroupTelegramSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedGroupTelegramSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedGroupTelegramSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedGroupTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedGroupTelegramSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedGroupTelegramSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedGroupTelegramSourceConnectionRequest := _PatchedGroupTelegramSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedGroupTelegramSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedGroupTelegramSourceConnectionRequest(varPatchedGroupTelegramSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedGroupTelegramSourceConnectionRequest struct { + value *PatchedGroupTelegramSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedGroupTelegramSourceConnectionRequest) Get() *PatchedGroupTelegramSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedGroupTelegramSourceConnectionRequest) Set(val *PatchedGroupTelegramSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedGroupTelegramSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedGroupTelegramSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedGroupTelegramSourceConnectionRequest(val *PatchedGroupTelegramSourceConnectionRequest) *NullablePatchedGroupTelegramSourceConnectionRequest { + return &NullablePatchedGroupTelegramSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedGroupTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedGroupTelegramSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_identification_stage_request.go b/packages/client-go/model_patched_identification_stage_request.go new file mode 100644 index 0000000000..b56995b393 --- /dev/null +++ b/packages/client-go/model_patched_identification_stage_request.go @@ -0,0 +1,713 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedIdentificationStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedIdentificationStageRequest{} + +// PatchedIdentificationStageRequest IdentificationStage Serializer +type PatchedIdentificationStageRequest struct { + Name *string `json:"name,omitempty"` + // Fields of the user object to match against. (Hold shift to select multiple options) + UserFields []UserFieldsEnum `json:"user_fields,omitempty"` + // When set, shows a password field, instead of showing the password field as separate step. + PasswordStage NullableString `json:"password_stage,omitempty"` + // When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage. + CaptchaStage NullableString `json:"captcha_stage,omitempty"` + // When enabled, user fields are matched regardless of their casing. + CaseInsensitiveMatching *bool `json:"case_insensitive_matching,omitempty"` + // When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown + ShowMatchedUser *bool `json:"show_matched_user,omitempty"` + // Optional enrollment flow, which is linked at the bottom of the page. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + // Optional recovery flow, which is linked at the bottom of the page. + RecoveryFlow NullableString `json:"recovery_flow,omitempty"` + // Optional passwordless flow, which is linked at the bottom of the page. + PasswordlessFlow NullableString `json:"passwordless_flow,omitempty"` + // Specify which sources should be shown. + Sources []string `json:"sources,omitempty"` + ShowSourceLabels *bool `json:"show_source_labels,omitempty"` + // When enabled, the stage will succeed and continue even when incorrect user info is entered. + PretendUserExists *bool `json:"pretend_user_exists,omitempty"` + // Show the user the 'Remember me on this device' toggle, allowing repeat users to skip straight to entering their password. + EnableRememberMe *bool `json:"enable_remember_me,omitempty"` + // When set, and conditional WebAuthn is available, allow the user to use their passkey as a first factor. + WebauthnStage NullableString `json:"webauthn_stage,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedIdentificationStageRequest PatchedIdentificationStageRequest + +// NewPatchedIdentificationStageRequest instantiates a new PatchedIdentificationStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedIdentificationStageRequest() *PatchedIdentificationStageRequest { + this := PatchedIdentificationStageRequest{} + return &this +} + +// NewPatchedIdentificationStageRequestWithDefaults instantiates a new PatchedIdentificationStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedIdentificationStageRequestWithDefaults() *PatchedIdentificationStageRequest { + this := PatchedIdentificationStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedIdentificationStageRequest) SetName(v string) { + o.Name = &v +} + +// GetUserFields returns the UserFields field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetUserFields() []UserFieldsEnum { + if o == nil || IsNil(o.UserFields) { + var ret []UserFieldsEnum + return ret + } + return o.UserFields +} + +// GetUserFieldsOk returns a tuple with the UserFields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetUserFieldsOk() ([]UserFieldsEnum, bool) { + if o == nil || IsNil(o.UserFields) { + return nil, false + } + return o.UserFields, true +} + +// HasUserFields returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasUserFields() bool { + if o != nil && !IsNil(o.UserFields) { + return true + } + + return false +} + +// SetUserFields gets a reference to the given []UserFieldsEnum and assigns it to the UserFields field. +func (o *PatchedIdentificationStageRequest) SetUserFields(v []UserFieldsEnum) { + o.UserFields = v +} + +// GetPasswordStage returns the PasswordStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetPasswordStage() string { + if o == nil || IsNil(o.PasswordStage.Get()) { + var ret string + return ret + } + return *o.PasswordStage.Get() +} + +// GetPasswordStageOk returns a tuple with the PasswordStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetPasswordStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordStage.Get(), o.PasswordStage.IsSet() +} + +// HasPasswordStage returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasPasswordStage() bool { + if o != nil && o.PasswordStage.IsSet() { + return true + } + + return false +} + +// SetPasswordStage gets a reference to the given NullableString and assigns it to the PasswordStage field. +func (o *PatchedIdentificationStageRequest) SetPasswordStage(v string) { + o.PasswordStage.Set(&v) +} + +// SetPasswordStageNil sets the value for PasswordStage to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetPasswordStageNil() { + o.PasswordStage.Set(nil) +} + +// UnsetPasswordStage ensures that no value is present for PasswordStage, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetPasswordStage() { + o.PasswordStage.Unset() +} + +// GetCaptchaStage returns the CaptchaStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetCaptchaStage() string { + if o == nil || IsNil(o.CaptchaStage.Get()) { + var ret string + return ret + } + return *o.CaptchaStage.Get() +} + +// GetCaptchaStageOk returns a tuple with the CaptchaStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetCaptchaStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CaptchaStage.Get(), o.CaptchaStage.IsSet() +} + +// HasCaptchaStage returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasCaptchaStage() bool { + if o != nil && o.CaptchaStage.IsSet() { + return true + } + + return false +} + +// SetCaptchaStage gets a reference to the given NullableString and assigns it to the CaptchaStage field. +func (o *PatchedIdentificationStageRequest) SetCaptchaStage(v string) { + o.CaptchaStage.Set(&v) +} + +// SetCaptchaStageNil sets the value for CaptchaStage to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetCaptchaStageNil() { + o.CaptchaStage.Set(nil) +} + +// UnsetCaptchaStage ensures that no value is present for CaptchaStage, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetCaptchaStage() { + o.CaptchaStage.Unset() +} + +// GetCaseInsensitiveMatching returns the CaseInsensitiveMatching field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetCaseInsensitiveMatching() bool { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + var ret bool + return ret + } + return *o.CaseInsensitiveMatching +} + +// GetCaseInsensitiveMatchingOk returns a tuple with the CaseInsensitiveMatching field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetCaseInsensitiveMatchingOk() (*bool, bool) { + if o == nil || IsNil(o.CaseInsensitiveMatching) { + return nil, false + } + return o.CaseInsensitiveMatching, true +} + +// HasCaseInsensitiveMatching returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasCaseInsensitiveMatching() bool { + if o != nil && !IsNil(o.CaseInsensitiveMatching) { + return true + } + + return false +} + +// SetCaseInsensitiveMatching gets a reference to the given bool and assigns it to the CaseInsensitiveMatching field. +func (o *PatchedIdentificationStageRequest) SetCaseInsensitiveMatching(v bool) { + o.CaseInsensitiveMatching = &v +} + +// GetShowMatchedUser returns the ShowMatchedUser field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetShowMatchedUser() bool { + if o == nil || IsNil(o.ShowMatchedUser) { + var ret bool + return ret + } + return *o.ShowMatchedUser +} + +// GetShowMatchedUserOk returns a tuple with the ShowMatchedUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetShowMatchedUserOk() (*bool, bool) { + if o == nil || IsNil(o.ShowMatchedUser) { + return nil, false + } + return o.ShowMatchedUser, true +} + +// HasShowMatchedUser returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasShowMatchedUser() bool { + if o != nil && !IsNil(o.ShowMatchedUser) { + return true + } + + return false +} + +// SetShowMatchedUser gets a reference to the given bool and assigns it to the ShowMatchedUser field. +func (o *PatchedIdentificationStageRequest) SetShowMatchedUser(v bool) { + o.ShowMatchedUser = &v +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedIdentificationStageRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetRecoveryFlow returns the RecoveryFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetRecoveryFlow() string { + if o == nil || IsNil(o.RecoveryFlow.Get()) { + var ret string + return ret + } + return *o.RecoveryFlow.Get() +} + +// GetRecoveryFlowOk returns a tuple with the RecoveryFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetRecoveryFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RecoveryFlow.Get(), o.RecoveryFlow.IsSet() +} + +// HasRecoveryFlow returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasRecoveryFlow() bool { + if o != nil && o.RecoveryFlow.IsSet() { + return true + } + + return false +} + +// SetRecoveryFlow gets a reference to the given NullableString and assigns it to the RecoveryFlow field. +func (o *PatchedIdentificationStageRequest) SetRecoveryFlow(v string) { + o.RecoveryFlow.Set(&v) +} + +// SetRecoveryFlowNil sets the value for RecoveryFlow to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetRecoveryFlowNil() { + o.RecoveryFlow.Set(nil) +} + +// UnsetRecoveryFlow ensures that no value is present for RecoveryFlow, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetRecoveryFlow() { + o.RecoveryFlow.Unset() +} + +// GetPasswordlessFlow returns the PasswordlessFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetPasswordlessFlow() string { + if o == nil || IsNil(o.PasswordlessFlow.Get()) { + var ret string + return ret + } + return *o.PasswordlessFlow.Get() +} + +// GetPasswordlessFlowOk returns a tuple with the PasswordlessFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetPasswordlessFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PasswordlessFlow.Get(), o.PasswordlessFlow.IsSet() +} + +// HasPasswordlessFlow returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasPasswordlessFlow() bool { + if o != nil && o.PasswordlessFlow.IsSet() { + return true + } + + return false +} + +// SetPasswordlessFlow gets a reference to the given NullableString and assigns it to the PasswordlessFlow field. +func (o *PatchedIdentificationStageRequest) SetPasswordlessFlow(v string) { + o.PasswordlessFlow.Set(&v) +} + +// SetPasswordlessFlowNil sets the value for PasswordlessFlow to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetPasswordlessFlowNil() { + o.PasswordlessFlow.Set(nil) +} + +// UnsetPasswordlessFlow ensures that no value is present for PasswordlessFlow, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetPasswordlessFlow() { + o.PasswordlessFlow.Unset() +} + +// GetSources returns the Sources field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetSources() []string { + if o == nil || IsNil(o.Sources) { + var ret []string + return ret + } + return o.Sources +} + +// GetSourcesOk returns a tuple with the Sources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.Sources) { + return nil, false + } + return o.Sources, true +} + +// HasSources returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasSources() bool { + if o != nil && !IsNil(o.Sources) { + return true + } + + return false +} + +// SetSources gets a reference to the given []string and assigns it to the Sources field. +func (o *PatchedIdentificationStageRequest) SetSources(v []string) { + o.Sources = v +} + +// GetShowSourceLabels returns the ShowSourceLabels field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetShowSourceLabels() bool { + if o == nil || IsNil(o.ShowSourceLabels) { + var ret bool + return ret + } + return *o.ShowSourceLabels +} + +// GetShowSourceLabelsOk returns a tuple with the ShowSourceLabels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetShowSourceLabelsOk() (*bool, bool) { + if o == nil || IsNil(o.ShowSourceLabels) { + return nil, false + } + return o.ShowSourceLabels, true +} + +// HasShowSourceLabels returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasShowSourceLabels() bool { + if o != nil && !IsNil(o.ShowSourceLabels) { + return true + } + + return false +} + +// SetShowSourceLabels gets a reference to the given bool and assigns it to the ShowSourceLabels field. +func (o *PatchedIdentificationStageRequest) SetShowSourceLabels(v bool) { + o.ShowSourceLabels = &v +} + +// GetPretendUserExists returns the PretendUserExists field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetPretendUserExists() bool { + if o == nil || IsNil(o.PretendUserExists) { + var ret bool + return ret + } + return *o.PretendUserExists +} + +// GetPretendUserExistsOk returns a tuple with the PretendUserExists field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetPretendUserExistsOk() (*bool, bool) { + if o == nil || IsNil(o.PretendUserExists) { + return nil, false + } + return o.PretendUserExists, true +} + +// HasPretendUserExists returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasPretendUserExists() bool { + if o != nil && !IsNil(o.PretendUserExists) { + return true + } + + return false +} + +// SetPretendUserExists gets a reference to the given bool and assigns it to the PretendUserExists field. +func (o *PatchedIdentificationStageRequest) SetPretendUserExists(v bool) { + o.PretendUserExists = &v +} + +// GetEnableRememberMe returns the EnableRememberMe field value if set, zero value otherwise. +func (o *PatchedIdentificationStageRequest) GetEnableRememberMe() bool { + if o == nil || IsNil(o.EnableRememberMe) { + var ret bool + return ret + } + return *o.EnableRememberMe +} + +// GetEnableRememberMeOk returns a tuple with the EnableRememberMe field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedIdentificationStageRequest) GetEnableRememberMeOk() (*bool, bool) { + if o == nil || IsNil(o.EnableRememberMe) { + return nil, false + } + return o.EnableRememberMe, true +} + +// HasEnableRememberMe returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasEnableRememberMe() bool { + if o != nil && !IsNil(o.EnableRememberMe) { + return true + } + + return false +} + +// SetEnableRememberMe gets a reference to the given bool and assigns it to the EnableRememberMe field. +func (o *PatchedIdentificationStageRequest) SetEnableRememberMe(v bool) { + o.EnableRememberMe = &v +} + +// GetWebauthnStage returns the WebauthnStage field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedIdentificationStageRequest) GetWebauthnStage() string { + if o == nil || IsNil(o.WebauthnStage.Get()) { + var ret string + return ret + } + return *o.WebauthnStage.Get() +} + +// GetWebauthnStageOk returns a tuple with the WebauthnStage field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedIdentificationStageRequest) GetWebauthnStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebauthnStage.Get(), o.WebauthnStage.IsSet() +} + +// HasWebauthnStage returns a boolean if a field has been set. +func (o *PatchedIdentificationStageRequest) HasWebauthnStage() bool { + if o != nil && o.WebauthnStage.IsSet() { + return true + } + + return false +} + +// SetWebauthnStage gets a reference to the given NullableString and assigns it to the WebauthnStage field. +func (o *PatchedIdentificationStageRequest) SetWebauthnStage(v string) { + o.WebauthnStage.Set(&v) +} + +// SetWebauthnStageNil sets the value for WebauthnStage to be an explicit nil +func (o *PatchedIdentificationStageRequest) SetWebauthnStageNil() { + o.WebauthnStage.Set(nil) +} + +// UnsetWebauthnStage ensures that no value is present for WebauthnStage, not even an explicit nil +func (o *PatchedIdentificationStageRequest) UnsetWebauthnStage() { + o.WebauthnStage.Unset() +} + +func (o PatchedIdentificationStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedIdentificationStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.UserFields) { + toSerialize["user_fields"] = o.UserFields + } + if o.PasswordStage.IsSet() { + toSerialize["password_stage"] = o.PasswordStage.Get() + } + if o.CaptchaStage.IsSet() { + toSerialize["captcha_stage"] = o.CaptchaStage.Get() + } + if !IsNil(o.CaseInsensitiveMatching) { + toSerialize["case_insensitive_matching"] = o.CaseInsensitiveMatching + } + if !IsNil(o.ShowMatchedUser) { + toSerialize["show_matched_user"] = o.ShowMatchedUser + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if o.RecoveryFlow.IsSet() { + toSerialize["recovery_flow"] = o.RecoveryFlow.Get() + } + if o.PasswordlessFlow.IsSet() { + toSerialize["passwordless_flow"] = o.PasswordlessFlow.Get() + } + if !IsNil(o.Sources) { + toSerialize["sources"] = o.Sources + } + if !IsNil(o.ShowSourceLabels) { + toSerialize["show_source_labels"] = o.ShowSourceLabels + } + if !IsNil(o.PretendUserExists) { + toSerialize["pretend_user_exists"] = o.PretendUserExists + } + if !IsNil(o.EnableRememberMe) { + toSerialize["enable_remember_me"] = o.EnableRememberMe + } + if o.WebauthnStage.IsSet() { + toSerialize["webauthn_stage"] = o.WebauthnStage.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedIdentificationStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedIdentificationStageRequest := _PatchedIdentificationStageRequest{} + + err = json.Unmarshal(data, &varPatchedIdentificationStageRequest) + + if err != nil { + return err + } + + *o = PatchedIdentificationStageRequest(varPatchedIdentificationStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "user_fields") + delete(additionalProperties, "password_stage") + delete(additionalProperties, "captcha_stage") + delete(additionalProperties, "case_insensitive_matching") + delete(additionalProperties, "show_matched_user") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "recovery_flow") + delete(additionalProperties, "passwordless_flow") + delete(additionalProperties, "sources") + delete(additionalProperties, "show_source_labels") + delete(additionalProperties, "pretend_user_exists") + delete(additionalProperties, "enable_remember_me") + delete(additionalProperties, "webauthn_stage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedIdentificationStageRequest struct { + value *PatchedIdentificationStageRequest + isSet bool +} + +func (v NullablePatchedIdentificationStageRequest) Get() *PatchedIdentificationStageRequest { + return v.value +} + +func (v *NullablePatchedIdentificationStageRequest) Set(val *PatchedIdentificationStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedIdentificationStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedIdentificationStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedIdentificationStageRequest(val *PatchedIdentificationStageRequest) *NullablePatchedIdentificationStageRequest { + return &NullablePatchedIdentificationStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedIdentificationStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedIdentificationStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_initial_permissions_request.go b/packages/client-go/model_patched_initial_permissions_request.go new file mode 100644 index 0000000000..0c6abbdf2f --- /dev/null +++ b/packages/client-go/model_patched_initial_permissions_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedInitialPermissionsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedInitialPermissionsRequest{} + +// PatchedInitialPermissionsRequest InitialPermissions serializer +type PatchedInitialPermissionsRequest struct { + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` + Permissions []int32 `json:"permissions,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedInitialPermissionsRequest PatchedInitialPermissionsRequest + +// NewPatchedInitialPermissionsRequest instantiates a new PatchedInitialPermissionsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedInitialPermissionsRequest() *PatchedInitialPermissionsRequest { + this := PatchedInitialPermissionsRequest{} + return &this +} + +// NewPatchedInitialPermissionsRequestWithDefaults instantiates a new PatchedInitialPermissionsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedInitialPermissionsRequestWithDefaults() *PatchedInitialPermissionsRequest { + this := PatchedInitialPermissionsRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedInitialPermissionsRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInitialPermissionsRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedInitialPermissionsRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedInitialPermissionsRequest) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *PatchedInitialPermissionsRequest) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInitialPermissionsRequest) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *PatchedInitialPermissionsRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *PatchedInitialPermissionsRequest) SetRole(v string) { + o.Role = &v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *PatchedInitialPermissionsRequest) GetPermissions() []int32 { + if o == nil || IsNil(o.Permissions) { + var ret []int32 + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInitialPermissionsRequest) GetPermissionsOk() ([]int32, bool) { + if o == nil || IsNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *PatchedInitialPermissionsRequest) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []int32 and assigns it to the Permissions field. +func (o *PatchedInitialPermissionsRequest) SetPermissions(v []int32) { + o.Permissions = v +} + +func (o PatchedInitialPermissionsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedInitialPermissionsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedInitialPermissionsRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedInitialPermissionsRequest := _PatchedInitialPermissionsRequest{} + + err = json.Unmarshal(data, &varPatchedInitialPermissionsRequest) + + if err != nil { + return err + } + + *o = PatchedInitialPermissionsRequest(varPatchedInitialPermissionsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "role") + delete(additionalProperties, "permissions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedInitialPermissionsRequest struct { + value *PatchedInitialPermissionsRequest + isSet bool +} + +func (v NullablePatchedInitialPermissionsRequest) Get() *PatchedInitialPermissionsRequest { + return v.value +} + +func (v *NullablePatchedInitialPermissionsRequest) Set(val *PatchedInitialPermissionsRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedInitialPermissionsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedInitialPermissionsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedInitialPermissionsRequest(val *PatchedInitialPermissionsRequest) *NullablePatchedInitialPermissionsRequest { + return &NullablePatchedInitialPermissionsRequest{value: val, isSet: true} +} + +func (v NullablePatchedInitialPermissionsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedInitialPermissionsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_invitation_request.go b/packages/client-go/model_patched_invitation_request.go new file mode 100644 index 0000000000..2272f3f212 --- /dev/null +++ b/packages/client-go/model_patched_invitation_request.go @@ -0,0 +1,327 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedInvitationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedInvitationRequest{} + +// PatchedInvitationRequest Invitation Serializer +type PatchedInvitationRequest struct { + Name *string `json:"name,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Expires NullableTime `json:"expires,omitempty"` + FixedData map[string]interface{} `json:"fixed_data,omitempty"` + // When enabled, the invitation will be deleted after usage. + SingleUse *bool `json:"single_use,omitempty"` + // When set, only the configured flow can use this invitation. + Flow NullableString `json:"flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedInvitationRequest PatchedInvitationRequest + +// NewPatchedInvitationRequest instantiates a new PatchedInvitationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedInvitationRequest() *PatchedInvitationRequest { + this := PatchedInvitationRequest{} + return &this +} + +// NewPatchedInvitationRequestWithDefaults instantiates a new PatchedInvitationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedInvitationRequestWithDefaults() *PatchedInvitationRequest { + this := PatchedInvitationRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedInvitationRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInvitationRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedInvitationRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedInvitationRequest) SetName(v string) { + o.Name = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedInvitationRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedInvitationRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedInvitationRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *PatchedInvitationRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *PatchedInvitationRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *PatchedInvitationRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetFixedData returns the FixedData field value if set, zero value otherwise. +func (o *PatchedInvitationRequest) GetFixedData() map[string]interface{} { + if o == nil || IsNil(o.FixedData) { + var ret map[string]interface{} + return ret + } + return o.FixedData +} + +// GetFixedDataOk returns a tuple with the FixedData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInvitationRequest) GetFixedDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.FixedData) { + return map[string]interface{}{}, false + } + return o.FixedData, true +} + +// HasFixedData returns a boolean if a field has been set. +func (o *PatchedInvitationRequest) HasFixedData() bool { + if o != nil && !IsNil(o.FixedData) { + return true + } + + return false +} + +// SetFixedData gets a reference to the given map[string]interface{} and assigns it to the FixedData field. +func (o *PatchedInvitationRequest) SetFixedData(v map[string]interface{}) { + o.FixedData = v +} + +// GetSingleUse returns the SingleUse field value if set, zero value otherwise. +func (o *PatchedInvitationRequest) GetSingleUse() bool { + if o == nil || IsNil(o.SingleUse) { + var ret bool + return ret + } + return *o.SingleUse +} + +// GetSingleUseOk returns a tuple with the SingleUse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInvitationRequest) GetSingleUseOk() (*bool, bool) { + if o == nil || IsNil(o.SingleUse) { + return nil, false + } + return o.SingleUse, true +} + +// HasSingleUse returns a boolean if a field has been set. +func (o *PatchedInvitationRequest) HasSingleUse() bool { + if o != nil && !IsNil(o.SingleUse) { + return true + } + + return false +} + +// SetSingleUse gets a reference to the given bool and assigns it to the SingleUse field. +func (o *PatchedInvitationRequest) SetSingleUse(v bool) { + o.SingleUse = &v +} + +// GetFlow returns the Flow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedInvitationRequest) GetFlow() string { + if o == nil || IsNil(o.Flow.Get()) { + var ret string + return ret + } + return *o.Flow.Get() +} + +// GetFlowOk returns a tuple with the Flow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedInvitationRequest) GetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Flow.Get(), o.Flow.IsSet() +} + +// HasFlow returns a boolean if a field has been set. +func (o *PatchedInvitationRequest) HasFlow() bool { + if o != nil && o.Flow.IsSet() { + return true + } + + return false +} + +// SetFlow gets a reference to the given NullableString and assigns it to the Flow field. +func (o *PatchedInvitationRequest) SetFlow(v string) { + o.Flow.Set(&v) +} + +// SetFlowNil sets the value for Flow to be an explicit nil +func (o *PatchedInvitationRequest) SetFlowNil() { + o.Flow.Set(nil) +} + +// UnsetFlow ensures that no value is present for Flow, not even an explicit nil +func (o *PatchedInvitationRequest) UnsetFlow() { + o.Flow.Unset() +} + +func (o PatchedInvitationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedInvitationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.FixedData) { + toSerialize["fixed_data"] = o.FixedData + } + if !IsNil(o.SingleUse) { + toSerialize["single_use"] = o.SingleUse + } + if o.Flow.IsSet() { + toSerialize["flow"] = o.Flow.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedInvitationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedInvitationRequest := _PatchedInvitationRequest{} + + err = json.Unmarshal(data, &varPatchedInvitationRequest) + + if err != nil { + return err + } + + *o = PatchedInvitationRequest(varPatchedInvitationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "expires") + delete(additionalProperties, "fixed_data") + delete(additionalProperties, "single_use") + delete(additionalProperties, "flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedInvitationRequest struct { + value *PatchedInvitationRequest + isSet bool +} + +func (v NullablePatchedInvitationRequest) Get() *PatchedInvitationRequest { + return v.value +} + +func (v *NullablePatchedInvitationRequest) Set(val *PatchedInvitationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedInvitationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedInvitationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedInvitationRequest(val *PatchedInvitationRequest) *NullablePatchedInvitationRequest { + return &NullablePatchedInvitationRequest{value: val, isSet: true} +} + +func (v NullablePatchedInvitationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedInvitationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_invitation_stage_request.go b/packages/client-go/model_patched_invitation_stage_request.go new file mode 100644 index 0000000000..a14846bb4e --- /dev/null +++ b/packages/client-go/model_patched_invitation_stage_request.go @@ -0,0 +1,192 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedInvitationStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedInvitationStageRequest{} + +// PatchedInvitationStageRequest InvitationStage Serializer +type PatchedInvitationStageRequest struct { + Name *string `json:"name,omitempty"` + // If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By default this Stage will cancel the Flow when no invitation is given. + ContinueFlowWithoutInvitation *bool `json:"continue_flow_without_invitation,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedInvitationStageRequest PatchedInvitationStageRequest + +// NewPatchedInvitationStageRequest instantiates a new PatchedInvitationStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedInvitationStageRequest() *PatchedInvitationStageRequest { + this := PatchedInvitationStageRequest{} + return &this +} + +// NewPatchedInvitationStageRequestWithDefaults instantiates a new PatchedInvitationStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedInvitationStageRequestWithDefaults() *PatchedInvitationStageRequest { + this := PatchedInvitationStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedInvitationStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInvitationStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedInvitationStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedInvitationStageRequest) SetName(v string) { + o.Name = &v +} + +// GetContinueFlowWithoutInvitation returns the ContinueFlowWithoutInvitation field value if set, zero value otherwise. +func (o *PatchedInvitationStageRequest) GetContinueFlowWithoutInvitation() bool { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + var ret bool + return ret + } + return *o.ContinueFlowWithoutInvitation +} + +// GetContinueFlowWithoutInvitationOk returns a tuple with the ContinueFlowWithoutInvitation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedInvitationStageRequest) GetContinueFlowWithoutInvitationOk() (*bool, bool) { + if o == nil || IsNil(o.ContinueFlowWithoutInvitation) { + return nil, false + } + return o.ContinueFlowWithoutInvitation, true +} + +// HasContinueFlowWithoutInvitation returns a boolean if a field has been set. +func (o *PatchedInvitationStageRequest) HasContinueFlowWithoutInvitation() bool { + if o != nil && !IsNil(o.ContinueFlowWithoutInvitation) { + return true + } + + return false +} + +// SetContinueFlowWithoutInvitation gets a reference to the given bool and assigns it to the ContinueFlowWithoutInvitation field. +func (o *PatchedInvitationStageRequest) SetContinueFlowWithoutInvitation(v bool) { + o.ContinueFlowWithoutInvitation = &v +} + +func (o PatchedInvitationStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedInvitationStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ContinueFlowWithoutInvitation) { + toSerialize["continue_flow_without_invitation"] = o.ContinueFlowWithoutInvitation + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedInvitationStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedInvitationStageRequest := _PatchedInvitationStageRequest{} + + err = json.Unmarshal(data, &varPatchedInvitationStageRequest) + + if err != nil { + return err + } + + *o = PatchedInvitationStageRequest(varPatchedInvitationStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "continue_flow_without_invitation") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedInvitationStageRequest struct { + value *PatchedInvitationStageRequest + isSet bool +} + +func (v NullablePatchedInvitationStageRequest) Get() *PatchedInvitationStageRequest { + return v.value +} + +func (v *NullablePatchedInvitationStageRequest) Set(val *PatchedInvitationStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedInvitationStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedInvitationStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedInvitationStageRequest(val *PatchedInvitationStageRequest) *NullablePatchedInvitationStageRequest { + return &NullablePatchedInvitationStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedInvitationStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedInvitationStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_kerberos_source_property_mapping_request.go b/packages/client-go/model_patched_kerberos_source_property_mapping_request.go new file mode 100644 index 0000000000..01ed9faaf2 --- /dev/null +++ b/packages/client-go/model_patched_kerberos_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedKerberosSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedKerberosSourcePropertyMappingRequest{} + +// PatchedKerberosSourcePropertyMappingRequest Kerberos PropertyMapping Serializer +type PatchedKerberosSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedKerberosSourcePropertyMappingRequest PatchedKerberosSourcePropertyMappingRequest + +// NewPatchedKerberosSourcePropertyMappingRequest instantiates a new PatchedKerberosSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedKerberosSourcePropertyMappingRequest() *PatchedKerberosSourcePropertyMappingRequest { + this := PatchedKerberosSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedKerberosSourcePropertyMappingRequestWithDefaults instantiates a new PatchedKerberosSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedKerberosSourcePropertyMappingRequestWithDefaults() *PatchedKerberosSourcePropertyMappingRequest { + this := PatchedKerberosSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedKerberosSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedKerberosSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedKerberosSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedKerberosSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedKerberosSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedKerberosSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedKerberosSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedKerberosSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedKerberosSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedKerberosSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedKerberosSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedKerberosSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedKerberosSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedKerberosSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedKerberosSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedKerberosSourcePropertyMappingRequest := _PatchedKerberosSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedKerberosSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedKerberosSourcePropertyMappingRequest(varPatchedKerberosSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedKerberosSourcePropertyMappingRequest struct { + value *PatchedKerberosSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedKerberosSourcePropertyMappingRequest) Get() *PatchedKerberosSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedKerberosSourcePropertyMappingRequest) Set(val *PatchedKerberosSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedKerberosSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedKerberosSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedKerberosSourcePropertyMappingRequest(val *PatchedKerberosSourcePropertyMappingRequest) *NullablePatchedKerberosSourcePropertyMappingRequest { + return &NullablePatchedKerberosSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedKerberosSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedKerberosSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_kerberos_source_request.go b/packages/client-go/model_patched_kerberos_source_request.go new file mode 100644 index 0000000000..ad32f0f378 --- /dev/null +++ b/packages/client-go/model_patched_kerberos_source_request.go @@ -0,0 +1,1159 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedKerberosSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedKerberosSourceRequest{} + +// PatchedKerberosSourceRequest Kerberos Source Serializer +type PatchedKerberosSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Kerberos realm + Realm *string `json:"realm,omitempty"` + // Custom krb5.conf to use. Uses the system one by default + Krb5Conf *string `json:"krb5_conf,omitempty"` + // KAdmin server type + KadminType *KadminTypeEnum `json:"kadmin_type,omitempty"` + // Sync users from Kerberos into authentik + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to Kerberos + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + // Principal to authenticate to kadmin for sync. + SyncPrincipal *string `json:"sync_principal,omitempty"` + // Password to authenticate to kadmin for sync + SyncPassword *string `json:"sync_password,omitempty"` + // Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form TYPE:residual + SyncKeytab *string `json:"sync_keytab,omitempty"` + // Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual + SyncCcache *string `json:"sync_ccache,omitempty"` + // Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname + SpnegoServerName *string `json:"spnego_server_name,omitempty"` + // SPNEGO keytab base64-encoded or path to keytab in the form FILE:path + SpnegoKeytab *string `json:"spnego_keytab,omitempty"` + // Credential cache to use for SPNEGO in form type:residual + SpnegoCcache *string `json:"spnego_ccache,omitempty"` + // If enabled, the authentik-stored password will be updated upon login with the Kerberos password backend + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedKerberosSourceRequest PatchedKerberosSourceRequest + +// NewPatchedKerberosSourceRequest instantiates a new PatchedKerberosSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedKerberosSourceRequest() *PatchedKerberosSourceRequest { + this := PatchedKerberosSourceRequest{} + return &this +} + +// NewPatchedKerberosSourceRequestWithDefaults instantiates a new PatchedKerberosSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedKerberosSourceRequestWithDefaults() *PatchedKerberosSourceRequest { + this := PatchedKerberosSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedKerberosSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedKerberosSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedKerberosSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedKerberosSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedKerberosSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedKerberosSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedKerberosSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedKerberosSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedKerberosSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedKerberosSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedKerberosSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedKerberosSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedKerberosSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedKerberosSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedKerberosSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedKerberosSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedKerberosSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedKerberosSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedKerberosSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedKerberosSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PatchedKerberosSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetRealm returns the Realm field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetRealm() string { + if o == nil || IsNil(o.Realm) { + var ret string + return ret + } + return *o.Realm +} + +// GetRealmOk returns a tuple with the Realm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetRealmOk() (*string, bool) { + if o == nil || IsNil(o.Realm) { + return nil, false + } + return o.Realm, true +} + +// HasRealm returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasRealm() bool { + if o != nil && !IsNil(o.Realm) { + return true + } + + return false +} + +// SetRealm gets a reference to the given string and assigns it to the Realm field. +func (o *PatchedKerberosSourceRequest) SetRealm(v string) { + o.Realm = &v +} + +// GetKrb5Conf returns the Krb5Conf field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetKrb5Conf() string { + if o == nil || IsNil(o.Krb5Conf) { + var ret string + return ret + } + return *o.Krb5Conf +} + +// GetKrb5ConfOk returns a tuple with the Krb5Conf field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetKrb5ConfOk() (*string, bool) { + if o == nil || IsNil(o.Krb5Conf) { + return nil, false + } + return o.Krb5Conf, true +} + +// HasKrb5Conf returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasKrb5Conf() bool { + if o != nil && !IsNil(o.Krb5Conf) { + return true + } + + return false +} + +// SetKrb5Conf gets a reference to the given string and assigns it to the Krb5Conf field. +func (o *PatchedKerberosSourceRequest) SetKrb5Conf(v string) { + o.Krb5Conf = &v +} + +// GetKadminType returns the KadminType field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetKadminType() KadminTypeEnum { + if o == nil || IsNil(o.KadminType) { + var ret KadminTypeEnum + return ret + } + return *o.KadminType +} + +// GetKadminTypeOk returns a tuple with the KadminType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetKadminTypeOk() (*KadminTypeEnum, bool) { + if o == nil || IsNil(o.KadminType) { + return nil, false + } + return o.KadminType, true +} + +// HasKadminType returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasKadminType() bool { + if o != nil && !IsNil(o.KadminType) { + return true + } + + return false +} + +// SetKadminType gets a reference to the given KadminTypeEnum and assigns it to the KadminType field. +func (o *PatchedKerberosSourceRequest) SetKadminType(v KadminTypeEnum) { + o.KadminType = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *PatchedKerberosSourceRequest) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *PatchedKerberosSourceRequest) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncPrincipal returns the SyncPrincipal field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncPrincipal() string { + if o == nil || IsNil(o.SyncPrincipal) { + var ret string + return ret + } + return *o.SyncPrincipal +} + +// GetSyncPrincipalOk returns a tuple with the SyncPrincipal field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncPrincipalOk() (*string, bool) { + if o == nil || IsNil(o.SyncPrincipal) { + return nil, false + } + return o.SyncPrincipal, true +} + +// HasSyncPrincipal returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncPrincipal() bool { + if o != nil && !IsNil(o.SyncPrincipal) { + return true + } + + return false +} + +// SetSyncPrincipal gets a reference to the given string and assigns it to the SyncPrincipal field. +func (o *PatchedKerberosSourceRequest) SetSyncPrincipal(v string) { + o.SyncPrincipal = &v +} + +// GetSyncPassword returns the SyncPassword field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncPassword() string { + if o == nil || IsNil(o.SyncPassword) { + var ret string + return ret + } + return *o.SyncPassword +} + +// GetSyncPasswordOk returns a tuple with the SyncPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncPasswordOk() (*string, bool) { + if o == nil || IsNil(o.SyncPassword) { + return nil, false + } + return o.SyncPassword, true +} + +// HasSyncPassword returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncPassword() bool { + if o != nil && !IsNil(o.SyncPassword) { + return true + } + + return false +} + +// SetSyncPassword gets a reference to the given string and assigns it to the SyncPassword field. +func (o *PatchedKerberosSourceRequest) SetSyncPassword(v string) { + o.SyncPassword = &v +} + +// GetSyncKeytab returns the SyncKeytab field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncKeytab() string { + if o == nil || IsNil(o.SyncKeytab) { + var ret string + return ret + } + return *o.SyncKeytab +} + +// GetSyncKeytabOk returns a tuple with the SyncKeytab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncKeytabOk() (*string, bool) { + if o == nil || IsNil(o.SyncKeytab) { + return nil, false + } + return o.SyncKeytab, true +} + +// HasSyncKeytab returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncKeytab() bool { + if o != nil && !IsNil(o.SyncKeytab) { + return true + } + + return false +} + +// SetSyncKeytab gets a reference to the given string and assigns it to the SyncKeytab field. +func (o *PatchedKerberosSourceRequest) SetSyncKeytab(v string) { + o.SyncKeytab = &v +} + +// GetSyncCcache returns the SyncCcache field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncCcache() string { + if o == nil || IsNil(o.SyncCcache) { + var ret string + return ret + } + return *o.SyncCcache +} + +// GetSyncCcacheOk returns a tuple with the SyncCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SyncCcache) { + return nil, false + } + return o.SyncCcache, true +} + +// HasSyncCcache returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncCcache() bool { + if o != nil && !IsNil(o.SyncCcache) { + return true + } + + return false +} + +// SetSyncCcache gets a reference to the given string and assigns it to the SyncCcache field. +func (o *PatchedKerberosSourceRequest) SetSyncCcache(v string) { + o.SyncCcache = &v +} + +// GetSpnegoServerName returns the SpnegoServerName field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSpnegoServerName() string { + if o == nil || IsNil(o.SpnegoServerName) { + var ret string + return ret + } + return *o.SpnegoServerName +} + +// GetSpnegoServerNameOk returns a tuple with the SpnegoServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSpnegoServerNameOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoServerName) { + return nil, false + } + return o.SpnegoServerName, true +} + +// HasSpnegoServerName returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSpnegoServerName() bool { + if o != nil && !IsNil(o.SpnegoServerName) { + return true + } + + return false +} + +// SetSpnegoServerName gets a reference to the given string and assigns it to the SpnegoServerName field. +func (o *PatchedKerberosSourceRequest) SetSpnegoServerName(v string) { + o.SpnegoServerName = &v +} + +// GetSpnegoKeytab returns the SpnegoKeytab field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSpnegoKeytab() string { + if o == nil || IsNil(o.SpnegoKeytab) { + var ret string + return ret + } + return *o.SpnegoKeytab +} + +// GetSpnegoKeytabOk returns a tuple with the SpnegoKeytab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSpnegoKeytabOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoKeytab) { + return nil, false + } + return o.SpnegoKeytab, true +} + +// HasSpnegoKeytab returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSpnegoKeytab() bool { + if o != nil && !IsNil(o.SpnegoKeytab) { + return true + } + + return false +} + +// SetSpnegoKeytab gets a reference to the given string and assigns it to the SpnegoKeytab field. +func (o *PatchedKerberosSourceRequest) SetSpnegoKeytab(v string) { + o.SpnegoKeytab = &v +} + +// GetSpnegoCcache returns the SpnegoCcache field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSpnegoCcache() string { + if o == nil || IsNil(o.SpnegoCcache) { + var ret string + return ret + } + return *o.SpnegoCcache +} + +// GetSpnegoCcacheOk returns a tuple with the SpnegoCcache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSpnegoCcacheOk() (*string, bool) { + if o == nil || IsNil(o.SpnegoCcache) { + return nil, false + } + return o.SpnegoCcache, true +} + +// HasSpnegoCcache returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSpnegoCcache() bool { + if o != nil && !IsNil(o.SpnegoCcache) { + return true + } + + return false +} + +// SetSpnegoCcache gets a reference to the given string and assigns it to the SpnegoCcache field. +func (o *PatchedKerberosSourceRequest) SetSpnegoCcache(v string) { + o.SpnegoCcache = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *PatchedKerberosSourceRequest) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *PatchedKerberosSourceRequest) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKerberosSourceRequest) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *PatchedKerberosSourceRequest) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *PatchedKerberosSourceRequest) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o PatchedKerberosSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedKerberosSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.Realm) { + toSerialize["realm"] = o.Realm + } + if !IsNil(o.Krb5Conf) { + toSerialize["krb5_conf"] = o.Krb5Conf + } + if !IsNil(o.KadminType) { + toSerialize["kadmin_type"] = o.KadminType + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncPrincipal) { + toSerialize["sync_principal"] = o.SyncPrincipal + } + if !IsNil(o.SyncPassword) { + toSerialize["sync_password"] = o.SyncPassword + } + if !IsNil(o.SyncKeytab) { + toSerialize["sync_keytab"] = o.SyncKeytab + } + if !IsNil(o.SyncCcache) { + toSerialize["sync_ccache"] = o.SyncCcache + } + if !IsNil(o.SpnegoServerName) { + toSerialize["spnego_server_name"] = o.SpnegoServerName + } + if !IsNil(o.SpnegoKeytab) { + toSerialize["spnego_keytab"] = o.SpnegoKeytab + } + if !IsNil(o.SpnegoCcache) { + toSerialize["spnego_ccache"] = o.SpnegoCcache + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedKerberosSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedKerberosSourceRequest := _PatchedKerberosSourceRequest{} + + err = json.Unmarshal(data, &varPatchedKerberosSourceRequest) + + if err != nil { + return err + } + + *o = PatchedKerberosSourceRequest(varPatchedKerberosSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "realm") + delete(additionalProperties, "krb5_conf") + delete(additionalProperties, "kadmin_type") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_principal") + delete(additionalProperties, "sync_password") + delete(additionalProperties, "sync_keytab") + delete(additionalProperties, "sync_ccache") + delete(additionalProperties, "spnego_server_name") + delete(additionalProperties, "spnego_keytab") + delete(additionalProperties, "spnego_ccache") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedKerberosSourceRequest struct { + value *PatchedKerberosSourceRequest + isSet bool +} + +func (v NullablePatchedKerberosSourceRequest) Get() *PatchedKerberosSourceRequest { + return v.value +} + +func (v *NullablePatchedKerberosSourceRequest) Set(val *PatchedKerberosSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedKerberosSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedKerberosSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedKerberosSourceRequest(val *PatchedKerberosSourceRequest) *NullablePatchedKerberosSourceRequest { + return &NullablePatchedKerberosSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedKerberosSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedKerberosSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_kubernetes_service_connection_request.go b/packages/client-go/model_patched_kubernetes_service_connection_request.go new file mode 100644 index 0000000000..6f2f829473 --- /dev/null +++ b/packages/client-go/model_patched_kubernetes_service_connection_request.go @@ -0,0 +1,268 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedKubernetesServiceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedKubernetesServiceConnectionRequest{} + +// PatchedKubernetesServiceConnectionRequest KubernetesServiceConnection Serializer +type PatchedKubernetesServiceConnectionRequest struct { + Name *string `json:"name,omitempty"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + // Paste your kubeconfig here. authentik will automatically use the currently selected context. + Kubeconfig map[string]interface{} `json:"kubeconfig,omitempty"` + // Verify SSL Certificates of the Kubernetes API endpoint + VerifySsl *bool `json:"verify_ssl,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedKubernetesServiceConnectionRequest PatchedKubernetesServiceConnectionRequest + +// NewPatchedKubernetesServiceConnectionRequest instantiates a new PatchedKubernetesServiceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedKubernetesServiceConnectionRequest() *PatchedKubernetesServiceConnectionRequest { + this := PatchedKubernetesServiceConnectionRequest{} + return &this +} + +// NewPatchedKubernetesServiceConnectionRequestWithDefaults instantiates a new PatchedKubernetesServiceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedKubernetesServiceConnectionRequestWithDefaults() *PatchedKubernetesServiceConnectionRequest { + this := PatchedKubernetesServiceConnectionRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedKubernetesServiceConnectionRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKubernetesServiceConnectionRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedKubernetesServiceConnectionRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedKubernetesServiceConnectionRequest) SetName(v string) { + o.Name = &v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *PatchedKubernetesServiceConnectionRequest) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKubernetesServiceConnectionRequest) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *PatchedKubernetesServiceConnectionRequest) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *PatchedKubernetesServiceConnectionRequest) SetLocal(v bool) { + o.Local = &v +} + +// GetKubeconfig returns the Kubeconfig field value if set, zero value otherwise. +func (o *PatchedKubernetesServiceConnectionRequest) GetKubeconfig() map[string]interface{} { + if o == nil || IsNil(o.Kubeconfig) { + var ret map[string]interface{} + return ret + } + return o.Kubeconfig +} + +// GetKubeconfigOk returns a tuple with the Kubeconfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKubernetesServiceConnectionRequest) GetKubeconfigOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Kubeconfig) { + return map[string]interface{}{}, false + } + return o.Kubeconfig, true +} + +// HasKubeconfig returns a boolean if a field has been set. +func (o *PatchedKubernetesServiceConnectionRequest) HasKubeconfig() bool { + if o != nil && !IsNil(o.Kubeconfig) { + return true + } + + return false +} + +// SetKubeconfig gets a reference to the given map[string]interface{} and assigns it to the Kubeconfig field. +func (o *PatchedKubernetesServiceConnectionRequest) SetKubeconfig(v map[string]interface{}) { + o.Kubeconfig = v +} + +// GetVerifySsl returns the VerifySsl field value if set, zero value otherwise. +func (o *PatchedKubernetesServiceConnectionRequest) GetVerifySsl() bool { + if o == nil || IsNil(o.VerifySsl) { + var ret bool + return ret + } + return *o.VerifySsl +} + +// GetVerifySslOk returns a tuple with the VerifySsl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedKubernetesServiceConnectionRequest) GetVerifySslOk() (*bool, bool) { + if o == nil || IsNil(o.VerifySsl) { + return nil, false + } + return o.VerifySsl, true +} + +// HasVerifySsl returns a boolean if a field has been set. +func (o *PatchedKubernetesServiceConnectionRequest) HasVerifySsl() bool { + if o != nil && !IsNil(o.VerifySsl) { + return true + } + + return false +} + +// SetVerifySsl gets a reference to the given bool and assigns it to the VerifySsl field. +func (o *PatchedKubernetesServiceConnectionRequest) SetVerifySsl(v bool) { + o.VerifySsl = &v +} + +func (o PatchedKubernetesServiceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedKubernetesServiceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + if !IsNil(o.Kubeconfig) { + toSerialize["kubeconfig"] = o.Kubeconfig + } + if !IsNil(o.VerifySsl) { + toSerialize["verify_ssl"] = o.VerifySsl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedKubernetesServiceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedKubernetesServiceConnectionRequest := _PatchedKubernetesServiceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedKubernetesServiceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedKubernetesServiceConnectionRequest(varPatchedKubernetesServiceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "kubeconfig") + delete(additionalProperties, "verify_ssl") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedKubernetesServiceConnectionRequest struct { + value *PatchedKubernetesServiceConnectionRequest + isSet bool +} + +func (v NullablePatchedKubernetesServiceConnectionRequest) Get() *PatchedKubernetesServiceConnectionRequest { + return v.value +} + +func (v *NullablePatchedKubernetesServiceConnectionRequest) Set(val *PatchedKubernetesServiceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedKubernetesServiceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedKubernetesServiceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedKubernetesServiceConnectionRequest(val *PatchedKubernetesServiceConnectionRequest) *NullablePatchedKubernetesServiceConnectionRequest { + return &NullablePatchedKubernetesServiceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedKubernetesServiceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedKubernetesServiceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_ldap_provider_request.go b/packages/client-go/model_patched_ldap_provider_request.go new file mode 100644 index 0000000000..dece1d7d46 --- /dev/null +++ b/packages/client-go/model_patched_ldap_provider_request.go @@ -0,0 +1,627 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedLDAPProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedLDAPProviderRequest{} + +// PatchedLDAPProviderRequest LDAPProvider Serializer +type PatchedLDAPProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // DN under which objects are accessible. + BaseDn *string `json:"base_dn,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + TlsServerName *string `json:"tls_server_name,omitempty"` + // The start for uidNumbers, this number is added to the user.pk to make sure that the numbers aren't too low for POSIX users. Default is 2000 to ensure that we don't collide with local users uidNumber + UidStartNumber *int32 `json:"uid_start_number,omitempty"` + // The start for gidNumbers, this number is added to a number generated from the group.pk to make sure that the numbers aren't too low for POSIX groups. Default is 4000 to ensure that we don't collide with local groups or users primary groups gidNumber + GidStartNumber *int32 `json:"gid_start_number,omitempty"` + SearchMode *LDAPAPIAccessMode `json:"search_mode,omitempty"` + BindMode *LDAPAPIAccessMode `json:"bind_mode,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedLDAPProviderRequest PatchedLDAPProviderRequest + +// NewPatchedLDAPProviderRequest instantiates a new PatchedLDAPProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedLDAPProviderRequest() *PatchedLDAPProviderRequest { + this := PatchedLDAPProviderRequest{} + return &this +} + +// NewPatchedLDAPProviderRequestWithDefaults instantiates a new PatchedLDAPProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedLDAPProviderRequestWithDefaults() *PatchedLDAPProviderRequest { + this := PatchedLDAPProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedLDAPProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedLDAPProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedLDAPProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedLDAPProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedLDAPProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedLDAPProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedLDAPProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetBaseDn returns the BaseDn field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetBaseDn() string { + if o == nil || IsNil(o.BaseDn) { + var ret string + return ret + } + return *o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetBaseDnOk() (*string, bool) { + if o == nil || IsNil(o.BaseDn) { + return nil, false + } + return o.BaseDn, true +} + +// HasBaseDn returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasBaseDn() bool { + if o != nil && !IsNil(o.BaseDn) { + return true + } + + return false +} + +// SetBaseDn gets a reference to the given string and assigns it to the BaseDn field. +func (o *PatchedLDAPProviderRequest) SetBaseDn(v string) { + o.BaseDn = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *PatchedLDAPProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *PatchedLDAPProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *PatchedLDAPProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetTlsServerName returns the TlsServerName field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetTlsServerName() string { + if o == nil || IsNil(o.TlsServerName) { + var ret string + return ret + } + return *o.TlsServerName +} + +// GetTlsServerNameOk returns a tuple with the TlsServerName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetTlsServerNameOk() (*string, bool) { + if o == nil || IsNil(o.TlsServerName) { + return nil, false + } + return o.TlsServerName, true +} + +// HasTlsServerName returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasTlsServerName() bool { + if o != nil && !IsNil(o.TlsServerName) { + return true + } + + return false +} + +// SetTlsServerName gets a reference to the given string and assigns it to the TlsServerName field. +func (o *PatchedLDAPProviderRequest) SetTlsServerName(v string) { + o.TlsServerName = &v +} + +// GetUidStartNumber returns the UidStartNumber field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetUidStartNumber() int32 { + if o == nil || IsNil(o.UidStartNumber) { + var ret int32 + return ret + } + return *o.UidStartNumber +} + +// GetUidStartNumberOk returns a tuple with the UidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetUidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.UidStartNumber) { + return nil, false + } + return o.UidStartNumber, true +} + +// HasUidStartNumber returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasUidStartNumber() bool { + if o != nil && !IsNil(o.UidStartNumber) { + return true + } + + return false +} + +// SetUidStartNumber gets a reference to the given int32 and assigns it to the UidStartNumber field. +func (o *PatchedLDAPProviderRequest) SetUidStartNumber(v int32) { + o.UidStartNumber = &v +} + +// GetGidStartNumber returns the GidStartNumber field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetGidStartNumber() int32 { + if o == nil || IsNil(o.GidStartNumber) { + var ret int32 + return ret + } + return *o.GidStartNumber +} + +// GetGidStartNumberOk returns a tuple with the GidStartNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetGidStartNumberOk() (*int32, bool) { + if o == nil || IsNil(o.GidStartNumber) { + return nil, false + } + return o.GidStartNumber, true +} + +// HasGidStartNumber returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasGidStartNumber() bool { + if o != nil && !IsNil(o.GidStartNumber) { + return true + } + + return false +} + +// SetGidStartNumber gets a reference to the given int32 and assigns it to the GidStartNumber field. +func (o *PatchedLDAPProviderRequest) SetGidStartNumber(v int32) { + o.GidStartNumber = &v +} + +// GetSearchMode returns the SearchMode field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetSearchMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.SearchMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.SearchMode +} + +// GetSearchModeOk returns a tuple with the SearchMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetSearchModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.SearchMode) { + return nil, false + } + return o.SearchMode, true +} + +// HasSearchMode returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasSearchMode() bool { + if o != nil && !IsNil(o.SearchMode) { + return true + } + + return false +} + +// SetSearchMode gets a reference to the given LDAPAPIAccessMode and assigns it to the SearchMode field. +func (o *PatchedLDAPProviderRequest) SetSearchMode(v LDAPAPIAccessMode) { + o.SearchMode = &v +} + +// GetBindMode returns the BindMode field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetBindMode() LDAPAPIAccessMode { + if o == nil || IsNil(o.BindMode) { + var ret LDAPAPIAccessMode + return ret + } + return *o.BindMode +} + +// GetBindModeOk returns a tuple with the BindMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetBindModeOk() (*LDAPAPIAccessMode, bool) { + if o == nil || IsNil(o.BindMode) { + return nil, false + } + return o.BindMode, true +} + +// HasBindMode returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasBindMode() bool { + if o != nil && !IsNil(o.BindMode) { + return true + } + + return false +} + +// SetBindMode gets a reference to the given LDAPAPIAccessMode and assigns it to the BindMode field. +func (o *PatchedLDAPProviderRequest) SetBindMode(v LDAPAPIAccessMode) { + o.BindMode = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *PatchedLDAPProviderRequest) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPProviderRequest) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *PatchedLDAPProviderRequest) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *PatchedLDAPProviderRequest) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +func (o PatchedLDAPProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedLDAPProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.BaseDn) { + toSerialize["base_dn"] = o.BaseDn + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.TlsServerName) { + toSerialize["tls_server_name"] = o.TlsServerName + } + if !IsNil(o.UidStartNumber) { + toSerialize["uid_start_number"] = o.UidStartNumber + } + if !IsNil(o.GidStartNumber) { + toSerialize["gid_start_number"] = o.GidStartNumber + } + if !IsNil(o.SearchMode) { + toSerialize["search_mode"] = o.SearchMode + } + if !IsNil(o.BindMode) { + toSerialize["bind_mode"] = o.BindMode + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedLDAPProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedLDAPProviderRequest := _PatchedLDAPProviderRequest{} + + err = json.Unmarshal(data, &varPatchedLDAPProviderRequest) + + if err != nil { + return err + } + + *o = PatchedLDAPProviderRequest(varPatchedLDAPProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "certificate") + delete(additionalProperties, "tls_server_name") + delete(additionalProperties, "uid_start_number") + delete(additionalProperties, "gid_start_number") + delete(additionalProperties, "search_mode") + delete(additionalProperties, "bind_mode") + delete(additionalProperties, "mfa_support") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedLDAPProviderRequest struct { + value *PatchedLDAPProviderRequest + isSet bool +} + +func (v NullablePatchedLDAPProviderRequest) Get() *PatchedLDAPProviderRequest { + return v.value +} + +func (v *NullablePatchedLDAPProviderRequest) Set(val *PatchedLDAPProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedLDAPProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedLDAPProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedLDAPProviderRequest(val *PatchedLDAPProviderRequest) *NullablePatchedLDAPProviderRequest { + return &NullablePatchedLDAPProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedLDAPProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedLDAPProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_ldap_source_property_mapping_request.go b/packages/client-go/model_patched_ldap_source_property_mapping_request.go new file mode 100644 index 0000000000..df168b6552 --- /dev/null +++ b/packages/client-go/model_patched_ldap_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedLDAPSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedLDAPSourcePropertyMappingRequest{} + +// PatchedLDAPSourcePropertyMappingRequest LDAP PropertyMapping Serializer +type PatchedLDAPSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedLDAPSourcePropertyMappingRequest PatchedLDAPSourcePropertyMappingRequest + +// NewPatchedLDAPSourcePropertyMappingRequest instantiates a new PatchedLDAPSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedLDAPSourcePropertyMappingRequest() *PatchedLDAPSourcePropertyMappingRequest { + this := PatchedLDAPSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedLDAPSourcePropertyMappingRequestWithDefaults instantiates a new PatchedLDAPSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedLDAPSourcePropertyMappingRequestWithDefaults() *PatchedLDAPSourcePropertyMappingRequest { + this := PatchedLDAPSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedLDAPSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedLDAPSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedLDAPSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedLDAPSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedLDAPSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedLDAPSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedLDAPSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedLDAPSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedLDAPSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedLDAPSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedLDAPSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedLDAPSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedLDAPSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedLDAPSourcePropertyMappingRequest := _PatchedLDAPSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedLDAPSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedLDAPSourcePropertyMappingRequest(varPatchedLDAPSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedLDAPSourcePropertyMappingRequest struct { + value *PatchedLDAPSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedLDAPSourcePropertyMappingRequest) Get() *PatchedLDAPSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedLDAPSourcePropertyMappingRequest) Set(val *PatchedLDAPSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedLDAPSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedLDAPSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedLDAPSourcePropertyMappingRequest(val *PatchedLDAPSourcePropertyMappingRequest) *NullablePatchedLDAPSourcePropertyMappingRequest { + return &NullablePatchedLDAPSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedLDAPSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedLDAPSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_ldap_source_request.go b/packages/client-go/model_patched_ldap_source_request.go new file mode 100644 index 0000000000..1d132ad94e --- /dev/null +++ b/packages/client-go/model_patched_ldap_source_request.go @@ -0,0 +1,1487 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedLDAPSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedLDAPSourceRequest{} + +// PatchedLDAPSourceRequest LDAP Source Serializer +type PatchedLDAPSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + ServerUri *string `json:"server_uri,omitempty"` + // Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. + PeerCertificate NullableString `json:"peer_certificate,omitempty"` + // Client certificate to authenticate against the LDAP Server's Certificate. + ClientCertificate NullableString `json:"client_certificate,omitempty"` + BindCn *string `json:"bind_cn,omitempty"` + BindPassword *string `json:"bind_password,omitempty"` + StartTls *bool `json:"start_tls,omitempty"` + Sni *bool `json:"sni,omitempty"` + BaseDn *string `json:"base_dn,omitempty"` + // Prepended to Base DN for User-queries. + AdditionalUserDn *string `json:"additional_user_dn,omitempty"` + // Prepended to Base DN for Group-queries. + AdditionalGroupDn *string `json:"additional_group_dn,omitempty"` + // Consider Objects matching this filter to be Users. + UserObjectFilter *string `json:"user_object_filter,omitempty"` + // Consider Objects matching this filter to be Groups. + GroupObjectFilter *string `json:"group_object_filter,omitempty"` + // Field which contains members of a group. + GroupMembershipField *string `json:"group_membership_field,omitempty"` + // Attribute which matches the value of `group_membership_field`. + UserMembershipAttribute *string `json:"user_membership_attribute,omitempty"` + // Field which contains a unique Identifier. + ObjectUniquenessField *string `json:"object_uniqueness_field,omitempty"` + // Update internal authentik password when login succeeds with LDAP + PasswordLoginUpdateInternalPassword *bool `json:"password_login_update_internal_password,omitempty"` + SyncUsers *bool `json:"sync_users,omitempty"` + // When a user changes their password, sync it back to LDAP. This can only be enabled on a single LDAP source. + SyncUsersPassword *bool `json:"sync_users_password,omitempty"` + SyncGroups *bool `json:"sync_groups,omitempty"` + SyncParentGroup NullableString `json:"sync_parent_group,omitempty"` + // Lookup group membership based on a user attribute instead of a group attribute. This allows nested group resolution on systems like FreeIPA and Active Directory + LookupGroupsFromUser *bool `json:"lookup_groups_from_user,omitempty"` + // Delete authentik users and groups which were previously supplied by this source, but are now missing from it. + DeleteNotFoundObjects *bool `json:"delete_not_found_objects,omitempty"` + // When to trigger sync for outgoing providers + SyncOutgoingTriggerMode *SyncOutgoingTriggerModeEnum `json:"sync_outgoing_trigger_mode,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedLDAPSourceRequest PatchedLDAPSourceRequest + +// NewPatchedLDAPSourceRequest instantiates a new PatchedLDAPSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedLDAPSourceRequest() *PatchedLDAPSourceRequest { + this := PatchedLDAPSourceRequest{} + return &this +} + +// NewPatchedLDAPSourceRequestWithDefaults instantiates a new PatchedLDAPSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedLDAPSourceRequestWithDefaults() *PatchedLDAPSourceRequest { + this := PatchedLDAPSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedLDAPSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedLDAPSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedLDAPSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedLDAPSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedLDAPSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedLDAPSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedLDAPSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedLDAPSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedLDAPSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedLDAPSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedLDAPSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedLDAPSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedLDAPSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedLDAPSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedLDAPSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedLDAPSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetServerUri returns the ServerUri field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetServerUri() string { + if o == nil || IsNil(o.ServerUri) { + var ret string + return ret + } + return *o.ServerUri +} + +// GetServerUriOk returns a tuple with the ServerUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetServerUriOk() (*string, bool) { + if o == nil || IsNil(o.ServerUri) { + return nil, false + } + return o.ServerUri, true +} + +// HasServerUri returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasServerUri() bool { + if o != nil && !IsNil(o.ServerUri) { + return true + } + + return false +} + +// SetServerUri gets a reference to the given string and assigns it to the ServerUri field. +func (o *PatchedLDAPSourceRequest) SetServerUri(v string) { + o.ServerUri = &v +} + +// GetPeerCertificate returns the PeerCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourceRequest) GetPeerCertificate() string { + if o == nil || IsNil(o.PeerCertificate.Get()) { + var ret string + return ret + } + return *o.PeerCertificate.Get() +} + +// GetPeerCertificateOk returns a tuple with the PeerCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourceRequest) GetPeerCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.PeerCertificate.Get(), o.PeerCertificate.IsSet() +} + +// HasPeerCertificate returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasPeerCertificate() bool { + if o != nil && o.PeerCertificate.IsSet() { + return true + } + + return false +} + +// SetPeerCertificate gets a reference to the given NullableString and assigns it to the PeerCertificate field. +func (o *PatchedLDAPSourceRequest) SetPeerCertificate(v string) { + o.PeerCertificate.Set(&v) +} + +// SetPeerCertificateNil sets the value for PeerCertificate to be an explicit nil +func (o *PatchedLDAPSourceRequest) SetPeerCertificateNil() { + o.PeerCertificate.Set(nil) +} + +// UnsetPeerCertificate ensures that no value is present for PeerCertificate, not even an explicit nil +func (o *PatchedLDAPSourceRequest) UnsetPeerCertificate() { + o.PeerCertificate.Unset() +} + +// GetClientCertificate returns the ClientCertificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourceRequest) GetClientCertificate() string { + if o == nil || IsNil(o.ClientCertificate.Get()) { + var ret string + return ret + } + return *o.ClientCertificate.Get() +} + +// GetClientCertificateOk returns a tuple with the ClientCertificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourceRequest) GetClientCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ClientCertificate.Get(), o.ClientCertificate.IsSet() +} + +// HasClientCertificate returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasClientCertificate() bool { + if o != nil && o.ClientCertificate.IsSet() { + return true + } + + return false +} + +// SetClientCertificate gets a reference to the given NullableString and assigns it to the ClientCertificate field. +func (o *PatchedLDAPSourceRequest) SetClientCertificate(v string) { + o.ClientCertificate.Set(&v) +} + +// SetClientCertificateNil sets the value for ClientCertificate to be an explicit nil +func (o *PatchedLDAPSourceRequest) SetClientCertificateNil() { + o.ClientCertificate.Set(nil) +} + +// UnsetClientCertificate ensures that no value is present for ClientCertificate, not even an explicit nil +func (o *PatchedLDAPSourceRequest) UnsetClientCertificate() { + o.ClientCertificate.Unset() +} + +// GetBindCn returns the BindCn field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetBindCn() string { + if o == nil || IsNil(o.BindCn) { + var ret string + return ret + } + return *o.BindCn +} + +// GetBindCnOk returns a tuple with the BindCn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetBindCnOk() (*string, bool) { + if o == nil || IsNil(o.BindCn) { + return nil, false + } + return o.BindCn, true +} + +// HasBindCn returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasBindCn() bool { + if o != nil && !IsNil(o.BindCn) { + return true + } + + return false +} + +// SetBindCn gets a reference to the given string and assigns it to the BindCn field. +func (o *PatchedLDAPSourceRequest) SetBindCn(v string) { + o.BindCn = &v +} + +// GetBindPassword returns the BindPassword field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetBindPassword() string { + if o == nil || IsNil(o.BindPassword) { + var ret string + return ret + } + return *o.BindPassword +} + +// GetBindPasswordOk returns a tuple with the BindPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetBindPasswordOk() (*string, bool) { + if o == nil || IsNil(o.BindPassword) { + return nil, false + } + return o.BindPassword, true +} + +// HasBindPassword returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasBindPassword() bool { + if o != nil && !IsNil(o.BindPassword) { + return true + } + + return false +} + +// SetBindPassword gets a reference to the given string and assigns it to the BindPassword field. +func (o *PatchedLDAPSourceRequest) SetBindPassword(v string) { + o.BindPassword = &v +} + +// GetStartTls returns the StartTls field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetStartTls() bool { + if o == nil || IsNil(o.StartTls) { + var ret bool + return ret + } + return *o.StartTls +} + +// GetStartTlsOk returns a tuple with the StartTls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetStartTlsOk() (*bool, bool) { + if o == nil || IsNil(o.StartTls) { + return nil, false + } + return o.StartTls, true +} + +// HasStartTls returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasStartTls() bool { + if o != nil && !IsNil(o.StartTls) { + return true + } + + return false +} + +// SetStartTls gets a reference to the given bool and assigns it to the StartTls field. +func (o *PatchedLDAPSourceRequest) SetStartTls(v bool) { + o.StartTls = &v +} + +// GetSni returns the Sni field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSni() bool { + if o == nil || IsNil(o.Sni) { + var ret bool + return ret + } + return *o.Sni +} + +// GetSniOk returns a tuple with the Sni field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSniOk() (*bool, bool) { + if o == nil || IsNil(o.Sni) { + return nil, false + } + return o.Sni, true +} + +// HasSni returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSni() bool { + if o != nil && !IsNil(o.Sni) { + return true + } + + return false +} + +// SetSni gets a reference to the given bool and assigns it to the Sni field. +func (o *PatchedLDAPSourceRequest) SetSni(v bool) { + o.Sni = &v +} + +// GetBaseDn returns the BaseDn field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetBaseDn() string { + if o == nil || IsNil(o.BaseDn) { + var ret string + return ret + } + return *o.BaseDn +} + +// GetBaseDnOk returns a tuple with the BaseDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetBaseDnOk() (*string, bool) { + if o == nil || IsNil(o.BaseDn) { + return nil, false + } + return o.BaseDn, true +} + +// HasBaseDn returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasBaseDn() bool { + if o != nil && !IsNil(o.BaseDn) { + return true + } + + return false +} + +// SetBaseDn gets a reference to the given string and assigns it to the BaseDn field. +func (o *PatchedLDAPSourceRequest) SetBaseDn(v string) { + o.BaseDn = &v +} + +// GetAdditionalUserDn returns the AdditionalUserDn field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetAdditionalUserDn() string { + if o == nil || IsNil(o.AdditionalUserDn) { + var ret string + return ret + } + return *o.AdditionalUserDn +} + +// GetAdditionalUserDnOk returns a tuple with the AdditionalUserDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetAdditionalUserDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalUserDn) { + return nil, false + } + return o.AdditionalUserDn, true +} + +// HasAdditionalUserDn returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasAdditionalUserDn() bool { + if o != nil && !IsNil(o.AdditionalUserDn) { + return true + } + + return false +} + +// SetAdditionalUserDn gets a reference to the given string and assigns it to the AdditionalUserDn field. +func (o *PatchedLDAPSourceRequest) SetAdditionalUserDn(v string) { + o.AdditionalUserDn = &v +} + +// GetAdditionalGroupDn returns the AdditionalGroupDn field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetAdditionalGroupDn() string { + if o == nil || IsNil(o.AdditionalGroupDn) { + var ret string + return ret + } + return *o.AdditionalGroupDn +} + +// GetAdditionalGroupDnOk returns a tuple with the AdditionalGroupDn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetAdditionalGroupDnOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalGroupDn) { + return nil, false + } + return o.AdditionalGroupDn, true +} + +// HasAdditionalGroupDn returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasAdditionalGroupDn() bool { + if o != nil && !IsNil(o.AdditionalGroupDn) { + return true + } + + return false +} + +// SetAdditionalGroupDn gets a reference to the given string and assigns it to the AdditionalGroupDn field. +func (o *PatchedLDAPSourceRequest) SetAdditionalGroupDn(v string) { + o.AdditionalGroupDn = &v +} + +// GetUserObjectFilter returns the UserObjectFilter field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetUserObjectFilter() string { + if o == nil || IsNil(o.UserObjectFilter) { + var ret string + return ret + } + return *o.UserObjectFilter +} + +// GetUserObjectFilterOk returns a tuple with the UserObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetUserObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.UserObjectFilter) { + return nil, false + } + return o.UserObjectFilter, true +} + +// HasUserObjectFilter returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasUserObjectFilter() bool { + if o != nil && !IsNil(o.UserObjectFilter) { + return true + } + + return false +} + +// SetUserObjectFilter gets a reference to the given string and assigns it to the UserObjectFilter field. +func (o *PatchedLDAPSourceRequest) SetUserObjectFilter(v string) { + o.UserObjectFilter = &v +} + +// GetGroupObjectFilter returns the GroupObjectFilter field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetGroupObjectFilter() string { + if o == nil || IsNil(o.GroupObjectFilter) { + var ret string + return ret + } + return *o.GroupObjectFilter +} + +// GetGroupObjectFilterOk returns a tuple with the GroupObjectFilter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetGroupObjectFilterOk() (*string, bool) { + if o == nil || IsNil(o.GroupObjectFilter) { + return nil, false + } + return o.GroupObjectFilter, true +} + +// HasGroupObjectFilter returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasGroupObjectFilter() bool { + if o != nil && !IsNil(o.GroupObjectFilter) { + return true + } + + return false +} + +// SetGroupObjectFilter gets a reference to the given string and assigns it to the GroupObjectFilter field. +func (o *PatchedLDAPSourceRequest) SetGroupObjectFilter(v string) { + o.GroupObjectFilter = &v +} + +// GetGroupMembershipField returns the GroupMembershipField field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetGroupMembershipField() string { + if o == nil || IsNil(o.GroupMembershipField) { + var ret string + return ret + } + return *o.GroupMembershipField +} + +// GetGroupMembershipFieldOk returns a tuple with the GroupMembershipField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetGroupMembershipFieldOk() (*string, bool) { + if o == nil || IsNil(o.GroupMembershipField) { + return nil, false + } + return o.GroupMembershipField, true +} + +// HasGroupMembershipField returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasGroupMembershipField() bool { + if o != nil && !IsNil(o.GroupMembershipField) { + return true + } + + return false +} + +// SetGroupMembershipField gets a reference to the given string and assigns it to the GroupMembershipField field. +func (o *PatchedLDAPSourceRequest) SetGroupMembershipField(v string) { + o.GroupMembershipField = &v +} + +// GetUserMembershipAttribute returns the UserMembershipAttribute field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetUserMembershipAttribute() string { + if o == nil || IsNil(o.UserMembershipAttribute) { + var ret string + return ret + } + return *o.UserMembershipAttribute +} + +// GetUserMembershipAttributeOk returns a tuple with the UserMembershipAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetUserMembershipAttributeOk() (*string, bool) { + if o == nil || IsNil(o.UserMembershipAttribute) { + return nil, false + } + return o.UserMembershipAttribute, true +} + +// HasUserMembershipAttribute returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasUserMembershipAttribute() bool { + if o != nil && !IsNil(o.UserMembershipAttribute) { + return true + } + + return false +} + +// SetUserMembershipAttribute gets a reference to the given string and assigns it to the UserMembershipAttribute field. +func (o *PatchedLDAPSourceRequest) SetUserMembershipAttribute(v string) { + o.UserMembershipAttribute = &v +} + +// GetObjectUniquenessField returns the ObjectUniquenessField field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetObjectUniquenessField() string { + if o == nil || IsNil(o.ObjectUniquenessField) { + var ret string + return ret + } + return *o.ObjectUniquenessField +} + +// GetObjectUniquenessFieldOk returns a tuple with the ObjectUniquenessField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetObjectUniquenessFieldOk() (*string, bool) { + if o == nil || IsNil(o.ObjectUniquenessField) { + return nil, false + } + return o.ObjectUniquenessField, true +} + +// HasObjectUniquenessField returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasObjectUniquenessField() bool { + if o != nil && !IsNil(o.ObjectUniquenessField) { + return true + } + + return false +} + +// SetObjectUniquenessField gets a reference to the given string and assigns it to the ObjectUniquenessField field. +func (o *PatchedLDAPSourceRequest) SetObjectUniquenessField(v string) { + o.ObjectUniquenessField = &v +} + +// GetPasswordLoginUpdateInternalPassword returns the PasswordLoginUpdateInternalPassword field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetPasswordLoginUpdateInternalPassword() bool { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + var ret bool + return ret + } + return *o.PasswordLoginUpdateInternalPassword +} + +// GetPasswordLoginUpdateInternalPasswordOk returns a tuple with the PasswordLoginUpdateInternalPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetPasswordLoginUpdateInternalPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.PasswordLoginUpdateInternalPassword) { + return nil, false + } + return o.PasswordLoginUpdateInternalPassword, true +} + +// HasPasswordLoginUpdateInternalPassword returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasPasswordLoginUpdateInternalPassword() bool { + if o != nil && !IsNil(o.PasswordLoginUpdateInternalPassword) { + return true + } + + return false +} + +// SetPasswordLoginUpdateInternalPassword gets a reference to the given bool and assigns it to the PasswordLoginUpdateInternalPassword field. +func (o *PatchedLDAPSourceRequest) SetPasswordLoginUpdateInternalPassword(v bool) { + o.PasswordLoginUpdateInternalPassword = &v +} + +// GetSyncUsers returns the SyncUsers field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSyncUsers() bool { + if o == nil || IsNil(o.SyncUsers) { + var ret bool + return ret + } + return *o.SyncUsers +} + +// GetSyncUsersOk returns a tuple with the SyncUsers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSyncUsersOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsers) { + return nil, false + } + return o.SyncUsers, true +} + +// HasSyncUsers returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSyncUsers() bool { + if o != nil && !IsNil(o.SyncUsers) { + return true + } + + return false +} + +// SetSyncUsers gets a reference to the given bool and assigns it to the SyncUsers field. +func (o *PatchedLDAPSourceRequest) SetSyncUsers(v bool) { + o.SyncUsers = &v +} + +// GetSyncUsersPassword returns the SyncUsersPassword field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSyncUsersPassword() bool { + if o == nil || IsNil(o.SyncUsersPassword) { + var ret bool + return ret + } + return *o.SyncUsersPassword +} + +// GetSyncUsersPasswordOk returns a tuple with the SyncUsersPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSyncUsersPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.SyncUsersPassword) { + return nil, false + } + return o.SyncUsersPassword, true +} + +// HasSyncUsersPassword returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSyncUsersPassword() bool { + if o != nil && !IsNil(o.SyncUsersPassword) { + return true + } + + return false +} + +// SetSyncUsersPassword gets a reference to the given bool and assigns it to the SyncUsersPassword field. +func (o *PatchedLDAPSourceRequest) SetSyncUsersPassword(v bool) { + o.SyncUsersPassword = &v +} + +// GetSyncGroups returns the SyncGroups field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSyncGroups() bool { + if o == nil || IsNil(o.SyncGroups) { + var ret bool + return ret + } + return *o.SyncGroups +} + +// GetSyncGroupsOk returns a tuple with the SyncGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSyncGroupsOk() (*bool, bool) { + if o == nil || IsNil(o.SyncGroups) { + return nil, false + } + return o.SyncGroups, true +} + +// HasSyncGroups returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSyncGroups() bool { + if o != nil && !IsNil(o.SyncGroups) { + return true + } + + return false +} + +// SetSyncGroups gets a reference to the given bool and assigns it to the SyncGroups field. +func (o *PatchedLDAPSourceRequest) SetSyncGroups(v bool) { + o.SyncGroups = &v +} + +// GetSyncParentGroup returns the SyncParentGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLDAPSourceRequest) GetSyncParentGroup() string { + if o == nil || IsNil(o.SyncParentGroup.Get()) { + var ret string + return ret + } + return *o.SyncParentGroup.Get() +} + +// GetSyncParentGroupOk returns a tuple with the SyncParentGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLDAPSourceRequest) GetSyncParentGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SyncParentGroup.Get(), o.SyncParentGroup.IsSet() +} + +// HasSyncParentGroup returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSyncParentGroup() bool { + if o != nil && o.SyncParentGroup.IsSet() { + return true + } + + return false +} + +// SetSyncParentGroup gets a reference to the given NullableString and assigns it to the SyncParentGroup field. +func (o *PatchedLDAPSourceRequest) SetSyncParentGroup(v string) { + o.SyncParentGroup.Set(&v) +} + +// SetSyncParentGroupNil sets the value for SyncParentGroup to be an explicit nil +func (o *PatchedLDAPSourceRequest) SetSyncParentGroupNil() { + o.SyncParentGroup.Set(nil) +} + +// UnsetSyncParentGroup ensures that no value is present for SyncParentGroup, not even an explicit nil +func (o *PatchedLDAPSourceRequest) UnsetSyncParentGroup() { + o.SyncParentGroup.Unset() +} + +// GetLookupGroupsFromUser returns the LookupGroupsFromUser field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetLookupGroupsFromUser() bool { + if o == nil || IsNil(o.LookupGroupsFromUser) { + var ret bool + return ret + } + return *o.LookupGroupsFromUser +} + +// GetLookupGroupsFromUserOk returns a tuple with the LookupGroupsFromUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetLookupGroupsFromUserOk() (*bool, bool) { + if o == nil || IsNil(o.LookupGroupsFromUser) { + return nil, false + } + return o.LookupGroupsFromUser, true +} + +// HasLookupGroupsFromUser returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasLookupGroupsFromUser() bool { + if o != nil && !IsNil(o.LookupGroupsFromUser) { + return true + } + + return false +} + +// SetLookupGroupsFromUser gets a reference to the given bool and assigns it to the LookupGroupsFromUser field. +func (o *PatchedLDAPSourceRequest) SetLookupGroupsFromUser(v bool) { + o.LookupGroupsFromUser = &v +} + +// GetDeleteNotFoundObjects returns the DeleteNotFoundObjects field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetDeleteNotFoundObjects() bool { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + var ret bool + return ret + } + return *o.DeleteNotFoundObjects +} + +// GetDeleteNotFoundObjectsOk returns a tuple with the DeleteNotFoundObjects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetDeleteNotFoundObjectsOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteNotFoundObjects) { + return nil, false + } + return o.DeleteNotFoundObjects, true +} + +// HasDeleteNotFoundObjects returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasDeleteNotFoundObjects() bool { + if o != nil && !IsNil(o.DeleteNotFoundObjects) { + return true + } + + return false +} + +// SetDeleteNotFoundObjects gets a reference to the given bool and assigns it to the DeleteNotFoundObjects field. +func (o *PatchedLDAPSourceRequest) SetDeleteNotFoundObjects(v bool) { + o.DeleteNotFoundObjects = &v +} + +// GetSyncOutgoingTriggerMode returns the SyncOutgoingTriggerMode field value if set, zero value otherwise. +func (o *PatchedLDAPSourceRequest) GetSyncOutgoingTriggerMode() SyncOutgoingTriggerModeEnum { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + var ret SyncOutgoingTriggerModeEnum + return ret + } + return *o.SyncOutgoingTriggerMode +} + +// GetSyncOutgoingTriggerModeOk returns a tuple with the SyncOutgoingTriggerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLDAPSourceRequest) GetSyncOutgoingTriggerModeOk() (*SyncOutgoingTriggerModeEnum, bool) { + if o == nil || IsNil(o.SyncOutgoingTriggerMode) { + return nil, false + } + return o.SyncOutgoingTriggerMode, true +} + +// HasSyncOutgoingTriggerMode returns a boolean if a field has been set. +func (o *PatchedLDAPSourceRequest) HasSyncOutgoingTriggerMode() bool { + if o != nil && !IsNil(o.SyncOutgoingTriggerMode) { + return true + } + + return false +} + +// SetSyncOutgoingTriggerMode gets a reference to the given SyncOutgoingTriggerModeEnum and assigns it to the SyncOutgoingTriggerMode field. +func (o *PatchedLDAPSourceRequest) SetSyncOutgoingTriggerMode(v SyncOutgoingTriggerModeEnum) { + o.SyncOutgoingTriggerMode = &v +} + +func (o PatchedLDAPSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedLDAPSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.ServerUri) { + toSerialize["server_uri"] = o.ServerUri + } + if o.PeerCertificate.IsSet() { + toSerialize["peer_certificate"] = o.PeerCertificate.Get() + } + if o.ClientCertificate.IsSet() { + toSerialize["client_certificate"] = o.ClientCertificate.Get() + } + if !IsNil(o.BindCn) { + toSerialize["bind_cn"] = o.BindCn + } + if !IsNil(o.BindPassword) { + toSerialize["bind_password"] = o.BindPassword + } + if !IsNil(o.StartTls) { + toSerialize["start_tls"] = o.StartTls + } + if !IsNil(o.Sni) { + toSerialize["sni"] = o.Sni + } + if !IsNil(o.BaseDn) { + toSerialize["base_dn"] = o.BaseDn + } + if !IsNil(o.AdditionalUserDn) { + toSerialize["additional_user_dn"] = o.AdditionalUserDn + } + if !IsNil(o.AdditionalGroupDn) { + toSerialize["additional_group_dn"] = o.AdditionalGroupDn + } + if !IsNil(o.UserObjectFilter) { + toSerialize["user_object_filter"] = o.UserObjectFilter + } + if !IsNil(o.GroupObjectFilter) { + toSerialize["group_object_filter"] = o.GroupObjectFilter + } + if !IsNil(o.GroupMembershipField) { + toSerialize["group_membership_field"] = o.GroupMembershipField + } + if !IsNil(o.UserMembershipAttribute) { + toSerialize["user_membership_attribute"] = o.UserMembershipAttribute + } + if !IsNil(o.ObjectUniquenessField) { + toSerialize["object_uniqueness_field"] = o.ObjectUniquenessField + } + if !IsNil(o.PasswordLoginUpdateInternalPassword) { + toSerialize["password_login_update_internal_password"] = o.PasswordLoginUpdateInternalPassword + } + if !IsNil(o.SyncUsers) { + toSerialize["sync_users"] = o.SyncUsers + } + if !IsNil(o.SyncUsersPassword) { + toSerialize["sync_users_password"] = o.SyncUsersPassword + } + if !IsNil(o.SyncGroups) { + toSerialize["sync_groups"] = o.SyncGroups + } + if o.SyncParentGroup.IsSet() { + toSerialize["sync_parent_group"] = o.SyncParentGroup.Get() + } + if !IsNil(o.LookupGroupsFromUser) { + toSerialize["lookup_groups_from_user"] = o.LookupGroupsFromUser + } + if !IsNil(o.DeleteNotFoundObjects) { + toSerialize["delete_not_found_objects"] = o.DeleteNotFoundObjects + } + if !IsNil(o.SyncOutgoingTriggerMode) { + toSerialize["sync_outgoing_trigger_mode"] = o.SyncOutgoingTriggerMode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedLDAPSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedLDAPSourceRequest := _PatchedLDAPSourceRequest{} + + err = json.Unmarshal(data, &varPatchedLDAPSourceRequest) + + if err != nil { + return err + } + + *o = PatchedLDAPSourceRequest(varPatchedLDAPSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "server_uri") + delete(additionalProperties, "peer_certificate") + delete(additionalProperties, "client_certificate") + delete(additionalProperties, "bind_cn") + delete(additionalProperties, "bind_password") + delete(additionalProperties, "start_tls") + delete(additionalProperties, "sni") + delete(additionalProperties, "base_dn") + delete(additionalProperties, "additional_user_dn") + delete(additionalProperties, "additional_group_dn") + delete(additionalProperties, "user_object_filter") + delete(additionalProperties, "group_object_filter") + delete(additionalProperties, "group_membership_field") + delete(additionalProperties, "user_membership_attribute") + delete(additionalProperties, "object_uniqueness_field") + delete(additionalProperties, "password_login_update_internal_password") + delete(additionalProperties, "sync_users") + delete(additionalProperties, "sync_users_password") + delete(additionalProperties, "sync_groups") + delete(additionalProperties, "sync_parent_group") + delete(additionalProperties, "lookup_groups_from_user") + delete(additionalProperties, "delete_not_found_objects") + delete(additionalProperties, "sync_outgoing_trigger_mode") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedLDAPSourceRequest struct { + value *PatchedLDAPSourceRequest + isSet bool +} + +func (v NullablePatchedLDAPSourceRequest) Get() *PatchedLDAPSourceRequest { + return v.value +} + +func (v *NullablePatchedLDAPSourceRequest) Set(val *PatchedLDAPSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedLDAPSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedLDAPSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedLDAPSourceRequest(val *PatchedLDAPSourceRequest) *NullablePatchedLDAPSourceRequest { + return &NullablePatchedLDAPSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedLDAPSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedLDAPSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_license_request.go b/packages/client-go/model_patched_license_request.go new file mode 100644 index 0000000000..be32458e03 --- /dev/null +++ b/packages/client-go/model_patched_license_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedLicenseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedLicenseRequest{} + +// PatchedLicenseRequest License Serializer +type PatchedLicenseRequest struct { + Key *string `json:"key,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedLicenseRequest PatchedLicenseRequest + +// NewPatchedLicenseRequest instantiates a new PatchedLicenseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedLicenseRequest() *PatchedLicenseRequest { + this := PatchedLicenseRequest{} + return &this +} + +// NewPatchedLicenseRequestWithDefaults instantiates a new PatchedLicenseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedLicenseRequestWithDefaults() *PatchedLicenseRequest { + this := PatchedLicenseRequest{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *PatchedLicenseRequest) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLicenseRequest) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *PatchedLicenseRequest) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *PatchedLicenseRequest) SetKey(v string) { + o.Key = &v +} + +func (o PatchedLicenseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedLicenseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedLicenseRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedLicenseRequest := _PatchedLicenseRequest{} + + err = json.Unmarshal(data, &varPatchedLicenseRequest) + + if err != nil { + return err + } + + *o = PatchedLicenseRequest(varPatchedLicenseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedLicenseRequest struct { + value *PatchedLicenseRequest + isSet bool +} + +func (v NullablePatchedLicenseRequest) Get() *PatchedLicenseRequest { + return v.value +} + +func (v *NullablePatchedLicenseRequest) Set(val *PatchedLicenseRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedLicenseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedLicenseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedLicenseRequest(val *PatchedLicenseRequest) *NullablePatchedLicenseRequest { + return &NullablePatchedLicenseRequest{value: val, isSet: true} +} + +func (v NullablePatchedLicenseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedLicenseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_lifecycle_rule_request.go b/packages/client-go/model_patched_lifecycle_rule_request.go new file mode 100644 index 0000000000..3e551a70c7 --- /dev/null +++ b/packages/client-go/model_patched_lifecycle_rule_request.go @@ -0,0 +1,499 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedLifecycleRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedLifecycleRuleRequest{} + +// PatchedLifecycleRuleRequest Mixin to validate that a valid enterprise license exists before allowing to save the object +type PatchedLifecycleRuleRequest struct { + Name *string `json:"name,omitempty"` + ContentType *ContentTypeEnum `json:"content_type,omitempty"` + ObjectId NullableString `json:"object_id,omitempty"` + Interval *string `json:"interval,omitempty"` + GracePeriod *string `json:"grace_period,omitempty"` + ReviewerGroups []string `json:"reviewer_groups,omitempty"` + MinReviewers *int32 `json:"min_reviewers,omitempty"` + MinReviewersIsPerGroup *bool `json:"min_reviewers_is_per_group,omitempty"` + Reviewers []string `json:"reviewers,omitempty"` + // Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI. + NotificationTransports []string `json:"notification_transports,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedLifecycleRuleRequest PatchedLifecycleRuleRequest + +// NewPatchedLifecycleRuleRequest instantiates a new PatchedLifecycleRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedLifecycleRuleRequest() *PatchedLifecycleRuleRequest { + this := PatchedLifecycleRuleRequest{} + return &this +} + +// NewPatchedLifecycleRuleRequestWithDefaults instantiates a new PatchedLifecycleRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedLifecycleRuleRequestWithDefaults() *PatchedLifecycleRuleRequest { + this := PatchedLifecycleRuleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedLifecycleRuleRequest) SetName(v string) { + o.Name = &v +} + +// GetContentType returns the ContentType field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetContentType() ContentTypeEnum { + if o == nil || IsNil(o.ContentType) { + var ret ContentTypeEnum + return ret + } + return *o.ContentType +} + +// GetContentTypeOk returns a tuple with the ContentType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetContentTypeOk() (*ContentTypeEnum, bool) { + if o == nil || IsNil(o.ContentType) { + return nil, false + } + return o.ContentType, true +} + +// HasContentType returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasContentType() bool { + if o != nil && !IsNil(o.ContentType) { + return true + } + + return false +} + +// SetContentType gets a reference to the given ContentTypeEnum and assigns it to the ContentType field. +func (o *PatchedLifecycleRuleRequest) SetContentType(v ContentTypeEnum) { + o.ContentType = &v +} + +// GetObjectId returns the ObjectId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedLifecycleRuleRequest) GetObjectId() string { + if o == nil || IsNil(o.ObjectId.Get()) { + var ret string + return ret + } + return *o.ObjectId.Get() +} + +// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedLifecycleRuleRequest) GetObjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ObjectId.Get(), o.ObjectId.IsSet() +} + +// HasObjectId returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasObjectId() bool { + if o != nil && o.ObjectId.IsSet() { + return true + } + + return false +} + +// SetObjectId gets a reference to the given NullableString and assigns it to the ObjectId field. +func (o *PatchedLifecycleRuleRequest) SetObjectId(v string) { + o.ObjectId.Set(&v) +} + +// SetObjectIdNil sets the value for ObjectId to be an explicit nil +func (o *PatchedLifecycleRuleRequest) SetObjectIdNil() { + o.ObjectId.Set(nil) +} + +// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil +func (o *PatchedLifecycleRuleRequest) UnsetObjectId() { + o.ObjectId.Unset() +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetInterval() string { + if o == nil || IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *PatchedLifecycleRuleRequest) SetInterval(v string) { + o.Interval = &v +} + +// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetGracePeriod() string { + if o == nil || IsNil(o.GracePeriod) { + var ret string + return ret + } + return *o.GracePeriod +} + +// GetGracePeriodOk returns a tuple with the GracePeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetGracePeriodOk() (*string, bool) { + if o == nil || IsNil(o.GracePeriod) { + return nil, false + } + return o.GracePeriod, true +} + +// HasGracePeriod returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasGracePeriod() bool { + if o != nil && !IsNil(o.GracePeriod) { + return true + } + + return false +} + +// SetGracePeriod gets a reference to the given string and assigns it to the GracePeriod field. +func (o *PatchedLifecycleRuleRequest) SetGracePeriod(v string) { + o.GracePeriod = &v +} + +// GetReviewerGroups returns the ReviewerGroups field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetReviewerGroups() []string { + if o == nil || IsNil(o.ReviewerGroups) { + var ret []string + return ret + } + return o.ReviewerGroups +} + +// GetReviewerGroupsOk returns a tuple with the ReviewerGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetReviewerGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.ReviewerGroups) { + return nil, false + } + return o.ReviewerGroups, true +} + +// HasReviewerGroups returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasReviewerGroups() bool { + if o != nil && !IsNil(o.ReviewerGroups) { + return true + } + + return false +} + +// SetReviewerGroups gets a reference to the given []string and assigns it to the ReviewerGroups field. +func (o *PatchedLifecycleRuleRequest) SetReviewerGroups(v []string) { + o.ReviewerGroups = v +} + +// GetMinReviewers returns the MinReviewers field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetMinReviewers() int32 { + if o == nil || IsNil(o.MinReviewers) { + var ret int32 + return ret + } + return *o.MinReviewers +} + +// GetMinReviewersOk returns a tuple with the MinReviewers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetMinReviewersOk() (*int32, bool) { + if o == nil || IsNil(o.MinReviewers) { + return nil, false + } + return o.MinReviewers, true +} + +// HasMinReviewers returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasMinReviewers() bool { + if o != nil && !IsNil(o.MinReviewers) { + return true + } + + return false +} + +// SetMinReviewers gets a reference to the given int32 and assigns it to the MinReviewers field. +func (o *PatchedLifecycleRuleRequest) SetMinReviewers(v int32) { + o.MinReviewers = &v +} + +// GetMinReviewersIsPerGroup returns the MinReviewersIsPerGroup field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetMinReviewersIsPerGroup() bool { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + var ret bool + return ret + } + return *o.MinReviewersIsPerGroup +} + +// GetMinReviewersIsPerGroupOk returns a tuple with the MinReviewersIsPerGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetMinReviewersIsPerGroupOk() (*bool, bool) { + if o == nil || IsNil(o.MinReviewersIsPerGroup) { + return nil, false + } + return o.MinReviewersIsPerGroup, true +} + +// HasMinReviewersIsPerGroup returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasMinReviewersIsPerGroup() bool { + if o != nil && !IsNil(o.MinReviewersIsPerGroup) { + return true + } + + return false +} + +// SetMinReviewersIsPerGroup gets a reference to the given bool and assigns it to the MinReviewersIsPerGroup field. +func (o *PatchedLifecycleRuleRequest) SetMinReviewersIsPerGroup(v bool) { + o.MinReviewersIsPerGroup = &v +} + +// GetReviewers returns the Reviewers field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetReviewers() []string { + if o == nil || IsNil(o.Reviewers) { + var ret []string + return ret + } + return o.Reviewers +} + +// GetReviewersOk returns a tuple with the Reviewers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetReviewersOk() ([]string, bool) { + if o == nil || IsNil(o.Reviewers) { + return nil, false + } + return o.Reviewers, true +} + +// HasReviewers returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasReviewers() bool { + if o != nil && !IsNil(o.Reviewers) { + return true + } + + return false +} + +// SetReviewers gets a reference to the given []string and assigns it to the Reviewers field. +func (o *PatchedLifecycleRuleRequest) SetReviewers(v []string) { + o.Reviewers = v +} + +// GetNotificationTransports returns the NotificationTransports field value if set, zero value otherwise. +func (o *PatchedLifecycleRuleRequest) GetNotificationTransports() []string { + if o == nil || IsNil(o.NotificationTransports) { + var ret []string + return ret + } + return o.NotificationTransports +} + +// GetNotificationTransportsOk returns a tuple with the NotificationTransports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedLifecycleRuleRequest) GetNotificationTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.NotificationTransports) { + return nil, false + } + return o.NotificationTransports, true +} + +// HasNotificationTransports returns a boolean if a field has been set. +func (o *PatchedLifecycleRuleRequest) HasNotificationTransports() bool { + if o != nil && !IsNil(o.NotificationTransports) { + return true + } + + return false +} + +// SetNotificationTransports gets a reference to the given []string and assigns it to the NotificationTransports field. +func (o *PatchedLifecycleRuleRequest) SetNotificationTransports(v []string) { + o.NotificationTransports = v +} + +func (o PatchedLifecycleRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedLifecycleRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ContentType) { + toSerialize["content_type"] = o.ContentType + } + if o.ObjectId.IsSet() { + toSerialize["object_id"] = o.ObjectId.Get() + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.GracePeriod) { + toSerialize["grace_period"] = o.GracePeriod + } + if !IsNil(o.ReviewerGroups) { + toSerialize["reviewer_groups"] = o.ReviewerGroups + } + if !IsNil(o.MinReviewers) { + toSerialize["min_reviewers"] = o.MinReviewers + } + if !IsNil(o.MinReviewersIsPerGroup) { + toSerialize["min_reviewers_is_per_group"] = o.MinReviewersIsPerGroup + } + if !IsNil(o.Reviewers) { + toSerialize["reviewers"] = o.Reviewers + } + if !IsNil(o.NotificationTransports) { + toSerialize["notification_transports"] = o.NotificationTransports + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedLifecycleRuleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedLifecycleRuleRequest := _PatchedLifecycleRuleRequest{} + + err = json.Unmarshal(data, &varPatchedLifecycleRuleRequest) + + if err != nil { + return err + } + + *o = PatchedLifecycleRuleRequest(varPatchedLifecycleRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "content_type") + delete(additionalProperties, "object_id") + delete(additionalProperties, "interval") + delete(additionalProperties, "grace_period") + delete(additionalProperties, "reviewer_groups") + delete(additionalProperties, "min_reviewers") + delete(additionalProperties, "min_reviewers_is_per_group") + delete(additionalProperties, "reviewers") + delete(additionalProperties, "notification_transports") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedLifecycleRuleRequest struct { + value *PatchedLifecycleRuleRequest + isSet bool +} + +func (v NullablePatchedLifecycleRuleRequest) Get() *PatchedLifecycleRuleRequest { + return v.value +} + +func (v *NullablePatchedLifecycleRuleRequest) Set(val *PatchedLifecycleRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedLifecycleRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedLifecycleRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedLifecycleRuleRequest(val *PatchedLifecycleRuleRequest) *NullablePatchedLifecycleRuleRequest { + return &NullablePatchedLifecycleRuleRequest{value: val, isSet: true} +} + +func (v NullablePatchedLifecycleRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedLifecycleRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_microsoft_entra_provider_mapping_request.go b/packages/client-go/model_patched_microsoft_entra_provider_mapping_request.go new file mode 100644 index 0000000000..424eb3e42c --- /dev/null +++ b/packages/client-go/model_patched_microsoft_entra_provider_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedMicrosoftEntraProviderMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedMicrosoftEntraProviderMappingRequest{} + +// PatchedMicrosoftEntraProviderMappingRequest MicrosoftEntraProviderMapping Serializer +type PatchedMicrosoftEntraProviderMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedMicrosoftEntraProviderMappingRequest PatchedMicrosoftEntraProviderMappingRequest + +// NewPatchedMicrosoftEntraProviderMappingRequest instantiates a new PatchedMicrosoftEntraProviderMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedMicrosoftEntraProviderMappingRequest() *PatchedMicrosoftEntraProviderMappingRequest { + this := PatchedMicrosoftEntraProviderMappingRequest{} + return &this +} + +// NewPatchedMicrosoftEntraProviderMappingRequestWithDefaults instantiates a new PatchedMicrosoftEntraProviderMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedMicrosoftEntraProviderMappingRequestWithDefaults() *PatchedMicrosoftEntraProviderMappingRequest { + this := PatchedMicrosoftEntraProviderMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedMicrosoftEntraProviderMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedMicrosoftEntraProviderMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedMicrosoftEntraProviderMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedMicrosoftEntraProviderMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedMicrosoftEntraProviderMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedMicrosoftEntraProviderMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedMicrosoftEntraProviderMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedMicrosoftEntraProviderMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedMicrosoftEntraProviderMappingRequest := _PatchedMicrosoftEntraProviderMappingRequest{} + + err = json.Unmarshal(data, &varPatchedMicrosoftEntraProviderMappingRequest) + + if err != nil { + return err + } + + *o = PatchedMicrosoftEntraProviderMappingRequest(varPatchedMicrosoftEntraProviderMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedMicrosoftEntraProviderMappingRequest struct { + value *PatchedMicrosoftEntraProviderMappingRequest + isSet bool +} + +func (v NullablePatchedMicrosoftEntraProviderMappingRequest) Get() *PatchedMicrosoftEntraProviderMappingRequest { + return v.value +} + +func (v *NullablePatchedMicrosoftEntraProviderMappingRequest) Set(val *PatchedMicrosoftEntraProviderMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedMicrosoftEntraProviderMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedMicrosoftEntraProviderMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedMicrosoftEntraProviderMappingRequest(val *PatchedMicrosoftEntraProviderMappingRequest) *NullablePatchedMicrosoftEntraProviderMappingRequest { + return &NullablePatchedMicrosoftEntraProviderMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedMicrosoftEntraProviderMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedMicrosoftEntraProviderMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_microsoft_entra_provider_request.go b/packages/client-go/model_patched_microsoft_entra_provider_request.go new file mode 100644 index 0000000000..21a557aaa7 --- /dev/null +++ b/packages/client-go/model_patched_microsoft_entra_provider_request.go @@ -0,0 +1,613 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedMicrosoftEntraProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedMicrosoftEntraProviderRequest{} + +// PatchedMicrosoftEntraProviderRequest MicrosoftEntraProvider Serializer +type PatchedMicrosoftEntraProviderRequest struct { + Name *string `json:"name,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + TenantId *string `json:"tenant_id,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + FilterGroup NullableString `json:"filter_group,omitempty"` + UserDeleteAction *OutgoingSyncDeleteAction `json:"user_delete_action,omitempty"` + GroupDeleteAction *OutgoingSyncDeleteAction `json:"group_delete_action,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedMicrosoftEntraProviderRequest PatchedMicrosoftEntraProviderRequest + +// NewPatchedMicrosoftEntraProviderRequest instantiates a new PatchedMicrosoftEntraProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedMicrosoftEntraProviderRequest() *PatchedMicrosoftEntraProviderRequest { + this := PatchedMicrosoftEntraProviderRequest{} + return &this +} + +// NewPatchedMicrosoftEntraProviderRequestWithDefaults instantiates a new PatchedMicrosoftEntraProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedMicrosoftEntraProviderRequestWithDefaults() *PatchedMicrosoftEntraProviderRequest { + this := PatchedMicrosoftEntraProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedMicrosoftEntraProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedMicrosoftEntraProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *PatchedMicrosoftEntraProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PatchedMicrosoftEntraProviderRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *PatchedMicrosoftEntraProviderRequest) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetTenantId returns the TenantId field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetTenantId() string { + if o == nil || IsNil(o.TenantId) { + var ret string + return ret + } + return *o.TenantId +} + +// GetTenantIdOk returns a tuple with the TenantId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetTenantIdOk() (*string, bool) { + if o == nil || IsNil(o.TenantId) { + return nil, false + } + return o.TenantId, true +} + +// HasTenantId returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasTenantId() bool { + if o != nil && !IsNil(o.TenantId) { + return true + } + + return false +} + +// SetTenantId gets a reference to the given string and assigns it to the TenantId field. +func (o *PatchedMicrosoftEntraProviderRequest) SetTenantId(v string) { + o.TenantId = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *PatchedMicrosoftEntraProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetFilterGroup returns the FilterGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedMicrosoftEntraProviderRequest) GetFilterGroup() string { + if o == nil || IsNil(o.FilterGroup.Get()) { + var ret string + return ret + } + return *o.FilterGroup.Get() +} + +// GetFilterGroupOk returns a tuple with the FilterGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedMicrosoftEntraProviderRequest) GetFilterGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FilterGroup.Get(), o.FilterGroup.IsSet() +} + +// HasFilterGroup returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasFilterGroup() bool { + if o != nil && o.FilterGroup.IsSet() { + return true + } + + return false +} + +// SetFilterGroup gets a reference to the given NullableString and assigns it to the FilterGroup field. +func (o *PatchedMicrosoftEntraProviderRequest) SetFilterGroup(v string) { + o.FilterGroup.Set(&v) +} + +// SetFilterGroupNil sets the value for FilterGroup to be an explicit nil +func (o *PatchedMicrosoftEntraProviderRequest) SetFilterGroupNil() { + o.FilterGroup.Set(nil) +} + +// UnsetFilterGroup ensures that no value is present for FilterGroup, not even an explicit nil +func (o *PatchedMicrosoftEntraProviderRequest) UnsetFilterGroup() { + o.FilterGroup.Unset() +} + +// GetUserDeleteAction returns the UserDeleteAction field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetUserDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.UserDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.UserDeleteAction +} + +// GetUserDeleteActionOk returns a tuple with the UserDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetUserDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.UserDeleteAction) { + return nil, false + } + return o.UserDeleteAction, true +} + +// HasUserDeleteAction returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasUserDeleteAction() bool { + if o != nil && !IsNil(o.UserDeleteAction) { + return true + } + + return false +} + +// SetUserDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the UserDeleteAction field. +func (o *PatchedMicrosoftEntraProviderRequest) SetUserDeleteAction(v OutgoingSyncDeleteAction) { + o.UserDeleteAction = &v +} + +// GetGroupDeleteAction returns the GroupDeleteAction field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetGroupDeleteAction() OutgoingSyncDeleteAction { + if o == nil || IsNil(o.GroupDeleteAction) { + var ret OutgoingSyncDeleteAction + return ret + } + return *o.GroupDeleteAction +} + +// GetGroupDeleteActionOk returns a tuple with the GroupDeleteAction field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetGroupDeleteActionOk() (*OutgoingSyncDeleteAction, bool) { + if o == nil || IsNil(o.GroupDeleteAction) { + return nil, false + } + return o.GroupDeleteAction, true +} + +// HasGroupDeleteAction returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasGroupDeleteAction() bool { + if o != nil && !IsNil(o.GroupDeleteAction) { + return true + } + + return false +} + +// SetGroupDeleteAction gets a reference to the given OutgoingSyncDeleteAction and assigns it to the GroupDeleteAction field. +func (o *PatchedMicrosoftEntraProviderRequest) SetGroupDeleteAction(v OutgoingSyncDeleteAction) { + o.GroupDeleteAction = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *PatchedMicrosoftEntraProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *PatchedMicrosoftEntraProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *PatchedMicrosoftEntraProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMicrosoftEntraProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *PatchedMicrosoftEntraProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *PatchedMicrosoftEntraProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o PatchedMicrosoftEntraProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedMicrosoftEntraProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.TenantId) { + toSerialize["tenant_id"] = o.TenantId + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if o.FilterGroup.IsSet() { + toSerialize["filter_group"] = o.FilterGroup.Get() + } + if !IsNil(o.UserDeleteAction) { + toSerialize["user_delete_action"] = o.UserDeleteAction + } + if !IsNil(o.GroupDeleteAction) { + toSerialize["group_delete_action"] = o.GroupDeleteAction + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedMicrosoftEntraProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedMicrosoftEntraProviderRequest := _PatchedMicrosoftEntraProviderRequest{} + + err = json.Unmarshal(data, &varPatchedMicrosoftEntraProviderRequest) + + if err != nil { + return err + } + + *o = PatchedMicrosoftEntraProviderRequest(varPatchedMicrosoftEntraProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "tenant_id") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "filter_group") + delete(additionalProperties, "user_delete_action") + delete(additionalProperties, "group_delete_action") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedMicrosoftEntraProviderRequest struct { + value *PatchedMicrosoftEntraProviderRequest + isSet bool +} + +func (v NullablePatchedMicrosoftEntraProviderRequest) Get() *PatchedMicrosoftEntraProviderRequest { + return v.value +} + +func (v *NullablePatchedMicrosoftEntraProviderRequest) Set(val *PatchedMicrosoftEntraProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedMicrosoftEntraProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedMicrosoftEntraProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedMicrosoftEntraProviderRequest(val *PatchedMicrosoftEntraProviderRequest) *NullablePatchedMicrosoftEntraProviderRequest { + return &NullablePatchedMicrosoftEntraProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedMicrosoftEntraProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedMicrosoftEntraProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_mutual_tls_stage_request.go b/packages/client-go/model_patched_mutual_tls_stage_request.go new file mode 100644 index 0000000000..5a01cfc8ed --- /dev/null +++ b/packages/client-go/model_patched_mutual_tls_stage_request.go @@ -0,0 +1,303 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedMutualTLSStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedMutualTLSStageRequest{} + +// PatchedMutualTLSStageRequest MutualTLSStage Serializer +type PatchedMutualTLSStageRequest struct { + Name *string `json:"name,omitempty"` + Mode *StageModeEnum `json:"mode,omitempty"` + // Configure certificate authorities to validate the certificate against. This option has a higher priority than the `client_certificate` option on `Brand`. + CertificateAuthorities []string `json:"certificate_authorities,omitempty"` + CertAttribute *CertAttributeEnum `json:"cert_attribute,omitempty"` + UserAttribute *UserAttributeEnum `json:"user_attribute,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedMutualTLSStageRequest PatchedMutualTLSStageRequest + +// NewPatchedMutualTLSStageRequest instantiates a new PatchedMutualTLSStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedMutualTLSStageRequest() *PatchedMutualTLSStageRequest { + this := PatchedMutualTLSStageRequest{} + return &this +} + +// NewPatchedMutualTLSStageRequestWithDefaults instantiates a new PatchedMutualTLSStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedMutualTLSStageRequestWithDefaults() *PatchedMutualTLSStageRequest { + this := PatchedMutualTLSStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedMutualTLSStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMutualTLSStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedMutualTLSStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedMutualTLSStageRequest) SetName(v string) { + o.Name = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedMutualTLSStageRequest) GetMode() StageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret StageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMutualTLSStageRequest) GetModeOk() (*StageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedMutualTLSStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given StageModeEnum and assigns it to the Mode field. +func (o *PatchedMutualTLSStageRequest) SetMode(v StageModeEnum) { + o.Mode = &v +} + +// GetCertificateAuthorities returns the CertificateAuthorities field value if set, zero value otherwise. +func (o *PatchedMutualTLSStageRequest) GetCertificateAuthorities() []string { + if o == nil || IsNil(o.CertificateAuthorities) { + var ret []string + return ret + } + return o.CertificateAuthorities +} + +// GetCertificateAuthoritiesOk returns a tuple with the CertificateAuthorities field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMutualTLSStageRequest) GetCertificateAuthoritiesOk() ([]string, bool) { + if o == nil || IsNil(o.CertificateAuthorities) { + return nil, false + } + return o.CertificateAuthorities, true +} + +// HasCertificateAuthorities returns a boolean if a field has been set. +func (o *PatchedMutualTLSStageRequest) HasCertificateAuthorities() bool { + if o != nil && !IsNil(o.CertificateAuthorities) { + return true + } + + return false +} + +// SetCertificateAuthorities gets a reference to the given []string and assigns it to the CertificateAuthorities field. +func (o *PatchedMutualTLSStageRequest) SetCertificateAuthorities(v []string) { + o.CertificateAuthorities = v +} + +// GetCertAttribute returns the CertAttribute field value if set, zero value otherwise. +func (o *PatchedMutualTLSStageRequest) GetCertAttribute() CertAttributeEnum { + if o == nil || IsNil(o.CertAttribute) { + var ret CertAttributeEnum + return ret + } + return *o.CertAttribute +} + +// GetCertAttributeOk returns a tuple with the CertAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMutualTLSStageRequest) GetCertAttributeOk() (*CertAttributeEnum, bool) { + if o == nil || IsNil(o.CertAttribute) { + return nil, false + } + return o.CertAttribute, true +} + +// HasCertAttribute returns a boolean if a field has been set. +func (o *PatchedMutualTLSStageRequest) HasCertAttribute() bool { + if o != nil && !IsNil(o.CertAttribute) { + return true + } + + return false +} + +// SetCertAttribute gets a reference to the given CertAttributeEnum and assigns it to the CertAttribute field. +func (o *PatchedMutualTLSStageRequest) SetCertAttribute(v CertAttributeEnum) { + o.CertAttribute = &v +} + +// GetUserAttribute returns the UserAttribute field value if set, zero value otherwise. +func (o *PatchedMutualTLSStageRequest) GetUserAttribute() UserAttributeEnum { + if o == nil || IsNil(o.UserAttribute) { + var ret UserAttributeEnum + return ret + } + return *o.UserAttribute +} + +// GetUserAttributeOk returns a tuple with the UserAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedMutualTLSStageRequest) GetUserAttributeOk() (*UserAttributeEnum, bool) { + if o == nil || IsNil(o.UserAttribute) { + return nil, false + } + return o.UserAttribute, true +} + +// HasUserAttribute returns a boolean if a field has been set. +func (o *PatchedMutualTLSStageRequest) HasUserAttribute() bool { + if o != nil && !IsNil(o.UserAttribute) { + return true + } + + return false +} + +// SetUserAttribute gets a reference to the given UserAttributeEnum and assigns it to the UserAttribute field. +func (o *PatchedMutualTLSStageRequest) SetUserAttribute(v UserAttributeEnum) { + o.UserAttribute = &v +} + +func (o PatchedMutualTLSStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedMutualTLSStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.CertificateAuthorities) { + toSerialize["certificate_authorities"] = o.CertificateAuthorities + } + if !IsNil(o.CertAttribute) { + toSerialize["cert_attribute"] = o.CertAttribute + } + if !IsNil(o.UserAttribute) { + toSerialize["user_attribute"] = o.UserAttribute + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedMutualTLSStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedMutualTLSStageRequest := _PatchedMutualTLSStageRequest{} + + err = json.Unmarshal(data, &varPatchedMutualTLSStageRequest) + + if err != nil { + return err + } + + *o = PatchedMutualTLSStageRequest(varPatchedMutualTLSStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "certificate_authorities") + delete(additionalProperties, "cert_attribute") + delete(additionalProperties, "user_attribute") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedMutualTLSStageRequest struct { + value *PatchedMutualTLSStageRequest + isSet bool +} + +func (v NullablePatchedMutualTLSStageRequest) Get() *PatchedMutualTLSStageRequest { + return v.value +} + +func (v *NullablePatchedMutualTLSStageRequest) Set(val *PatchedMutualTLSStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedMutualTLSStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedMutualTLSStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedMutualTLSStageRequest(val *PatchedMutualTLSStageRequest) *NullablePatchedMutualTLSStageRequest { + return &NullablePatchedMutualTLSStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedMutualTLSStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedMutualTLSStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_notification_request.go b/packages/client-go/model_patched_notification_request.go new file mode 100644 index 0000000000..fb0c0d22cc --- /dev/null +++ b/packages/client-go/model_patched_notification_request.go @@ -0,0 +1,287 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedNotificationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedNotificationRequest{} + +// PatchedNotificationRequest Notification Serializer +type PatchedNotificationRequest struct { + Hyperlink NullableString `json:"hyperlink,omitempty"` + HyperlinkLabel NullableString `json:"hyperlink_label,omitempty"` + Event *EventRequest `json:"event,omitempty"` + Seen *bool `json:"seen,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedNotificationRequest PatchedNotificationRequest + +// NewPatchedNotificationRequest instantiates a new PatchedNotificationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedNotificationRequest() *PatchedNotificationRequest { + this := PatchedNotificationRequest{} + return &this +} + +// NewPatchedNotificationRequestWithDefaults instantiates a new PatchedNotificationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedNotificationRequestWithDefaults() *PatchedNotificationRequest { + this := PatchedNotificationRequest{} + return &this +} + +// GetHyperlink returns the Hyperlink field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationRequest) GetHyperlink() string { + if o == nil || IsNil(o.Hyperlink.Get()) { + var ret string + return ret + } + return *o.Hyperlink.Get() +} + +// GetHyperlinkOk returns a tuple with the Hyperlink field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationRequest) GetHyperlinkOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Hyperlink.Get(), o.Hyperlink.IsSet() +} + +// HasHyperlink returns a boolean if a field has been set. +func (o *PatchedNotificationRequest) HasHyperlink() bool { + if o != nil && o.Hyperlink.IsSet() { + return true + } + + return false +} + +// SetHyperlink gets a reference to the given NullableString and assigns it to the Hyperlink field. +func (o *PatchedNotificationRequest) SetHyperlink(v string) { + o.Hyperlink.Set(&v) +} + +// SetHyperlinkNil sets the value for Hyperlink to be an explicit nil +func (o *PatchedNotificationRequest) SetHyperlinkNil() { + o.Hyperlink.Set(nil) +} + +// UnsetHyperlink ensures that no value is present for Hyperlink, not even an explicit nil +func (o *PatchedNotificationRequest) UnsetHyperlink() { + o.Hyperlink.Unset() +} + +// GetHyperlinkLabel returns the HyperlinkLabel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationRequest) GetHyperlinkLabel() string { + if o == nil || IsNil(o.HyperlinkLabel.Get()) { + var ret string + return ret + } + return *o.HyperlinkLabel.Get() +} + +// GetHyperlinkLabelOk returns a tuple with the HyperlinkLabel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationRequest) GetHyperlinkLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.HyperlinkLabel.Get(), o.HyperlinkLabel.IsSet() +} + +// HasHyperlinkLabel returns a boolean if a field has been set. +func (o *PatchedNotificationRequest) HasHyperlinkLabel() bool { + if o != nil && o.HyperlinkLabel.IsSet() { + return true + } + + return false +} + +// SetHyperlinkLabel gets a reference to the given NullableString and assigns it to the HyperlinkLabel field. +func (o *PatchedNotificationRequest) SetHyperlinkLabel(v string) { + o.HyperlinkLabel.Set(&v) +} + +// SetHyperlinkLabelNil sets the value for HyperlinkLabel to be an explicit nil +func (o *PatchedNotificationRequest) SetHyperlinkLabelNil() { + o.HyperlinkLabel.Set(nil) +} + +// UnsetHyperlinkLabel ensures that no value is present for HyperlinkLabel, not even an explicit nil +func (o *PatchedNotificationRequest) UnsetHyperlinkLabel() { + o.HyperlinkLabel.Unset() +} + +// GetEvent returns the Event field value if set, zero value otherwise. +func (o *PatchedNotificationRequest) GetEvent() EventRequest { + if o == nil || IsNil(o.Event) { + var ret EventRequest + return ret + } + return *o.Event +} + +// GetEventOk returns a tuple with the Event field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRequest) GetEventOk() (*EventRequest, bool) { + if o == nil || IsNil(o.Event) { + return nil, false + } + return o.Event, true +} + +// HasEvent returns a boolean if a field has been set. +func (o *PatchedNotificationRequest) HasEvent() bool { + if o != nil && !IsNil(o.Event) { + return true + } + + return false +} + +// SetEvent gets a reference to the given EventRequest and assigns it to the Event field. +func (o *PatchedNotificationRequest) SetEvent(v EventRequest) { + o.Event = &v +} + +// GetSeen returns the Seen field value if set, zero value otherwise. +func (o *PatchedNotificationRequest) GetSeen() bool { + if o == nil || IsNil(o.Seen) { + var ret bool + return ret + } + return *o.Seen +} + +// GetSeenOk returns a tuple with the Seen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRequest) GetSeenOk() (*bool, bool) { + if o == nil || IsNil(o.Seen) { + return nil, false + } + return o.Seen, true +} + +// HasSeen returns a boolean if a field has been set. +func (o *PatchedNotificationRequest) HasSeen() bool { + if o != nil && !IsNil(o.Seen) { + return true + } + + return false +} + +// SetSeen gets a reference to the given bool and assigns it to the Seen field. +func (o *PatchedNotificationRequest) SetSeen(v bool) { + o.Seen = &v +} + +func (o PatchedNotificationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedNotificationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Hyperlink.IsSet() { + toSerialize["hyperlink"] = o.Hyperlink.Get() + } + if o.HyperlinkLabel.IsSet() { + toSerialize["hyperlink_label"] = o.HyperlinkLabel.Get() + } + if !IsNil(o.Event) { + toSerialize["event"] = o.Event + } + if !IsNil(o.Seen) { + toSerialize["seen"] = o.Seen + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedNotificationRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedNotificationRequest := _PatchedNotificationRequest{} + + err = json.Unmarshal(data, &varPatchedNotificationRequest) + + if err != nil { + return err + } + + *o = PatchedNotificationRequest(varPatchedNotificationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "hyperlink") + delete(additionalProperties, "hyperlink_label") + delete(additionalProperties, "event") + delete(additionalProperties, "seen") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedNotificationRequest struct { + value *PatchedNotificationRequest + isSet bool +} + +func (v NullablePatchedNotificationRequest) Get() *PatchedNotificationRequest { + return v.value +} + +func (v *NullablePatchedNotificationRequest) Set(val *PatchedNotificationRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedNotificationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedNotificationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedNotificationRequest(val *PatchedNotificationRequest) *NullablePatchedNotificationRequest { + return &NullablePatchedNotificationRequest{value: val, isSet: true} +} + +func (v NullablePatchedNotificationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedNotificationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_notification_rule_request.go b/packages/client-go/model_patched_notification_rule_request.go new file mode 100644 index 0000000000..0597c7e01c --- /dev/null +++ b/packages/client-go/model_patched_notification_rule_request.go @@ -0,0 +1,317 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedNotificationRuleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedNotificationRuleRequest{} + +// PatchedNotificationRuleRequest NotificationRule Serializer +type PatchedNotificationRuleRequest struct { + Name *string `json:"name,omitempty"` + // Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI. + Transports []string `json:"transports,omitempty"` + // Controls which severity level the created notifications will have. + Severity *SeverityEnum `json:"severity,omitempty"` + // Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent. + DestinationGroup NullableString `json:"destination_group,omitempty"` + // When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both. + DestinationEventUser *bool `json:"destination_event_user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedNotificationRuleRequest PatchedNotificationRuleRequest + +// NewPatchedNotificationRuleRequest instantiates a new PatchedNotificationRuleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedNotificationRuleRequest() *PatchedNotificationRuleRequest { + this := PatchedNotificationRuleRequest{} + return &this +} + +// NewPatchedNotificationRuleRequestWithDefaults instantiates a new PatchedNotificationRuleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedNotificationRuleRequestWithDefaults() *PatchedNotificationRuleRequest { + this := PatchedNotificationRuleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedNotificationRuleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRuleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedNotificationRuleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedNotificationRuleRequest) SetName(v string) { + o.Name = &v +} + +// GetTransports returns the Transports field value if set, zero value otherwise. +func (o *PatchedNotificationRuleRequest) GetTransports() []string { + if o == nil || IsNil(o.Transports) { + var ret []string + return ret + } + return o.Transports +} + +// GetTransportsOk returns a tuple with the Transports field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRuleRequest) GetTransportsOk() ([]string, bool) { + if o == nil || IsNil(o.Transports) { + return nil, false + } + return o.Transports, true +} + +// HasTransports returns a boolean if a field has been set. +func (o *PatchedNotificationRuleRequest) HasTransports() bool { + if o != nil && !IsNil(o.Transports) { + return true + } + + return false +} + +// SetTransports gets a reference to the given []string and assigns it to the Transports field. +func (o *PatchedNotificationRuleRequest) SetTransports(v []string) { + o.Transports = v +} + +// GetSeverity returns the Severity field value if set, zero value otherwise. +func (o *PatchedNotificationRuleRequest) GetSeverity() SeverityEnum { + if o == nil || IsNil(o.Severity) { + var ret SeverityEnum + return ret + } + return *o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRuleRequest) GetSeverityOk() (*SeverityEnum, bool) { + if o == nil || IsNil(o.Severity) { + return nil, false + } + return o.Severity, true +} + +// HasSeverity returns a boolean if a field has been set. +func (o *PatchedNotificationRuleRequest) HasSeverity() bool { + if o != nil && !IsNil(o.Severity) { + return true + } + + return false +} + +// SetSeverity gets a reference to the given SeverityEnum and assigns it to the Severity field. +func (o *PatchedNotificationRuleRequest) SetSeverity(v SeverityEnum) { + o.Severity = &v +} + +// GetDestinationGroup returns the DestinationGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationRuleRequest) GetDestinationGroup() string { + if o == nil || IsNil(o.DestinationGroup.Get()) { + var ret string + return ret + } + return *o.DestinationGroup.Get() +} + +// GetDestinationGroupOk returns a tuple with the DestinationGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationRuleRequest) GetDestinationGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DestinationGroup.Get(), o.DestinationGroup.IsSet() +} + +// HasDestinationGroup returns a boolean if a field has been set. +func (o *PatchedNotificationRuleRequest) HasDestinationGroup() bool { + if o != nil && o.DestinationGroup.IsSet() { + return true + } + + return false +} + +// SetDestinationGroup gets a reference to the given NullableString and assigns it to the DestinationGroup field. +func (o *PatchedNotificationRuleRequest) SetDestinationGroup(v string) { + o.DestinationGroup.Set(&v) +} + +// SetDestinationGroupNil sets the value for DestinationGroup to be an explicit nil +func (o *PatchedNotificationRuleRequest) SetDestinationGroupNil() { + o.DestinationGroup.Set(nil) +} + +// UnsetDestinationGroup ensures that no value is present for DestinationGroup, not even an explicit nil +func (o *PatchedNotificationRuleRequest) UnsetDestinationGroup() { + o.DestinationGroup.Unset() +} + +// GetDestinationEventUser returns the DestinationEventUser field value if set, zero value otherwise. +func (o *PatchedNotificationRuleRequest) GetDestinationEventUser() bool { + if o == nil || IsNil(o.DestinationEventUser) { + var ret bool + return ret + } + return *o.DestinationEventUser +} + +// GetDestinationEventUserOk returns a tuple with the DestinationEventUser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationRuleRequest) GetDestinationEventUserOk() (*bool, bool) { + if o == nil || IsNil(o.DestinationEventUser) { + return nil, false + } + return o.DestinationEventUser, true +} + +// HasDestinationEventUser returns a boolean if a field has been set. +func (o *PatchedNotificationRuleRequest) HasDestinationEventUser() bool { + if o != nil && !IsNil(o.DestinationEventUser) { + return true + } + + return false +} + +// SetDestinationEventUser gets a reference to the given bool and assigns it to the DestinationEventUser field. +func (o *PatchedNotificationRuleRequest) SetDestinationEventUser(v bool) { + o.DestinationEventUser = &v +} + +func (o PatchedNotificationRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedNotificationRuleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Transports) { + toSerialize["transports"] = o.Transports + } + if !IsNil(o.Severity) { + toSerialize["severity"] = o.Severity + } + if o.DestinationGroup.IsSet() { + toSerialize["destination_group"] = o.DestinationGroup.Get() + } + if !IsNil(o.DestinationEventUser) { + toSerialize["destination_event_user"] = o.DestinationEventUser + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedNotificationRuleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedNotificationRuleRequest := _PatchedNotificationRuleRequest{} + + err = json.Unmarshal(data, &varPatchedNotificationRuleRequest) + + if err != nil { + return err + } + + *o = PatchedNotificationRuleRequest(varPatchedNotificationRuleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "transports") + delete(additionalProperties, "severity") + delete(additionalProperties, "destination_group") + delete(additionalProperties, "destination_event_user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedNotificationRuleRequest struct { + value *PatchedNotificationRuleRequest + isSet bool +} + +func (v NullablePatchedNotificationRuleRequest) Get() *PatchedNotificationRuleRequest { + return v.value +} + +func (v *NullablePatchedNotificationRuleRequest) Set(val *PatchedNotificationRuleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedNotificationRuleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedNotificationRuleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedNotificationRuleRequest(val *PatchedNotificationRuleRequest) *NullablePatchedNotificationRuleRequest { + return &NullablePatchedNotificationRuleRequest{value: val, isSet: true} +} + +func (v NullablePatchedNotificationRuleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedNotificationRuleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_notification_transport_request.go b/packages/client-go/model_patched_notification_transport_request.go new file mode 100644 index 0000000000..d5e86b10ec --- /dev/null +++ b/packages/client-go/model_patched_notification_transport_request.go @@ -0,0 +1,487 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedNotificationTransportRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedNotificationTransportRequest{} + +// PatchedNotificationTransportRequest NotificationTransport Serializer +type PatchedNotificationTransportRequest struct { + Name *string `json:"name,omitempty"` + Mode *NotificationTransportModeEnum `json:"mode,omitempty"` + WebhookUrl *string `json:"webhook_url,omitempty"` + // When set, the selected ceritifcate is used to validate the certificate of the webhook server. + WebhookCa NullableString `json:"webhook_ca,omitempty"` + // Customize the body of the request. Mapping should return data that is JSON-serializable. + WebhookMappingBody NullableString `json:"webhook_mapping_body,omitempty"` + // Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs + WebhookMappingHeaders NullableString `json:"webhook_mapping_headers,omitempty"` + EmailSubjectPrefix *string `json:"email_subject_prefix,omitempty"` + EmailTemplate *string `json:"email_template,omitempty"` + // Only send notification once, for example when sending a webhook into a chat channel. + SendOnce *bool `json:"send_once,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedNotificationTransportRequest PatchedNotificationTransportRequest + +// NewPatchedNotificationTransportRequest instantiates a new PatchedNotificationTransportRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedNotificationTransportRequest() *PatchedNotificationTransportRequest { + this := PatchedNotificationTransportRequest{} + return &this +} + +// NewPatchedNotificationTransportRequestWithDefaults instantiates a new PatchedNotificationTransportRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedNotificationTransportRequestWithDefaults() *PatchedNotificationTransportRequest { + this := PatchedNotificationTransportRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedNotificationTransportRequest) SetName(v string) { + o.Name = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetMode() NotificationTransportModeEnum { + if o == nil || IsNil(o.Mode) { + var ret NotificationTransportModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetModeOk() (*NotificationTransportModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given NotificationTransportModeEnum and assigns it to the Mode field. +func (o *PatchedNotificationTransportRequest) SetMode(v NotificationTransportModeEnum) { + o.Mode = &v +} + +// GetWebhookUrl returns the WebhookUrl field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetWebhookUrl() string { + if o == nil || IsNil(o.WebhookUrl) { + var ret string + return ret + } + return *o.WebhookUrl +} + +// GetWebhookUrlOk returns a tuple with the WebhookUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetWebhookUrlOk() (*string, bool) { + if o == nil || IsNil(o.WebhookUrl) { + return nil, false + } + return o.WebhookUrl, true +} + +// HasWebhookUrl returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasWebhookUrl() bool { + if o != nil && !IsNil(o.WebhookUrl) { + return true + } + + return false +} + +// SetWebhookUrl gets a reference to the given string and assigns it to the WebhookUrl field. +func (o *PatchedNotificationTransportRequest) SetWebhookUrl(v string) { + o.WebhookUrl = &v +} + +// GetWebhookCa returns the WebhookCa field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationTransportRequest) GetWebhookCa() string { + if o == nil || IsNil(o.WebhookCa.Get()) { + var ret string + return ret + } + return *o.WebhookCa.Get() +} + +// GetWebhookCaOk returns a tuple with the WebhookCa field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationTransportRequest) GetWebhookCaOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookCa.Get(), o.WebhookCa.IsSet() +} + +// HasWebhookCa returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasWebhookCa() bool { + if o != nil && o.WebhookCa.IsSet() { + return true + } + + return false +} + +// SetWebhookCa gets a reference to the given NullableString and assigns it to the WebhookCa field. +func (o *PatchedNotificationTransportRequest) SetWebhookCa(v string) { + o.WebhookCa.Set(&v) +} + +// SetWebhookCaNil sets the value for WebhookCa to be an explicit nil +func (o *PatchedNotificationTransportRequest) SetWebhookCaNil() { + o.WebhookCa.Set(nil) +} + +// UnsetWebhookCa ensures that no value is present for WebhookCa, not even an explicit nil +func (o *PatchedNotificationTransportRequest) UnsetWebhookCa() { + o.WebhookCa.Unset() +} + +// GetWebhookMappingBody returns the WebhookMappingBody field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationTransportRequest) GetWebhookMappingBody() string { + if o == nil || IsNil(o.WebhookMappingBody.Get()) { + var ret string + return ret + } + return *o.WebhookMappingBody.Get() +} + +// GetWebhookMappingBodyOk returns a tuple with the WebhookMappingBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationTransportRequest) GetWebhookMappingBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingBody.Get(), o.WebhookMappingBody.IsSet() +} + +// HasWebhookMappingBody returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasWebhookMappingBody() bool { + if o != nil && o.WebhookMappingBody.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingBody gets a reference to the given NullableString and assigns it to the WebhookMappingBody field. +func (o *PatchedNotificationTransportRequest) SetWebhookMappingBody(v string) { + o.WebhookMappingBody.Set(&v) +} + +// SetWebhookMappingBodyNil sets the value for WebhookMappingBody to be an explicit nil +func (o *PatchedNotificationTransportRequest) SetWebhookMappingBodyNil() { + o.WebhookMappingBody.Set(nil) +} + +// UnsetWebhookMappingBody ensures that no value is present for WebhookMappingBody, not even an explicit nil +func (o *PatchedNotificationTransportRequest) UnsetWebhookMappingBody() { + o.WebhookMappingBody.Unset() +} + +// GetWebhookMappingHeaders returns the WebhookMappingHeaders field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedNotificationTransportRequest) GetWebhookMappingHeaders() string { + if o == nil || IsNil(o.WebhookMappingHeaders.Get()) { + var ret string + return ret + } + return *o.WebhookMappingHeaders.Get() +} + +// GetWebhookMappingHeadersOk returns a tuple with the WebhookMappingHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedNotificationTransportRequest) GetWebhookMappingHeadersOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.WebhookMappingHeaders.Get(), o.WebhookMappingHeaders.IsSet() +} + +// HasWebhookMappingHeaders returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasWebhookMappingHeaders() bool { + if o != nil && o.WebhookMappingHeaders.IsSet() { + return true + } + + return false +} + +// SetWebhookMappingHeaders gets a reference to the given NullableString and assigns it to the WebhookMappingHeaders field. +func (o *PatchedNotificationTransportRequest) SetWebhookMappingHeaders(v string) { + o.WebhookMappingHeaders.Set(&v) +} + +// SetWebhookMappingHeadersNil sets the value for WebhookMappingHeaders to be an explicit nil +func (o *PatchedNotificationTransportRequest) SetWebhookMappingHeadersNil() { + o.WebhookMappingHeaders.Set(nil) +} + +// UnsetWebhookMappingHeaders ensures that no value is present for WebhookMappingHeaders, not even an explicit nil +func (o *PatchedNotificationTransportRequest) UnsetWebhookMappingHeaders() { + o.WebhookMappingHeaders.Unset() +} + +// GetEmailSubjectPrefix returns the EmailSubjectPrefix field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetEmailSubjectPrefix() string { + if o == nil || IsNil(o.EmailSubjectPrefix) { + var ret string + return ret + } + return *o.EmailSubjectPrefix +} + +// GetEmailSubjectPrefixOk returns a tuple with the EmailSubjectPrefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetEmailSubjectPrefixOk() (*string, bool) { + if o == nil || IsNil(o.EmailSubjectPrefix) { + return nil, false + } + return o.EmailSubjectPrefix, true +} + +// HasEmailSubjectPrefix returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasEmailSubjectPrefix() bool { + if o != nil && !IsNil(o.EmailSubjectPrefix) { + return true + } + + return false +} + +// SetEmailSubjectPrefix gets a reference to the given string and assigns it to the EmailSubjectPrefix field. +func (o *PatchedNotificationTransportRequest) SetEmailSubjectPrefix(v string) { + o.EmailSubjectPrefix = &v +} + +// GetEmailTemplate returns the EmailTemplate field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetEmailTemplate() string { + if o == nil || IsNil(o.EmailTemplate) { + var ret string + return ret + } + return *o.EmailTemplate +} + +// GetEmailTemplateOk returns a tuple with the EmailTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetEmailTemplateOk() (*string, bool) { + if o == nil || IsNil(o.EmailTemplate) { + return nil, false + } + return o.EmailTemplate, true +} + +// HasEmailTemplate returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasEmailTemplate() bool { + if o != nil && !IsNil(o.EmailTemplate) { + return true + } + + return false +} + +// SetEmailTemplate gets a reference to the given string and assigns it to the EmailTemplate field. +func (o *PatchedNotificationTransportRequest) SetEmailTemplate(v string) { + o.EmailTemplate = &v +} + +// GetSendOnce returns the SendOnce field value if set, zero value otherwise. +func (o *PatchedNotificationTransportRequest) GetSendOnce() bool { + if o == nil || IsNil(o.SendOnce) { + var ret bool + return ret + } + return *o.SendOnce +} + +// GetSendOnceOk returns a tuple with the SendOnce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationTransportRequest) GetSendOnceOk() (*bool, bool) { + if o == nil || IsNil(o.SendOnce) { + return nil, false + } + return o.SendOnce, true +} + +// HasSendOnce returns a boolean if a field has been set. +func (o *PatchedNotificationTransportRequest) HasSendOnce() bool { + if o != nil && !IsNil(o.SendOnce) { + return true + } + + return false +} + +// SetSendOnce gets a reference to the given bool and assigns it to the SendOnce field. +func (o *PatchedNotificationTransportRequest) SetSendOnce(v bool) { + o.SendOnce = &v +} + +func (o PatchedNotificationTransportRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedNotificationTransportRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.WebhookUrl) { + toSerialize["webhook_url"] = o.WebhookUrl + } + if o.WebhookCa.IsSet() { + toSerialize["webhook_ca"] = o.WebhookCa.Get() + } + if o.WebhookMappingBody.IsSet() { + toSerialize["webhook_mapping_body"] = o.WebhookMappingBody.Get() + } + if o.WebhookMappingHeaders.IsSet() { + toSerialize["webhook_mapping_headers"] = o.WebhookMappingHeaders.Get() + } + if !IsNil(o.EmailSubjectPrefix) { + toSerialize["email_subject_prefix"] = o.EmailSubjectPrefix + } + if !IsNil(o.EmailTemplate) { + toSerialize["email_template"] = o.EmailTemplate + } + if !IsNil(o.SendOnce) { + toSerialize["send_once"] = o.SendOnce + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedNotificationTransportRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedNotificationTransportRequest := _PatchedNotificationTransportRequest{} + + err = json.Unmarshal(data, &varPatchedNotificationTransportRequest) + + if err != nil { + return err + } + + *o = PatchedNotificationTransportRequest(varPatchedNotificationTransportRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "mode") + delete(additionalProperties, "webhook_url") + delete(additionalProperties, "webhook_ca") + delete(additionalProperties, "webhook_mapping_body") + delete(additionalProperties, "webhook_mapping_headers") + delete(additionalProperties, "email_subject_prefix") + delete(additionalProperties, "email_template") + delete(additionalProperties, "send_once") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedNotificationTransportRequest struct { + value *PatchedNotificationTransportRequest + isSet bool +} + +func (v NullablePatchedNotificationTransportRequest) Get() *PatchedNotificationTransportRequest { + return v.value +} + +func (v *NullablePatchedNotificationTransportRequest) Set(val *PatchedNotificationTransportRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedNotificationTransportRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedNotificationTransportRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedNotificationTransportRequest(val *PatchedNotificationTransportRequest) *NullablePatchedNotificationTransportRequest { + return &NullablePatchedNotificationTransportRequest{value: val, isSet: true} +} + +func (v NullablePatchedNotificationTransportRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedNotificationTransportRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_notification_webhook_mapping_request.go b/packages/client-go/model_patched_notification_webhook_mapping_request.go new file mode 100644 index 0000000000..b870c9b355 --- /dev/null +++ b/packages/client-go/model_patched_notification_webhook_mapping_request.go @@ -0,0 +1,191 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedNotificationWebhookMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedNotificationWebhookMappingRequest{} + +// PatchedNotificationWebhookMappingRequest NotificationWebhookMapping Serializer +type PatchedNotificationWebhookMappingRequest struct { + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedNotificationWebhookMappingRequest PatchedNotificationWebhookMappingRequest + +// NewPatchedNotificationWebhookMappingRequest instantiates a new PatchedNotificationWebhookMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedNotificationWebhookMappingRequest() *PatchedNotificationWebhookMappingRequest { + this := PatchedNotificationWebhookMappingRequest{} + return &this +} + +// NewPatchedNotificationWebhookMappingRequestWithDefaults instantiates a new PatchedNotificationWebhookMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedNotificationWebhookMappingRequestWithDefaults() *PatchedNotificationWebhookMappingRequest { + this := PatchedNotificationWebhookMappingRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedNotificationWebhookMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationWebhookMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedNotificationWebhookMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedNotificationWebhookMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedNotificationWebhookMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedNotificationWebhookMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedNotificationWebhookMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedNotificationWebhookMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedNotificationWebhookMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedNotificationWebhookMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedNotificationWebhookMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedNotificationWebhookMappingRequest := _PatchedNotificationWebhookMappingRequest{} + + err = json.Unmarshal(data, &varPatchedNotificationWebhookMappingRequest) + + if err != nil { + return err + } + + *o = PatchedNotificationWebhookMappingRequest(varPatchedNotificationWebhookMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedNotificationWebhookMappingRequest struct { + value *PatchedNotificationWebhookMappingRequest + isSet bool +} + +func (v NullablePatchedNotificationWebhookMappingRequest) Get() *PatchedNotificationWebhookMappingRequest { + return v.value +} + +func (v *NullablePatchedNotificationWebhookMappingRequest) Set(val *PatchedNotificationWebhookMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedNotificationWebhookMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedNotificationWebhookMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedNotificationWebhookMappingRequest(val *PatchedNotificationWebhookMappingRequest) *NullablePatchedNotificationWebhookMappingRequest { + return &NullablePatchedNotificationWebhookMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedNotificationWebhookMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedNotificationWebhookMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_o_auth2_provider_request.go b/packages/client-go/model_patched_o_auth2_provider_request.go new file mode 100644 index 0000000000..ee9c6b6d18 --- /dev/null +++ b/packages/client-go/model_patched_o_auth2_provider_request.go @@ -0,0 +1,978 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedOAuth2ProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedOAuth2ProviderRequest{} + +// PatchedOAuth2ProviderRequest OAuth2Provider Serializer +type PatchedOAuth2ProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable + ClientType *ClientTypeEnum `json:"client_type,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + // Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessCodeValidity *string `json:"access_code_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + // When refreshing a token, if the refresh token is valid for less than this duration, it will be renewed. When set to seconds=0, token will always be renewed. (Format: hours=1;minutes=2;seconds=3). + RefreshTokenThreshold *string `json:"refresh_token_threshold,omitempty"` + // Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint. + IncludeClaimsInIdToken *bool `json:"include_claims_in_id_token,omitempty"` + // Key used to sign the tokens. + SigningKey NullableString `json:"signing_key,omitempty"` + // Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. + EncryptionKey NullableString `json:"encryption_key,omitempty"` + RedirectUris []RedirectURIRequest `json:"redirect_uris,omitempty"` + LogoutUri *string `json:"logout_uri,omitempty"` + // Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser + LogoutMethod *OAuth2ProviderLogoutMethodEnum `json:"logout_method,omitempty"` + // Configure what data should be used as unique User Identifier. For most cases, the default should be fine. + SubMode *SubModeEnum `json:"sub_mode,omitempty"` + // Configure how the issuer field of the ID Token should be filled. + IssuerMode *IssuerModeEnum `json:"issuer_mode,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedOAuth2ProviderRequest PatchedOAuth2ProviderRequest + +// NewPatchedOAuth2ProviderRequest instantiates a new PatchedOAuth2ProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedOAuth2ProviderRequest() *PatchedOAuth2ProviderRequest { + this := PatchedOAuth2ProviderRequest{} + return &this +} + +// NewPatchedOAuth2ProviderRequestWithDefaults instantiates a new PatchedOAuth2ProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedOAuth2ProviderRequestWithDefaults() *PatchedOAuth2ProviderRequest { + this := PatchedOAuth2ProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedOAuth2ProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuth2ProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuth2ProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedOAuth2ProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedOAuth2ProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedOAuth2ProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedOAuth2ProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedOAuth2ProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedOAuth2ProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetClientType returns the ClientType field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetClientType() ClientTypeEnum { + if o == nil || IsNil(o.ClientType) { + var ret ClientTypeEnum + return ret + } + return *o.ClientType +} + +// GetClientTypeOk returns a tuple with the ClientType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetClientTypeOk() (*ClientTypeEnum, bool) { + if o == nil || IsNil(o.ClientType) { + return nil, false + } + return o.ClientType, true +} + +// HasClientType returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasClientType() bool { + if o != nil && !IsNil(o.ClientType) { + return true + } + + return false +} + +// SetClientType gets a reference to the given ClientTypeEnum and assigns it to the ClientType field. +func (o *PatchedOAuth2ProviderRequest) SetClientType(v ClientTypeEnum) { + o.ClientType = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PatchedOAuth2ProviderRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *PatchedOAuth2ProviderRequest) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetAccessCodeValidity returns the AccessCodeValidity field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetAccessCodeValidity() string { + if o == nil || IsNil(o.AccessCodeValidity) { + var ret string + return ret + } + return *o.AccessCodeValidity +} + +// GetAccessCodeValidityOk returns a tuple with the AccessCodeValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetAccessCodeValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessCodeValidity) { + return nil, false + } + return o.AccessCodeValidity, true +} + +// HasAccessCodeValidity returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasAccessCodeValidity() bool { + if o != nil && !IsNil(o.AccessCodeValidity) { + return true + } + + return false +} + +// SetAccessCodeValidity gets a reference to the given string and assigns it to the AccessCodeValidity field. +func (o *PatchedOAuth2ProviderRequest) SetAccessCodeValidity(v string) { + o.AccessCodeValidity = &v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *PatchedOAuth2ProviderRequest) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *PatchedOAuth2ProviderRequest) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +// GetRefreshTokenThreshold returns the RefreshTokenThreshold field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetRefreshTokenThreshold() string { + if o == nil || IsNil(o.RefreshTokenThreshold) { + var ret string + return ret + } + return *o.RefreshTokenThreshold +} + +// GetRefreshTokenThresholdOk returns a tuple with the RefreshTokenThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetRefreshTokenThresholdOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenThreshold) { + return nil, false + } + return o.RefreshTokenThreshold, true +} + +// HasRefreshTokenThreshold returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasRefreshTokenThreshold() bool { + if o != nil && !IsNil(o.RefreshTokenThreshold) { + return true + } + + return false +} + +// SetRefreshTokenThreshold gets a reference to the given string and assigns it to the RefreshTokenThreshold field. +func (o *PatchedOAuth2ProviderRequest) SetRefreshTokenThreshold(v string) { + o.RefreshTokenThreshold = &v +} + +// GetIncludeClaimsInIdToken returns the IncludeClaimsInIdToken field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetIncludeClaimsInIdToken() bool { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + var ret bool + return ret + } + return *o.IncludeClaimsInIdToken +} + +// GetIncludeClaimsInIdTokenOk returns a tuple with the IncludeClaimsInIdToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetIncludeClaimsInIdTokenOk() (*bool, bool) { + if o == nil || IsNil(o.IncludeClaimsInIdToken) { + return nil, false + } + return o.IncludeClaimsInIdToken, true +} + +// HasIncludeClaimsInIdToken returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasIncludeClaimsInIdToken() bool { + if o != nil && !IsNil(o.IncludeClaimsInIdToken) { + return true + } + + return false +} + +// SetIncludeClaimsInIdToken gets a reference to the given bool and assigns it to the IncludeClaimsInIdToken field. +func (o *PatchedOAuth2ProviderRequest) SetIncludeClaimsInIdToken(v bool) { + o.IncludeClaimsInIdToken = &v +} + +// GetSigningKey returns the SigningKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuth2ProviderRequest) GetSigningKey() string { + if o == nil || IsNil(o.SigningKey.Get()) { + var ret string + return ret + } + return *o.SigningKey.Get() +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuth2ProviderRequest) GetSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKey.Get(), o.SigningKey.IsSet() +} + +// HasSigningKey returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasSigningKey() bool { + if o != nil && o.SigningKey.IsSet() { + return true + } + + return false +} + +// SetSigningKey gets a reference to the given NullableString and assigns it to the SigningKey field. +func (o *PatchedOAuth2ProviderRequest) SetSigningKey(v string) { + o.SigningKey.Set(&v) +} + +// SetSigningKeyNil sets the value for SigningKey to be an explicit nil +func (o *PatchedOAuth2ProviderRequest) SetSigningKeyNil() { + o.SigningKey.Set(nil) +} + +// UnsetSigningKey ensures that no value is present for SigningKey, not even an explicit nil +func (o *PatchedOAuth2ProviderRequest) UnsetSigningKey() { + o.SigningKey.Unset() +} + +// GetEncryptionKey returns the EncryptionKey field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuth2ProviderRequest) GetEncryptionKey() string { + if o == nil || IsNil(o.EncryptionKey.Get()) { + var ret string + return ret + } + return *o.EncryptionKey.Get() +} + +// GetEncryptionKeyOk returns a tuple with the EncryptionKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuth2ProviderRequest) GetEncryptionKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKey.Get(), o.EncryptionKey.IsSet() +} + +// HasEncryptionKey returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasEncryptionKey() bool { + if o != nil && o.EncryptionKey.IsSet() { + return true + } + + return false +} + +// SetEncryptionKey gets a reference to the given NullableString and assigns it to the EncryptionKey field. +func (o *PatchedOAuth2ProviderRequest) SetEncryptionKey(v string) { + o.EncryptionKey.Set(&v) +} + +// SetEncryptionKeyNil sets the value for EncryptionKey to be an explicit nil +func (o *PatchedOAuth2ProviderRequest) SetEncryptionKeyNil() { + o.EncryptionKey.Set(nil) +} + +// UnsetEncryptionKey ensures that no value is present for EncryptionKey, not even an explicit nil +func (o *PatchedOAuth2ProviderRequest) UnsetEncryptionKey() { + o.EncryptionKey.Unset() +} + +// GetRedirectUris returns the RedirectUris field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetRedirectUris() []RedirectURIRequest { + if o == nil || IsNil(o.RedirectUris) { + var ret []RedirectURIRequest + return ret + } + return o.RedirectUris +} + +// GetRedirectUrisOk returns a tuple with the RedirectUris field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetRedirectUrisOk() ([]RedirectURIRequest, bool) { + if o == nil || IsNil(o.RedirectUris) { + return nil, false + } + return o.RedirectUris, true +} + +// HasRedirectUris returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasRedirectUris() bool { + if o != nil && !IsNil(o.RedirectUris) { + return true + } + + return false +} + +// SetRedirectUris gets a reference to the given []RedirectURIRequest and assigns it to the RedirectUris field. +func (o *PatchedOAuth2ProviderRequest) SetRedirectUris(v []RedirectURIRequest) { + o.RedirectUris = v +} + +// GetLogoutUri returns the LogoutUri field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetLogoutUri() string { + if o == nil || IsNil(o.LogoutUri) { + var ret string + return ret + } + return *o.LogoutUri +} + +// GetLogoutUriOk returns a tuple with the LogoutUri field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetLogoutUriOk() (*string, bool) { + if o == nil || IsNil(o.LogoutUri) { + return nil, false + } + return o.LogoutUri, true +} + +// HasLogoutUri returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasLogoutUri() bool { + if o != nil && !IsNil(o.LogoutUri) { + return true + } + + return false +} + +// SetLogoutUri gets a reference to the given string and assigns it to the LogoutUri field. +func (o *PatchedOAuth2ProviderRequest) SetLogoutUri(v string) { + o.LogoutUri = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetLogoutMethod() OAuth2ProviderLogoutMethodEnum { + if o == nil || IsNil(o.LogoutMethod) { + var ret OAuth2ProviderLogoutMethodEnum + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetLogoutMethodOk() (*OAuth2ProviderLogoutMethodEnum, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given OAuth2ProviderLogoutMethodEnum and assigns it to the LogoutMethod field. +func (o *PatchedOAuth2ProviderRequest) SetLogoutMethod(v OAuth2ProviderLogoutMethodEnum) { + o.LogoutMethod = &v +} + +// GetSubMode returns the SubMode field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetSubMode() SubModeEnum { + if o == nil || IsNil(o.SubMode) { + var ret SubModeEnum + return ret + } + return *o.SubMode +} + +// GetSubModeOk returns a tuple with the SubMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetSubModeOk() (*SubModeEnum, bool) { + if o == nil || IsNil(o.SubMode) { + return nil, false + } + return o.SubMode, true +} + +// HasSubMode returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasSubMode() bool { + if o != nil && !IsNil(o.SubMode) { + return true + } + + return false +} + +// SetSubMode gets a reference to the given SubModeEnum and assigns it to the SubMode field. +func (o *PatchedOAuth2ProviderRequest) SetSubMode(v SubModeEnum) { + o.SubMode = &v +} + +// GetIssuerMode returns the IssuerMode field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetIssuerMode() IssuerModeEnum { + if o == nil || IsNil(o.IssuerMode) { + var ret IssuerModeEnum + return ret + } + return *o.IssuerMode +} + +// GetIssuerModeOk returns a tuple with the IssuerMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetIssuerModeOk() (*IssuerModeEnum, bool) { + if o == nil || IsNil(o.IssuerMode) { + return nil, false + } + return o.IssuerMode, true +} + +// HasIssuerMode returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasIssuerMode() bool { + if o != nil && !IsNil(o.IssuerMode) { + return true + } + + return false +} + +// SetIssuerMode gets a reference to the given IssuerModeEnum and assigns it to the IssuerMode field. +func (o *PatchedOAuth2ProviderRequest) SetIssuerMode(v IssuerModeEnum) { + o.IssuerMode = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *PatchedOAuth2ProviderRequest) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *PatchedOAuth2ProviderRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuth2ProviderRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *PatchedOAuth2ProviderRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *PatchedOAuth2ProviderRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +func (o PatchedOAuth2ProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedOAuth2ProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.ClientType) { + toSerialize["client_type"] = o.ClientType + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.AccessCodeValidity) { + toSerialize["access_code_validity"] = o.AccessCodeValidity + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + if !IsNil(o.RefreshTokenThreshold) { + toSerialize["refresh_token_threshold"] = o.RefreshTokenThreshold + } + if !IsNil(o.IncludeClaimsInIdToken) { + toSerialize["include_claims_in_id_token"] = o.IncludeClaimsInIdToken + } + if o.SigningKey.IsSet() { + toSerialize["signing_key"] = o.SigningKey.Get() + } + if o.EncryptionKey.IsSet() { + toSerialize["encryption_key"] = o.EncryptionKey.Get() + } + if !IsNil(o.RedirectUris) { + toSerialize["redirect_uris"] = o.RedirectUris + } + if !IsNil(o.LogoutUri) { + toSerialize["logout_uri"] = o.LogoutUri + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.SubMode) { + toSerialize["sub_mode"] = o.SubMode + } + if !IsNil(o.IssuerMode) { + toSerialize["issuer_mode"] = o.IssuerMode + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedOAuth2ProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedOAuth2ProviderRequest := _PatchedOAuth2ProviderRequest{} + + err = json.Unmarshal(data, &varPatchedOAuth2ProviderRequest) + + if err != nil { + return err + } + + *o = PatchedOAuth2ProviderRequest(varPatchedOAuth2ProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "client_type") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "access_code_validity") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + delete(additionalProperties, "refresh_token_threshold") + delete(additionalProperties, "include_claims_in_id_token") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "encryption_key") + delete(additionalProperties, "redirect_uris") + delete(additionalProperties, "logout_uri") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "sub_mode") + delete(additionalProperties, "issuer_mode") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedOAuth2ProviderRequest struct { + value *PatchedOAuth2ProviderRequest + isSet bool +} + +func (v NullablePatchedOAuth2ProviderRequest) Get() *PatchedOAuth2ProviderRequest { + return v.value +} + +func (v *NullablePatchedOAuth2ProviderRequest) Set(val *PatchedOAuth2ProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedOAuth2ProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedOAuth2ProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedOAuth2ProviderRequest(val *PatchedOAuth2ProviderRequest) *NullablePatchedOAuth2ProviderRequest { + return &NullablePatchedOAuth2ProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedOAuth2ProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedOAuth2ProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_o_auth_source_property_mapping_request.go b/packages/client-go/model_patched_o_auth_source_property_mapping_request.go new file mode 100644 index 0000000000..6141ef0120 --- /dev/null +++ b/packages/client-go/model_patched_o_auth_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedOAuthSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedOAuthSourcePropertyMappingRequest{} + +// PatchedOAuthSourcePropertyMappingRequest OAuthSourcePropertyMapping Serializer +type PatchedOAuthSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedOAuthSourcePropertyMappingRequest PatchedOAuthSourcePropertyMappingRequest + +// NewPatchedOAuthSourcePropertyMappingRequest instantiates a new PatchedOAuthSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedOAuthSourcePropertyMappingRequest() *PatchedOAuthSourcePropertyMappingRequest { + this := PatchedOAuthSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedOAuthSourcePropertyMappingRequestWithDefaults instantiates a new PatchedOAuthSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedOAuthSourcePropertyMappingRequestWithDefaults() *PatchedOAuthSourcePropertyMappingRequest { + this := PatchedOAuthSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedOAuthSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedOAuthSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedOAuthSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedOAuthSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedOAuthSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedOAuthSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedOAuthSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedOAuthSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedOAuthSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedOAuthSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedOAuthSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedOAuthSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedOAuthSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedOAuthSourcePropertyMappingRequest := _PatchedOAuthSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedOAuthSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedOAuthSourcePropertyMappingRequest(varPatchedOAuthSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedOAuthSourcePropertyMappingRequest struct { + value *PatchedOAuthSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedOAuthSourcePropertyMappingRequest) Get() *PatchedOAuthSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedOAuthSourcePropertyMappingRequest) Set(val *PatchedOAuthSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedOAuthSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedOAuthSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedOAuthSourcePropertyMappingRequest(val *PatchedOAuthSourcePropertyMappingRequest) *NullablePatchedOAuthSourcePropertyMappingRequest { + return &NullablePatchedOAuthSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedOAuthSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedOAuthSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_o_auth_source_request.go b/packages/client-go/model_patched_o_auth_source_request.go new file mode 100644 index 0000000000..33f2746d09 --- /dev/null +++ b/packages/client-go/model_patched_o_auth_source_request.go @@ -0,0 +1,1157 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedOAuthSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedOAuthSourceRequest{} + +// PatchedOAuthSourceRequest OAuth Source Serializer +type PatchedOAuthSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + ProviderType *ProviderTypeEnum `json:"provider_type,omitempty"` + // URL used to request the initial token. This URL is only required for OAuth 1. + RequestTokenUrl NullableString `json:"request_token_url,omitempty"` + // URL the user is redirect to to conest the flow. + AuthorizationUrl NullableString `json:"authorization_url,omitempty"` + // URL used by authentik to retrieve tokens. + AccessTokenUrl NullableString `json:"access_token_url,omitempty"` + // URL used by authentik to get user information. + ProfileUrl NullableString `json:"profile_url,omitempty"` + Pkce *PKCEMethodEnum `json:"pkce,omitempty"` + ConsumerKey *string `json:"consumer_key,omitempty"` + ConsumerSecret *string `json:"consumer_secret,omitempty"` + AdditionalScopes *string `json:"additional_scopes,omitempty"` + OidcWellKnownUrl *string `json:"oidc_well_known_url,omitempty"` + OidcJwksUrl *string `json:"oidc_jwks_url,omitempty"` + OidcJwks map[string]interface{} `json:"oidc_jwks,omitempty"` + // How to perform authentication during an authorization_code token request flow + AuthorizationCodeAuthMethod *AuthorizationCodeAuthMethodEnum `json:"authorization_code_auth_method,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedOAuthSourceRequest PatchedOAuthSourceRequest + +// NewPatchedOAuthSourceRequest instantiates a new PatchedOAuthSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedOAuthSourceRequest() *PatchedOAuthSourceRequest { + this := PatchedOAuthSourceRequest{} + return &this +} + +// NewPatchedOAuthSourceRequestWithDefaults instantiates a new PatchedOAuthSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedOAuthSourceRequestWithDefaults() *PatchedOAuthSourceRequest { + this := PatchedOAuthSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedOAuthSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedOAuthSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedOAuthSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedOAuthSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedOAuthSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedOAuthSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedOAuthSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedOAuthSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedOAuthSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedOAuthSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedOAuthSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedOAuthSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PatchedOAuthSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetProviderType returns the ProviderType field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetProviderType() ProviderTypeEnum { + if o == nil || IsNil(o.ProviderType) { + var ret ProviderTypeEnum + return ret + } + return *o.ProviderType +} + +// GetProviderTypeOk returns a tuple with the ProviderType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetProviderTypeOk() (*ProviderTypeEnum, bool) { + if o == nil || IsNil(o.ProviderType) { + return nil, false + } + return o.ProviderType, true +} + +// HasProviderType returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasProviderType() bool { + if o != nil && !IsNil(o.ProviderType) { + return true + } + + return false +} + +// SetProviderType gets a reference to the given ProviderTypeEnum and assigns it to the ProviderType field. +func (o *PatchedOAuthSourceRequest) SetProviderType(v ProviderTypeEnum) { + o.ProviderType = &v +} + +// GetRequestTokenUrl returns the RequestTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetRequestTokenUrl() string { + if o == nil || IsNil(o.RequestTokenUrl.Get()) { + var ret string + return ret + } + return *o.RequestTokenUrl.Get() +} + +// GetRequestTokenUrlOk returns a tuple with the RequestTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetRequestTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RequestTokenUrl.Get(), o.RequestTokenUrl.IsSet() +} + +// HasRequestTokenUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasRequestTokenUrl() bool { + if o != nil && o.RequestTokenUrl.IsSet() { + return true + } + + return false +} + +// SetRequestTokenUrl gets a reference to the given NullableString and assigns it to the RequestTokenUrl field. +func (o *PatchedOAuthSourceRequest) SetRequestTokenUrl(v string) { + o.RequestTokenUrl.Set(&v) +} + +// SetRequestTokenUrlNil sets the value for RequestTokenUrl to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetRequestTokenUrlNil() { + o.RequestTokenUrl.Set(nil) +} + +// UnsetRequestTokenUrl ensures that no value is present for RequestTokenUrl, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetRequestTokenUrl() { + o.RequestTokenUrl.Unset() +} + +// GetAuthorizationUrl returns the AuthorizationUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetAuthorizationUrl() string { + if o == nil || IsNil(o.AuthorizationUrl.Get()) { + var ret string + return ret + } + return *o.AuthorizationUrl.Get() +} + +// GetAuthorizationUrlOk returns a tuple with the AuthorizationUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetAuthorizationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationUrl.Get(), o.AuthorizationUrl.IsSet() +} + +// HasAuthorizationUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasAuthorizationUrl() bool { + if o != nil && o.AuthorizationUrl.IsSet() { + return true + } + + return false +} + +// SetAuthorizationUrl gets a reference to the given NullableString and assigns it to the AuthorizationUrl field. +func (o *PatchedOAuthSourceRequest) SetAuthorizationUrl(v string) { + o.AuthorizationUrl.Set(&v) +} + +// SetAuthorizationUrlNil sets the value for AuthorizationUrl to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetAuthorizationUrlNil() { + o.AuthorizationUrl.Set(nil) +} + +// UnsetAuthorizationUrl ensures that no value is present for AuthorizationUrl, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetAuthorizationUrl() { + o.AuthorizationUrl.Unset() +} + +// GetAccessTokenUrl returns the AccessTokenUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetAccessTokenUrl() string { + if o == nil || IsNil(o.AccessTokenUrl.Get()) { + var ret string + return ret + } + return *o.AccessTokenUrl.Get() +} + +// GetAccessTokenUrlOk returns a tuple with the AccessTokenUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetAccessTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessTokenUrl.Get(), o.AccessTokenUrl.IsSet() +} + +// HasAccessTokenUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasAccessTokenUrl() bool { + if o != nil && o.AccessTokenUrl.IsSet() { + return true + } + + return false +} + +// SetAccessTokenUrl gets a reference to the given NullableString and assigns it to the AccessTokenUrl field. +func (o *PatchedOAuthSourceRequest) SetAccessTokenUrl(v string) { + o.AccessTokenUrl.Set(&v) +} + +// SetAccessTokenUrlNil sets the value for AccessTokenUrl to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetAccessTokenUrlNil() { + o.AccessTokenUrl.Set(nil) +} + +// UnsetAccessTokenUrl ensures that no value is present for AccessTokenUrl, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetAccessTokenUrl() { + o.AccessTokenUrl.Unset() +} + +// GetProfileUrl returns the ProfileUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOAuthSourceRequest) GetProfileUrl() string { + if o == nil || IsNil(o.ProfileUrl.Get()) { + var ret string + return ret + } + return *o.ProfileUrl.Get() +} + +// GetProfileUrlOk returns a tuple with the ProfileUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOAuthSourceRequest) GetProfileUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProfileUrl.Get(), o.ProfileUrl.IsSet() +} + +// HasProfileUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasProfileUrl() bool { + if o != nil && o.ProfileUrl.IsSet() { + return true + } + + return false +} + +// SetProfileUrl gets a reference to the given NullableString and assigns it to the ProfileUrl field. +func (o *PatchedOAuthSourceRequest) SetProfileUrl(v string) { + o.ProfileUrl.Set(&v) +} + +// SetProfileUrlNil sets the value for ProfileUrl to be an explicit nil +func (o *PatchedOAuthSourceRequest) SetProfileUrlNil() { + o.ProfileUrl.Set(nil) +} + +// UnsetProfileUrl ensures that no value is present for ProfileUrl, not even an explicit nil +func (o *PatchedOAuthSourceRequest) UnsetProfileUrl() { + o.ProfileUrl.Unset() +} + +// GetPkce returns the Pkce field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetPkce() PKCEMethodEnum { + if o == nil || IsNil(o.Pkce) { + var ret PKCEMethodEnum + return ret + } + return *o.Pkce +} + +// GetPkceOk returns a tuple with the Pkce field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetPkceOk() (*PKCEMethodEnum, bool) { + if o == nil || IsNil(o.Pkce) { + return nil, false + } + return o.Pkce, true +} + +// HasPkce returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasPkce() bool { + if o != nil && !IsNil(o.Pkce) { + return true + } + + return false +} + +// SetPkce gets a reference to the given PKCEMethodEnum and assigns it to the Pkce field. +func (o *PatchedOAuthSourceRequest) SetPkce(v PKCEMethodEnum) { + o.Pkce = &v +} + +// GetConsumerKey returns the ConsumerKey field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetConsumerKey() string { + if o == nil || IsNil(o.ConsumerKey) { + var ret string + return ret + } + return *o.ConsumerKey +} + +// GetConsumerKeyOk returns a tuple with the ConsumerKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetConsumerKeyOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerKey) { + return nil, false + } + return o.ConsumerKey, true +} + +// HasConsumerKey returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasConsumerKey() bool { + if o != nil && !IsNil(o.ConsumerKey) { + return true + } + + return false +} + +// SetConsumerKey gets a reference to the given string and assigns it to the ConsumerKey field. +func (o *PatchedOAuthSourceRequest) SetConsumerKey(v string) { + o.ConsumerKey = &v +} + +// GetConsumerSecret returns the ConsumerSecret field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetConsumerSecret() string { + if o == nil || IsNil(o.ConsumerSecret) { + var ret string + return ret + } + return *o.ConsumerSecret +} + +// GetConsumerSecretOk returns a tuple with the ConsumerSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetConsumerSecretOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerSecret) { + return nil, false + } + return o.ConsumerSecret, true +} + +// HasConsumerSecret returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasConsumerSecret() bool { + if o != nil && !IsNil(o.ConsumerSecret) { + return true + } + + return false +} + +// SetConsumerSecret gets a reference to the given string and assigns it to the ConsumerSecret field. +func (o *PatchedOAuthSourceRequest) SetConsumerSecret(v string) { + o.ConsumerSecret = &v +} + +// GetAdditionalScopes returns the AdditionalScopes field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetAdditionalScopes() string { + if o == nil || IsNil(o.AdditionalScopes) { + var ret string + return ret + } + return *o.AdditionalScopes +} + +// GetAdditionalScopesOk returns a tuple with the AdditionalScopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetAdditionalScopesOk() (*string, bool) { + if o == nil || IsNil(o.AdditionalScopes) { + return nil, false + } + return o.AdditionalScopes, true +} + +// HasAdditionalScopes returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasAdditionalScopes() bool { + if o != nil && !IsNil(o.AdditionalScopes) { + return true + } + + return false +} + +// SetAdditionalScopes gets a reference to the given string and assigns it to the AdditionalScopes field. +func (o *PatchedOAuthSourceRequest) SetAdditionalScopes(v string) { + o.AdditionalScopes = &v +} + +// GetOidcWellKnownUrl returns the OidcWellKnownUrl field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetOidcWellKnownUrl() string { + if o == nil || IsNil(o.OidcWellKnownUrl) { + var ret string + return ret + } + return *o.OidcWellKnownUrl +} + +// GetOidcWellKnownUrlOk returns a tuple with the OidcWellKnownUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetOidcWellKnownUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcWellKnownUrl) { + return nil, false + } + return o.OidcWellKnownUrl, true +} + +// HasOidcWellKnownUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasOidcWellKnownUrl() bool { + if o != nil && !IsNil(o.OidcWellKnownUrl) { + return true + } + + return false +} + +// SetOidcWellKnownUrl gets a reference to the given string and assigns it to the OidcWellKnownUrl field. +func (o *PatchedOAuthSourceRequest) SetOidcWellKnownUrl(v string) { + o.OidcWellKnownUrl = &v +} + +// GetOidcJwksUrl returns the OidcJwksUrl field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetOidcJwksUrl() string { + if o == nil || IsNil(o.OidcJwksUrl) { + var ret string + return ret + } + return *o.OidcJwksUrl +} + +// GetOidcJwksUrlOk returns a tuple with the OidcJwksUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetOidcJwksUrlOk() (*string, bool) { + if o == nil || IsNil(o.OidcJwksUrl) { + return nil, false + } + return o.OidcJwksUrl, true +} + +// HasOidcJwksUrl returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasOidcJwksUrl() bool { + if o != nil && !IsNil(o.OidcJwksUrl) { + return true + } + + return false +} + +// SetOidcJwksUrl gets a reference to the given string and assigns it to the OidcJwksUrl field. +func (o *PatchedOAuthSourceRequest) SetOidcJwksUrl(v string) { + o.OidcJwksUrl = &v +} + +// GetOidcJwks returns the OidcJwks field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetOidcJwks() map[string]interface{} { + if o == nil || IsNil(o.OidcJwks) { + var ret map[string]interface{} + return ret + } + return o.OidcJwks +} + +// GetOidcJwksOk returns a tuple with the OidcJwks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetOidcJwksOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.OidcJwks) { + return map[string]interface{}{}, false + } + return o.OidcJwks, true +} + +// HasOidcJwks returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasOidcJwks() bool { + if o != nil && !IsNil(o.OidcJwks) { + return true + } + + return false +} + +// SetOidcJwks gets a reference to the given map[string]interface{} and assigns it to the OidcJwks field. +func (o *PatchedOAuthSourceRequest) SetOidcJwks(v map[string]interface{}) { + o.OidcJwks = v +} + +// GetAuthorizationCodeAuthMethod returns the AuthorizationCodeAuthMethod field value if set, zero value otherwise. +func (o *PatchedOAuthSourceRequest) GetAuthorizationCodeAuthMethod() AuthorizationCodeAuthMethodEnum { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + var ret AuthorizationCodeAuthMethodEnum + return ret + } + return *o.AuthorizationCodeAuthMethod +} + +// GetAuthorizationCodeAuthMethodOk returns a tuple with the AuthorizationCodeAuthMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOAuthSourceRequest) GetAuthorizationCodeAuthMethodOk() (*AuthorizationCodeAuthMethodEnum, bool) { + if o == nil || IsNil(o.AuthorizationCodeAuthMethod) { + return nil, false + } + return o.AuthorizationCodeAuthMethod, true +} + +// HasAuthorizationCodeAuthMethod returns a boolean if a field has been set. +func (o *PatchedOAuthSourceRequest) HasAuthorizationCodeAuthMethod() bool { + if o != nil && !IsNil(o.AuthorizationCodeAuthMethod) { + return true + } + + return false +} + +// SetAuthorizationCodeAuthMethod gets a reference to the given AuthorizationCodeAuthMethodEnum and assigns it to the AuthorizationCodeAuthMethod field. +func (o *PatchedOAuthSourceRequest) SetAuthorizationCodeAuthMethod(v AuthorizationCodeAuthMethodEnum) { + o.AuthorizationCodeAuthMethod = &v +} + +func (o PatchedOAuthSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedOAuthSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.ProviderType) { + toSerialize["provider_type"] = o.ProviderType + } + if o.RequestTokenUrl.IsSet() { + toSerialize["request_token_url"] = o.RequestTokenUrl.Get() + } + if o.AuthorizationUrl.IsSet() { + toSerialize["authorization_url"] = o.AuthorizationUrl.Get() + } + if o.AccessTokenUrl.IsSet() { + toSerialize["access_token_url"] = o.AccessTokenUrl.Get() + } + if o.ProfileUrl.IsSet() { + toSerialize["profile_url"] = o.ProfileUrl.Get() + } + if !IsNil(o.Pkce) { + toSerialize["pkce"] = o.Pkce + } + if !IsNil(o.ConsumerKey) { + toSerialize["consumer_key"] = o.ConsumerKey + } + if !IsNil(o.ConsumerSecret) { + toSerialize["consumer_secret"] = o.ConsumerSecret + } + if !IsNil(o.AdditionalScopes) { + toSerialize["additional_scopes"] = o.AdditionalScopes + } + if !IsNil(o.OidcWellKnownUrl) { + toSerialize["oidc_well_known_url"] = o.OidcWellKnownUrl + } + if !IsNil(o.OidcJwksUrl) { + toSerialize["oidc_jwks_url"] = o.OidcJwksUrl + } + if !IsNil(o.OidcJwks) { + toSerialize["oidc_jwks"] = o.OidcJwks + } + if !IsNil(o.AuthorizationCodeAuthMethod) { + toSerialize["authorization_code_auth_method"] = o.AuthorizationCodeAuthMethod + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedOAuthSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedOAuthSourceRequest := _PatchedOAuthSourceRequest{} + + err = json.Unmarshal(data, &varPatchedOAuthSourceRequest) + + if err != nil { + return err + } + + *o = PatchedOAuthSourceRequest(varPatchedOAuthSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "provider_type") + delete(additionalProperties, "request_token_url") + delete(additionalProperties, "authorization_url") + delete(additionalProperties, "access_token_url") + delete(additionalProperties, "profile_url") + delete(additionalProperties, "pkce") + delete(additionalProperties, "consumer_key") + delete(additionalProperties, "consumer_secret") + delete(additionalProperties, "additional_scopes") + delete(additionalProperties, "oidc_well_known_url") + delete(additionalProperties, "oidc_jwks_url") + delete(additionalProperties, "oidc_jwks") + delete(additionalProperties, "authorization_code_auth_method") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedOAuthSourceRequest struct { + value *PatchedOAuthSourceRequest + isSet bool +} + +func (v NullablePatchedOAuthSourceRequest) Get() *PatchedOAuthSourceRequest { + return v.value +} + +func (v *NullablePatchedOAuthSourceRequest) Set(val *PatchedOAuthSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedOAuthSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedOAuthSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedOAuthSourceRequest(val *PatchedOAuthSourceRequest) *NullablePatchedOAuthSourceRequest { + return &NullablePatchedOAuthSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedOAuthSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedOAuthSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_outpost_request.go b/packages/client-go/model_patched_outpost_request.go new file mode 100644 index 0000000000..4eaa3015e1 --- /dev/null +++ b/packages/client-go/model_patched_outpost_request.go @@ -0,0 +1,363 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedOutpostRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedOutpostRequest{} + +// PatchedOutpostRequest Outpost Serializer +type PatchedOutpostRequest struct { + Name *string `json:"name,omitempty"` + Type *OutpostTypeEnum `json:"type,omitempty"` + Providers []int32 `json:"providers,omitempty"` + // Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment. + ServiceConnection NullableString `json:"service_connection,omitempty"` + Config map[string]interface{} `json:"config,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedOutpostRequest PatchedOutpostRequest + +// NewPatchedOutpostRequest instantiates a new PatchedOutpostRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedOutpostRequest() *PatchedOutpostRequest { + this := PatchedOutpostRequest{} + return &this +} + +// NewPatchedOutpostRequestWithDefaults instantiates a new PatchedOutpostRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedOutpostRequestWithDefaults() *PatchedOutpostRequest { + this := PatchedOutpostRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedOutpostRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOutpostRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedOutpostRequest) SetName(v string) { + o.Name = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedOutpostRequest) GetType() OutpostTypeEnum { + if o == nil || IsNil(o.Type) { + var ret OutpostTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOutpostRequest) GetTypeOk() (*OutpostTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given OutpostTypeEnum and assigns it to the Type field. +func (o *PatchedOutpostRequest) SetType(v OutpostTypeEnum) { + o.Type = &v +} + +// GetProviders returns the Providers field value if set, zero value otherwise. +func (o *PatchedOutpostRequest) GetProviders() []int32 { + if o == nil || IsNil(o.Providers) { + var ret []int32 + return ret + } + return o.Providers +} + +// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOutpostRequest) GetProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.Providers) { + return nil, false + } + return o.Providers, true +} + +// HasProviders returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasProviders() bool { + if o != nil && !IsNil(o.Providers) { + return true + } + + return false +} + +// SetProviders gets a reference to the given []int32 and assigns it to the Providers field. +func (o *PatchedOutpostRequest) SetProviders(v []int32) { + o.Providers = v +} + +// GetServiceConnection returns the ServiceConnection field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOutpostRequest) GetServiceConnection() string { + if o == nil || IsNil(o.ServiceConnection.Get()) { + var ret string + return ret + } + return *o.ServiceConnection.Get() +} + +// GetServiceConnectionOk returns a tuple with the ServiceConnection field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOutpostRequest) GetServiceConnectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ServiceConnection.Get(), o.ServiceConnection.IsSet() +} + +// HasServiceConnection returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasServiceConnection() bool { + if o != nil && o.ServiceConnection.IsSet() { + return true + } + + return false +} + +// SetServiceConnection gets a reference to the given NullableString and assigns it to the ServiceConnection field. +func (o *PatchedOutpostRequest) SetServiceConnection(v string) { + o.ServiceConnection.Set(&v) +} + +// SetServiceConnectionNil sets the value for ServiceConnection to be an explicit nil +func (o *PatchedOutpostRequest) SetServiceConnectionNil() { + o.ServiceConnection.Set(nil) +} + +// UnsetServiceConnection ensures that no value is present for ServiceConnection, not even an explicit nil +func (o *PatchedOutpostRequest) UnsetServiceConnection() { + o.ServiceConnection.Unset() +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *PatchedOutpostRequest) GetConfig() map[string]interface{} { + if o == nil || IsNil(o.Config) { + var ret map[string]interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedOutpostRequest) GetConfigOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Config) { + return map[string]interface{}{}, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. +func (o *PatchedOutpostRequest) SetConfig(v map[string]interface{}) { + o.Config = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedOutpostRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedOutpostRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedOutpostRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedOutpostRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedOutpostRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedOutpostRequest) UnsetManaged() { + o.Managed.Unset() +} + +func (o PatchedOutpostRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedOutpostRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Providers) { + toSerialize["providers"] = o.Providers + } + if o.ServiceConnection.IsSet() { + toSerialize["service_connection"] = o.ServiceConnection.Get() + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedOutpostRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedOutpostRequest := _PatchedOutpostRequest{} + + err = json.Unmarshal(data, &varPatchedOutpostRequest) + + if err != nil { + return err + } + + *o = PatchedOutpostRequest(varPatchedOutpostRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "type") + delete(additionalProperties, "providers") + delete(additionalProperties, "service_connection") + delete(additionalProperties, "config") + delete(additionalProperties, "managed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedOutpostRequest struct { + value *PatchedOutpostRequest + isSet bool +} + +func (v NullablePatchedOutpostRequest) Get() *PatchedOutpostRequest { + return v.value +} + +func (v *NullablePatchedOutpostRequest) Set(val *PatchedOutpostRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedOutpostRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedOutpostRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedOutpostRequest(val *PatchedOutpostRequest) *NullablePatchedOutpostRequest { + return &NullablePatchedOutpostRequest{value: val, isSet: true} +} + +func (v NullablePatchedOutpostRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedOutpostRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_password_expiry_policy_request.go b/packages/client-go/model_patched_password_expiry_policy_request.go new file mode 100644 index 0000000000..3d63069f3c --- /dev/null +++ b/packages/client-go/model_patched_password_expiry_policy_request.go @@ -0,0 +1,266 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPasswordExpiryPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPasswordExpiryPolicyRequest{} + +// PatchedPasswordExpiryPolicyRequest Password Expiry Policy Serializer +type PatchedPasswordExpiryPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + Days *int32 `json:"days,omitempty"` + DenyOnly *bool `json:"deny_only,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPasswordExpiryPolicyRequest PatchedPasswordExpiryPolicyRequest + +// NewPatchedPasswordExpiryPolicyRequest instantiates a new PatchedPasswordExpiryPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPasswordExpiryPolicyRequest() *PatchedPasswordExpiryPolicyRequest { + this := PatchedPasswordExpiryPolicyRequest{} + return &this +} + +// NewPatchedPasswordExpiryPolicyRequestWithDefaults instantiates a new PatchedPasswordExpiryPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPasswordExpiryPolicyRequestWithDefaults() *PatchedPasswordExpiryPolicyRequest { + this := PatchedPasswordExpiryPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPasswordExpiryPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordExpiryPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPasswordExpiryPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPasswordExpiryPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedPasswordExpiryPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordExpiryPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedPasswordExpiryPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedPasswordExpiryPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetDays returns the Days field value if set, zero value otherwise. +func (o *PatchedPasswordExpiryPolicyRequest) GetDays() int32 { + if o == nil || IsNil(o.Days) { + var ret int32 + return ret + } + return *o.Days +} + +// GetDaysOk returns a tuple with the Days field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordExpiryPolicyRequest) GetDaysOk() (*int32, bool) { + if o == nil || IsNil(o.Days) { + return nil, false + } + return o.Days, true +} + +// HasDays returns a boolean if a field has been set. +func (o *PatchedPasswordExpiryPolicyRequest) HasDays() bool { + if o != nil && !IsNil(o.Days) { + return true + } + + return false +} + +// SetDays gets a reference to the given int32 and assigns it to the Days field. +func (o *PatchedPasswordExpiryPolicyRequest) SetDays(v int32) { + o.Days = &v +} + +// GetDenyOnly returns the DenyOnly field value if set, zero value otherwise. +func (o *PatchedPasswordExpiryPolicyRequest) GetDenyOnly() bool { + if o == nil || IsNil(o.DenyOnly) { + var ret bool + return ret + } + return *o.DenyOnly +} + +// GetDenyOnlyOk returns a tuple with the DenyOnly field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordExpiryPolicyRequest) GetDenyOnlyOk() (*bool, bool) { + if o == nil || IsNil(o.DenyOnly) { + return nil, false + } + return o.DenyOnly, true +} + +// HasDenyOnly returns a boolean if a field has been set. +func (o *PatchedPasswordExpiryPolicyRequest) HasDenyOnly() bool { + if o != nil && !IsNil(o.DenyOnly) { + return true + } + + return false +} + +// SetDenyOnly gets a reference to the given bool and assigns it to the DenyOnly field. +func (o *PatchedPasswordExpiryPolicyRequest) SetDenyOnly(v bool) { + o.DenyOnly = &v +} + +func (o PatchedPasswordExpiryPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPasswordExpiryPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.Days) { + toSerialize["days"] = o.Days + } + if !IsNil(o.DenyOnly) { + toSerialize["deny_only"] = o.DenyOnly + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPasswordExpiryPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPasswordExpiryPolicyRequest := _PatchedPasswordExpiryPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedPasswordExpiryPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedPasswordExpiryPolicyRequest(varPatchedPasswordExpiryPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "days") + delete(additionalProperties, "deny_only") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPasswordExpiryPolicyRequest struct { + value *PatchedPasswordExpiryPolicyRequest + isSet bool +} + +func (v NullablePatchedPasswordExpiryPolicyRequest) Get() *PatchedPasswordExpiryPolicyRequest { + return v.value +} + +func (v *NullablePatchedPasswordExpiryPolicyRequest) Set(val *PatchedPasswordExpiryPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPasswordExpiryPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPasswordExpiryPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPasswordExpiryPolicyRequest(val *PatchedPasswordExpiryPolicyRequest) *NullablePatchedPasswordExpiryPolicyRequest { + return &NullablePatchedPasswordExpiryPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedPasswordExpiryPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPasswordExpiryPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_password_policy_request.go b/packages/client-go/model_patched_password_policy_request.go new file mode 100644 index 0000000000..cf929de73f --- /dev/null +++ b/packages/client-go/model_patched_password_policy_request.go @@ -0,0 +1,676 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPasswordPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPasswordPolicyRequest{} + +// PatchedPasswordPolicyRequest Password Policy Serializer +type PatchedPasswordPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + AmountDigits *int32 `json:"amount_digits,omitempty"` + AmountUppercase *int32 `json:"amount_uppercase,omitempty"` + AmountLowercase *int32 `json:"amount_lowercase,omitempty"` + AmountSymbols *int32 `json:"amount_symbols,omitempty"` + LengthMin *int32 `json:"length_min,omitempty"` + SymbolCharset *string `json:"symbol_charset,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + CheckStaticRules *bool `json:"check_static_rules,omitempty"` + CheckHaveIBeenPwned *bool `json:"check_have_i_been_pwned,omitempty"` + CheckZxcvbn *bool `json:"check_zxcvbn,omitempty"` + // How many times the password hash is allowed to be on haveibeenpwned + HibpAllowedCount *int32 `json:"hibp_allowed_count,omitempty"` + // If the zxcvbn score is equal or less than this value, the policy will fail. + ZxcvbnScoreThreshold *int32 `json:"zxcvbn_score_threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPasswordPolicyRequest PatchedPasswordPolicyRequest + +// NewPatchedPasswordPolicyRequest instantiates a new PatchedPasswordPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPasswordPolicyRequest() *PatchedPasswordPolicyRequest { + this := PatchedPasswordPolicyRequest{} + return &this +} + +// NewPatchedPasswordPolicyRequestWithDefaults instantiates a new PatchedPasswordPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPasswordPolicyRequestWithDefaults() *PatchedPasswordPolicyRequest { + this := PatchedPasswordPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPasswordPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedPasswordPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *PatchedPasswordPolicyRequest) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetAmountDigits returns the AmountDigits field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetAmountDigits() int32 { + if o == nil || IsNil(o.AmountDigits) { + var ret int32 + return ret + } + return *o.AmountDigits +} + +// GetAmountDigitsOk returns a tuple with the AmountDigits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetAmountDigitsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountDigits) { + return nil, false + } + return o.AmountDigits, true +} + +// HasAmountDigits returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasAmountDigits() bool { + if o != nil && !IsNil(o.AmountDigits) { + return true + } + + return false +} + +// SetAmountDigits gets a reference to the given int32 and assigns it to the AmountDigits field. +func (o *PatchedPasswordPolicyRequest) SetAmountDigits(v int32) { + o.AmountDigits = &v +} + +// GetAmountUppercase returns the AmountUppercase field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetAmountUppercase() int32 { + if o == nil || IsNil(o.AmountUppercase) { + var ret int32 + return ret + } + return *o.AmountUppercase +} + +// GetAmountUppercaseOk returns a tuple with the AmountUppercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetAmountUppercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountUppercase) { + return nil, false + } + return o.AmountUppercase, true +} + +// HasAmountUppercase returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasAmountUppercase() bool { + if o != nil && !IsNil(o.AmountUppercase) { + return true + } + + return false +} + +// SetAmountUppercase gets a reference to the given int32 and assigns it to the AmountUppercase field. +func (o *PatchedPasswordPolicyRequest) SetAmountUppercase(v int32) { + o.AmountUppercase = &v +} + +// GetAmountLowercase returns the AmountLowercase field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetAmountLowercase() int32 { + if o == nil || IsNil(o.AmountLowercase) { + var ret int32 + return ret + } + return *o.AmountLowercase +} + +// GetAmountLowercaseOk returns a tuple with the AmountLowercase field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetAmountLowercaseOk() (*int32, bool) { + if o == nil || IsNil(o.AmountLowercase) { + return nil, false + } + return o.AmountLowercase, true +} + +// HasAmountLowercase returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasAmountLowercase() bool { + if o != nil && !IsNil(o.AmountLowercase) { + return true + } + + return false +} + +// SetAmountLowercase gets a reference to the given int32 and assigns it to the AmountLowercase field. +func (o *PatchedPasswordPolicyRequest) SetAmountLowercase(v int32) { + o.AmountLowercase = &v +} + +// GetAmountSymbols returns the AmountSymbols field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetAmountSymbols() int32 { + if o == nil || IsNil(o.AmountSymbols) { + var ret int32 + return ret + } + return *o.AmountSymbols +} + +// GetAmountSymbolsOk returns a tuple with the AmountSymbols field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetAmountSymbolsOk() (*int32, bool) { + if o == nil || IsNil(o.AmountSymbols) { + return nil, false + } + return o.AmountSymbols, true +} + +// HasAmountSymbols returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasAmountSymbols() bool { + if o != nil && !IsNil(o.AmountSymbols) { + return true + } + + return false +} + +// SetAmountSymbols gets a reference to the given int32 and assigns it to the AmountSymbols field. +func (o *PatchedPasswordPolicyRequest) SetAmountSymbols(v int32) { + o.AmountSymbols = &v +} + +// GetLengthMin returns the LengthMin field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetLengthMin() int32 { + if o == nil || IsNil(o.LengthMin) { + var ret int32 + return ret + } + return *o.LengthMin +} + +// GetLengthMinOk returns a tuple with the LengthMin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetLengthMinOk() (*int32, bool) { + if o == nil || IsNil(o.LengthMin) { + return nil, false + } + return o.LengthMin, true +} + +// HasLengthMin returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasLengthMin() bool { + if o != nil && !IsNil(o.LengthMin) { + return true + } + + return false +} + +// SetLengthMin gets a reference to the given int32 and assigns it to the LengthMin field. +func (o *PatchedPasswordPolicyRequest) SetLengthMin(v int32) { + o.LengthMin = &v +} + +// GetSymbolCharset returns the SymbolCharset field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetSymbolCharset() string { + if o == nil || IsNil(o.SymbolCharset) { + var ret string + return ret + } + return *o.SymbolCharset +} + +// GetSymbolCharsetOk returns a tuple with the SymbolCharset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetSymbolCharsetOk() (*string, bool) { + if o == nil || IsNil(o.SymbolCharset) { + return nil, false + } + return o.SymbolCharset, true +} + +// HasSymbolCharset returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasSymbolCharset() bool { + if o != nil && !IsNil(o.SymbolCharset) { + return true + } + + return false +} + +// SetSymbolCharset gets a reference to the given string and assigns it to the SymbolCharset field. +func (o *PatchedPasswordPolicyRequest) SetSymbolCharset(v string) { + o.SymbolCharset = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *PatchedPasswordPolicyRequest) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetCheckStaticRules returns the CheckStaticRules field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetCheckStaticRules() bool { + if o == nil || IsNil(o.CheckStaticRules) { + var ret bool + return ret + } + return *o.CheckStaticRules +} + +// GetCheckStaticRulesOk returns a tuple with the CheckStaticRules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetCheckStaticRulesOk() (*bool, bool) { + if o == nil || IsNil(o.CheckStaticRules) { + return nil, false + } + return o.CheckStaticRules, true +} + +// HasCheckStaticRules returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasCheckStaticRules() bool { + if o != nil && !IsNil(o.CheckStaticRules) { + return true + } + + return false +} + +// SetCheckStaticRules gets a reference to the given bool and assigns it to the CheckStaticRules field. +func (o *PatchedPasswordPolicyRequest) SetCheckStaticRules(v bool) { + o.CheckStaticRules = &v +} + +// GetCheckHaveIBeenPwned returns the CheckHaveIBeenPwned field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetCheckHaveIBeenPwned() bool { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + var ret bool + return ret + } + return *o.CheckHaveIBeenPwned +} + +// GetCheckHaveIBeenPwnedOk returns a tuple with the CheckHaveIBeenPwned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetCheckHaveIBeenPwnedOk() (*bool, bool) { + if o == nil || IsNil(o.CheckHaveIBeenPwned) { + return nil, false + } + return o.CheckHaveIBeenPwned, true +} + +// HasCheckHaveIBeenPwned returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasCheckHaveIBeenPwned() bool { + if o != nil && !IsNil(o.CheckHaveIBeenPwned) { + return true + } + + return false +} + +// SetCheckHaveIBeenPwned gets a reference to the given bool and assigns it to the CheckHaveIBeenPwned field. +func (o *PatchedPasswordPolicyRequest) SetCheckHaveIBeenPwned(v bool) { + o.CheckHaveIBeenPwned = &v +} + +// GetCheckZxcvbn returns the CheckZxcvbn field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetCheckZxcvbn() bool { + if o == nil || IsNil(o.CheckZxcvbn) { + var ret bool + return ret + } + return *o.CheckZxcvbn +} + +// GetCheckZxcvbnOk returns a tuple with the CheckZxcvbn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetCheckZxcvbnOk() (*bool, bool) { + if o == nil || IsNil(o.CheckZxcvbn) { + return nil, false + } + return o.CheckZxcvbn, true +} + +// HasCheckZxcvbn returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasCheckZxcvbn() bool { + if o != nil && !IsNil(o.CheckZxcvbn) { + return true + } + + return false +} + +// SetCheckZxcvbn gets a reference to the given bool and assigns it to the CheckZxcvbn field. +func (o *PatchedPasswordPolicyRequest) SetCheckZxcvbn(v bool) { + o.CheckZxcvbn = &v +} + +// GetHibpAllowedCount returns the HibpAllowedCount field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetHibpAllowedCount() int32 { + if o == nil || IsNil(o.HibpAllowedCount) { + var ret int32 + return ret + } + return *o.HibpAllowedCount +} + +// GetHibpAllowedCountOk returns a tuple with the HibpAllowedCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetHibpAllowedCountOk() (*int32, bool) { + if o == nil || IsNil(o.HibpAllowedCount) { + return nil, false + } + return o.HibpAllowedCount, true +} + +// HasHibpAllowedCount returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasHibpAllowedCount() bool { + if o != nil && !IsNil(o.HibpAllowedCount) { + return true + } + + return false +} + +// SetHibpAllowedCount gets a reference to the given int32 and assigns it to the HibpAllowedCount field. +func (o *PatchedPasswordPolicyRequest) SetHibpAllowedCount(v int32) { + o.HibpAllowedCount = &v +} + +// GetZxcvbnScoreThreshold returns the ZxcvbnScoreThreshold field value if set, zero value otherwise. +func (o *PatchedPasswordPolicyRequest) GetZxcvbnScoreThreshold() int32 { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + var ret int32 + return ret + } + return *o.ZxcvbnScoreThreshold +} + +// GetZxcvbnScoreThresholdOk returns a tuple with the ZxcvbnScoreThreshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordPolicyRequest) GetZxcvbnScoreThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.ZxcvbnScoreThreshold) { + return nil, false + } + return o.ZxcvbnScoreThreshold, true +} + +// HasZxcvbnScoreThreshold returns a boolean if a field has been set. +func (o *PatchedPasswordPolicyRequest) HasZxcvbnScoreThreshold() bool { + if o != nil && !IsNil(o.ZxcvbnScoreThreshold) { + return true + } + + return false +} + +// SetZxcvbnScoreThreshold gets a reference to the given int32 and assigns it to the ZxcvbnScoreThreshold field. +func (o *PatchedPasswordPolicyRequest) SetZxcvbnScoreThreshold(v int32) { + o.ZxcvbnScoreThreshold = &v +} + +func (o PatchedPasswordPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPasswordPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.AmountDigits) { + toSerialize["amount_digits"] = o.AmountDigits + } + if !IsNil(o.AmountUppercase) { + toSerialize["amount_uppercase"] = o.AmountUppercase + } + if !IsNil(o.AmountLowercase) { + toSerialize["amount_lowercase"] = o.AmountLowercase + } + if !IsNil(o.AmountSymbols) { + toSerialize["amount_symbols"] = o.AmountSymbols + } + if !IsNil(o.LengthMin) { + toSerialize["length_min"] = o.LengthMin + } + if !IsNil(o.SymbolCharset) { + toSerialize["symbol_charset"] = o.SymbolCharset + } + if !IsNil(o.ErrorMessage) { + toSerialize["error_message"] = o.ErrorMessage + } + if !IsNil(o.CheckStaticRules) { + toSerialize["check_static_rules"] = o.CheckStaticRules + } + if !IsNil(o.CheckHaveIBeenPwned) { + toSerialize["check_have_i_been_pwned"] = o.CheckHaveIBeenPwned + } + if !IsNil(o.CheckZxcvbn) { + toSerialize["check_zxcvbn"] = o.CheckZxcvbn + } + if !IsNil(o.HibpAllowedCount) { + toSerialize["hibp_allowed_count"] = o.HibpAllowedCount + } + if !IsNil(o.ZxcvbnScoreThreshold) { + toSerialize["zxcvbn_score_threshold"] = o.ZxcvbnScoreThreshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPasswordPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPasswordPolicyRequest := _PatchedPasswordPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedPasswordPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedPasswordPolicyRequest(varPatchedPasswordPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "password_field") + delete(additionalProperties, "amount_digits") + delete(additionalProperties, "amount_uppercase") + delete(additionalProperties, "amount_lowercase") + delete(additionalProperties, "amount_symbols") + delete(additionalProperties, "length_min") + delete(additionalProperties, "symbol_charset") + delete(additionalProperties, "error_message") + delete(additionalProperties, "check_static_rules") + delete(additionalProperties, "check_have_i_been_pwned") + delete(additionalProperties, "check_zxcvbn") + delete(additionalProperties, "hibp_allowed_count") + delete(additionalProperties, "zxcvbn_score_threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPasswordPolicyRequest struct { + value *PatchedPasswordPolicyRequest + isSet bool +} + +func (v NullablePatchedPasswordPolicyRequest) Get() *PatchedPasswordPolicyRequest { + return v.value +} + +func (v *NullablePatchedPasswordPolicyRequest) Set(val *PatchedPasswordPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPasswordPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPasswordPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPasswordPolicyRequest(val *PatchedPasswordPolicyRequest) *NullablePatchedPasswordPolicyRequest { + return &NullablePatchedPasswordPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedPasswordPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPasswordPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_password_stage_request.go b/packages/client-go/model_patched_password_stage_request.go new file mode 100644 index 0000000000..90bb803b1a --- /dev/null +++ b/packages/client-go/model_patched_password_stage_request.go @@ -0,0 +1,317 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPasswordStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPasswordStageRequest{} + +// PatchedPasswordStageRequest PasswordStage Serializer +type PatchedPasswordStageRequest struct { + Name *string `json:"name,omitempty"` + // Selection of backends to test the password against. + Backends []BackendsEnum `json:"backends,omitempty"` + // Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage. + ConfigureFlow NullableString `json:"configure_flow,omitempty"` + // How many attempts a user has before the flow is canceled. To lock the user out, use a reputation policy and a user_write stage. + FailedAttemptsBeforeCancel *int32 `json:"failed_attempts_before_cancel,omitempty"` + // When enabled, provides a 'show password' button with the password input field. + AllowShowPassword *bool `json:"allow_show_password,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPasswordStageRequest PatchedPasswordStageRequest + +// NewPatchedPasswordStageRequest instantiates a new PatchedPasswordStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPasswordStageRequest() *PatchedPasswordStageRequest { + this := PatchedPasswordStageRequest{} + return &this +} + +// NewPatchedPasswordStageRequestWithDefaults instantiates a new PatchedPasswordStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPasswordStageRequestWithDefaults() *PatchedPasswordStageRequest { + this := PatchedPasswordStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPasswordStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPasswordStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPasswordStageRequest) SetName(v string) { + o.Name = &v +} + +// GetBackends returns the Backends field value if set, zero value otherwise. +func (o *PatchedPasswordStageRequest) GetBackends() []BackendsEnum { + if o == nil || IsNil(o.Backends) { + var ret []BackendsEnum + return ret + } + return o.Backends +} + +// GetBackendsOk returns a tuple with the Backends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordStageRequest) GetBackendsOk() ([]BackendsEnum, bool) { + if o == nil || IsNil(o.Backends) { + return nil, false + } + return o.Backends, true +} + +// HasBackends returns a boolean if a field has been set. +func (o *PatchedPasswordStageRequest) HasBackends() bool { + if o != nil && !IsNil(o.Backends) { + return true + } + + return false +} + +// SetBackends gets a reference to the given []BackendsEnum and assigns it to the Backends field. +func (o *PatchedPasswordStageRequest) SetBackends(v []BackendsEnum) { + o.Backends = v +} + +// GetConfigureFlow returns the ConfigureFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPasswordStageRequest) GetConfigureFlow() string { + if o == nil || IsNil(o.ConfigureFlow.Get()) { + var ret string + return ret + } + return *o.ConfigureFlow.Get() +} + +// GetConfigureFlowOk returns a tuple with the ConfigureFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPasswordStageRequest) GetConfigureFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ConfigureFlow.Get(), o.ConfigureFlow.IsSet() +} + +// HasConfigureFlow returns a boolean if a field has been set. +func (o *PatchedPasswordStageRequest) HasConfigureFlow() bool { + if o != nil && o.ConfigureFlow.IsSet() { + return true + } + + return false +} + +// SetConfigureFlow gets a reference to the given NullableString and assigns it to the ConfigureFlow field. +func (o *PatchedPasswordStageRequest) SetConfigureFlow(v string) { + o.ConfigureFlow.Set(&v) +} + +// SetConfigureFlowNil sets the value for ConfigureFlow to be an explicit nil +func (o *PatchedPasswordStageRequest) SetConfigureFlowNil() { + o.ConfigureFlow.Set(nil) +} + +// UnsetConfigureFlow ensures that no value is present for ConfigureFlow, not even an explicit nil +func (o *PatchedPasswordStageRequest) UnsetConfigureFlow() { + o.ConfigureFlow.Unset() +} + +// GetFailedAttemptsBeforeCancel returns the FailedAttemptsBeforeCancel field value if set, zero value otherwise. +func (o *PatchedPasswordStageRequest) GetFailedAttemptsBeforeCancel() int32 { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + var ret int32 + return ret + } + return *o.FailedAttemptsBeforeCancel +} + +// GetFailedAttemptsBeforeCancelOk returns a tuple with the FailedAttemptsBeforeCancel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordStageRequest) GetFailedAttemptsBeforeCancelOk() (*int32, bool) { + if o == nil || IsNil(o.FailedAttemptsBeforeCancel) { + return nil, false + } + return o.FailedAttemptsBeforeCancel, true +} + +// HasFailedAttemptsBeforeCancel returns a boolean if a field has been set. +func (o *PatchedPasswordStageRequest) HasFailedAttemptsBeforeCancel() bool { + if o != nil && !IsNil(o.FailedAttemptsBeforeCancel) { + return true + } + + return false +} + +// SetFailedAttemptsBeforeCancel gets a reference to the given int32 and assigns it to the FailedAttemptsBeforeCancel field. +func (o *PatchedPasswordStageRequest) SetFailedAttemptsBeforeCancel(v int32) { + o.FailedAttemptsBeforeCancel = &v +} + +// GetAllowShowPassword returns the AllowShowPassword field value if set, zero value otherwise. +func (o *PatchedPasswordStageRequest) GetAllowShowPassword() bool { + if o == nil || IsNil(o.AllowShowPassword) { + var ret bool + return ret + } + return *o.AllowShowPassword +} + +// GetAllowShowPasswordOk returns a tuple with the AllowShowPassword field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPasswordStageRequest) GetAllowShowPasswordOk() (*bool, bool) { + if o == nil || IsNil(o.AllowShowPassword) { + return nil, false + } + return o.AllowShowPassword, true +} + +// HasAllowShowPassword returns a boolean if a field has been set. +func (o *PatchedPasswordStageRequest) HasAllowShowPassword() bool { + if o != nil && !IsNil(o.AllowShowPassword) { + return true + } + + return false +} + +// SetAllowShowPassword gets a reference to the given bool and assigns it to the AllowShowPassword field. +func (o *PatchedPasswordStageRequest) SetAllowShowPassword(v bool) { + o.AllowShowPassword = &v +} + +func (o PatchedPasswordStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPasswordStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Backends) { + toSerialize["backends"] = o.Backends + } + if o.ConfigureFlow.IsSet() { + toSerialize["configure_flow"] = o.ConfigureFlow.Get() + } + if !IsNil(o.FailedAttemptsBeforeCancel) { + toSerialize["failed_attempts_before_cancel"] = o.FailedAttemptsBeforeCancel + } + if !IsNil(o.AllowShowPassword) { + toSerialize["allow_show_password"] = o.AllowShowPassword + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPasswordStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPasswordStageRequest := _PatchedPasswordStageRequest{} + + err = json.Unmarshal(data, &varPatchedPasswordStageRequest) + + if err != nil { + return err + } + + *o = PatchedPasswordStageRequest(varPatchedPasswordStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "backends") + delete(additionalProperties, "configure_flow") + delete(additionalProperties, "failed_attempts_before_cancel") + delete(additionalProperties, "allow_show_password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPasswordStageRequest struct { + value *PatchedPasswordStageRequest + isSet bool +} + +func (v NullablePatchedPasswordStageRequest) Get() *PatchedPasswordStageRequest { + return v.value +} + +func (v *NullablePatchedPasswordStageRequest) Set(val *PatchedPasswordStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPasswordStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPasswordStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPasswordStageRequest(val *PatchedPasswordStageRequest) *NullablePatchedPasswordStageRequest { + return &NullablePatchedPasswordStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedPasswordStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPasswordStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_permission_assign_request.go b/packages/client-go/model_patched_permission_assign_request.go new file mode 100644 index 0000000000..ba058bf2ed --- /dev/null +++ b/packages/client-go/model_patched_permission_assign_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPermissionAssignRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPermissionAssignRequest{} + +// PatchedPermissionAssignRequest Request to assign a new permission +type PatchedPermissionAssignRequest struct { + Permissions []string `json:"permissions,omitempty"` + Model *ModelEnum `json:"model,omitempty"` + ObjectPk *string `json:"object_pk,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPermissionAssignRequest PatchedPermissionAssignRequest + +// NewPatchedPermissionAssignRequest instantiates a new PatchedPermissionAssignRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPermissionAssignRequest() *PatchedPermissionAssignRequest { + this := PatchedPermissionAssignRequest{} + return &this +} + +// NewPatchedPermissionAssignRequestWithDefaults instantiates a new PatchedPermissionAssignRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPermissionAssignRequestWithDefaults() *PatchedPermissionAssignRequest { + this := PatchedPermissionAssignRequest{} + return &this +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *PatchedPermissionAssignRequest) GetPermissions() []string { + if o == nil || IsNil(o.Permissions) { + var ret []string + return ret + } + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPermissionAssignRequest) GetPermissionsOk() ([]string, bool) { + if o == nil || IsNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *PatchedPermissionAssignRequest) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given []string and assigns it to the Permissions field. +func (o *PatchedPermissionAssignRequest) SetPermissions(v []string) { + o.Permissions = v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *PatchedPermissionAssignRequest) GetModel() ModelEnum { + if o == nil || IsNil(o.Model) { + var ret ModelEnum + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPermissionAssignRequest) GetModelOk() (*ModelEnum, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *PatchedPermissionAssignRequest) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given ModelEnum and assigns it to the Model field. +func (o *PatchedPermissionAssignRequest) SetModel(v ModelEnum) { + o.Model = &v +} + +// GetObjectPk returns the ObjectPk field value if set, zero value otherwise. +func (o *PatchedPermissionAssignRequest) GetObjectPk() string { + if o == nil || IsNil(o.ObjectPk) { + var ret string + return ret + } + return *o.ObjectPk +} + +// GetObjectPkOk returns a tuple with the ObjectPk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPermissionAssignRequest) GetObjectPkOk() (*string, bool) { + if o == nil || IsNil(o.ObjectPk) { + return nil, false + } + return o.ObjectPk, true +} + +// HasObjectPk returns a boolean if a field has been set. +func (o *PatchedPermissionAssignRequest) HasObjectPk() bool { + if o != nil && !IsNil(o.ObjectPk) { + return true + } + + return false +} + +// SetObjectPk gets a reference to the given string and assigns it to the ObjectPk field. +func (o *PatchedPermissionAssignRequest) SetObjectPk(v string) { + o.ObjectPk = &v +} + +func (o PatchedPermissionAssignRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPermissionAssignRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.ObjectPk) { + toSerialize["object_pk"] = o.ObjectPk + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPermissionAssignRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPermissionAssignRequest := _PatchedPermissionAssignRequest{} + + err = json.Unmarshal(data, &varPatchedPermissionAssignRequest) + + if err != nil { + return err + } + + *o = PatchedPermissionAssignRequest(varPatchedPermissionAssignRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "permissions") + delete(additionalProperties, "model") + delete(additionalProperties, "object_pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPermissionAssignRequest struct { + value *PatchedPermissionAssignRequest + isSet bool +} + +func (v NullablePatchedPermissionAssignRequest) Get() *PatchedPermissionAssignRequest { + return v.value +} + +func (v *NullablePatchedPermissionAssignRequest) Set(val *PatchedPermissionAssignRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPermissionAssignRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPermissionAssignRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPermissionAssignRequest(val *PatchedPermissionAssignRequest) *NullablePatchedPermissionAssignRequest { + return &NullablePatchedPermissionAssignRequest{value: val, isSet: true} +} + +func (v NullablePatchedPermissionAssignRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPermissionAssignRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_plex_source_property_mapping_request.go b/packages/client-go/model_patched_plex_source_property_mapping_request.go new file mode 100644 index 0000000000..b511cc4ab0 --- /dev/null +++ b/packages/client-go/model_patched_plex_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPlexSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPlexSourcePropertyMappingRequest{} + +// PatchedPlexSourcePropertyMappingRequest PlexSourcePropertyMapping Serializer +type PatchedPlexSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPlexSourcePropertyMappingRequest PatchedPlexSourcePropertyMappingRequest + +// NewPatchedPlexSourcePropertyMappingRequest instantiates a new PatchedPlexSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPlexSourcePropertyMappingRequest() *PatchedPlexSourcePropertyMappingRequest { + this := PatchedPlexSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedPlexSourcePropertyMappingRequestWithDefaults instantiates a new PatchedPlexSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPlexSourcePropertyMappingRequestWithDefaults() *PatchedPlexSourcePropertyMappingRequest { + this := PatchedPlexSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPlexSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPlexSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedPlexSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedPlexSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedPlexSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedPlexSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPlexSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPlexSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPlexSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedPlexSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedPlexSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedPlexSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedPlexSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPlexSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPlexSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPlexSourcePropertyMappingRequest := _PatchedPlexSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedPlexSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedPlexSourcePropertyMappingRequest(varPatchedPlexSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPlexSourcePropertyMappingRequest struct { + value *PatchedPlexSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedPlexSourcePropertyMappingRequest) Get() *PatchedPlexSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedPlexSourcePropertyMappingRequest) Set(val *PatchedPlexSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPlexSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPlexSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPlexSourcePropertyMappingRequest(val *PatchedPlexSourcePropertyMappingRequest) *NullablePatchedPlexSourcePropertyMappingRequest { + return &NullablePatchedPlexSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedPlexSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPlexSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_plex_source_request.go b/packages/client-go/model_patched_plex_source_request.go new file mode 100644 index 0000000000..7b739687fc --- /dev/null +++ b/packages/client-go/model_patched_plex_source_request.go @@ -0,0 +1,779 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPlexSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPlexSourceRequest{} + +// PatchedPlexSourceRequest Plex Source Serializer +type PatchedPlexSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Client identifier used to talk to Plex. + ClientId *string `json:"client_id,omitempty"` + // Which servers a user has to be a member of to be granted access. Empty list allows every server. + AllowedServers []string `json:"allowed_servers,omitempty"` + // Allow friends to authenticate, even if you don't share a server. + AllowFriends *bool `json:"allow_friends,omitempty"` + // Plex token used to check friends + PlexToken *string `json:"plex_token,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPlexSourceRequest PatchedPlexSourceRequest + +// NewPatchedPlexSourceRequest instantiates a new PatchedPlexSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPlexSourceRequest() *PatchedPlexSourceRequest { + this := PatchedPlexSourceRequest{} + return &this +} + +// NewPatchedPlexSourceRequestWithDefaults instantiates a new PatchedPlexSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPlexSourceRequestWithDefaults() *PatchedPlexSourceRequest { + this := PatchedPlexSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPlexSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedPlexSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedPlexSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedPlexSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPlexSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPlexSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedPlexSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedPlexSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedPlexSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPlexSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPlexSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedPlexSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedPlexSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedPlexSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedPlexSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedPlexSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedPlexSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedPlexSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedPlexSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedPlexSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PatchedPlexSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PatchedPlexSourceRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetAllowedServers returns the AllowedServers field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetAllowedServers() []string { + if o == nil || IsNil(o.AllowedServers) { + var ret []string + return ret + } + return o.AllowedServers +} + +// GetAllowedServersOk returns a tuple with the AllowedServers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetAllowedServersOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedServers) { + return nil, false + } + return o.AllowedServers, true +} + +// HasAllowedServers returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasAllowedServers() bool { + if o != nil && !IsNil(o.AllowedServers) { + return true + } + + return false +} + +// SetAllowedServers gets a reference to the given []string and assigns it to the AllowedServers field. +func (o *PatchedPlexSourceRequest) SetAllowedServers(v []string) { + o.AllowedServers = v +} + +// GetAllowFriends returns the AllowFriends field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetAllowFriends() bool { + if o == nil || IsNil(o.AllowFriends) { + var ret bool + return ret + } + return *o.AllowFriends +} + +// GetAllowFriendsOk returns a tuple with the AllowFriends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetAllowFriendsOk() (*bool, bool) { + if o == nil || IsNil(o.AllowFriends) { + return nil, false + } + return o.AllowFriends, true +} + +// HasAllowFriends returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasAllowFriends() bool { + if o != nil && !IsNil(o.AllowFriends) { + return true + } + + return false +} + +// SetAllowFriends gets a reference to the given bool and assigns it to the AllowFriends field. +func (o *PatchedPlexSourceRequest) SetAllowFriends(v bool) { + o.AllowFriends = &v +} + +// GetPlexToken returns the PlexToken field value if set, zero value otherwise. +func (o *PatchedPlexSourceRequest) GetPlexToken() string { + if o == nil || IsNil(o.PlexToken) { + var ret string + return ret + } + return *o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPlexSourceRequest) GetPlexTokenOk() (*string, bool) { + if o == nil || IsNil(o.PlexToken) { + return nil, false + } + return o.PlexToken, true +} + +// HasPlexToken returns a boolean if a field has been set. +func (o *PatchedPlexSourceRequest) HasPlexToken() bool { + if o != nil && !IsNil(o.PlexToken) { + return true + } + + return false +} + +// SetPlexToken gets a reference to the given string and assigns it to the PlexToken field. +func (o *PatchedPlexSourceRequest) SetPlexToken(v string) { + o.PlexToken = &v +} + +func (o PatchedPlexSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPlexSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.AllowedServers) { + toSerialize["allowed_servers"] = o.AllowedServers + } + if !IsNil(o.AllowFriends) { + toSerialize["allow_friends"] = o.AllowFriends + } + if !IsNil(o.PlexToken) { + toSerialize["plex_token"] = o.PlexToken + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPlexSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPlexSourceRequest := _PatchedPlexSourceRequest{} + + err = json.Unmarshal(data, &varPatchedPlexSourceRequest) + + if err != nil { + return err + } + + *o = PatchedPlexSourceRequest(varPatchedPlexSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "client_id") + delete(additionalProperties, "allowed_servers") + delete(additionalProperties, "allow_friends") + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPlexSourceRequest struct { + value *PatchedPlexSourceRequest + isSet bool +} + +func (v NullablePatchedPlexSourceRequest) Get() *PatchedPlexSourceRequest { + return v.value +} + +func (v *NullablePatchedPlexSourceRequest) Set(val *PatchedPlexSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPlexSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPlexSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPlexSourceRequest(val *PatchedPlexSourceRequest) *NullablePatchedPlexSourceRequest { + return &NullablePatchedPlexSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedPlexSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPlexSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_policy_binding_request.go b/packages/client-go/model_patched_policy_binding_request.go new file mode 100644 index 0000000000..c8bf7bd2ee --- /dev/null +++ b/packages/client-go/model_patched_policy_binding_request.go @@ -0,0 +1,486 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPolicyBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPolicyBindingRequest{} + +// PatchedPolicyBindingRequest PolicyBinding Serializer +type PatchedPolicyBindingRequest struct { + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Target *string `json:"target,omitempty"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order *int32 `json:"order,omitempty"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPolicyBindingRequest PatchedPolicyBindingRequest + +// NewPatchedPolicyBindingRequest instantiates a new PatchedPolicyBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPolicyBindingRequest() *PatchedPolicyBindingRequest { + this := PatchedPolicyBindingRequest{} + return &this +} + +// NewPatchedPolicyBindingRequestWithDefaults instantiates a new PatchedPolicyBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPolicyBindingRequestWithDefaults() *PatchedPolicyBindingRequest { + this := PatchedPolicyBindingRequest{} + return &this +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPolicyBindingRequest) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPolicyBindingRequest) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *PatchedPolicyBindingRequest) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *PatchedPolicyBindingRequest) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *PatchedPolicyBindingRequest) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPolicyBindingRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPolicyBindingRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *PatchedPolicyBindingRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PatchedPolicyBindingRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PatchedPolicyBindingRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedPolicyBindingRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedPolicyBindingRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PatchedPolicyBindingRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PatchedPolicyBindingRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PatchedPolicyBindingRequest) UnsetUser() { + o.User.Unset() +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetTarget() string { + if o == nil || IsNil(o.Target) { + var ret string + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetTargetOk() (*string, bool) { + if o == nil || IsNil(o.Target) { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasTarget() bool { + if o != nil && !IsNil(o.Target) { + return true + } + + return false +} + +// SetTarget gets a reference to the given string and assigns it to the Target field. +func (o *PatchedPolicyBindingRequest) SetTarget(v string) { + o.Target = &v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *PatchedPolicyBindingRequest) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedPolicyBindingRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *PatchedPolicyBindingRequest) SetOrder(v int32) { + o.Order = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PatchedPolicyBindingRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *PatchedPolicyBindingRequest) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPolicyBindingRequest) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *PatchedPolicyBindingRequest) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *PatchedPolicyBindingRequest) SetFailureResult(v bool) { + o.FailureResult = &v +} + +func (o PatchedPolicyBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPolicyBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Target) { + toSerialize["target"] = o.Target + } + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPolicyBindingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPolicyBindingRequest := _PatchedPolicyBindingRequest{} + + err = json.Unmarshal(data, &varPatchedPolicyBindingRequest) + + if err != nil { + return err + } + + *o = PatchedPolicyBindingRequest(varPatchedPolicyBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPolicyBindingRequest struct { + value *PatchedPolicyBindingRequest + isSet bool +} + +func (v NullablePatchedPolicyBindingRequest) Get() *PatchedPolicyBindingRequest { + return v.value +} + +func (v *NullablePatchedPolicyBindingRequest) Set(val *PatchedPolicyBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPolicyBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPolicyBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPolicyBindingRequest(val *PatchedPolicyBindingRequest) *NullablePatchedPolicyBindingRequest { + return &NullablePatchedPolicyBindingRequest{value: val, isSet: true} +} + +func (v NullablePatchedPolicyBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPolicyBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_prompt_request.go b/packages/client-go/model_patched_prompt_request.go new file mode 100644 index 0000000000..b10b95f1ce --- /dev/null +++ b/packages/client-go/model_patched_prompt_request.go @@ -0,0 +1,527 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPromptRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPromptRequest{} + +// PatchedPromptRequest Prompt Serializer +type PatchedPromptRequest struct { + Name *string `json:"name,omitempty"` + // Name of the form field, also used to store the value + FieldKey *string `json:"field_key,omitempty"` + Label *string `json:"label,omitempty"` + Type *PromptTypeEnum `json:"type,omitempty"` + Required *bool `json:"required,omitempty"` + // Optionally provide a short hint that describes the expected input value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple choices. + Placeholder *string `json:"placeholder,omitempty"` + // Optionally pre-fill the input with an initial value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple default choices. + InitialValue *string `json:"initial_value,omitempty"` + Order *int32 `json:"order,omitempty"` + SubText *string `json:"sub_text,omitempty"` + PlaceholderExpression *bool `json:"placeholder_expression,omitempty"` + InitialValueExpression *bool `json:"initial_value_expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPromptRequest PatchedPromptRequest + +// NewPatchedPromptRequest instantiates a new PatchedPromptRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPromptRequest() *PatchedPromptRequest { + this := PatchedPromptRequest{} + return &this +} + +// NewPatchedPromptRequestWithDefaults instantiates a new PatchedPromptRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPromptRequestWithDefaults() *PatchedPromptRequest { + this := PatchedPromptRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPromptRequest) SetName(v string) { + o.Name = &v +} + +// GetFieldKey returns the FieldKey field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetFieldKey() string { + if o == nil || IsNil(o.FieldKey) { + var ret string + return ret + } + return *o.FieldKey +} + +// GetFieldKeyOk returns a tuple with the FieldKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetFieldKeyOk() (*string, bool) { + if o == nil || IsNil(o.FieldKey) { + return nil, false + } + return o.FieldKey, true +} + +// HasFieldKey returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasFieldKey() bool { + if o != nil && !IsNil(o.FieldKey) { + return true + } + + return false +} + +// SetFieldKey gets a reference to the given string and assigns it to the FieldKey field. +func (o *PatchedPromptRequest) SetFieldKey(v string) { + o.FieldKey = &v +} + +// GetLabel returns the Label field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetLabel() string { + if o == nil || IsNil(o.Label) { + var ret string + return ret + } + return *o.Label +} + +// GetLabelOk returns a tuple with the Label field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetLabelOk() (*string, bool) { + if o == nil || IsNil(o.Label) { + return nil, false + } + return o.Label, true +} + +// HasLabel returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasLabel() bool { + if o != nil && !IsNil(o.Label) { + return true + } + + return false +} + +// SetLabel gets a reference to the given string and assigns it to the Label field. +func (o *PatchedPromptRequest) SetLabel(v string) { + o.Label = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetType() PromptTypeEnum { + if o == nil || IsNil(o.Type) { + var ret PromptTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetTypeOk() (*PromptTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given PromptTypeEnum and assigns it to the Type field. +func (o *PatchedPromptRequest) SetType(v PromptTypeEnum) { + o.Type = &v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *PatchedPromptRequest) SetRequired(v bool) { + o.Required = &v +} + +// GetPlaceholder returns the Placeholder field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetPlaceholder() string { + if o == nil || IsNil(o.Placeholder) { + var ret string + return ret + } + return *o.Placeholder +} + +// GetPlaceholderOk returns a tuple with the Placeholder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetPlaceholderOk() (*string, bool) { + if o == nil || IsNil(o.Placeholder) { + return nil, false + } + return o.Placeholder, true +} + +// HasPlaceholder returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasPlaceholder() bool { + if o != nil && !IsNil(o.Placeholder) { + return true + } + + return false +} + +// SetPlaceholder gets a reference to the given string and assigns it to the Placeholder field. +func (o *PatchedPromptRequest) SetPlaceholder(v string) { + o.Placeholder = &v +} + +// GetInitialValue returns the InitialValue field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetInitialValue() string { + if o == nil || IsNil(o.InitialValue) { + var ret string + return ret + } + return *o.InitialValue +} + +// GetInitialValueOk returns a tuple with the InitialValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetInitialValueOk() (*string, bool) { + if o == nil || IsNil(o.InitialValue) { + return nil, false + } + return o.InitialValue, true +} + +// HasInitialValue returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasInitialValue() bool { + if o != nil && !IsNil(o.InitialValue) { + return true + } + + return false +} + +// SetInitialValue gets a reference to the given string and assigns it to the InitialValue field. +func (o *PatchedPromptRequest) SetInitialValue(v string) { + o.InitialValue = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *PatchedPromptRequest) SetOrder(v int32) { + o.Order = &v +} + +// GetSubText returns the SubText field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetSubText() string { + if o == nil || IsNil(o.SubText) { + var ret string + return ret + } + return *o.SubText +} + +// GetSubTextOk returns a tuple with the SubText field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetSubTextOk() (*string, bool) { + if o == nil || IsNil(o.SubText) { + return nil, false + } + return o.SubText, true +} + +// HasSubText returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasSubText() bool { + if o != nil && !IsNil(o.SubText) { + return true + } + + return false +} + +// SetSubText gets a reference to the given string and assigns it to the SubText field. +func (o *PatchedPromptRequest) SetSubText(v string) { + o.SubText = &v +} + +// GetPlaceholderExpression returns the PlaceholderExpression field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetPlaceholderExpression() bool { + if o == nil || IsNil(o.PlaceholderExpression) { + var ret bool + return ret + } + return *o.PlaceholderExpression +} + +// GetPlaceholderExpressionOk returns a tuple with the PlaceholderExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetPlaceholderExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.PlaceholderExpression) { + return nil, false + } + return o.PlaceholderExpression, true +} + +// HasPlaceholderExpression returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasPlaceholderExpression() bool { + if o != nil && !IsNil(o.PlaceholderExpression) { + return true + } + + return false +} + +// SetPlaceholderExpression gets a reference to the given bool and assigns it to the PlaceholderExpression field. +func (o *PatchedPromptRequest) SetPlaceholderExpression(v bool) { + o.PlaceholderExpression = &v +} + +// GetInitialValueExpression returns the InitialValueExpression field value if set, zero value otherwise. +func (o *PatchedPromptRequest) GetInitialValueExpression() bool { + if o == nil || IsNil(o.InitialValueExpression) { + var ret bool + return ret + } + return *o.InitialValueExpression +} + +// GetInitialValueExpressionOk returns a tuple with the InitialValueExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptRequest) GetInitialValueExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.InitialValueExpression) { + return nil, false + } + return o.InitialValueExpression, true +} + +// HasInitialValueExpression returns a boolean if a field has been set. +func (o *PatchedPromptRequest) HasInitialValueExpression() bool { + if o != nil && !IsNil(o.InitialValueExpression) { + return true + } + + return false +} + +// SetInitialValueExpression gets a reference to the given bool and assigns it to the InitialValueExpression field. +func (o *PatchedPromptRequest) SetInitialValueExpression(v bool) { + o.InitialValueExpression = &v +} + +func (o PatchedPromptRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPromptRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.FieldKey) { + toSerialize["field_key"] = o.FieldKey + } + if !IsNil(o.Label) { + toSerialize["label"] = o.Label + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.Placeholder) { + toSerialize["placeholder"] = o.Placeholder + } + if !IsNil(o.InitialValue) { + toSerialize["initial_value"] = o.InitialValue + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !IsNil(o.SubText) { + toSerialize["sub_text"] = o.SubText + } + if !IsNil(o.PlaceholderExpression) { + toSerialize["placeholder_expression"] = o.PlaceholderExpression + } + if !IsNil(o.InitialValueExpression) { + toSerialize["initial_value_expression"] = o.InitialValueExpression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPromptRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPromptRequest := _PatchedPromptRequest{} + + err = json.Unmarshal(data, &varPatchedPromptRequest) + + if err != nil { + return err + } + + *o = PatchedPromptRequest(varPatchedPromptRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "field_key") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "required") + delete(additionalProperties, "placeholder") + delete(additionalProperties, "initial_value") + delete(additionalProperties, "order") + delete(additionalProperties, "sub_text") + delete(additionalProperties, "placeholder_expression") + delete(additionalProperties, "initial_value_expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPromptRequest struct { + value *PatchedPromptRequest + isSet bool +} + +func (v NullablePatchedPromptRequest) Get() *PatchedPromptRequest { + return v.value +} + +func (v *NullablePatchedPromptRequest) Set(val *PatchedPromptRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPromptRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPromptRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPromptRequest(val *PatchedPromptRequest) *NullablePatchedPromptRequest { + return &NullablePatchedPromptRequest{value: val, isSet: true} +} + +func (v NullablePatchedPromptRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPromptRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_prompt_stage_request.go b/packages/client-go/model_patched_prompt_stage_request.go new file mode 100644 index 0000000000..bf6065f000 --- /dev/null +++ b/packages/client-go/model_patched_prompt_stage_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedPromptStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedPromptStageRequest{} + +// PatchedPromptStageRequest PromptStage Serializer +type PatchedPromptStageRequest struct { + Name *string `json:"name,omitempty"` + Fields []string `json:"fields,omitempty"` + ValidationPolicies []string `json:"validation_policies,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedPromptStageRequest PatchedPromptStageRequest + +// NewPatchedPromptStageRequest instantiates a new PatchedPromptStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedPromptStageRequest() *PatchedPromptStageRequest { + this := PatchedPromptStageRequest{} + return &this +} + +// NewPatchedPromptStageRequestWithDefaults instantiates a new PatchedPromptStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedPromptStageRequestWithDefaults() *PatchedPromptStageRequest { + this := PatchedPromptStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedPromptStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedPromptStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedPromptStageRequest) SetName(v string) { + o.Name = &v +} + +// GetFields returns the Fields field value if set, zero value otherwise. +func (o *PatchedPromptStageRequest) GetFields() []string { + if o == nil || IsNil(o.Fields) { + var ret []string + return ret + } + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptStageRequest) GetFieldsOk() ([]string, bool) { + if o == nil || IsNil(o.Fields) { + return nil, false + } + return o.Fields, true +} + +// HasFields returns a boolean if a field has been set. +func (o *PatchedPromptStageRequest) HasFields() bool { + if o != nil && !IsNil(o.Fields) { + return true + } + + return false +} + +// SetFields gets a reference to the given []string and assigns it to the Fields field. +func (o *PatchedPromptStageRequest) SetFields(v []string) { + o.Fields = v +} + +// GetValidationPolicies returns the ValidationPolicies field value if set, zero value otherwise. +func (o *PatchedPromptStageRequest) GetValidationPolicies() []string { + if o == nil || IsNil(o.ValidationPolicies) { + var ret []string + return ret + } + return o.ValidationPolicies +} + +// GetValidationPoliciesOk returns a tuple with the ValidationPolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedPromptStageRequest) GetValidationPoliciesOk() ([]string, bool) { + if o == nil || IsNil(o.ValidationPolicies) { + return nil, false + } + return o.ValidationPolicies, true +} + +// HasValidationPolicies returns a boolean if a field has been set. +func (o *PatchedPromptStageRequest) HasValidationPolicies() bool { + if o != nil && !IsNil(o.ValidationPolicies) { + return true + } + + return false +} + +// SetValidationPolicies gets a reference to the given []string and assigns it to the ValidationPolicies field. +func (o *PatchedPromptStageRequest) SetValidationPolicies(v []string) { + o.ValidationPolicies = v +} + +func (o PatchedPromptStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedPromptStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Fields) { + toSerialize["fields"] = o.Fields + } + if !IsNil(o.ValidationPolicies) { + toSerialize["validation_policies"] = o.ValidationPolicies + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedPromptStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedPromptStageRequest := _PatchedPromptStageRequest{} + + err = json.Unmarshal(data, &varPatchedPromptStageRequest) + + if err != nil { + return err + } + + *o = PatchedPromptStageRequest(varPatchedPromptStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "fields") + delete(additionalProperties, "validation_policies") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedPromptStageRequest struct { + value *PatchedPromptStageRequest + isSet bool +} + +func (v NullablePatchedPromptStageRequest) Get() *PatchedPromptStageRequest { + return v.value +} + +func (v *NullablePatchedPromptStageRequest) Set(val *PatchedPromptStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedPromptStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedPromptStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedPromptStageRequest(val *PatchedPromptStageRequest) *NullablePatchedPromptStageRequest { + return &NullablePatchedPromptStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedPromptStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedPromptStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_proxy_provider_request.go b/packages/client-go/model_patched_proxy_provider_request.go new file mode 100644 index 0000000000..4dfbca47ac --- /dev/null +++ b/packages/client-go/model_patched_proxy_provider_request.go @@ -0,0 +1,891 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedProxyProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedProxyProviderRequest{} + +// PatchedProxyProviderRequest ProxyProvider Serializer +type PatchedProxyProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + InternalHost *string `json:"internal_host,omitempty"` + ExternalHost *string `json:"external_host,omitempty"` + // Validate SSL Certificates of upstream servers + InternalHostSslValidation *bool `json:"internal_host_ssl_validation,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + // Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression. + SkipPathRegex *string `json:"skip_path_regex,omitempty"` + // Set a custom HTTP-Basic Authentication header based on values from authentik. + BasicAuthEnabled *bool `json:"basic_auth_enabled,omitempty"` + // User/Group Attribute used for the password part of the HTTP-Basic Header. + BasicAuthPasswordAttribute *string `json:"basic_auth_password_attribute,omitempty"` + // User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used. + BasicAuthUserAttribute *string `json:"basic_auth_user_attribute,omitempty"` + // Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host. + Mode *ProxyMode `json:"mode,omitempty"` + // When enabled, this provider will intercept the authorization header and authenticate requests based on its value. + InterceptHeaderAuth *bool `json:"intercept_header_auth,omitempty"` + CookieDomain *string `json:"cookie_domain,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedProxyProviderRequest PatchedProxyProviderRequest + +// NewPatchedProxyProviderRequest instantiates a new PatchedProxyProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedProxyProviderRequest() *PatchedProxyProviderRequest { + this := PatchedProxyProviderRequest{} + return &this +} + +// NewPatchedProxyProviderRequestWithDefaults instantiates a new PatchedProxyProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedProxyProviderRequestWithDefaults() *PatchedProxyProviderRequest { + this := PatchedProxyProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedProxyProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedProxyProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedProxyProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedProxyProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedProxyProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedProxyProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedProxyProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedProxyProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedProxyProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetInternalHost returns the InternalHost field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetInternalHost() string { + if o == nil || IsNil(o.InternalHost) { + var ret string + return ret + } + return *o.InternalHost +} + +// GetInternalHostOk returns a tuple with the InternalHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetInternalHostOk() (*string, bool) { + if o == nil || IsNil(o.InternalHost) { + return nil, false + } + return o.InternalHost, true +} + +// HasInternalHost returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasInternalHost() bool { + if o != nil && !IsNil(o.InternalHost) { + return true + } + + return false +} + +// SetInternalHost gets a reference to the given string and assigns it to the InternalHost field. +func (o *PatchedProxyProviderRequest) SetInternalHost(v string) { + o.InternalHost = &v +} + +// GetExternalHost returns the ExternalHost field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetExternalHost() string { + if o == nil || IsNil(o.ExternalHost) { + var ret string + return ret + } + return *o.ExternalHost +} + +// GetExternalHostOk returns a tuple with the ExternalHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetExternalHostOk() (*string, bool) { + if o == nil || IsNil(o.ExternalHost) { + return nil, false + } + return o.ExternalHost, true +} + +// HasExternalHost returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasExternalHost() bool { + if o != nil && !IsNil(o.ExternalHost) { + return true + } + + return false +} + +// SetExternalHost gets a reference to the given string and assigns it to the ExternalHost field. +func (o *PatchedProxyProviderRequest) SetExternalHost(v string) { + o.ExternalHost = &v +} + +// GetInternalHostSslValidation returns the InternalHostSslValidation field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetInternalHostSslValidation() bool { + if o == nil || IsNil(o.InternalHostSslValidation) { + var ret bool + return ret + } + return *o.InternalHostSslValidation +} + +// GetInternalHostSslValidationOk returns a tuple with the InternalHostSslValidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetInternalHostSslValidationOk() (*bool, bool) { + if o == nil || IsNil(o.InternalHostSslValidation) { + return nil, false + } + return o.InternalHostSslValidation, true +} + +// HasInternalHostSslValidation returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasInternalHostSslValidation() bool { + if o != nil && !IsNil(o.InternalHostSslValidation) { + return true + } + + return false +} + +// SetInternalHostSslValidation gets a reference to the given bool and assigns it to the InternalHostSslValidation field. +func (o *PatchedProxyProviderRequest) SetInternalHostSslValidation(v bool) { + o.InternalHostSslValidation = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedProxyProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedProxyProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *PatchedProxyProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *PatchedProxyProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *PatchedProxyProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetSkipPathRegex returns the SkipPathRegex field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetSkipPathRegex() string { + if o == nil || IsNil(o.SkipPathRegex) { + var ret string + return ret + } + return *o.SkipPathRegex +} + +// GetSkipPathRegexOk returns a tuple with the SkipPathRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetSkipPathRegexOk() (*string, bool) { + if o == nil || IsNil(o.SkipPathRegex) { + return nil, false + } + return o.SkipPathRegex, true +} + +// HasSkipPathRegex returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasSkipPathRegex() bool { + if o != nil && !IsNil(o.SkipPathRegex) { + return true + } + + return false +} + +// SetSkipPathRegex gets a reference to the given string and assigns it to the SkipPathRegex field. +func (o *PatchedProxyProviderRequest) SetSkipPathRegex(v string) { + o.SkipPathRegex = &v +} + +// GetBasicAuthEnabled returns the BasicAuthEnabled field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetBasicAuthEnabled() bool { + if o == nil || IsNil(o.BasicAuthEnabled) { + var ret bool + return ret + } + return *o.BasicAuthEnabled +} + +// GetBasicAuthEnabledOk returns a tuple with the BasicAuthEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetBasicAuthEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BasicAuthEnabled) { + return nil, false + } + return o.BasicAuthEnabled, true +} + +// HasBasicAuthEnabled returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasBasicAuthEnabled() bool { + if o != nil && !IsNil(o.BasicAuthEnabled) { + return true + } + + return false +} + +// SetBasicAuthEnabled gets a reference to the given bool and assigns it to the BasicAuthEnabled field. +func (o *PatchedProxyProviderRequest) SetBasicAuthEnabled(v bool) { + o.BasicAuthEnabled = &v +} + +// GetBasicAuthPasswordAttribute returns the BasicAuthPasswordAttribute field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetBasicAuthPasswordAttribute() string { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + var ret string + return ret + } + return *o.BasicAuthPasswordAttribute +} + +// GetBasicAuthPasswordAttributeOk returns a tuple with the BasicAuthPasswordAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetBasicAuthPasswordAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + return nil, false + } + return o.BasicAuthPasswordAttribute, true +} + +// HasBasicAuthPasswordAttribute returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasBasicAuthPasswordAttribute() bool { + if o != nil && !IsNil(o.BasicAuthPasswordAttribute) { + return true + } + + return false +} + +// SetBasicAuthPasswordAttribute gets a reference to the given string and assigns it to the BasicAuthPasswordAttribute field. +func (o *PatchedProxyProviderRequest) SetBasicAuthPasswordAttribute(v string) { + o.BasicAuthPasswordAttribute = &v +} + +// GetBasicAuthUserAttribute returns the BasicAuthUserAttribute field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetBasicAuthUserAttribute() string { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + var ret string + return ret + } + return *o.BasicAuthUserAttribute +} + +// GetBasicAuthUserAttributeOk returns a tuple with the BasicAuthUserAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetBasicAuthUserAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + return nil, false + } + return o.BasicAuthUserAttribute, true +} + +// HasBasicAuthUserAttribute returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasBasicAuthUserAttribute() bool { + if o != nil && !IsNil(o.BasicAuthUserAttribute) { + return true + } + + return false +} + +// SetBasicAuthUserAttribute gets a reference to the given string and assigns it to the BasicAuthUserAttribute field. +func (o *PatchedProxyProviderRequest) SetBasicAuthUserAttribute(v string) { + o.BasicAuthUserAttribute = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetMode() ProxyMode { + if o == nil || IsNil(o.Mode) { + var ret ProxyMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetModeOk() (*ProxyMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ProxyMode and assigns it to the Mode field. +func (o *PatchedProxyProviderRequest) SetMode(v ProxyMode) { + o.Mode = &v +} + +// GetInterceptHeaderAuth returns the InterceptHeaderAuth field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetInterceptHeaderAuth() bool { + if o == nil || IsNil(o.InterceptHeaderAuth) { + var ret bool + return ret + } + return *o.InterceptHeaderAuth +} + +// GetInterceptHeaderAuthOk returns a tuple with the InterceptHeaderAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetInterceptHeaderAuthOk() (*bool, bool) { + if o == nil || IsNil(o.InterceptHeaderAuth) { + return nil, false + } + return o.InterceptHeaderAuth, true +} + +// HasInterceptHeaderAuth returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasInterceptHeaderAuth() bool { + if o != nil && !IsNil(o.InterceptHeaderAuth) { + return true + } + + return false +} + +// SetInterceptHeaderAuth gets a reference to the given bool and assigns it to the InterceptHeaderAuth field. +func (o *PatchedProxyProviderRequest) SetInterceptHeaderAuth(v bool) { + o.InterceptHeaderAuth = &v +} + +// GetCookieDomain returns the CookieDomain field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetCookieDomain() string { + if o == nil || IsNil(o.CookieDomain) { + var ret string + return ret + } + return *o.CookieDomain +} + +// GetCookieDomainOk returns a tuple with the CookieDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetCookieDomainOk() (*string, bool) { + if o == nil || IsNil(o.CookieDomain) { + return nil, false + } + return o.CookieDomain, true +} + +// HasCookieDomain returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasCookieDomain() bool { + if o != nil && !IsNil(o.CookieDomain) { + return true + } + + return false +} + +// SetCookieDomain gets a reference to the given string and assigns it to the CookieDomain field. +func (o *PatchedProxyProviderRequest) SetCookieDomain(v string) { + o.CookieDomain = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *PatchedProxyProviderRequest) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *PatchedProxyProviderRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *PatchedProxyProviderRequest) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *PatchedProxyProviderRequest) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedProxyProviderRequest) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *PatchedProxyProviderRequest) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *PatchedProxyProviderRequest) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +func (o PatchedProxyProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedProxyProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.InternalHost) { + toSerialize["internal_host"] = o.InternalHost + } + if !IsNil(o.ExternalHost) { + toSerialize["external_host"] = o.ExternalHost + } + if !IsNil(o.InternalHostSslValidation) { + toSerialize["internal_host_ssl_validation"] = o.InternalHostSslValidation + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.SkipPathRegex) { + toSerialize["skip_path_regex"] = o.SkipPathRegex + } + if !IsNil(o.BasicAuthEnabled) { + toSerialize["basic_auth_enabled"] = o.BasicAuthEnabled + } + if !IsNil(o.BasicAuthPasswordAttribute) { + toSerialize["basic_auth_password_attribute"] = o.BasicAuthPasswordAttribute + } + if !IsNil(o.BasicAuthUserAttribute) { + toSerialize["basic_auth_user_attribute"] = o.BasicAuthUserAttribute + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.InterceptHeaderAuth) { + toSerialize["intercept_header_auth"] = o.InterceptHeaderAuth + } + if !IsNil(o.CookieDomain) { + toSerialize["cookie_domain"] = o.CookieDomain + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedProxyProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedProxyProviderRequest := _PatchedProxyProviderRequest{} + + err = json.Unmarshal(data, &varPatchedProxyProviderRequest) + + if err != nil { + return err + } + + *o = PatchedProxyProviderRequest(varPatchedProxyProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "internal_host") + delete(additionalProperties, "external_host") + delete(additionalProperties, "internal_host_ssl_validation") + delete(additionalProperties, "certificate") + delete(additionalProperties, "skip_path_regex") + delete(additionalProperties, "basic_auth_enabled") + delete(additionalProperties, "basic_auth_password_attribute") + delete(additionalProperties, "basic_auth_user_attribute") + delete(additionalProperties, "mode") + delete(additionalProperties, "intercept_header_auth") + delete(additionalProperties, "cookie_domain") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedProxyProviderRequest struct { + value *PatchedProxyProviderRequest + isSet bool +} + +func (v NullablePatchedProxyProviderRequest) Get() *PatchedProxyProviderRequest { + return v.value +} + +func (v *NullablePatchedProxyProviderRequest) Set(val *PatchedProxyProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedProxyProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedProxyProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedProxyProviderRequest(val *PatchedProxyProviderRequest) *NullablePatchedProxyProviderRequest { + return &NullablePatchedProxyProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedProxyProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedProxyProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_rac_property_mapping_request.go b/packages/client-go/model_patched_rac_property_mapping_request.go new file mode 100644 index 0000000000..2a7a1d198b --- /dev/null +++ b/packages/client-go/model_patched_rac_property_mapping_request.go @@ -0,0 +1,277 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRACPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRACPropertyMappingRequest{} + +// PatchedRACPropertyMappingRequest RACPropertyMapping Serializer +type PatchedRACPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + StaticSettings map[string]interface{} `json:"static_settings,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRACPropertyMappingRequest PatchedRACPropertyMappingRequest + +// NewPatchedRACPropertyMappingRequest instantiates a new PatchedRACPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRACPropertyMappingRequest() *PatchedRACPropertyMappingRequest { + this := PatchedRACPropertyMappingRequest{} + return &this +} + +// NewPatchedRACPropertyMappingRequestWithDefaults instantiates a new PatchedRACPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRACPropertyMappingRequestWithDefaults() *PatchedRACPropertyMappingRequest { + this := PatchedRACPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRACPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRACPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedRACPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedRACPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedRACPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedRACPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRACPropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRACPropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRACPropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedRACPropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedRACPropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedRACPropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +// GetStaticSettings returns the StaticSettings field value if set, zero value otherwise. +func (o *PatchedRACPropertyMappingRequest) GetStaticSettings() map[string]interface{} { + if o == nil || IsNil(o.StaticSettings) { + var ret map[string]interface{} + return ret + } + return o.StaticSettings +} + +// GetStaticSettingsOk returns a tuple with the StaticSettings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACPropertyMappingRequest) GetStaticSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.StaticSettings) { + return map[string]interface{}{}, false + } + return o.StaticSettings, true +} + +// HasStaticSettings returns a boolean if a field has been set. +func (o *PatchedRACPropertyMappingRequest) HasStaticSettings() bool { + if o != nil && !IsNil(o.StaticSettings) { + return true + } + + return false +} + +// SetStaticSettings gets a reference to the given map[string]interface{} and assigns it to the StaticSettings field. +func (o *PatchedRACPropertyMappingRequest) SetStaticSettings(v map[string]interface{}) { + o.StaticSettings = v +} + +func (o PatchedRACPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRACPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + if !IsNil(o.StaticSettings) { + toSerialize["static_settings"] = o.StaticSettings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRACPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRACPropertyMappingRequest := _PatchedRACPropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedRACPropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedRACPropertyMappingRequest(varPatchedRACPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "static_settings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRACPropertyMappingRequest struct { + value *PatchedRACPropertyMappingRequest + isSet bool +} + +func (v NullablePatchedRACPropertyMappingRequest) Get() *PatchedRACPropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedRACPropertyMappingRequest) Set(val *PatchedRACPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRACPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRACPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRACPropertyMappingRequest(val *PatchedRACPropertyMappingRequest) *NullablePatchedRACPropertyMappingRequest { + return &NullablePatchedRACPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedRACPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRACPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_rac_provider_request.go b/packages/client-go/model_patched_rac_provider_request.go new file mode 100644 index 0000000000..5fe04f8d61 --- /dev/null +++ b/packages/client-go/model_patched_rac_provider_request.go @@ -0,0 +1,391 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRACProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRACProviderRequest{} + +// PatchedRACProviderRequest RACProvider Serializer +type PatchedRACProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + Settings map[string]interface{} `json:"settings,omitempty"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + ConnectionExpiry *string `json:"connection_expiry,omitempty"` + // When set to true, connection tokens will be deleted upon disconnect. + DeleteTokenOnDisconnect *bool `json:"delete_token_on_disconnect,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRACProviderRequest PatchedRACProviderRequest + +// NewPatchedRACProviderRequest instantiates a new PatchedRACProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRACProviderRequest() *PatchedRACProviderRequest { + this := PatchedRACProviderRequest{} + return &this +} + +// NewPatchedRACProviderRequestWithDefaults instantiates a new PatchedRACProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRACProviderRequestWithDefaults() *PatchedRACProviderRequest { + this := PatchedRACProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRACProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRACProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRACProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedRACProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedRACProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedRACProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedRACProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedRACProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *PatchedRACProviderRequest) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetConnectionExpiry returns the ConnectionExpiry field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetConnectionExpiry() string { + if o == nil || IsNil(o.ConnectionExpiry) { + var ret string + return ret + } + return *o.ConnectionExpiry +} + +// GetConnectionExpiryOk returns a tuple with the ConnectionExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetConnectionExpiryOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionExpiry) { + return nil, false + } + return o.ConnectionExpiry, true +} + +// HasConnectionExpiry returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasConnectionExpiry() bool { + if o != nil && !IsNil(o.ConnectionExpiry) { + return true + } + + return false +} + +// SetConnectionExpiry gets a reference to the given string and assigns it to the ConnectionExpiry field. +func (o *PatchedRACProviderRequest) SetConnectionExpiry(v string) { + o.ConnectionExpiry = &v +} + +// GetDeleteTokenOnDisconnect returns the DeleteTokenOnDisconnect field value if set, zero value otherwise. +func (o *PatchedRACProviderRequest) GetDeleteTokenOnDisconnect() bool { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + var ret bool + return ret + } + return *o.DeleteTokenOnDisconnect +} + +// GetDeleteTokenOnDisconnectOk returns a tuple with the DeleteTokenOnDisconnect field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRACProviderRequest) GetDeleteTokenOnDisconnectOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + return nil, false + } + return o.DeleteTokenOnDisconnect, true +} + +// HasDeleteTokenOnDisconnect returns a boolean if a field has been set. +func (o *PatchedRACProviderRequest) HasDeleteTokenOnDisconnect() bool { + if o != nil && !IsNil(o.DeleteTokenOnDisconnect) { + return true + } + + return false +} + +// SetDeleteTokenOnDisconnect gets a reference to the given bool and assigns it to the DeleteTokenOnDisconnect field. +func (o *PatchedRACProviderRequest) SetDeleteTokenOnDisconnect(v bool) { + o.DeleteTokenOnDisconnect = &v +} + +func (o PatchedRACProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRACProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + if !IsNil(o.ConnectionExpiry) { + toSerialize["connection_expiry"] = o.ConnectionExpiry + } + if !IsNil(o.DeleteTokenOnDisconnect) { + toSerialize["delete_token_on_disconnect"] = o.DeleteTokenOnDisconnect + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRACProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRACProviderRequest := _PatchedRACProviderRequest{} + + err = json.Unmarshal(data, &varPatchedRACProviderRequest) + + if err != nil { + return err + } + + *o = PatchedRACProviderRequest(varPatchedRACProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "settings") + delete(additionalProperties, "connection_expiry") + delete(additionalProperties, "delete_token_on_disconnect") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRACProviderRequest struct { + value *PatchedRACProviderRequest + isSet bool +} + +func (v NullablePatchedRACProviderRequest) Get() *PatchedRACProviderRequest { + return v.value +} + +func (v *NullablePatchedRACProviderRequest) Set(val *PatchedRACProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRACProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRACProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRACProviderRequest(val *PatchedRACProviderRequest) *NullablePatchedRACProviderRequest { + return &NullablePatchedRACProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedRACProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRACProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_radius_provider_property_mapping_request.go b/packages/client-go/model_patched_radius_provider_property_mapping_request.go new file mode 100644 index 0000000000..fc00afe34f --- /dev/null +++ b/packages/client-go/model_patched_radius_provider_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRadiusProviderPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRadiusProviderPropertyMappingRequest{} + +// PatchedRadiusProviderPropertyMappingRequest RadiusProviderPropertyMapping Serializer +type PatchedRadiusProviderPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRadiusProviderPropertyMappingRequest PatchedRadiusProviderPropertyMappingRequest + +// NewPatchedRadiusProviderPropertyMappingRequest instantiates a new PatchedRadiusProviderPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRadiusProviderPropertyMappingRequest() *PatchedRadiusProviderPropertyMappingRequest { + this := PatchedRadiusProviderPropertyMappingRequest{} + return &this +} + +// NewPatchedRadiusProviderPropertyMappingRequestWithDefaults instantiates a new PatchedRadiusProviderPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRadiusProviderPropertyMappingRequestWithDefaults() *PatchedRadiusProviderPropertyMappingRequest { + this := PatchedRadiusProviderPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRadiusProviderPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRadiusProviderPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedRadiusProviderPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedRadiusProviderPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedRadiusProviderPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedRadiusProviderPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRadiusProviderPropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRadiusProviderPropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRadiusProviderPropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedRadiusProviderPropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedRadiusProviderPropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedRadiusProviderPropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedRadiusProviderPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRadiusProviderPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRadiusProviderPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRadiusProviderPropertyMappingRequest := _PatchedRadiusProviderPropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedRadiusProviderPropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedRadiusProviderPropertyMappingRequest(varPatchedRadiusProviderPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRadiusProviderPropertyMappingRequest struct { + value *PatchedRadiusProviderPropertyMappingRequest + isSet bool +} + +func (v NullablePatchedRadiusProviderPropertyMappingRequest) Get() *PatchedRadiusProviderPropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedRadiusProviderPropertyMappingRequest) Set(val *PatchedRadiusProviderPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRadiusProviderPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRadiusProviderPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRadiusProviderPropertyMappingRequest(val *PatchedRadiusProviderPropertyMappingRequest) *NullablePatchedRadiusProviderPropertyMappingRequest { + return &NullablePatchedRadiusProviderPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedRadiusProviderPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRadiusProviderPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_radius_provider_request.go b/packages/client-go/model_patched_radius_provider_request.go new file mode 100644 index 0000000000..58756450cb --- /dev/null +++ b/packages/client-go/model_patched_radius_provider_request.go @@ -0,0 +1,478 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRadiusProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRadiusProviderRequest{} + +// PatchedRadiusProviderRequest RadiusProvider Serializer +type PatchedRadiusProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + ClientNetworks *string `json:"client_networks,omitempty"` + // Shared secret between clients and server to hash packets. + SharedSecret *string `json:"shared_secret,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRadiusProviderRequest PatchedRadiusProviderRequest + +// NewPatchedRadiusProviderRequest instantiates a new PatchedRadiusProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRadiusProviderRequest() *PatchedRadiusProviderRequest { + this := PatchedRadiusProviderRequest{} + return &this +} + +// NewPatchedRadiusProviderRequestWithDefaults instantiates a new PatchedRadiusProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRadiusProviderRequestWithDefaults() *PatchedRadiusProviderRequest { + this := PatchedRadiusProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRadiusProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRadiusProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRadiusProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedRadiusProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedRadiusProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedRadiusProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedRadiusProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedRadiusProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedRadiusProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetClientNetworks returns the ClientNetworks field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetClientNetworks() string { + if o == nil || IsNil(o.ClientNetworks) { + var ret string + return ret + } + return *o.ClientNetworks +} + +// GetClientNetworksOk returns a tuple with the ClientNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetClientNetworksOk() (*string, bool) { + if o == nil || IsNil(o.ClientNetworks) { + return nil, false + } + return o.ClientNetworks, true +} + +// HasClientNetworks returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasClientNetworks() bool { + if o != nil && !IsNil(o.ClientNetworks) { + return true + } + + return false +} + +// SetClientNetworks gets a reference to the given string and assigns it to the ClientNetworks field. +func (o *PatchedRadiusProviderRequest) SetClientNetworks(v string) { + o.ClientNetworks = &v +} + +// GetSharedSecret returns the SharedSecret field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetSharedSecret() string { + if o == nil || IsNil(o.SharedSecret) { + var ret string + return ret + } + return *o.SharedSecret +} + +// GetSharedSecretOk returns a tuple with the SharedSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetSharedSecretOk() (*string, bool) { + if o == nil || IsNil(o.SharedSecret) { + return nil, false + } + return o.SharedSecret, true +} + +// HasSharedSecret returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasSharedSecret() bool { + if o != nil && !IsNil(o.SharedSecret) { + return true + } + + return false +} + +// SetSharedSecret gets a reference to the given string and assigns it to the SharedSecret field. +func (o *PatchedRadiusProviderRequest) SetSharedSecret(v string) { + o.SharedSecret = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *PatchedRadiusProviderRequest) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRadiusProviderRequest) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *PatchedRadiusProviderRequest) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRadiusProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRadiusProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *PatchedRadiusProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *PatchedRadiusProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *PatchedRadiusProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *PatchedRadiusProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +func (o PatchedRadiusProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRadiusProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.ClientNetworks) { + toSerialize["client_networks"] = o.ClientNetworks + } + if !IsNil(o.SharedSecret) { + toSerialize["shared_secret"] = o.SharedSecret + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRadiusProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRadiusProviderRequest := _PatchedRadiusProviderRequest{} + + err = json.Unmarshal(data, &varPatchedRadiusProviderRequest) + + if err != nil { + return err + } + + *o = PatchedRadiusProviderRequest(varPatchedRadiusProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "client_networks") + delete(additionalProperties, "shared_secret") + delete(additionalProperties, "mfa_support") + delete(additionalProperties, "certificate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRadiusProviderRequest struct { + value *PatchedRadiusProviderRequest + isSet bool +} + +func (v NullablePatchedRadiusProviderRequest) Get() *PatchedRadiusProviderRequest { + return v.value +} + +func (v *NullablePatchedRadiusProviderRequest) Set(val *PatchedRadiusProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRadiusProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRadiusProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRadiusProviderRequest(val *PatchedRadiusProviderRequest) *NullablePatchedRadiusProviderRequest { + return &NullablePatchedRadiusProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedRadiusProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRadiusProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_redirect_stage_request.go b/packages/client-go/model_patched_redirect_stage_request.go new file mode 100644 index 0000000000..871f7c1d6d --- /dev/null +++ b/packages/client-go/model_patched_redirect_stage_request.go @@ -0,0 +1,313 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRedirectStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRedirectStageRequest{} + +// PatchedRedirectStageRequest RedirectStage Serializer +type PatchedRedirectStageRequest struct { + Name *string `json:"name,omitempty"` + KeepContext *bool `json:"keep_context,omitempty"` + Mode *RedirectStageModeEnum `json:"mode,omitempty"` + TargetStatic *string `json:"target_static,omitempty"` + TargetFlow NullableString `json:"target_flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRedirectStageRequest PatchedRedirectStageRequest + +// NewPatchedRedirectStageRequest instantiates a new PatchedRedirectStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRedirectStageRequest() *PatchedRedirectStageRequest { + this := PatchedRedirectStageRequest{} + return &this +} + +// NewPatchedRedirectStageRequestWithDefaults instantiates a new PatchedRedirectStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRedirectStageRequestWithDefaults() *PatchedRedirectStageRequest { + this := PatchedRedirectStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRedirectStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRedirectStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRedirectStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRedirectStageRequest) SetName(v string) { + o.Name = &v +} + +// GetKeepContext returns the KeepContext field value if set, zero value otherwise. +func (o *PatchedRedirectStageRequest) GetKeepContext() bool { + if o == nil || IsNil(o.KeepContext) { + var ret bool + return ret + } + return *o.KeepContext +} + +// GetKeepContextOk returns a tuple with the KeepContext field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRedirectStageRequest) GetKeepContextOk() (*bool, bool) { + if o == nil || IsNil(o.KeepContext) { + return nil, false + } + return o.KeepContext, true +} + +// HasKeepContext returns a boolean if a field has been set. +func (o *PatchedRedirectStageRequest) HasKeepContext() bool { + if o != nil && !IsNil(o.KeepContext) { + return true + } + + return false +} + +// SetKeepContext gets a reference to the given bool and assigns it to the KeepContext field. +func (o *PatchedRedirectStageRequest) SetKeepContext(v bool) { + o.KeepContext = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *PatchedRedirectStageRequest) GetMode() RedirectStageModeEnum { + if o == nil || IsNil(o.Mode) { + var ret RedirectStageModeEnum + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRedirectStageRequest) GetModeOk() (*RedirectStageModeEnum, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *PatchedRedirectStageRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given RedirectStageModeEnum and assigns it to the Mode field. +func (o *PatchedRedirectStageRequest) SetMode(v RedirectStageModeEnum) { + o.Mode = &v +} + +// GetTargetStatic returns the TargetStatic field value if set, zero value otherwise. +func (o *PatchedRedirectStageRequest) GetTargetStatic() string { + if o == nil || IsNil(o.TargetStatic) { + var ret string + return ret + } + return *o.TargetStatic +} + +// GetTargetStaticOk returns a tuple with the TargetStatic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRedirectStageRequest) GetTargetStaticOk() (*string, bool) { + if o == nil || IsNil(o.TargetStatic) { + return nil, false + } + return o.TargetStatic, true +} + +// HasTargetStatic returns a boolean if a field has been set. +func (o *PatchedRedirectStageRequest) HasTargetStatic() bool { + if o != nil && !IsNil(o.TargetStatic) { + return true + } + + return false +} + +// SetTargetStatic gets a reference to the given string and assigns it to the TargetStatic field. +func (o *PatchedRedirectStageRequest) SetTargetStatic(v string) { + o.TargetStatic = &v +} + +// GetTargetFlow returns the TargetFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedRedirectStageRequest) GetTargetFlow() string { + if o == nil || IsNil(o.TargetFlow.Get()) { + var ret string + return ret + } + return *o.TargetFlow.Get() +} + +// GetTargetFlowOk returns a tuple with the TargetFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedRedirectStageRequest) GetTargetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TargetFlow.Get(), o.TargetFlow.IsSet() +} + +// HasTargetFlow returns a boolean if a field has been set. +func (o *PatchedRedirectStageRequest) HasTargetFlow() bool { + if o != nil && o.TargetFlow.IsSet() { + return true + } + + return false +} + +// SetTargetFlow gets a reference to the given NullableString and assigns it to the TargetFlow field. +func (o *PatchedRedirectStageRequest) SetTargetFlow(v string) { + o.TargetFlow.Set(&v) +} + +// SetTargetFlowNil sets the value for TargetFlow to be an explicit nil +func (o *PatchedRedirectStageRequest) SetTargetFlowNil() { + o.TargetFlow.Set(nil) +} + +// UnsetTargetFlow ensures that no value is present for TargetFlow, not even an explicit nil +func (o *PatchedRedirectStageRequest) UnsetTargetFlow() { + o.TargetFlow.Unset() +} + +func (o PatchedRedirectStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRedirectStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.KeepContext) { + toSerialize["keep_context"] = o.KeepContext + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.TargetStatic) { + toSerialize["target_static"] = o.TargetStatic + } + if o.TargetFlow.IsSet() { + toSerialize["target_flow"] = o.TargetFlow.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRedirectStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRedirectStageRequest := _PatchedRedirectStageRequest{} + + err = json.Unmarshal(data, &varPatchedRedirectStageRequest) + + if err != nil { + return err + } + + *o = PatchedRedirectStageRequest(varPatchedRedirectStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "keep_context") + delete(additionalProperties, "mode") + delete(additionalProperties, "target_static") + delete(additionalProperties, "target_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRedirectStageRequest struct { + value *PatchedRedirectStageRequest + isSet bool +} + +func (v NullablePatchedRedirectStageRequest) Get() *PatchedRedirectStageRequest { + return v.value +} + +func (v *NullablePatchedRedirectStageRequest) Set(val *PatchedRedirectStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRedirectStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRedirectStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRedirectStageRequest(val *PatchedRedirectStageRequest) *NullablePatchedRedirectStageRequest { + return &NullablePatchedRedirectStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedRedirectStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRedirectStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_reputation_policy_request.go b/packages/client-go/model_patched_reputation_policy_request.go new file mode 100644 index 0000000000..1acd2c0bd4 --- /dev/null +++ b/packages/client-go/model_patched_reputation_policy_request.go @@ -0,0 +1,303 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedReputationPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedReputationPolicyRequest{} + +// PatchedReputationPolicyRequest Reputation Policy Serializer +type PatchedReputationPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + CheckIp *bool `json:"check_ip,omitempty"` + CheckUsername *bool `json:"check_username,omitempty"` + Threshold *int32 `json:"threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedReputationPolicyRequest PatchedReputationPolicyRequest + +// NewPatchedReputationPolicyRequest instantiates a new PatchedReputationPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedReputationPolicyRequest() *PatchedReputationPolicyRequest { + this := PatchedReputationPolicyRequest{} + return &this +} + +// NewPatchedReputationPolicyRequestWithDefaults instantiates a new PatchedReputationPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedReputationPolicyRequestWithDefaults() *PatchedReputationPolicyRequest { + this := PatchedReputationPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedReputationPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedReputationPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedReputationPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedReputationPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedReputationPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedReputationPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedReputationPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedReputationPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetCheckIp returns the CheckIp field value if set, zero value otherwise. +func (o *PatchedReputationPolicyRequest) GetCheckIp() bool { + if o == nil || IsNil(o.CheckIp) { + var ret bool + return ret + } + return *o.CheckIp +} + +// GetCheckIpOk returns a tuple with the CheckIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedReputationPolicyRequest) GetCheckIpOk() (*bool, bool) { + if o == nil || IsNil(o.CheckIp) { + return nil, false + } + return o.CheckIp, true +} + +// HasCheckIp returns a boolean if a field has been set. +func (o *PatchedReputationPolicyRequest) HasCheckIp() bool { + if o != nil && !IsNil(o.CheckIp) { + return true + } + + return false +} + +// SetCheckIp gets a reference to the given bool and assigns it to the CheckIp field. +func (o *PatchedReputationPolicyRequest) SetCheckIp(v bool) { + o.CheckIp = &v +} + +// GetCheckUsername returns the CheckUsername field value if set, zero value otherwise. +func (o *PatchedReputationPolicyRequest) GetCheckUsername() bool { + if o == nil || IsNil(o.CheckUsername) { + var ret bool + return ret + } + return *o.CheckUsername +} + +// GetCheckUsernameOk returns a tuple with the CheckUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedReputationPolicyRequest) GetCheckUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.CheckUsername) { + return nil, false + } + return o.CheckUsername, true +} + +// HasCheckUsername returns a boolean if a field has been set. +func (o *PatchedReputationPolicyRequest) HasCheckUsername() bool { + if o != nil && !IsNil(o.CheckUsername) { + return true + } + + return false +} + +// SetCheckUsername gets a reference to the given bool and assigns it to the CheckUsername field. +func (o *PatchedReputationPolicyRequest) SetCheckUsername(v bool) { + o.CheckUsername = &v +} + +// GetThreshold returns the Threshold field value if set, zero value otherwise. +func (o *PatchedReputationPolicyRequest) GetThreshold() int32 { + if o == nil || IsNil(o.Threshold) { + var ret int32 + return ret + } + return *o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedReputationPolicyRequest) GetThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.Threshold) { + return nil, false + } + return o.Threshold, true +} + +// HasThreshold returns a boolean if a field has been set. +func (o *PatchedReputationPolicyRequest) HasThreshold() bool { + if o != nil && !IsNil(o.Threshold) { + return true + } + + return false +} + +// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. +func (o *PatchedReputationPolicyRequest) SetThreshold(v int32) { + o.Threshold = &v +} + +func (o PatchedReputationPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedReputationPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.CheckIp) { + toSerialize["check_ip"] = o.CheckIp + } + if !IsNil(o.CheckUsername) { + toSerialize["check_username"] = o.CheckUsername + } + if !IsNil(o.Threshold) { + toSerialize["threshold"] = o.Threshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedReputationPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedReputationPolicyRequest := _PatchedReputationPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedReputationPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedReputationPolicyRequest(varPatchedReputationPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "check_ip") + delete(additionalProperties, "check_username") + delete(additionalProperties, "threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedReputationPolicyRequest struct { + value *PatchedReputationPolicyRequest + isSet bool +} + +func (v NullablePatchedReputationPolicyRequest) Get() *PatchedReputationPolicyRequest { + return v.value +} + +func (v *NullablePatchedReputationPolicyRequest) Set(val *PatchedReputationPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedReputationPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedReputationPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedReputationPolicyRequest(val *PatchedReputationPolicyRequest) *NullablePatchedReputationPolicyRequest { + return &NullablePatchedReputationPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedReputationPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedReputationPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_role_request.go b/packages/client-go/model_patched_role_request.go new file mode 100644 index 0000000000..6aeb33f992 --- /dev/null +++ b/packages/client-go/model_patched_role_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedRoleRequest{} + +// PatchedRoleRequest Role serializer +type PatchedRoleRequest struct { + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedRoleRequest PatchedRoleRequest + +// NewPatchedRoleRequest instantiates a new PatchedRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedRoleRequest() *PatchedRoleRequest { + this := PatchedRoleRequest{} + return &this +} + +// NewPatchedRoleRequestWithDefaults instantiates a new PatchedRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedRoleRequestWithDefaults() *PatchedRoleRequest { + this := PatchedRoleRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedRoleRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedRoleRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedRoleRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedRoleRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedRoleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedRoleRequest := _PatchedRoleRequest{} + + err = json.Unmarshal(data, &varPatchedRoleRequest) + + if err != nil { + return err + } + + *o = PatchedRoleRequest(varPatchedRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedRoleRequest struct { + value *PatchedRoleRequest + isSet bool +} + +func (v NullablePatchedRoleRequest) Get() *PatchedRoleRequest { + return v.value +} + +func (v *NullablePatchedRoleRequest) Set(val *PatchedRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedRoleRequest(val *PatchedRoleRequest) *NullablePatchedRoleRequest { + return &NullablePatchedRoleRequest{value: val, isSet: true} +} + +func (v NullablePatchedRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_saml_property_mapping_request.go b/packages/client-go/model_patched_saml_property_mapping_request.go new file mode 100644 index 0000000000..4bf4ddbaab --- /dev/null +++ b/packages/client-go/model_patched_saml_property_mapping_request.go @@ -0,0 +1,325 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSAMLPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSAMLPropertyMappingRequest{} + +// PatchedSAMLPropertyMappingRequest SAMLPropertyMapping Serializer +type PatchedSAMLPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + SamlName *string `json:"saml_name,omitempty"` + FriendlyName NullableString `json:"friendly_name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSAMLPropertyMappingRequest PatchedSAMLPropertyMappingRequest + +// NewPatchedSAMLPropertyMappingRequest instantiates a new PatchedSAMLPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSAMLPropertyMappingRequest() *PatchedSAMLPropertyMappingRequest { + this := PatchedSAMLPropertyMappingRequest{} + return &this +} + +// NewPatchedSAMLPropertyMappingRequestWithDefaults instantiates a new PatchedSAMLPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSAMLPropertyMappingRequestWithDefaults() *PatchedSAMLPropertyMappingRequest { + this := PatchedSAMLPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedSAMLPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedSAMLPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedSAMLPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedSAMLPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSAMLPropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSAMLPropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSAMLPropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedSAMLPropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedSAMLPropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedSAMLPropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +// GetSamlName returns the SamlName field value if set, zero value otherwise. +func (o *PatchedSAMLPropertyMappingRequest) GetSamlName() string { + if o == nil || IsNil(o.SamlName) { + var ret string + return ret + } + return *o.SamlName +} + +// GetSamlNameOk returns a tuple with the SamlName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLPropertyMappingRequest) GetSamlNameOk() (*string, bool) { + if o == nil || IsNil(o.SamlName) { + return nil, false + } + return o.SamlName, true +} + +// HasSamlName returns a boolean if a field has been set. +func (o *PatchedSAMLPropertyMappingRequest) HasSamlName() bool { + if o != nil && !IsNil(o.SamlName) { + return true + } + + return false +} + +// SetSamlName gets a reference to the given string and assigns it to the SamlName field. +func (o *PatchedSAMLPropertyMappingRequest) SetSamlName(v string) { + o.SamlName = &v +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLPropertyMappingRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName.Get()) { + var ret string + return ret + } + return *o.FriendlyName.Get() +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLPropertyMappingRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FriendlyName.Get(), o.FriendlyName.IsSet() +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *PatchedSAMLPropertyMappingRequest) HasFriendlyName() bool { + if o != nil && o.FriendlyName.IsSet() { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given NullableString and assigns it to the FriendlyName field. +func (o *PatchedSAMLPropertyMappingRequest) SetFriendlyName(v string) { + o.FriendlyName.Set(&v) +} + +// SetFriendlyNameNil sets the value for FriendlyName to be an explicit nil +func (o *PatchedSAMLPropertyMappingRequest) SetFriendlyNameNil() { + o.FriendlyName.Set(nil) +} + +// UnsetFriendlyName ensures that no value is present for FriendlyName, not even an explicit nil +func (o *PatchedSAMLPropertyMappingRequest) UnsetFriendlyName() { + o.FriendlyName.Unset() +} + +func (o PatchedSAMLPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSAMLPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + if !IsNil(o.SamlName) { + toSerialize["saml_name"] = o.SamlName + } + if o.FriendlyName.IsSet() { + toSerialize["friendly_name"] = o.FriendlyName.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSAMLPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSAMLPropertyMappingRequest := _PatchedSAMLPropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedSAMLPropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedSAMLPropertyMappingRequest(varPatchedSAMLPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "saml_name") + delete(additionalProperties, "friendly_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSAMLPropertyMappingRequest struct { + value *PatchedSAMLPropertyMappingRequest + isSet bool +} + +func (v NullablePatchedSAMLPropertyMappingRequest) Get() *PatchedSAMLPropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedSAMLPropertyMappingRequest) Set(val *PatchedSAMLPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSAMLPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSAMLPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSAMLPropertyMappingRequest(val *PatchedSAMLPropertyMappingRequest) *NullablePatchedSAMLPropertyMappingRequest { + return &NullablePatchedSAMLPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedSAMLPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSAMLPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_saml_provider_request.go b/packages/client-go/model_patched_saml_provider_request.go new file mode 100644 index 0000000000..c3cf05349d --- /dev/null +++ b/packages/client-go/model_patched_saml_provider_request.go @@ -0,0 +1,1237 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSAMLProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSAMLProviderRequest{} + +// PatchedSAMLProviderRequest SAMLProvider Serializer +type PatchedSAMLProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + AcsUrl *string `json:"acs_url,omitempty"` + // Single Logout Service URL where the logout response should be sent. + SlsUrl *string `json:"sls_url,omitempty"` + // Value of the audience restriction field of the assertion. When left empty, no audience restriction will be added. + Audience *string `json:"audience,omitempty"` + // Also known as EntityID + Issuer *string `json:"issuer,omitempty"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignResponse *bool `json:"sign_response,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + SignLogoutResponse *bool `json:"sign_logout_response,omitempty"` + // This determines how authentik sends the response back to the Service Provider. + SpBinding *SAMLBindingsEnum `json:"sp_binding,omitempty"` + // This determines how authentik sends the logout response back to the Service Provider. + SlsBinding *SAMLBindingsEnum `json:"sls_binding,omitempty"` + // Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in hidden iframes. Front-channel native uses your active browser tab to send post requests and redirect to providers. Back-channel sends logout requests directly from the server without user interaction (requires POST SLS binding). + LogoutMethod *SAMLLogoutMethods `json:"logout_method,omitempty"` + // Default relay_state value for IDP-initiated logins + DefaultRelayState *string `json:"default_relay_state,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSAMLProviderRequest PatchedSAMLProviderRequest + +// NewPatchedSAMLProviderRequest instantiates a new PatchedSAMLProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSAMLProviderRequest() *PatchedSAMLProviderRequest { + this := PatchedSAMLProviderRequest{} + return &this +} + +// NewPatchedSAMLProviderRequestWithDefaults instantiates a new PatchedSAMLProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSAMLProviderRequestWithDefaults() *PatchedSAMLProviderRequest { + this := PatchedSAMLProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSAMLProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedSAMLProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedSAMLProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedSAMLProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedSAMLProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetAcsUrl returns the AcsUrl field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetAcsUrl() string { + if o == nil || IsNil(o.AcsUrl) { + var ret string + return ret + } + return *o.AcsUrl +} + +// GetAcsUrlOk returns a tuple with the AcsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetAcsUrlOk() (*string, bool) { + if o == nil || IsNil(o.AcsUrl) { + return nil, false + } + return o.AcsUrl, true +} + +// HasAcsUrl returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAcsUrl() bool { + if o != nil && !IsNil(o.AcsUrl) { + return true + } + + return false +} + +// SetAcsUrl gets a reference to the given string and assigns it to the AcsUrl field. +func (o *PatchedSAMLProviderRequest) SetAcsUrl(v string) { + o.AcsUrl = &v +} + +// GetSlsUrl returns the SlsUrl field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSlsUrl() string { + if o == nil || IsNil(o.SlsUrl) { + var ret string + return ret + } + return *o.SlsUrl +} + +// GetSlsUrlOk returns a tuple with the SlsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSlsUrlOk() (*string, bool) { + if o == nil || IsNil(o.SlsUrl) { + return nil, false + } + return o.SlsUrl, true +} + +// HasSlsUrl returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSlsUrl() bool { + if o != nil && !IsNil(o.SlsUrl) { + return true + } + + return false +} + +// SetSlsUrl gets a reference to the given string and assigns it to the SlsUrl field. +func (o *PatchedSAMLProviderRequest) SetSlsUrl(v string) { + o.SlsUrl = &v +} + +// GetAudience returns the Audience field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetAudience() string { + if o == nil || IsNil(o.Audience) { + var ret string + return ret + } + return *o.Audience +} + +// GetAudienceOk returns a tuple with the Audience field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetAudienceOk() (*string, bool) { + if o == nil || IsNil(o.Audience) { + return nil, false + } + return o.Audience, true +} + +// HasAudience returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAudience() bool { + if o != nil && !IsNil(o.Audience) { + return true + } + + return false +} + +// SetAudience gets a reference to the given string and assigns it to the Audience field. +func (o *PatchedSAMLProviderRequest) SetAudience(v string) { + o.Audience = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *PatchedSAMLProviderRequest) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *PatchedSAMLProviderRequest) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *PatchedSAMLProviderRequest) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *PatchedSAMLProviderRequest) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *PatchedSAMLProviderRequest) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *PatchedSAMLProviderRequest) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *PatchedSAMLProviderRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *PatchedSAMLProviderRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *PatchedSAMLProviderRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *PatchedSAMLProviderRequest) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLProviderRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLProviderRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *PatchedSAMLProviderRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *PatchedSAMLProviderRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *PatchedSAMLProviderRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *PatchedSAMLProviderRequest) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignResponse returns the SignResponse field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSignResponse() bool { + if o == nil || IsNil(o.SignResponse) { + var ret bool + return ret + } + return *o.SignResponse +} + +// GetSignResponseOk returns a tuple with the SignResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSignResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignResponse) { + return nil, false + } + return o.SignResponse, true +} + +// HasSignResponse returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSignResponse() bool { + if o != nil && !IsNil(o.SignResponse) { + return true + } + + return false +} + +// SetSignResponse gets a reference to the given bool and assigns it to the SignResponse field. +func (o *PatchedSAMLProviderRequest) SetSignResponse(v bool) { + o.SignResponse = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *PatchedSAMLProviderRequest) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetSignLogoutResponse returns the SignLogoutResponse field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSignLogoutResponse() bool { + if o == nil || IsNil(o.SignLogoutResponse) { + var ret bool + return ret + } + return *o.SignLogoutResponse +} + +// GetSignLogoutResponseOk returns a tuple with the SignLogoutResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSignLogoutResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutResponse) { + return nil, false + } + return o.SignLogoutResponse, true +} + +// HasSignLogoutResponse returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSignLogoutResponse() bool { + if o != nil && !IsNil(o.SignLogoutResponse) { + return true + } + + return false +} + +// SetSignLogoutResponse gets a reference to the given bool and assigns it to the SignLogoutResponse field. +func (o *PatchedSAMLProviderRequest) SetSignLogoutResponse(v bool) { + o.SignLogoutResponse = &v +} + +// GetSpBinding returns the SpBinding field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSpBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SpBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SpBinding +} + +// GetSpBindingOk returns a tuple with the SpBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSpBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SpBinding) { + return nil, false + } + return o.SpBinding, true +} + +// HasSpBinding returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSpBinding() bool { + if o != nil && !IsNil(o.SpBinding) { + return true + } + + return false +} + +// SetSpBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SpBinding field. +func (o *PatchedSAMLProviderRequest) SetSpBinding(v SAMLBindingsEnum) { + o.SpBinding = &v +} + +// GetSlsBinding returns the SlsBinding field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetSlsBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SlsBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SlsBinding +} + +// GetSlsBindingOk returns a tuple with the SlsBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetSlsBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SlsBinding) { + return nil, false + } + return o.SlsBinding, true +} + +// HasSlsBinding returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasSlsBinding() bool { + if o != nil && !IsNil(o.SlsBinding) { + return true + } + + return false +} + +// SetSlsBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SlsBinding field. +func (o *PatchedSAMLProviderRequest) SetSlsBinding(v SAMLBindingsEnum) { + o.SlsBinding = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetLogoutMethod() SAMLLogoutMethods { + if o == nil || IsNil(o.LogoutMethod) { + var ret SAMLLogoutMethods + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetLogoutMethodOk() (*SAMLLogoutMethods, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given SAMLLogoutMethods and assigns it to the LogoutMethod field. +func (o *PatchedSAMLProviderRequest) SetLogoutMethod(v SAMLLogoutMethods) { + o.LogoutMethod = &v +} + +// GetDefaultRelayState returns the DefaultRelayState field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetDefaultRelayState() string { + if o == nil || IsNil(o.DefaultRelayState) { + var ret string + return ret + } + return *o.DefaultRelayState +} + +// GetDefaultRelayStateOk returns a tuple with the DefaultRelayState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetDefaultRelayStateOk() (*string, bool) { + if o == nil || IsNil(o.DefaultRelayState) { + return nil, false + } + return o.DefaultRelayState, true +} + +// HasDefaultRelayState returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasDefaultRelayState() bool { + if o != nil && !IsNil(o.DefaultRelayState) { + return true + } + + return false +} + +// SetDefaultRelayState gets a reference to the given string and assigns it to the DefaultRelayState field. +func (o *PatchedSAMLProviderRequest) SetDefaultRelayState(v string) { + o.DefaultRelayState = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *PatchedSAMLProviderRequest) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLProviderRequest) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *PatchedSAMLProviderRequest) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *PatchedSAMLProviderRequest) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +func (o PatchedSAMLProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSAMLProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.AcsUrl) { + toSerialize["acs_url"] = o.AcsUrl + } + if !IsNil(o.SlsUrl) { + toSerialize["sls_url"] = o.SlsUrl + } + if !IsNil(o.Audience) { + toSerialize["audience"] = o.Audience + } + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignResponse) { + toSerialize["sign_response"] = o.SignResponse + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.SignLogoutResponse) { + toSerialize["sign_logout_response"] = o.SignLogoutResponse + } + if !IsNil(o.SpBinding) { + toSerialize["sp_binding"] = o.SpBinding + } + if !IsNil(o.SlsBinding) { + toSerialize["sls_binding"] = o.SlsBinding + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.DefaultRelayState) { + toSerialize["default_relay_state"] = o.DefaultRelayState + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSAMLProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSAMLProviderRequest := _PatchedSAMLProviderRequest{} + + err = json.Unmarshal(data, &varPatchedSAMLProviderRequest) + + if err != nil { + return err + } + + *o = PatchedSAMLProviderRequest(varPatchedSAMLProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "acs_url") + delete(additionalProperties, "sls_url") + delete(additionalProperties, "audience") + delete(additionalProperties, "issuer") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_response") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "sign_logout_response") + delete(additionalProperties, "sp_binding") + delete(additionalProperties, "sls_binding") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "default_relay_state") + delete(additionalProperties, "default_name_id_policy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSAMLProviderRequest struct { + value *PatchedSAMLProviderRequest + isSet bool +} + +func (v NullablePatchedSAMLProviderRequest) Get() *PatchedSAMLProviderRequest { + return v.value +} + +func (v *NullablePatchedSAMLProviderRequest) Set(val *PatchedSAMLProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSAMLProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSAMLProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSAMLProviderRequest(val *PatchedSAMLProviderRequest) *NullablePatchedSAMLProviderRequest { + return &NullablePatchedSAMLProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedSAMLProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSAMLProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_saml_source_property_mapping_request.go b/packages/client-go/model_patched_saml_source_property_mapping_request.go new file mode 100644 index 0000000000..69f17276c0 --- /dev/null +++ b/packages/client-go/model_patched_saml_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSAMLSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSAMLSourcePropertyMappingRequest{} + +// PatchedSAMLSourcePropertyMappingRequest SAMLSourcePropertyMapping Serializer +type PatchedSAMLSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSAMLSourcePropertyMappingRequest PatchedSAMLSourcePropertyMappingRequest + +// NewPatchedSAMLSourcePropertyMappingRequest instantiates a new PatchedSAMLSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSAMLSourcePropertyMappingRequest() *PatchedSAMLSourcePropertyMappingRequest { + this := PatchedSAMLSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedSAMLSourcePropertyMappingRequestWithDefaults instantiates a new PatchedSAMLSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSAMLSourcePropertyMappingRequestWithDefaults() *PatchedSAMLSourcePropertyMappingRequest { + this := PatchedSAMLSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedSAMLSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedSAMLSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedSAMLSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedSAMLSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSAMLSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSAMLSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSAMLSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedSAMLSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedSAMLSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedSAMLSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedSAMLSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSAMLSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSAMLSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSAMLSourcePropertyMappingRequest := _PatchedSAMLSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedSAMLSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedSAMLSourcePropertyMappingRequest(varPatchedSAMLSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSAMLSourcePropertyMappingRequest struct { + value *PatchedSAMLSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedSAMLSourcePropertyMappingRequest) Get() *PatchedSAMLSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedSAMLSourcePropertyMappingRequest) Set(val *PatchedSAMLSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSAMLSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSAMLSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSAMLSourcePropertyMappingRequest(val *PatchedSAMLSourcePropertyMappingRequest) *NullablePatchedSAMLSourcePropertyMappingRequest { + return &NullablePatchedSAMLSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedSAMLSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSAMLSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_saml_source_request.go b/packages/client-go/model_patched_saml_source_request.go new file mode 100644 index 0000000000..2a09c2e063 --- /dev/null +++ b/packages/client-go/model_patched_saml_source_request.go @@ -0,0 +1,1236 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSAMLSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSAMLSourceRequest{} + +// PatchedSAMLSourceRequest SAMLSource Serializer +type PatchedSAMLSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow *string `json:"pre_authentication_flow,omitempty"` + // Also known as Entity ID. Defaults the Metadata URL. + Issuer *string `json:"issuer,omitempty"` + // URL that the initial Login request is sent to. + SsoUrl *string `json:"sso_url,omitempty"` + // Optional URL if your IDP supports Single-Logout. + SloUrl NullableString `json:"slo_url,omitempty"` + // Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done. + AllowIdpInitiated *bool `json:"allow_idp_initiated,omitempty"` + // NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + NameIdPolicy *SAMLNameIDPolicyEnum `json:"name_id_policy,omitempty"` + BindingType *BindingTypeEnum `json:"binding_type,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // Keypair used to sign outgoing Responses going to the Identity Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3). + TemporaryUserDeleteAfter *string `json:"temporary_user_delete_after,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignedAssertion *bool `json:"signed_assertion,omitempty"` + SignedResponse *bool `json:"signed_response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSAMLSourceRequest PatchedSAMLSourceRequest + +// NewPatchedSAMLSourceRequest instantiates a new PatchedSAMLSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSAMLSourceRequest() *PatchedSAMLSourceRequest { + this := PatchedSAMLSourceRequest{} + return &this +} + +// NewPatchedSAMLSourceRequestWithDefaults instantiates a new PatchedSAMLSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSAMLSourceRequestWithDefaults() *PatchedSAMLSourceRequest { + this := PatchedSAMLSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSAMLSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedSAMLSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedSAMLSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedSAMLSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedSAMLSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedSAMLSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedSAMLSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedSAMLSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedSAMLSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedSAMLSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedSAMLSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedSAMLSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PatchedSAMLSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetPreAuthenticationFlow() string { + if o == nil || IsNil(o.PreAuthenticationFlow) { + var ret string + return ret + } + return *o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil || IsNil(o.PreAuthenticationFlow) { + return nil, false + } + return o.PreAuthenticationFlow, true +} + +// HasPreAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasPreAuthenticationFlow() bool { + if o != nil && !IsNil(o.PreAuthenticationFlow) { + return true + } + + return false +} + +// SetPreAuthenticationFlow gets a reference to the given string and assigns it to the PreAuthenticationFlow field. +func (o *PatchedSAMLSourceRequest) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *PatchedSAMLSourceRequest) SetIssuer(v string) { + o.Issuer = &v +} + +// GetSsoUrl returns the SsoUrl field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetSsoUrl() string { + if o == nil || IsNil(o.SsoUrl) { + var ret string + return ret + } + return *o.SsoUrl +} + +// GetSsoUrlOk returns a tuple with the SsoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetSsoUrlOk() (*string, bool) { + if o == nil || IsNil(o.SsoUrl) { + return nil, false + } + return o.SsoUrl, true +} + +// HasSsoUrl returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSsoUrl() bool { + if o != nil && !IsNil(o.SsoUrl) { + return true + } + + return false +} + +// SetSsoUrl gets a reference to the given string and assigns it to the SsoUrl field. +func (o *PatchedSAMLSourceRequest) SetSsoUrl(v string) { + o.SsoUrl = &v +} + +// GetSloUrl returns the SloUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetSloUrl() string { + if o == nil || IsNil(o.SloUrl.Get()) { + var ret string + return ret + } + return *o.SloUrl.Get() +} + +// GetSloUrlOk returns a tuple with the SloUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetSloUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SloUrl.Get(), o.SloUrl.IsSet() +} + +// HasSloUrl returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSloUrl() bool { + if o != nil && o.SloUrl.IsSet() { + return true + } + + return false +} + +// SetSloUrl gets a reference to the given NullableString and assigns it to the SloUrl field. +func (o *PatchedSAMLSourceRequest) SetSloUrl(v string) { + o.SloUrl.Set(&v) +} + +// SetSloUrlNil sets the value for SloUrl to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetSloUrlNil() { + o.SloUrl.Set(nil) +} + +// UnsetSloUrl ensures that no value is present for SloUrl, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetSloUrl() { + o.SloUrl.Unset() +} + +// GetAllowIdpInitiated returns the AllowIdpInitiated field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetAllowIdpInitiated() bool { + if o == nil || IsNil(o.AllowIdpInitiated) { + var ret bool + return ret + } + return *o.AllowIdpInitiated +} + +// GetAllowIdpInitiatedOk returns a tuple with the AllowIdpInitiated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetAllowIdpInitiatedOk() (*bool, bool) { + if o == nil || IsNil(o.AllowIdpInitiated) { + return nil, false + } + return o.AllowIdpInitiated, true +} + +// HasAllowIdpInitiated returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasAllowIdpInitiated() bool { + if o != nil && !IsNil(o.AllowIdpInitiated) { + return true + } + + return false +} + +// SetAllowIdpInitiated gets a reference to the given bool and assigns it to the AllowIdpInitiated field. +func (o *PatchedSAMLSourceRequest) SetAllowIdpInitiated(v bool) { + o.AllowIdpInitiated = &v +} + +// GetNameIdPolicy returns the NameIdPolicy field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.NameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.NameIdPolicy +} + +// GetNameIdPolicyOk returns a tuple with the NameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.NameIdPolicy) { + return nil, false + } + return o.NameIdPolicy, true +} + +// HasNameIdPolicy returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasNameIdPolicy() bool { + if o != nil && !IsNil(o.NameIdPolicy) { + return true + } + + return false +} + +// SetNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the NameIdPolicy field. +func (o *PatchedSAMLSourceRequest) SetNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.NameIdPolicy = &v +} + +// GetBindingType returns the BindingType field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetBindingType() BindingTypeEnum { + if o == nil || IsNil(o.BindingType) { + var ret BindingTypeEnum + return ret + } + return *o.BindingType +} + +// GetBindingTypeOk returns a tuple with the BindingType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetBindingTypeOk() (*BindingTypeEnum, bool) { + if o == nil || IsNil(o.BindingType) { + return nil, false + } + return o.BindingType, true +} + +// HasBindingType returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasBindingType() bool { + if o != nil && !IsNil(o.BindingType) { + return true + } + + return false +} + +// SetBindingType gets a reference to the given BindingTypeEnum and assigns it to the BindingType field. +func (o *PatchedSAMLSourceRequest) SetBindingType(v BindingTypeEnum) { + o.BindingType = &v +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *PatchedSAMLSourceRequest) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *PatchedSAMLSourceRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *PatchedSAMLSourceRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *PatchedSAMLSourceRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetTemporaryUserDeleteAfter returns the TemporaryUserDeleteAfter field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetTemporaryUserDeleteAfter() string { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + var ret string + return ret + } + return *o.TemporaryUserDeleteAfter +} + +// GetTemporaryUserDeleteAfterOk returns a tuple with the TemporaryUserDeleteAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetTemporaryUserDeleteAfterOk() (*string, bool) { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + return nil, false + } + return o.TemporaryUserDeleteAfter, true +} + +// HasTemporaryUserDeleteAfter returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasTemporaryUserDeleteAfter() bool { + if o != nil && !IsNil(o.TemporaryUserDeleteAfter) { + return true + } + + return false +} + +// SetTemporaryUserDeleteAfter gets a reference to the given string and assigns it to the TemporaryUserDeleteAfter field. +func (o *PatchedSAMLSourceRequest) SetTemporaryUserDeleteAfter(v string) { + o.TemporaryUserDeleteAfter = &v +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSAMLSourceRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSAMLSourceRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *PatchedSAMLSourceRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *PatchedSAMLSourceRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *PatchedSAMLSourceRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignedAssertion returns the SignedAssertion field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetSignedAssertion() bool { + if o == nil || IsNil(o.SignedAssertion) { + var ret bool + return ret + } + return *o.SignedAssertion +} + +// GetSignedAssertionOk returns a tuple with the SignedAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetSignedAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignedAssertion) { + return nil, false + } + return o.SignedAssertion, true +} + +// HasSignedAssertion returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSignedAssertion() bool { + if o != nil && !IsNil(o.SignedAssertion) { + return true + } + + return false +} + +// SetSignedAssertion gets a reference to the given bool and assigns it to the SignedAssertion field. +func (o *PatchedSAMLSourceRequest) SetSignedAssertion(v bool) { + o.SignedAssertion = &v +} + +// GetSignedResponse returns the SignedResponse field value if set, zero value otherwise. +func (o *PatchedSAMLSourceRequest) GetSignedResponse() bool { + if o == nil || IsNil(o.SignedResponse) { + var ret bool + return ret + } + return *o.SignedResponse +} + +// GetSignedResponseOk returns a tuple with the SignedResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSAMLSourceRequest) GetSignedResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignedResponse) { + return nil, false + } + return o.SignedResponse, true +} + +// HasSignedResponse returns a boolean if a field has been set. +func (o *PatchedSAMLSourceRequest) HasSignedResponse() bool { + if o != nil && !IsNil(o.SignedResponse) { + return true + } + + return false +} + +// SetSignedResponse gets a reference to the given bool and assigns it to the SignedResponse field. +func (o *PatchedSAMLSourceRequest) SetSignedResponse(v bool) { + o.SignedResponse = &v +} + +func (o PatchedSAMLSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSAMLSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.PreAuthenticationFlow) { + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + } + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.SsoUrl) { + toSerialize["sso_url"] = o.SsoUrl + } + if o.SloUrl.IsSet() { + toSerialize["slo_url"] = o.SloUrl.Get() + } + if !IsNil(o.AllowIdpInitiated) { + toSerialize["allow_idp_initiated"] = o.AllowIdpInitiated + } + if !IsNil(o.NameIdPolicy) { + toSerialize["name_id_policy"] = o.NameIdPolicy + } + if !IsNil(o.BindingType) { + toSerialize["binding_type"] = o.BindingType + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if !IsNil(o.TemporaryUserDeleteAfter) { + toSerialize["temporary_user_delete_after"] = o.TemporaryUserDeleteAfter + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignedAssertion) { + toSerialize["signed_assertion"] = o.SignedAssertion + } + if !IsNil(o.SignedResponse) { + toSerialize["signed_response"] = o.SignedResponse + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSAMLSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSAMLSourceRequest := _PatchedSAMLSourceRequest{} + + err = json.Unmarshal(data, &varPatchedSAMLSourceRequest) + + if err != nil { + return err + } + + *o = PatchedSAMLSourceRequest(varPatchedSAMLSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "pre_authentication_flow") + delete(additionalProperties, "issuer") + delete(additionalProperties, "sso_url") + delete(additionalProperties, "slo_url") + delete(additionalProperties, "allow_idp_initiated") + delete(additionalProperties, "name_id_policy") + delete(additionalProperties, "binding_type") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "temporary_user_delete_after") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "signed_assertion") + delete(additionalProperties, "signed_response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSAMLSourceRequest struct { + value *PatchedSAMLSourceRequest + isSet bool +} + +func (v NullablePatchedSAMLSourceRequest) Get() *PatchedSAMLSourceRequest { + return v.value +} + +func (v *NullablePatchedSAMLSourceRequest) Set(val *PatchedSAMLSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSAMLSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSAMLSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSAMLSourceRequest(val *PatchedSAMLSourceRequest) *NullablePatchedSAMLSourceRequest { + return &NullablePatchedSAMLSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedSAMLSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSAMLSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_schedule_request.go b/packages/client-go/model_patched_schedule_request.go new file mode 100644 index 0000000000..0c7c74e1b3 --- /dev/null +++ b/packages/client-go/model_patched_schedule_request.go @@ -0,0 +1,241 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedScheduleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedScheduleRequest{} + +// PatchedScheduleRequest struct for PatchedScheduleRequest +type PatchedScheduleRequest struct { + RelObjId NullableString `json:"rel_obj_id,omitempty"` + // When to schedule tasks + Crontab *string `json:"crontab,omitempty"` + // Pause this schedule + Paused *bool `json:"paused,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedScheduleRequest PatchedScheduleRequest + +// NewPatchedScheduleRequest instantiates a new PatchedScheduleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedScheduleRequest() *PatchedScheduleRequest { + this := PatchedScheduleRequest{} + return &this +} + +// NewPatchedScheduleRequestWithDefaults instantiates a new PatchedScheduleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedScheduleRequestWithDefaults() *PatchedScheduleRequest { + this := PatchedScheduleRequest{} + return &this +} + +// GetRelObjId returns the RelObjId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedScheduleRequest) GetRelObjId() string { + if o == nil || IsNil(o.RelObjId.Get()) { + var ret string + return ret + } + return *o.RelObjId.Get() +} + +// GetRelObjIdOk returns a tuple with the RelObjId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedScheduleRequest) GetRelObjIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RelObjId.Get(), o.RelObjId.IsSet() +} + +// HasRelObjId returns a boolean if a field has been set. +func (o *PatchedScheduleRequest) HasRelObjId() bool { + if o != nil && o.RelObjId.IsSet() { + return true + } + + return false +} + +// SetRelObjId gets a reference to the given NullableString and assigns it to the RelObjId field. +func (o *PatchedScheduleRequest) SetRelObjId(v string) { + o.RelObjId.Set(&v) +} + +// SetRelObjIdNil sets the value for RelObjId to be an explicit nil +func (o *PatchedScheduleRequest) SetRelObjIdNil() { + o.RelObjId.Set(nil) +} + +// UnsetRelObjId ensures that no value is present for RelObjId, not even an explicit nil +func (o *PatchedScheduleRequest) UnsetRelObjId() { + o.RelObjId.Unset() +} + +// GetCrontab returns the Crontab field value if set, zero value otherwise. +func (o *PatchedScheduleRequest) GetCrontab() string { + if o == nil || IsNil(o.Crontab) { + var ret string + return ret + } + return *o.Crontab +} + +// GetCrontabOk returns a tuple with the Crontab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScheduleRequest) GetCrontabOk() (*string, bool) { + if o == nil || IsNil(o.Crontab) { + return nil, false + } + return o.Crontab, true +} + +// HasCrontab returns a boolean if a field has been set. +func (o *PatchedScheduleRequest) HasCrontab() bool { + if o != nil && !IsNil(o.Crontab) { + return true + } + + return false +} + +// SetCrontab gets a reference to the given string and assigns it to the Crontab field. +func (o *PatchedScheduleRequest) SetCrontab(v string) { + o.Crontab = &v +} + +// GetPaused returns the Paused field value if set, zero value otherwise. +func (o *PatchedScheduleRequest) GetPaused() bool { + if o == nil || IsNil(o.Paused) { + var ret bool + return ret + } + return *o.Paused +} + +// GetPausedOk returns a tuple with the Paused field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScheduleRequest) GetPausedOk() (*bool, bool) { + if o == nil || IsNil(o.Paused) { + return nil, false + } + return o.Paused, true +} + +// HasPaused returns a boolean if a field has been set. +func (o *PatchedScheduleRequest) HasPaused() bool { + if o != nil && !IsNil(o.Paused) { + return true + } + + return false +} + +// SetPaused gets a reference to the given bool and assigns it to the Paused field. +func (o *PatchedScheduleRequest) SetPaused(v bool) { + o.Paused = &v +} + +func (o PatchedScheduleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedScheduleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.RelObjId.IsSet() { + toSerialize["rel_obj_id"] = o.RelObjId.Get() + } + if !IsNil(o.Crontab) { + toSerialize["crontab"] = o.Crontab + } + if !IsNil(o.Paused) { + toSerialize["paused"] = o.Paused + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedScheduleRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedScheduleRequest := _PatchedScheduleRequest{} + + err = json.Unmarshal(data, &varPatchedScheduleRequest) + + if err != nil { + return err + } + + *o = PatchedScheduleRequest(varPatchedScheduleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rel_obj_id") + delete(additionalProperties, "crontab") + delete(additionalProperties, "paused") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedScheduleRequest struct { + value *PatchedScheduleRequest + isSet bool +} + +func (v NullablePatchedScheduleRequest) Get() *PatchedScheduleRequest { + return v.value +} + +func (v *NullablePatchedScheduleRequest) Set(val *PatchedScheduleRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedScheduleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedScheduleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedScheduleRequest(val *PatchedScheduleRequest) *NullablePatchedScheduleRequest { + return &NullablePatchedScheduleRequest{value: val, isSet: true} +} + +func (v NullablePatchedScheduleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedScheduleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_mapping_request.go b/packages/client-go/model_patched_scim_mapping_request.go new file mode 100644 index 0000000000..6241324e1a --- /dev/null +++ b/packages/client-go/model_patched_scim_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMMappingRequest{} + +// PatchedSCIMMappingRequest SCIMMapping Serializer +type PatchedSCIMMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMMappingRequest PatchedSCIMMappingRequest + +// NewPatchedSCIMMappingRequest instantiates a new PatchedSCIMMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMMappingRequest() *PatchedSCIMMappingRequest { + this := PatchedSCIMMappingRequest{} + return &this +} + +// NewPatchedSCIMMappingRequestWithDefaults instantiates a new PatchedSCIMMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMMappingRequestWithDefaults() *PatchedSCIMMappingRequest { + this := PatchedSCIMMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSCIMMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSCIMMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedSCIMMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedSCIMMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedSCIMMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedSCIMMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSCIMMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSCIMMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSCIMMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedSCIMMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedSCIMMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedSCIMMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedSCIMMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMMappingRequest := _PatchedSCIMMappingRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMMappingRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMMappingRequest(varPatchedSCIMMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMMappingRequest struct { + value *PatchedSCIMMappingRequest + isSet bool +} + +func (v NullablePatchedSCIMMappingRequest) Get() *PatchedSCIMMappingRequest { + return v.value +} + +func (v *NullablePatchedSCIMMappingRequest) Set(val *PatchedSCIMMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMMappingRequest(val *PatchedSCIMMappingRequest) *NullablePatchedSCIMMappingRequest { + return &NullablePatchedSCIMMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_provider_request.go b/packages/client-go/model_patched_scim_provider_request.go new file mode 100644 index 0000000000..4cc47c0675 --- /dev/null +++ b/packages/client-go/model_patched_scim_provider_request.go @@ -0,0 +1,731 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMProviderRequest{} + +// PatchedSCIMProviderRequest SCIMProvider Serializer +type PatchedSCIMProviderRequest struct { + Name *string `json:"name,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + // Base URL to SCIM requests, usually ends in /v2 + Url *string `json:"url,omitempty"` + VerifyCertificates *bool `json:"verify_certificates,omitempty"` + // Authentication token + Token *string `json:"token,omitempty"` + AuthMode *SCIMAuthenticationModeEnum `json:"auth_mode,omitempty"` + // OAuth Source used for authentication + AuthOauth NullableString `json:"auth_oauth,omitempty"` + // Additional OAuth parameters, such as grant_type + AuthOauthParams map[string]interface{} `json:"auth_oauth_params,omitempty"` + // Alter authentik behavior for vendor-specific SCIM implementations. + CompatibilityMode *CompatibilityModeEnum `json:"compatibility_mode,omitempty"` + // Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + ServiceProviderConfigCacheTimeout *string `json:"service_provider_config_cache_timeout,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // Group filters used to define sync-scope for groups. + GroupFilters []string `json:"group_filters,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMProviderRequest PatchedSCIMProviderRequest + +// NewPatchedSCIMProviderRequest instantiates a new PatchedSCIMProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMProviderRequest() *PatchedSCIMProviderRequest { + this := PatchedSCIMProviderRequest{} + return &this +} + +// NewPatchedSCIMProviderRequestWithDefaults instantiates a new PatchedSCIMProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMProviderRequestWithDefaults() *PatchedSCIMProviderRequest { + this := PatchedSCIMProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSCIMProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedSCIMProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *PatchedSCIMProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetUrl() string { + if o == nil || IsNil(o.Url) { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetUrlOk() (*string, bool) { + if o == nil || IsNil(o.Url) { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasUrl() bool { + if o != nil && !IsNil(o.Url) { + return true + } + + return false +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *PatchedSCIMProviderRequest) SetUrl(v string) { + o.Url = &v +} + +// GetVerifyCertificates returns the VerifyCertificates field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetVerifyCertificates() bool { + if o == nil || IsNil(o.VerifyCertificates) { + var ret bool + return ret + } + return *o.VerifyCertificates +} + +// GetVerifyCertificatesOk returns a tuple with the VerifyCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetVerifyCertificatesOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyCertificates) { + return nil, false + } + return o.VerifyCertificates, true +} + +// HasVerifyCertificates returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasVerifyCertificates() bool { + if o != nil && !IsNil(o.VerifyCertificates) { + return true + } + + return false +} + +// SetVerifyCertificates gets a reference to the given bool and assigns it to the VerifyCertificates field. +func (o *PatchedSCIMProviderRequest) SetVerifyCertificates(v bool) { + o.VerifyCertificates = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *PatchedSCIMProviderRequest) SetToken(v string) { + o.Token = &v +} + +// GetAuthMode returns the AuthMode field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetAuthMode() SCIMAuthenticationModeEnum { + if o == nil || IsNil(o.AuthMode) { + var ret SCIMAuthenticationModeEnum + return ret + } + return *o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetAuthModeOk() (*SCIMAuthenticationModeEnum, bool) { + if o == nil || IsNil(o.AuthMode) { + return nil, false + } + return o.AuthMode, true +} + +// HasAuthMode returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasAuthMode() bool { + if o != nil && !IsNil(o.AuthMode) { + return true + } + + return false +} + +// SetAuthMode gets a reference to the given SCIMAuthenticationModeEnum and assigns it to the AuthMode field. +func (o *PatchedSCIMProviderRequest) SetAuthMode(v SCIMAuthenticationModeEnum) { + o.AuthMode = &v +} + +// GetAuthOauth returns the AuthOauth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSCIMProviderRequest) GetAuthOauth() string { + if o == nil || IsNil(o.AuthOauth.Get()) { + var ret string + return ret + } + return *o.AuthOauth.Get() +} + +// GetAuthOauthOk returns a tuple with the AuthOauth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSCIMProviderRequest) GetAuthOauthOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthOauth.Get(), o.AuthOauth.IsSet() +} + +// HasAuthOauth returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasAuthOauth() bool { + if o != nil && o.AuthOauth.IsSet() { + return true + } + + return false +} + +// SetAuthOauth gets a reference to the given NullableString and assigns it to the AuthOauth field. +func (o *PatchedSCIMProviderRequest) SetAuthOauth(v string) { + o.AuthOauth.Set(&v) +} + +// SetAuthOauthNil sets the value for AuthOauth to be an explicit nil +func (o *PatchedSCIMProviderRequest) SetAuthOauthNil() { + o.AuthOauth.Set(nil) +} + +// UnsetAuthOauth ensures that no value is present for AuthOauth, not even an explicit nil +func (o *PatchedSCIMProviderRequest) UnsetAuthOauth() { + o.AuthOauth.Unset() +} + +// GetAuthOauthParams returns the AuthOauthParams field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetAuthOauthParams() map[string]interface{} { + if o == nil || IsNil(o.AuthOauthParams) { + var ret map[string]interface{} + return ret + } + return o.AuthOauthParams +} + +// GetAuthOauthParamsOk returns a tuple with the AuthOauthParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetAuthOauthParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.AuthOauthParams) { + return map[string]interface{}{}, false + } + return o.AuthOauthParams, true +} + +// HasAuthOauthParams returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasAuthOauthParams() bool { + if o != nil && !IsNil(o.AuthOauthParams) { + return true + } + + return false +} + +// SetAuthOauthParams gets a reference to the given map[string]interface{} and assigns it to the AuthOauthParams field. +func (o *PatchedSCIMProviderRequest) SetAuthOauthParams(v map[string]interface{}) { + o.AuthOauthParams = v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetCompatibilityMode() CompatibilityModeEnum { + if o == nil || IsNil(o.CompatibilityMode) { + var ret CompatibilityModeEnum + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetCompatibilityModeOk() (*CompatibilityModeEnum, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given CompatibilityModeEnum and assigns it to the CompatibilityMode field. +func (o *PatchedSCIMProviderRequest) SetCompatibilityMode(v CompatibilityModeEnum) { + o.CompatibilityMode = &v +} + +// GetServiceProviderConfigCacheTimeout returns the ServiceProviderConfigCacheTimeout field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetServiceProviderConfigCacheTimeout() string { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + var ret string + return ret + } + return *o.ServiceProviderConfigCacheTimeout +} + +// GetServiceProviderConfigCacheTimeoutOk returns a tuple with the ServiceProviderConfigCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetServiceProviderConfigCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + return nil, false + } + return o.ServiceProviderConfigCacheTimeout, true +} + +// HasServiceProviderConfigCacheTimeout returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasServiceProviderConfigCacheTimeout() bool { + if o != nil && !IsNil(o.ServiceProviderConfigCacheTimeout) { + return true + } + + return false +} + +// SetServiceProviderConfigCacheTimeout gets a reference to the given string and assigns it to the ServiceProviderConfigCacheTimeout field. +func (o *PatchedSCIMProviderRequest) SetServiceProviderConfigCacheTimeout(v string) { + o.ServiceProviderConfigCacheTimeout = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *PatchedSCIMProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *PatchedSCIMProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *PatchedSCIMProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetGroupFilters returns the GroupFilters field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetGroupFilters() []string { + if o == nil || IsNil(o.GroupFilters) { + var ret []string + return ret + } + return o.GroupFilters +} + +// GetGroupFiltersOk returns a tuple with the GroupFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetGroupFiltersOk() ([]string, bool) { + if o == nil || IsNil(o.GroupFilters) { + return nil, false + } + return o.GroupFilters, true +} + +// HasGroupFilters returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasGroupFilters() bool { + if o != nil && !IsNil(o.GroupFilters) { + return true + } + + return false +} + +// SetGroupFilters gets a reference to the given []string and assigns it to the GroupFilters field. +func (o *PatchedSCIMProviderRequest) SetGroupFilters(v []string) { + o.GroupFilters = v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *PatchedSCIMProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *PatchedSCIMProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *PatchedSCIMProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o PatchedSCIMProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + if !IsNil(o.Url) { + toSerialize["url"] = o.Url + } + if !IsNil(o.VerifyCertificates) { + toSerialize["verify_certificates"] = o.VerifyCertificates + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if !IsNil(o.AuthMode) { + toSerialize["auth_mode"] = o.AuthMode + } + if o.AuthOauth.IsSet() { + toSerialize["auth_oauth"] = o.AuthOauth.Get() + } + if !IsNil(o.AuthOauthParams) { + toSerialize["auth_oauth_params"] = o.AuthOauthParams + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + if !IsNil(o.ServiceProviderConfigCacheTimeout) { + toSerialize["service_provider_config_cache_timeout"] = o.ServiceProviderConfigCacheTimeout + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.GroupFilters) { + toSerialize["group_filters"] = o.GroupFilters + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMProviderRequest := _PatchedSCIMProviderRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMProviderRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMProviderRequest(varPatchedSCIMProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "url") + delete(additionalProperties, "verify_certificates") + delete(additionalProperties, "token") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "auth_oauth") + delete(additionalProperties, "auth_oauth_params") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "service_provider_config_cache_timeout") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "group_filters") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMProviderRequest struct { + value *PatchedSCIMProviderRequest + isSet bool +} + +func (v NullablePatchedSCIMProviderRequest) Get() *PatchedSCIMProviderRequest { + return v.value +} + +func (v *NullablePatchedSCIMProviderRequest) Set(val *PatchedSCIMProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMProviderRequest(val *PatchedSCIMProviderRequest) *NullablePatchedSCIMProviderRequest { + return &NullablePatchedSCIMProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_source_group_request.go b/packages/client-go/model_patched_scim_source_group_request.go new file mode 100644 index 0000000000..f9eb7787d7 --- /dev/null +++ b/packages/client-go/model_patched_scim_source_group_request.go @@ -0,0 +1,302 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMSourceGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMSourceGroupRequest{} + +// PatchedSCIMSourceGroupRequest SCIMSourceGroup Serializer +type PatchedSCIMSourceGroupRequest struct { + Id *string `json:"id,omitempty"` + ExternalId *string `json:"external_id,omitempty"` + Group *string `json:"group,omitempty"` + Source *string `json:"source,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMSourceGroupRequest PatchedSCIMSourceGroupRequest + +// NewPatchedSCIMSourceGroupRequest instantiates a new PatchedSCIMSourceGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMSourceGroupRequest() *PatchedSCIMSourceGroupRequest { + this := PatchedSCIMSourceGroupRequest{} + return &this +} + +// NewPatchedSCIMSourceGroupRequestWithDefaults instantiates a new PatchedSCIMSourceGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMSourceGroupRequestWithDefaults() *PatchedSCIMSourceGroupRequest { + this := PatchedSCIMSourceGroupRequest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PatchedSCIMSourceGroupRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceGroupRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PatchedSCIMSourceGroupRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PatchedSCIMSourceGroupRequest) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value if set, zero value otherwise. +func (o *PatchedSCIMSourceGroupRequest) GetExternalId() string { + if o == nil || IsNil(o.ExternalId) { + var ret string + return ret + } + return *o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceGroupRequest) GetExternalIdOk() (*string, bool) { + if o == nil || IsNil(o.ExternalId) { + return nil, false + } + return o.ExternalId, true +} + +// HasExternalId returns a boolean if a field has been set. +func (o *PatchedSCIMSourceGroupRequest) HasExternalId() bool { + if o != nil && !IsNil(o.ExternalId) { + return true + } + + return false +} + +// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +func (o *PatchedSCIMSourceGroupRequest) SetExternalId(v string) { + o.ExternalId = &v +} + +// GetGroup returns the Group field value if set, zero value otherwise. +func (o *PatchedSCIMSourceGroupRequest) GetGroup() string { + if o == nil || IsNil(o.Group) { + var ret string + return ret + } + return *o.Group +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceGroupRequest) GetGroupOk() (*string, bool) { + if o == nil || IsNil(o.Group) { + return nil, false + } + return o.Group, true +} + +// HasGroup returns a boolean if a field has been set. +func (o *PatchedSCIMSourceGroupRequest) HasGroup() bool { + if o != nil && !IsNil(o.Group) { + return true + } + + return false +} + +// SetGroup gets a reference to the given string and assigns it to the Group field. +func (o *PatchedSCIMSourceGroupRequest) SetGroup(v string) { + o.Group = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedSCIMSourceGroupRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceGroupRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedSCIMSourceGroupRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedSCIMSourceGroupRequest) SetSource(v string) { + o.Source = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedSCIMSourceGroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceGroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedSCIMSourceGroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedSCIMSourceGroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedSCIMSourceGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMSourceGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ExternalId) { + toSerialize["external_id"] = o.ExternalId + } + if !IsNil(o.Group) { + toSerialize["group"] = o.Group + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMSourceGroupRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMSourceGroupRequest := _PatchedSCIMSourceGroupRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMSourceGroupRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMSourceGroupRequest(varPatchedSCIMSourceGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMSourceGroupRequest struct { + value *PatchedSCIMSourceGroupRequest + isSet bool +} + +func (v NullablePatchedSCIMSourceGroupRequest) Get() *PatchedSCIMSourceGroupRequest { + return v.value +} + +func (v *NullablePatchedSCIMSourceGroupRequest) Set(val *PatchedSCIMSourceGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMSourceGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMSourceGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMSourceGroupRequest(val *PatchedSCIMSourceGroupRequest) *NullablePatchedSCIMSourceGroupRequest { + return &NullablePatchedSCIMSourceGroupRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMSourceGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMSourceGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_source_property_mapping_request.go b/packages/client-go/model_patched_scim_source_property_mapping_request.go new file mode 100644 index 0000000000..836ff727a2 --- /dev/null +++ b/packages/client-go/model_patched_scim_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMSourcePropertyMappingRequest{} + +// PatchedSCIMSourcePropertyMappingRequest SCIMSourcePropertyMapping Serializer +type PatchedSCIMSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMSourcePropertyMappingRequest PatchedSCIMSourcePropertyMappingRequest + +// NewPatchedSCIMSourcePropertyMappingRequest instantiates a new PatchedSCIMSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMSourcePropertyMappingRequest() *PatchedSCIMSourcePropertyMappingRequest { + this := PatchedSCIMSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedSCIMSourcePropertyMappingRequestWithDefaults instantiates a new PatchedSCIMSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMSourcePropertyMappingRequestWithDefaults() *PatchedSCIMSourcePropertyMappingRequest { + this := PatchedSCIMSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSCIMSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSCIMSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedSCIMSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedSCIMSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedSCIMSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedSCIMSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSCIMSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSCIMSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSCIMSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedSCIMSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedSCIMSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedSCIMSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedSCIMSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMSourcePropertyMappingRequest := _PatchedSCIMSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMSourcePropertyMappingRequest(varPatchedSCIMSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMSourcePropertyMappingRequest struct { + value *PatchedSCIMSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedSCIMSourcePropertyMappingRequest) Get() *PatchedSCIMSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedSCIMSourcePropertyMappingRequest) Set(val *PatchedSCIMSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMSourcePropertyMappingRequest(val *PatchedSCIMSourcePropertyMappingRequest) *NullablePatchedSCIMSourcePropertyMappingRequest { + return &NullablePatchedSCIMSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_source_request.go b/packages/client-go/model_patched_scim_source_request.go new file mode 100644 index 0000000000..08928d785e --- /dev/null +++ b/packages/client-go/model_patched_scim_source_request.go @@ -0,0 +1,341 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMSourceRequest{} + +// PatchedSCIMSourceRequest SCIMSource Serializer +type PatchedSCIMSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMSourceRequest PatchedSCIMSourceRequest + +// NewPatchedSCIMSourceRequest instantiates a new PatchedSCIMSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMSourceRequest() *PatchedSCIMSourceRequest { + this := PatchedSCIMSourceRequest{} + return &this +} + +// NewPatchedSCIMSourceRequestWithDefaults instantiates a new PatchedSCIMSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMSourceRequestWithDefaults() *PatchedSCIMSourceRequest { + this := PatchedSCIMSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSCIMSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedSCIMSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedSCIMSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedSCIMSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedSCIMSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedSCIMSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedSCIMSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedSCIMSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +func (o PatchedSCIMSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMSourceRequest := _PatchedSCIMSourceRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMSourceRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMSourceRequest(varPatchedSCIMSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "user_path_template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMSourceRequest struct { + value *PatchedSCIMSourceRequest + isSet bool +} + +func (v NullablePatchedSCIMSourceRequest) Get() *PatchedSCIMSourceRequest { + return v.value +} + +func (v *NullablePatchedSCIMSourceRequest) Set(val *PatchedSCIMSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMSourceRequest(val *PatchedSCIMSourceRequest) *NullablePatchedSCIMSourceRequest { + return &NullablePatchedSCIMSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scim_source_user_request.go b/packages/client-go/model_patched_scim_source_user_request.go new file mode 100644 index 0000000000..c8e362dd1e --- /dev/null +++ b/packages/client-go/model_patched_scim_source_user_request.go @@ -0,0 +1,302 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSCIMSourceUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSCIMSourceUserRequest{} + +// PatchedSCIMSourceUserRequest SCIMSourceUser Serializer +type PatchedSCIMSourceUserRequest struct { + Id *string `json:"id,omitempty"` + ExternalId *string `json:"external_id,omitempty"` + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSCIMSourceUserRequest PatchedSCIMSourceUserRequest + +// NewPatchedSCIMSourceUserRequest instantiates a new PatchedSCIMSourceUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSCIMSourceUserRequest() *PatchedSCIMSourceUserRequest { + this := PatchedSCIMSourceUserRequest{} + return &this +} + +// NewPatchedSCIMSourceUserRequestWithDefaults instantiates a new PatchedSCIMSourceUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSCIMSourceUserRequestWithDefaults() *PatchedSCIMSourceUserRequest { + this := PatchedSCIMSourceUserRequest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PatchedSCIMSourceUserRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceUserRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PatchedSCIMSourceUserRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PatchedSCIMSourceUserRequest) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value if set, zero value otherwise. +func (o *PatchedSCIMSourceUserRequest) GetExternalId() string { + if o == nil || IsNil(o.ExternalId) { + var ret string + return ret + } + return *o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceUserRequest) GetExternalIdOk() (*string, bool) { + if o == nil || IsNil(o.ExternalId) { + return nil, false + } + return o.ExternalId, true +} + +// HasExternalId returns a boolean if a field has been set. +func (o *PatchedSCIMSourceUserRequest) HasExternalId() bool { + if o != nil && !IsNil(o.ExternalId) { + return true + } + + return false +} + +// SetExternalId gets a reference to the given string and assigns it to the ExternalId field. +func (o *PatchedSCIMSourceUserRequest) SetExternalId(v string) { + o.ExternalId = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedSCIMSourceUserRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceUserRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedSCIMSourceUserRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedSCIMSourceUserRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedSCIMSourceUserRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceUserRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedSCIMSourceUserRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedSCIMSourceUserRequest) SetSource(v string) { + o.Source = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedSCIMSourceUserRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSCIMSourceUserRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedSCIMSourceUserRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedSCIMSourceUserRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o PatchedSCIMSourceUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSCIMSourceUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ExternalId) { + toSerialize["external_id"] = o.ExternalId + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSCIMSourceUserRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSCIMSourceUserRequest := _PatchedSCIMSourceUserRequest{} + + err = json.Unmarshal(data, &varPatchedSCIMSourceUserRequest) + + if err != nil { + return err + } + + *o = PatchedSCIMSourceUserRequest(varPatchedSCIMSourceUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSCIMSourceUserRequest struct { + value *PatchedSCIMSourceUserRequest + isSet bool +} + +func (v NullablePatchedSCIMSourceUserRequest) Get() *PatchedSCIMSourceUserRequest { + return v.value +} + +func (v *NullablePatchedSCIMSourceUserRequest) Set(val *PatchedSCIMSourceUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSCIMSourceUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSCIMSourceUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSCIMSourceUserRequest(val *PatchedSCIMSourceUserRequest) *NullablePatchedSCIMSourceUserRequest { + return &NullablePatchedSCIMSourceUserRequest{value: val, isSet: true} +} + +func (v NullablePatchedSCIMSourceUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSCIMSourceUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_scope_mapping_request.go b/packages/client-go/model_patched_scope_mapping_request.go new file mode 100644 index 0000000000..6f9eb659c0 --- /dev/null +++ b/packages/client-go/model_patched_scope_mapping_request.go @@ -0,0 +1,316 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedScopeMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedScopeMappingRequest{} + +// PatchedScopeMappingRequest ScopeMapping Serializer +type PatchedScopeMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + // Scope name requested by the client + ScopeName *string `json:"scope_name,omitempty"` + // Description shown to the user when consenting. If left empty, the user won't be informed. + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedScopeMappingRequest PatchedScopeMappingRequest + +// NewPatchedScopeMappingRequest instantiates a new PatchedScopeMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedScopeMappingRequest() *PatchedScopeMappingRequest { + this := PatchedScopeMappingRequest{} + return &this +} + +// NewPatchedScopeMappingRequestWithDefaults instantiates a new PatchedScopeMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedScopeMappingRequestWithDefaults() *PatchedScopeMappingRequest { + this := PatchedScopeMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedScopeMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedScopeMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedScopeMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedScopeMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedScopeMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedScopeMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedScopeMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScopeMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedScopeMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedScopeMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedScopeMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScopeMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedScopeMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedScopeMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +// GetScopeName returns the ScopeName field value if set, zero value otherwise. +func (o *PatchedScopeMappingRequest) GetScopeName() string { + if o == nil || IsNil(o.ScopeName) { + var ret string + return ret + } + return *o.ScopeName +} + +// GetScopeNameOk returns a tuple with the ScopeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScopeMappingRequest) GetScopeNameOk() (*string, bool) { + if o == nil || IsNil(o.ScopeName) { + return nil, false + } + return o.ScopeName, true +} + +// HasScopeName returns a boolean if a field has been set. +func (o *PatchedScopeMappingRequest) HasScopeName() bool { + if o != nil && !IsNil(o.ScopeName) { + return true + } + + return false +} + +// SetScopeName gets a reference to the given string and assigns it to the ScopeName field. +func (o *PatchedScopeMappingRequest) SetScopeName(v string) { + o.ScopeName = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedScopeMappingRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedScopeMappingRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedScopeMappingRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedScopeMappingRequest) SetDescription(v string) { + o.Description = &v +} + +func (o PatchedScopeMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedScopeMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + if !IsNil(o.ScopeName) { + toSerialize["scope_name"] = o.ScopeName + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedScopeMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedScopeMappingRequest := _PatchedScopeMappingRequest{} + + err = json.Unmarshal(data, &varPatchedScopeMappingRequest) + + if err != nil { + return err + } + + *o = PatchedScopeMappingRequest(varPatchedScopeMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "scope_name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedScopeMappingRequest struct { + value *PatchedScopeMappingRequest + isSet bool +} + +func (v NullablePatchedScopeMappingRequest) Get() *PatchedScopeMappingRequest { + return v.value +} + +func (v *NullablePatchedScopeMappingRequest) Set(val *PatchedScopeMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedScopeMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedScopeMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedScopeMappingRequest(val *PatchedScopeMappingRequest) *NullablePatchedScopeMappingRequest { + return &NullablePatchedScopeMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedScopeMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedScopeMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_settings_request.go b/packages/client-go/model_patched_settings_request.go new file mode 100644 index 0000000000..8a9ce6dcb7 --- /dev/null +++ b/packages/client-go/model_patched_settings_request.go @@ -0,0 +1,724 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSettingsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSettingsRequest{} + +// PatchedSettingsRequest Settings Serializer +type PatchedSettingsRequest struct { + // Configure how authentik should show avatars for users. + Avatars *string `json:"avatars,omitempty"` + // Enable the ability for users to change their name. + DefaultUserChangeName *bool `json:"default_user_change_name,omitempty"` + // Enable the ability for users to change their email address. + DefaultUserChangeEmail *bool `json:"default_user_change_email,omitempty"` + // Enable the ability for users to change their username. + DefaultUserChangeUsername *bool `json:"default_user_change_username,omitempty"` + // Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + EventRetention *string `json:"event_retention,omitempty"` + // Reputation cannot decrease lower than this value. Zero or negative. + ReputationLowerLimit *int32 `json:"reputation_lower_limit,omitempty"` + // Reputation cannot increase higher than this value. Zero or positive. + ReputationUpperLimit *int32 `json:"reputation_upper_limit,omitempty"` + FooterLinks interface{} `json:"footer_links,omitempty"` + // When enabled, all the events caused by a user will be deleted upon the user's deletion. + GdprCompliance *bool `json:"gdpr_compliance,omitempty"` + // Globally enable/disable impersonation. + Impersonation *bool `json:"impersonation,omitempty"` + // Require administrators to provide a reason for impersonating a user. + ImpersonationRequireReason *bool `json:"impersonation_require_reason,omitempty"` + // Default token duration + DefaultTokenDuration *string `json:"default_token_duration,omitempty"` + // Default token length + DefaultTokenLength *int32 `json:"default_token_length,omitempty"` + // Default page size for API responses, if no size was requested. + PaginationDefaultPageSize *int32 `json:"pagination_default_page_size,omitempty"` + // Maximum page size + PaginationMaxPageSize *int32 `json:"pagination_max_page_size,omitempty"` + Flags *PatchedSettingsRequestFlags `json:"flags,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSettingsRequest PatchedSettingsRequest + +// NewPatchedSettingsRequest instantiates a new PatchedSettingsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSettingsRequest() *PatchedSettingsRequest { + this := PatchedSettingsRequest{} + return &this +} + +// NewPatchedSettingsRequestWithDefaults instantiates a new PatchedSettingsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSettingsRequestWithDefaults() *PatchedSettingsRequest { + this := PatchedSettingsRequest{} + return &this +} + +// GetAvatars returns the Avatars field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetAvatars() string { + if o == nil || IsNil(o.Avatars) { + var ret string + return ret + } + return *o.Avatars +} + +// GetAvatarsOk returns a tuple with the Avatars field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetAvatarsOk() (*string, bool) { + if o == nil || IsNil(o.Avatars) { + return nil, false + } + return o.Avatars, true +} + +// HasAvatars returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasAvatars() bool { + if o != nil && !IsNil(o.Avatars) { + return true + } + + return false +} + +// SetAvatars gets a reference to the given string and assigns it to the Avatars field. +func (o *PatchedSettingsRequest) SetAvatars(v string) { + o.Avatars = &v +} + +// GetDefaultUserChangeName returns the DefaultUserChangeName field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetDefaultUserChangeName() bool { + if o == nil || IsNil(o.DefaultUserChangeName) { + var ret bool + return ret + } + return *o.DefaultUserChangeName +} + +// GetDefaultUserChangeNameOk returns a tuple with the DefaultUserChangeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetDefaultUserChangeNameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeName) { + return nil, false + } + return o.DefaultUserChangeName, true +} + +// HasDefaultUserChangeName returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasDefaultUserChangeName() bool { + if o != nil && !IsNil(o.DefaultUserChangeName) { + return true + } + + return false +} + +// SetDefaultUserChangeName gets a reference to the given bool and assigns it to the DefaultUserChangeName field. +func (o *PatchedSettingsRequest) SetDefaultUserChangeName(v bool) { + o.DefaultUserChangeName = &v +} + +// GetDefaultUserChangeEmail returns the DefaultUserChangeEmail field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetDefaultUserChangeEmail() bool { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + var ret bool + return ret + } + return *o.DefaultUserChangeEmail +} + +// GetDefaultUserChangeEmailOk returns a tuple with the DefaultUserChangeEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetDefaultUserChangeEmailOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + return nil, false + } + return o.DefaultUserChangeEmail, true +} + +// HasDefaultUserChangeEmail returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasDefaultUserChangeEmail() bool { + if o != nil && !IsNil(o.DefaultUserChangeEmail) { + return true + } + + return false +} + +// SetDefaultUserChangeEmail gets a reference to the given bool and assigns it to the DefaultUserChangeEmail field. +func (o *PatchedSettingsRequest) SetDefaultUserChangeEmail(v bool) { + o.DefaultUserChangeEmail = &v +} + +// GetDefaultUserChangeUsername returns the DefaultUserChangeUsername field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetDefaultUserChangeUsername() bool { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + var ret bool + return ret + } + return *o.DefaultUserChangeUsername +} + +// GetDefaultUserChangeUsernameOk returns a tuple with the DefaultUserChangeUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetDefaultUserChangeUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + return nil, false + } + return o.DefaultUserChangeUsername, true +} + +// HasDefaultUserChangeUsername returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasDefaultUserChangeUsername() bool { + if o != nil && !IsNil(o.DefaultUserChangeUsername) { + return true + } + + return false +} + +// SetDefaultUserChangeUsername gets a reference to the given bool and assigns it to the DefaultUserChangeUsername field. +func (o *PatchedSettingsRequest) SetDefaultUserChangeUsername(v bool) { + o.DefaultUserChangeUsername = &v +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *PatchedSettingsRequest) SetEventRetention(v string) { + o.EventRetention = &v +} + +// GetReputationLowerLimit returns the ReputationLowerLimit field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetReputationLowerLimit() int32 { + if o == nil || IsNil(o.ReputationLowerLimit) { + var ret int32 + return ret + } + return *o.ReputationLowerLimit +} + +// GetReputationLowerLimitOk returns a tuple with the ReputationLowerLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetReputationLowerLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationLowerLimit) { + return nil, false + } + return o.ReputationLowerLimit, true +} + +// HasReputationLowerLimit returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasReputationLowerLimit() bool { + if o != nil && !IsNil(o.ReputationLowerLimit) { + return true + } + + return false +} + +// SetReputationLowerLimit gets a reference to the given int32 and assigns it to the ReputationLowerLimit field. +func (o *PatchedSettingsRequest) SetReputationLowerLimit(v int32) { + o.ReputationLowerLimit = &v +} + +// GetReputationUpperLimit returns the ReputationUpperLimit field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetReputationUpperLimit() int32 { + if o == nil || IsNil(o.ReputationUpperLimit) { + var ret int32 + return ret + } + return *o.ReputationUpperLimit +} + +// GetReputationUpperLimitOk returns a tuple with the ReputationUpperLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetReputationUpperLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationUpperLimit) { + return nil, false + } + return o.ReputationUpperLimit, true +} + +// HasReputationUpperLimit returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasReputationUpperLimit() bool { + if o != nil && !IsNil(o.ReputationUpperLimit) { + return true + } + + return false +} + +// SetReputationUpperLimit gets a reference to the given int32 and assigns it to the ReputationUpperLimit field. +func (o *PatchedSettingsRequest) SetReputationUpperLimit(v int32) { + o.ReputationUpperLimit = &v +} + +// GetFooterLinks returns the FooterLinks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedSettingsRequest) GetFooterLinks() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.FooterLinks +} + +// GetFooterLinksOk returns a tuple with the FooterLinks field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedSettingsRequest) GetFooterLinksOk() (*interface{}, bool) { + if o == nil || IsNil(o.FooterLinks) { + return nil, false + } + return &o.FooterLinks, true +} + +// HasFooterLinks returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasFooterLinks() bool { + if o != nil && !IsNil(o.FooterLinks) { + return true + } + + return false +} + +// SetFooterLinks gets a reference to the given interface{} and assigns it to the FooterLinks field. +func (o *PatchedSettingsRequest) SetFooterLinks(v interface{}) { + o.FooterLinks = v +} + +// GetGdprCompliance returns the GdprCompliance field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetGdprCompliance() bool { + if o == nil || IsNil(o.GdprCompliance) { + var ret bool + return ret + } + return *o.GdprCompliance +} + +// GetGdprComplianceOk returns a tuple with the GdprCompliance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetGdprComplianceOk() (*bool, bool) { + if o == nil || IsNil(o.GdprCompliance) { + return nil, false + } + return o.GdprCompliance, true +} + +// HasGdprCompliance returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasGdprCompliance() bool { + if o != nil && !IsNil(o.GdprCompliance) { + return true + } + + return false +} + +// SetGdprCompliance gets a reference to the given bool and assigns it to the GdprCompliance field. +func (o *PatchedSettingsRequest) SetGdprCompliance(v bool) { + o.GdprCompliance = &v +} + +// GetImpersonation returns the Impersonation field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetImpersonation() bool { + if o == nil || IsNil(o.Impersonation) { + var ret bool + return ret + } + return *o.Impersonation +} + +// GetImpersonationOk returns a tuple with the Impersonation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetImpersonationOk() (*bool, bool) { + if o == nil || IsNil(o.Impersonation) { + return nil, false + } + return o.Impersonation, true +} + +// HasImpersonation returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasImpersonation() bool { + if o != nil && !IsNil(o.Impersonation) { + return true + } + + return false +} + +// SetImpersonation gets a reference to the given bool and assigns it to the Impersonation field. +func (o *PatchedSettingsRequest) SetImpersonation(v bool) { + o.Impersonation = &v +} + +// GetImpersonationRequireReason returns the ImpersonationRequireReason field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetImpersonationRequireReason() bool { + if o == nil || IsNil(o.ImpersonationRequireReason) { + var ret bool + return ret + } + return *o.ImpersonationRequireReason +} + +// GetImpersonationRequireReasonOk returns a tuple with the ImpersonationRequireReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetImpersonationRequireReasonOk() (*bool, bool) { + if o == nil || IsNil(o.ImpersonationRequireReason) { + return nil, false + } + return o.ImpersonationRequireReason, true +} + +// HasImpersonationRequireReason returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasImpersonationRequireReason() bool { + if o != nil && !IsNil(o.ImpersonationRequireReason) { + return true + } + + return false +} + +// SetImpersonationRequireReason gets a reference to the given bool and assigns it to the ImpersonationRequireReason field. +func (o *PatchedSettingsRequest) SetImpersonationRequireReason(v bool) { + o.ImpersonationRequireReason = &v +} + +// GetDefaultTokenDuration returns the DefaultTokenDuration field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetDefaultTokenDuration() string { + if o == nil || IsNil(o.DefaultTokenDuration) { + var ret string + return ret + } + return *o.DefaultTokenDuration +} + +// GetDefaultTokenDurationOk returns a tuple with the DefaultTokenDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetDefaultTokenDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultTokenDuration) { + return nil, false + } + return o.DefaultTokenDuration, true +} + +// HasDefaultTokenDuration returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasDefaultTokenDuration() bool { + if o != nil && !IsNil(o.DefaultTokenDuration) { + return true + } + + return false +} + +// SetDefaultTokenDuration gets a reference to the given string and assigns it to the DefaultTokenDuration field. +func (o *PatchedSettingsRequest) SetDefaultTokenDuration(v string) { + o.DefaultTokenDuration = &v +} + +// GetDefaultTokenLength returns the DefaultTokenLength field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetDefaultTokenLength() int32 { + if o == nil || IsNil(o.DefaultTokenLength) { + var ret int32 + return ret + } + return *o.DefaultTokenLength +} + +// GetDefaultTokenLengthOk returns a tuple with the DefaultTokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetDefaultTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultTokenLength) { + return nil, false + } + return o.DefaultTokenLength, true +} + +// HasDefaultTokenLength returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasDefaultTokenLength() bool { + if o != nil && !IsNil(o.DefaultTokenLength) { + return true + } + + return false +} + +// SetDefaultTokenLength gets a reference to the given int32 and assigns it to the DefaultTokenLength field. +func (o *PatchedSettingsRequest) SetDefaultTokenLength(v int32) { + o.DefaultTokenLength = &v +} + +// GetPaginationDefaultPageSize returns the PaginationDefaultPageSize field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetPaginationDefaultPageSize() int32 { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + var ret int32 + return ret + } + return *o.PaginationDefaultPageSize +} + +// GetPaginationDefaultPageSizeOk returns a tuple with the PaginationDefaultPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetPaginationDefaultPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + return nil, false + } + return o.PaginationDefaultPageSize, true +} + +// HasPaginationDefaultPageSize returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasPaginationDefaultPageSize() bool { + if o != nil && !IsNil(o.PaginationDefaultPageSize) { + return true + } + + return false +} + +// SetPaginationDefaultPageSize gets a reference to the given int32 and assigns it to the PaginationDefaultPageSize field. +func (o *PatchedSettingsRequest) SetPaginationDefaultPageSize(v int32) { + o.PaginationDefaultPageSize = &v +} + +// GetPaginationMaxPageSize returns the PaginationMaxPageSize field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetPaginationMaxPageSize() int32 { + if o == nil || IsNil(o.PaginationMaxPageSize) { + var ret int32 + return ret + } + return *o.PaginationMaxPageSize +} + +// GetPaginationMaxPageSizeOk returns a tuple with the PaginationMaxPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetPaginationMaxPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationMaxPageSize) { + return nil, false + } + return o.PaginationMaxPageSize, true +} + +// HasPaginationMaxPageSize returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasPaginationMaxPageSize() bool { + if o != nil && !IsNil(o.PaginationMaxPageSize) { + return true + } + + return false +} + +// SetPaginationMaxPageSize gets a reference to the given int32 and assigns it to the PaginationMaxPageSize field. +func (o *PatchedSettingsRequest) SetPaginationMaxPageSize(v int32) { + o.PaginationMaxPageSize = &v +} + +// GetFlags returns the Flags field value if set, zero value otherwise. +func (o *PatchedSettingsRequest) GetFlags() PatchedSettingsRequestFlags { + if o == nil || IsNil(o.Flags) { + var ret PatchedSettingsRequestFlags + return ret + } + return *o.Flags +} + +// GetFlagsOk returns a tuple with the Flags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequest) GetFlagsOk() (*PatchedSettingsRequestFlags, bool) { + if o == nil || IsNil(o.Flags) { + return nil, false + } + return o.Flags, true +} + +// HasFlags returns a boolean if a field has been set. +func (o *PatchedSettingsRequest) HasFlags() bool { + if o != nil && !IsNil(o.Flags) { + return true + } + + return false +} + +// SetFlags gets a reference to the given PatchedSettingsRequestFlags and assigns it to the Flags field. +func (o *PatchedSettingsRequest) SetFlags(v PatchedSettingsRequestFlags) { + o.Flags = &v +} + +func (o PatchedSettingsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSettingsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Avatars) { + toSerialize["avatars"] = o.Avatars + } + if !IsNil(o.DefaultUserChangeName) { + toSerialize["default_user_change_name"] = o.DefaultUserChangeName + } + if !IsNil(o.DefaultUserChangeEmail) { + toSerialize["default_user_change_email"] = o.DefaultUserChangeEmail + } + if !IsNil(o.DefaultUserChangeUsername) { + toSerialize["default_user_change_username"] = o.DefaultUserChangeUsername + } + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + if !IsNil(o.ReputationLowerLimit) { + toSerialize["reputation_lower_limit"] = o.ReputationLowerLimit + } + if !IsNil(o.ReputationUpperLimit) { + toSerialize["reputation_upper_limit"] = o.ReputationUpperLimit + } + if o.FooterLinks != nil { + toSerialize["footer_links"] = o.FooterLinks + } + if !IsNil(o.GdprCompliance) { + toSerialize["gdpr_compliance"] = o.GdprCompliance + } + if !IsNil(o.Impersonation) { + toSerialize["impersonation"] = o.Impersonation + } + if !IsNil(o.ImpersonationRequireReason) { + toSerialize["impersonation_require_reason"] = o.ImpersonationRequireReason + } + if !IsNil(o.DefaultTokenDuration) { + toSerialize["default_token_duration"] = o.DefaultTokenDuration + } + if !IsNil(o.DefaultTokenLength) { + toSerialize["default_token_length"] = o.DefaultTokenLength + } + if !IsNil(o.PaginationDefaultPageSize) { + toSerialize["pagination_default_page_size"] = o.PaginationDefaultPageSize + } + if !IsNil(o.PaginationMaxPageSize) { + toSerialize["pagination_max_page_size"] = o.PaginationMaxPageSize + } + if !IsNil(o.Flags) { + toSerialize["flags"] = o.Flags + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSettingsRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSettingsRequest := _PatchedSettingsRequest{} + + err = json.Unmarshal(data, &varPatchedSettingsRequest) + + if err != nil { + return err + } + + *o = PatchedSettingsRequest(varPatchedSettingsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "avatars") + delete(additionalProperties, "default_user_change_name") + delete(additionalProperties, "default_user_change_email") + delete(additionalProperties, "default_user_change_username") + delete(additionalProperties, "event_retention") + delete(additionalProperties, "reputation_lower_limit") + delete(additionalProperties, "reputation_upper_limit") + delete(additionalProperties, "footer_links") + delete(additionalProperties, "gdpr_compliance") + delete(additionalProperties, "impersonation") + delete(additionalProperties, "impersonation_require_reason") + delete(additionalProperties, "default_token_duration") + delete(additionalProperties, "default_token_length") + delete(additionalProperties, "pagination_default_page_size") + delete(additionalProperties, "pagination_max_page_size") + delete(additionalProperties, "flags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSettingsRequest struct { + value *PatchedSettingsRequest + isSet bool +} + +func (v NullablePatchedSettingsRequest) Get() *PatchedSettingsRequest { + return v.value +} + +func (v *NullablePatchedSettingsRequest) Set(val *PatchedSettingsRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSettingsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSettingsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSettingsRequest(val *PatchedSettingsRequest) *NullablePatchedSettingsRequest { + return &NullablePatchedSettingsRequest{value: val, isSet: true} +} + +func (v NullablePatchedSettingsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSettingsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_settings_request_flags.go b/packages/client-go/model_patched_settings_request_flags.go new file mode 100644 index 0000000000..8292b433f6 --- /dev/null +++ b/packages/client-go/model_patched_settings_request_flags.go @@ -0,0 +1,258 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PatchedSettingsRequestFlags type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSettingsRequestFlags{} + +// PatchedSettingsRequestFlags struct for PatchedSettingsRequestFlags +type PatchedSettingsRequestFlags struct { + // Configure if applications without any policy/group/user bindings should be accessible to any user. + CoreDefaultAppAccess bool `json:"core_default_app_access"` + // Include additional information in audit logs, may incur a performance penalty. + EnterpriseAuditIncludeExpandedDiff bool `json:"enterprise_audit_include_expanded_diff"` + // Upon successful authentication, re-start authentication in other open tabs. + FlowsContinuousLogin bool `json:"flows_continuous_login"` + // Refresh other tabs after successful authentication. + FlowsRefreshOthers bool `json:"flows_refresh_others"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSettingsRequestFlags PatchedSettingsRequestFlags + +// NewPatchedSettingsRequestFlags instantiates a new PatchedSettingsRequestFlags object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSettingsRequestFlags(coreDefaultAppAccess bool, enterpriseAuditIncludeExpandedDiff bool, flowsContinuousLogin bool, flowsRefreshOthers bool) *PatchedSettingsRequestFlags { + this := PatchedSettingsRequestFlags{} + this.CoreDefaultAppAccess = coreDefaultAppAccess + this.EnterpriseAuditIncludeExpandedDiff = enterpriseAuditIncludeExpandedDiff + this.FlowsContinuousLogin = flowsContinuousLogin + this.FlowsRefreshOthers = flowsRefreshOthers + return &this +} + +// NewPatchedSettingsRequestFlagsWithDefaults instantiates a new PatchedSettingsRequestFlags object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSettingsRequestFlagsWithDefaults() *PatchedSettingsRequestFlags { + this := PatchedSettingsRequestFlags{} + return &this +} + +// GetCoreDefaultAppAccess returns the CoreDefaultAppAccess field value +func (o *PatchedSettingsRequestFlags) GetCoreDefaultAppAccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.CoreDefaultAppAccess +} + +// GetCoreDefaultAppAccessOk returns a tuple with the CoreDefaultAppAccess field value +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequestFlags) GetCoreDefaultAppAccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.CoreDefaultAppAccess, true +} + +// SetCoreDefaultAppAccess sets field value +func (o *PatchedSettingsRequestFlags) SetCoreDefaultAppAccess(v bool) { + o.CoreDefaultAppAccess = v +} + +// GetEnterpriseAuditIncludeExpandedDiff returns the EnterpriseAuditIncludeExpandedDiff field value +func (o *PatchedSettingsRequestFlags) GetEnterpriseAuditIncludeExpandedDiff() bool { + if o == nil { + var ret bool + return ret + } + + return o.EnterpriseAuditIncludeExpandedDiff +} + +// GetEnterpriseAuditIncludeExpandedDiffOk returns a tuple with the EnterpriseAuditIncludeExpandedDiff field value +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequestFlags) GetEnterpriseAuditIncludeExpandedDiffOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.EnterpriseAuditIncludeExpandedDiff, true +} + +// SetEnterpriseAuditIncludeExpandedDiff sets field value +func (o *PatchedSettingsRequestFlags) SetEnterpriseAuditIncludeExpandedDiff(v bool) { + o.EnterpriseAuditIncludeExpandedDiff = v +} + +// GetFlowsContinuousLogin returns the FlowsContinuousLogin field value +func (o *PatchedSettingsRequestFlags) GetFlowsContinuousLogin() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlowsContinuousLogin +} + +// GetFlowsContinuousLoginOk returns a tuple with the FlowsContinuousLogin field value +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequestFlags) GetFlowsContinuousLoginOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlowsContinuousLogin, true +} + +// SetFlowsContinuousLogin sets field value +func (o *PatchedSettingsRequestFlags) SetFlowsContinuousLogin(v bool) { + o.FlowsContinuousLogin = v +} + +// GetFlowsRefreshOthers returns the FlowsRefreshOthers field value +func (o *PatchedSettingsRequestFlags) GetFlowsRefreshOthers() bool { + if o == nil { + var ret bool + return ret + } + + return o.FlowsRefreshOthers +} + +// GetFlowsRefreshOthersOk returns a tuple with the FlowsRefreshOthers field value +// and a boolean to check if the value has been set. +func (o *PatchedSettingsRequestFlags) GetFlowsRefreshOthersOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.FlowsRefreshOthers, true +} + +// SetFlowsRefreshOthers sets field value +func (o *PatchedSettingsRequestFlags) SetFlowsRefreshOthers(v bool) { + o.FlowsRefreshOthers = v +} + +func (o PatchedSettingsRequestFlags) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSettingsRequestFlags) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["core_default_app_access"] = o.CoreDefaultAppAccess + toSerialize["enterprise_audit_include_expanded_diff"] = o.EnterpriseAuditIncludeExpandedDiff + toSerialize["flows_continuous_login"] = o.FlowsContinuousLogin + toSerialize["flows_refresh_others"] = o.FlowsRefreshOthers + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSettingsRequestFlags) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "core_default_app_access", + "enterprise_audit_include_expanded_diff", + "flows_continuous_login", + "flows_refresh_others", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchedSettingsRequestFlags := _PatchedSettingsRequestFlags{} + + err = json.Unmarshal(data, &varPatchedSettingsRequestFlags) + + if err != nil { + return err + } + + *o = PatchedSettingsRequestFlags(varPatchedSettingsRequestFlags) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "core_default_app_access") + delete(additionalProperties, "enterprise_audit_include_expanded_diff") + delete(additionalProperties, "flows_continuous_login") + delete(additionalProperties, "flows_refresh_others") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSettingsRequestFlags struct { + value *PatchedSettingsRequestFlags + isSet bool +} + +func (v NullablePatchedSettingsRequestFlags) Get() *PatchedSettingsRequestFlags { + return v.value +} + +func (v *NullablePatchedSettingsRequestFlags) Set(val *PatchedSettingsRequestFlags) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSettingsRequestFlags) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSettingsRequestFlags) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSettingsRequestFlags(val *PatchedSettingsRequestFlags) *NullablePatchedSettingsRequestFlags { + return &NullablePatchedSettingsRequestFlags{value: val, isSet: true} +} + +func (v NullablePatchedSettingsRequestFlags) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSettingsRequestFlags) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_sms_device_request.go b/packages/client-go/model_patched_sms_device_request.go new file mode 100644 index 0000000000..f25a0fb629 --- /dev/null +++ b/packages/client-go/model_patched_sms_device_request.go @@ -0,0 +1,155 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSMSDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSMSDeviceRequest{} + +// PatchedSMSDeviceRequest Serializer for sms authenticator devices +type PatchedSMSDeviceRequest struct { + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSMSDeviceRequest PatchedSMSDeviceRequest + +// NewPatchedSMSDeviceRequest instantiates a new PatchedSMSDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSMSDeviceRequest() *PatchedSMSDeviceRequest { + this := PatchedSMSDeviceRequest{} + return &this +} + +// NewPatchedSMSDeviceRequestWithDefaults instantiates a new PatchedSMSDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSMSDeviceRequestWithDefaults() *PatchedSMSDeviceRequest { + this := PatchedSMSDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSMSDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSMSDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSMSDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSMSDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedSMSDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSMSDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSMSDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSMSDeviceRequest := _PatchedSMSDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedSMSDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedSMSDeviceRequest(varPatchedSMSDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSMSDeviceRequest struct { + value *PatchedSMSDeviceRequest + isSet bool +} + +func (v NullablePatchedSMSDeviceRequest) Get() *PatchedSMSDeviceRequest { + return v.value +} + +func (v *NullablePatchedSMSDeviceRequest) Set(val *PatchedSMSDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSMSDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSMSDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSMSDeviceRequest(val *PatchedSMSDeviceRequest) *NullablePatchedSMSDeviceRequest { + return &NullablePatchedSMSDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedSMSDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSMSDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_source_stage_request.go b/packages/client-go/model_patched_source_stage_request.go new file mode 100644 index 0000000000..0e7b56999d --- /dev/null +++ b/packages/client-go/model_patched_source_stage_request.go @@ -0,0 +1,229 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSourceStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSourceStageRequest{} + +// PatchedSourceStageRequest SourceStage Serializer +type PatchedSourceStageRequest struct { + Name *string `json:"name,omitempty"` + Source *string `json:"source,omitempty"` + // Amount of time a user can take to return from the source to continue the flow (Format: hours=-1;minutes=-2;seconds=-3) + ResumeTimeout *string `json:"resume_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSourceStageRequest PatchedSourceStageRequest + +// NewPatchedSourceStageRequest instantiates a new PatchedSourceStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSourceStageRequest() *PatchedSourceStageRequest { + this := PatchedSourceStageRequest{} + return &this +} + +// NewPatchedSourceStageRequestWithDefaults instantiates a new PatchedSourceStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSourceStageRequestWithDefaults() *PatchedSourceStageRequest { + this := PatchedSourceStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSourceStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSourceStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSourceStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSourceStageRequest) SetName(v string) { + o.Name = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedSourceStageRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSourceStageRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedSourceStageRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedSourceStageRequest) SetSource(v string) { + o.Source = &v +} + +// GetResumeTimeout returns the ResumeTimeout field value if set, zero value otherwise. +func (o *PatchedSourceStageRequest) GetResumeTimeout() string { + if o == nil || IsNil(o.ResumeTimeout) { + var ret string + return ret + } + return *o.ResumeTimeout +} + +// GetResumeTimeoutOk returns a tuple with the ResumeTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSourceStageRequest) GetResumeTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ResumeTimeout) { + return nil, false + } + return o.ResumeTimeout, true +} + +// HasResumeTimeout returns a boolean if a field has been set. +func (o *PatchedSourceStageRequest) HasResumeTimeout() bool { + if o != nil && !IsNil(o.ResumeTimeout) { + return true + } + + return false +} + +// SetResumeTimeout gets a reference to the given string and assigns it to the ResumeTimeout field. +func (o *PatchedSourceStageRequest) SetResumeTimeout(v string) { + o.ResumeTimeout = &v +} + +func (o PatchedSourceStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSourceStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.ResumeTimeout) { + toSerialize["resume_timeout"] = o.ResumeTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSourceStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSourceStageRequest := _PatchedSourceStageRequest{} + + err = json.Unmarshal(data, &varPatchedSourceStageRequest) + + if err != nil { + return err + } + + *o = PatchedSourceStageRequest(varPatchedSourceStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "source") + delete(additionalProperties, "resume_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSourceStageRequest struct { + value *PatchedSourceStageRequest + isSet bool +} + +func (v NullablePatchedSourceStageRequest) Get() *PatchedSourceStageRequest { + return v.value +} + +func (v *NullablePatchedSourceStageRequest) Set(val *PatchedSourceStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSourceStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSourceStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSourceStageRequest(val *PatchedSourceStageRequest) *NullablePatchedSourceStageRequest { + return &NullablePatchedSourceStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedSourceStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSourceStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_ssf_provider_request.go b/packages/client-go/model_patched_ssf_provider_request.go new file mode 100644 index 0000000000..84712b3b5d --- /dev/null +++ b/packages/client-go/model_patched_ssf_provider_request.go @@ -0,0 +1,266 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedSSFProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedSSFProviderRequest{} + +// PatchedSSFProviderRequest SSFProvider Serializer +type PatchedSSFProviderRequest struct { + Name *string `json:"name,omitempty"` + // Key used to sign the SSF Events. + SigningKey *string `json:"signing_key,omitempty"` + OidcAuthProviders []int32 `json:"oidc_auth_providers,omitempty"` + EventRetention *string `json:"event_retention,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedSSFProviderRequest PatchedSSFProviderRequest + +// NewPatchedSSFProviderRequest instantiates a new PatchedSSFProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedSSFProviderRequest() *PatchedSSFProviderRequest { + this := PatchedSSFProviderRequest{} + return &this +} + +// NewPatchedSSFProviderRequestWithDefaults instantiates a new PatchedSSFProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedSSFProviderRequestWithDefaults() *PatchedSSFProviderRequest { + this := PatchedSSFProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedSSFProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSSFProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedSSFProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedSSFProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetSigningKey returns the SigningKey field value if set, zero value otherwise. +func (o *PatchedSSFProviderRequest) GetSigningKey() string { + if o == nil || IsNil(o.SigningKey) { + var ret string + return ret + } + return *o.SigningKey +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSSFProviderRequest) GetSigningKeyOk() (*string, bool) { + if o == nil || IsNil(o.SigningKey) { + return nil, false + } + return o.SigningKey, true +} + +// HasSigningKey returns a boolean if a field has been set. +func (o *PatchedSSFProviderRequest) HasSigningKey() bool { + if o != nil && !IsNil(o.SigningKey) { + return true + } + + return false +} + +// SetSigningKey gets a reference to the given string and assigns it to the SigningKey field. +func (o *PatchedSSFProviderRequest) SetSigningKey(v string) { + o.SigningKey = &v +} + +// GetOidcAuthProviders returns the OidcAuthProviders field value if set, zero value otherwise. +func (o *PatchedSSFProviderRequest) GetOidcAuthProviders() []int32 { + if o == nil || IsNil(o.OidcAuthProviders) { + var ret []int32 + return ret + } + return o.OidcAuthProviders +} + +// GetOidcAuthProvidersOk returns a tuple with the OidcAuthProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSSFProviderRequest) GetOidcAuthProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.OidcAuthProviders) { + return nil, false + } + return o.OidcAuthProviders, true +} + +// HasOidcAuthProviders returns a boolean if a field has been set. +func (o *PatchedSSFProviderRequest) HasOidcAuthProviders() bool { + if o != nil && !IsNil(o.OidcAuthProviders) { + return true + } + + return false +} + +// SetOidcAuthProviders gets a reference to the given []int32 and assigns it to the OidcAuthProviders field. +func (o *PatchedSSFProviderRequest) SetOidcAuthProviders(v []int32) { + o.OidcAuthProviders = v +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *PatchedSSFProviderRequest) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedSSFProviderRequest) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *PatchedSSFProviderRequest) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *PatchedSSFProviderRequest) SetEventRetention(v string) { + o.EventRetention = &v +} + +func (o PatchedSSFProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedSSFProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.SigningKey) { + toSerialize["signing_key"] = o.SigningKey + } + if !IsNil(o.OidcAuthProviders) { + toSerialize["oidc_auth_providers"] = o.OidcAuthProviders + } + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedSSFProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedSSFProviderRequest := _PatchedSSFProviderRequest{} + + err = json.Unmarshal(data, &varPatchedSSFProviderRequest) + + if err != nil { + return err + } + + *o = PatchedSSFProviderRequest(varPatchedSSFProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "oidc_auth_providers") + delete(additionalProperties, "event_retention") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedSSFProviderRequest struct { + value *PatchedSSFProviderRequest + isSet bool +} + +func (v NullablePatchedSSFProviderRequest) Get() *PatchedSSFProviderRequest { + return v.value +} + +func (v *NullablePatchedSSFProviderRequest) Set(val *PatchedSSFProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedSSFProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedSSFProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedSSFProviderRequest(val *PatchedSSFProviderRequest) *NullablePatchedSSFProviderRequest { + return &NullablePatchedSSFProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedSSFProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedSSFProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_static_device_request.go b/packages/client-go/model_patched_static_device_request.go new file mode 100644 index 0000000000..cf56c5af3b --- /dev/null +++ b/packages/client-go/model_patched_static_device_request.go @@ -0,0 +1,155 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedStaticDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedStaticDeviceRequest{} + +// PatchedStaticDeviceRequest Serializer for static authenticator devices +type PatchedStaticDeviceRequest struct { + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedStaticDeviceRequest PatchedStaticDeviceRequest + +// NewPatchedStaticDeviceRequest instantiates a new PatchedStaticDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedStaticDeviceRequest() *PatchedStaticDeviceRequest { + this := PatchedStaticDeviceRequest{} + return &this +} + +// NewPatchedStaticDeviceRequestWithDefaults instantiates a new PatchedStaticDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedStaticDeviceRequestWithDefaults() *PatchedStaticDeviceRequest { + this := PatchedStaticDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedStaticDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedStaticDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedStaticDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedStaticDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedStaticDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedStaticDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedStaticDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedStaticDeviceRequest := _PatchedStaticDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedStaticDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedStaticDeviceRequest(varPatchedStaticDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedStaticDeviceRequest struct { + value *PatchedStaticDeviceRequest + isSet bool +} + +func (v NullablePatchedStaticDeviceRequest) Get() *PatchedStaticDeviceRequest { + return v.value +} + +func (v *NullablePatchedStaticDeviceRequest) Set(val *PatchedStaticDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedStaticDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedStaticDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedStaticDeviceRequest(val *PatchedStaticDeviceRequest) *NullablePatchedStaticDeviceRequest { + return &NullablePatchedStaticDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedStaticDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedStaticDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_telegram_source_property_mapping_request.go b/packages/client-go/model_patched_telegram_source_property_mapping_request.go new file mode 100644 index 0000000000..f7863bbfa8 --- /dev/null +++ b/packages/client-go/model_patched_telegram_source_property_mapping_request.go @@ -0,0 +1,240 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedTelegramSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTelegramSourcePropertyMappingRequest{} + +// PatchedTelegramSourcePropertyMappingRequest TelegramSourcePropertyMapping Serializer +type PatchedTelegramSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name *string `json:"name,omitempty"` + Expression *string `json:"expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTelegramSourcePropertyMappingRequest PatchedTelegramSourcePropertyMappingRequest + +// NewPatchedTelegramSourcePropertyMappingRequest instantiates a new PatchedTelegramSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTelegramSourcePropertyMappingRequest() *PatchedTelegramSourcePropertyMappingRequest { + this := PatchedTelegramSourcePropertyMappingRequest{} + return &this +} + +// NewPatchedTelegramSourcePropertyMappingRequestWithDefaults instantiates a new PatchedTelegramSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTelegramSourcePropertyMappingRequestWithDefaults() *PatchedTelegramSourcePropertyMappingRequest { + this := PatchedTelegramSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedTelegramSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedTelegramSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedTelegramSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedTelegramSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedTelegramSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedTelegramSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTelegramSourcePropertyMappingRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTelegramSourcePropertyMappingRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTelegramSourcePropertyMappingRequest) SetName(v string) { + o.Name = &v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *PatchedTelegramSourcePropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *PatchedTelegramSourcePropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *PatchedTelegramSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +func (o PatchedTelegramSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTelegramSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTelegramSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTelegramSourcePropertyMappingRequest := _PatchedTelegramSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPatchedTelegramSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PatchedTelegramSourcePropertyMappingRequest(varPatchedTelegramSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTelegramSourcePropertyMappingRequest struct { + value *PatchedTelegramSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePatchedTelegramSourcePropertyMappingRequest) Get() *PatchedTelegramSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePatchedTelegramSourcePropertyMappingRequest) Set(val *PatchedTelegramSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTelegramSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTelegramSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTelegramSourcePropertyMappingRequest(val *PatchedTelegramSourcePropertyMappingRequest) *NullablePatchedTelegramSourcePropertyMappingRequest { + return &NullablePatchedTelegramSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePatchedTelegramSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTelegramSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_telegram_source_request.go b/packages/client-go/model_patched_telegram_source_request.go new file mode 100644 index 0000000000..e2a2369da1 --- /dev/null +++ b/packages/client-go/model_patched_telegram_source_request.go @@ -0,0 +1,741 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedTelegramSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTelegramSourceRequest{} + +// PatchedTelegramSourceRequest Source Serializer +type PatchedTelegramSourceRequest struct { + // Source's display Name. + Name *string `json:"name,omitempty"` + // Internal source name, used in URLs. + Slug *string `json:"slug,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // Telegram bot username + BotUsername *string `json:"bot_username,omitempty"` + // Telegram bot token + BotToken *string `json:"bot_token,omitempty"` + // Request access to send messages from your bot. + RequestMessageAccess *bool `json:"request_message_access,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow *string `json:"pre_authentication_flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTelegramSourceRequest PatchedTelegramSourceRequest + +// NewPatchedTelegramSourceRequest instantiates a new PatchedTelegramSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTelegramSourceRequest() *PatchedTelegramSourceRequest { + this := PatchedTelegramSourceRequest{} + return &this +} + +// NewPatchedTelegramSourceRequestWithDefaults instantiates a new PatchedTelegramSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTelegramSourceRequestWithDefaults() *PatchedTelegramSourceRequest { + this := PatchedTelegramSourceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTelegramSourceRequest) SetName(v string) { + o.Name = &v +} + +// GetSlug returns the Slug field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetSlug() string { + if o == nil || IsNil(o.Slug) { + var ret string + return ret + } + return *o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetSlugOk() (*string, bool) { + if o == nil || IsNil(o.Slug) { + return nil, false + } + return o.Slug, true +} + +// HasSlug returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasSlug() bool { + if o != nil && !IsNil(o.Slug) { + return true + } + + return false +} + +// SetSlug gets a reference to the given string and assigns it to the Slug field. +func (o *PatchedTelegramSourceRequest) SetSlug(v string) { + o.Slug = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PatchedTelegramSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PatchedTelegramSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedTelegramSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedTelegramSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedTelegramSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedTelegramSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedTelegramSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedTelegramSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedTelegramSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PatchedTelegramSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PatchedTelegramSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PatchedTelegramSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PatchedTelegramSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PatchedTelegramSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PatchedTelegramSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PatchedTelegramSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedTelegramSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PatchedTelegramSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetBotUsername returns the BotUsername field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetBotUsername() string { + if o == nil || IsNil(o.BotUsername) { + var ret string + return ret + } + return *o.BotUsername +} + +// GetBotUsernameOk returns a tuple with the BotUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetBotUsernameOk() (*string, bool) { + if o == nil || IsNil(o.BotUsername) { + return nil, false + } + return o.BotUsername, true +} + +// HasBotUsername returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasBotUsername() bool { + if o != nil && !IsNil(o.BotUsername) { + return true + } + + return false +} + +// SetBotUsername gets a reference to the given string and assigns it to the BotUsername field. +func (o *PatchedTelegramSourceRequest) SetBotUsername(v string) { + o.BotUsername = &v +} + +// GetBotToken returns the BotToken field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetBotToken() string { + if o == nil || IsNil(o.BotToken) { + var ret string + return ret + } + return *o.BotToken +} + +// GetBotTokenOk returns a tuple with the BotToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetBotTokenOk() (*string, bool) { + if o == nil || IsNil(o.BotToken) { + return nil, false + } + return o.BotToken, true +} + +// HasBotToken returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasBotToken() bool { + if o != nil && !IsNil(o.BotToken) { + return true + } + + return false +} + +// SetBotToken gets a reference to the given string and assigns it to the BotToken field. +func (o *PatchedTelegramSourceRequest) SetBotToken(v string) { + o.BotToken = &v +} + +// GetRequestMessageAccess returns the RequestMessageAccess field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetRequestMessageAccess() bool { + if o == nil || IsNil(o.RequestMessageAccess) { + var ret bool + return ret + } + return *o.RequestMessageAccess +} + +// GetRequestMessageAccessOk returns a tuple with the RequestMessageAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetRequestMessageAccessOk() (*bool, bool) { + if o == nil || IsNil(o.RequestMessageAccess) { + return nil, false + } + return o.RequestMessageAccess, true +} + +// HasRequestMessageAccess returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasRequestMessageAccess() bool { + if o != nil && !IsNil(o.RequestMessageAccess) { + return true + } + + return false +} + +// SetRequestMessageAccess gets a reference to the given bool and assigns it to the RequestMessageAccess field. +func (o *PatchedTelegramSourceRequest) SetRequestMessageAccess(v bool) { + o.RequestMessageAccess = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value if set, zero value otherwise. +func (o *PatchedTelegramSourceRequest) GetPreAuthenticationFlow() string { + if o == nil || IsNil(o.PreAuthenticationFlow) { + var ret string + return ret + } + return *o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTelegramSourceRequest) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil || IsNil(o.PreAuthenticationFlow) { + return nil, false + } + return o.PreAuthenticationFlow, true +} + +// HasPreAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedTelegramSourceRequest) HasPreAuthenticationFlow() bool { + if o != nil && !IsNil(o.PreAuthenticationFlow) { + return true + } + + return false +} + +// SetPreAuthenticationFlow gets a reference to the given string and assigns it to the PreAuthenticationFlow field. +func (o *PatchedTelegramSourceRequest) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = &v +} + +func (o PatchedTelegramSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTelegramSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Slug) { + toSerialize["slug"] = o.Slug + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.BotUsername) { + toSerialize["bot_username"] = o.BotUsername + } + if !IsNil(o.BotToken) { + toSerialize["bot_token"] = o.BotToken + } + if !IsNil(o.RequestMessageAccess) { + toSerialize["request_message_access"] = o.RequestMessageAccess + } + if !IsNil(o.PreAuthenticationFlow) { + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTelegramSourceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTelegramSourceRequest := _PatchedTelegramSourceRequest{} + + err = json.Unmarshal(data, &varPatchedTelegramSourceRequest) + + if err != nil { + return err + } + + *o = PatchedTelegramSourceRequest(varPatchedTelegramSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "bot_username") + delete(additionalProperties, "bot_token") + delete(additionalProperties, "request_message_access") + delete(additionalProperties, "pre_authentication_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTelegramSourceRequest struct { + value *PatchedTelegramSourceRequest + isSet bool +} + +func (v NullablePatchedTelegramSourceRequest) Get() *PatchedTelegramSourceRequest { + return v.value +} + +func (v *NullablePatchedTelegramSourceRequest) Set(val *PatchedTelegramSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTelegramSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTelegramSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTelegramSourceRequest(val *PatchedTelegramSourceRequest) *NullablePatchedTelegramSourceRequest { + return &NullablePatchedTelegramSourceRequest{value: val, isSet: true} +} + +func (v NullablePatchedTelegramSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTelegramSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_tenant_request.go b/packages/client-go/model_patched_tenant_request.go new file mode 100644 index 0000000000..c602ec8c2b --- /dev/null +++ b/packages/client-go/model_patched_tenant_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedTenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTenantRequest{} + +// PatchedTenantRequest Tenant Serializer +type PatchedTenantRequest struct { + SchemaName *string `json:"schema_name,omitempty"` + Name *string `json:"name,omitempty"` + Ready *bool `json:"ready,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTenantRequest PatchedTenantRequest + +// NewPatchedTenantRequest instantiates a new PatchedTenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTenantRequest() *PatchedTenantRequest { + this := PatchedTenantRequest{} + return &this +} + +// NewPatchedTenantRequestWithDefaults instantiates a new PatchedTenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTenantRequestWithDefaults() *PatchedTenantRequest { + this := PatchedTenantRequest{} + return &this +} + +// GetSchemaName returns the SchemaName field value if set, zero value otherwise. +func (o *PatchedTenantRequest) GetSchemaName() string { + if o == nil || IsNil(o.SchemaName) { + var ret string + return ret + } + return *o.SchemaName +} + +// GetSchemaNameOk returns a tuple with the SchemaName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTenantRequest) GetSchemaNameOk() (*string, bool) { + if o == nil || IsNil(o.SchemaName) { + return nil, false + } + return o.SchemaName, true +} + +// HasSchemaName returns a boolean if a field has been set. +func (o *PatchedTenantRequest) HasSchemaName() bool { + if o != nil && !IsNil(o.SchemaName) { + return true + } + + return false +} + +// SetSchemaName gets a reference to the given string and assigns it to the SchemaName field. +func (o *PatchedTenantRequest) SetSchemaName(v string) { + o.SchemaName = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTenantRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTenantRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTenantRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTenantRequest) SetName(v string) { + o.Name = &v +} + +// GetReady returns the Ready field value if set, zero value otherwise. +func (o *PatchedTenantRequest) GetReady() bool { + if o == nil || IsNil(o.Ready) { + var ret bool + return ret + } + return *o.Ready +} + +// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTenantRequest) GetReadyOk() (*bool, bool) { + if o == nil || IsNil(o.Ready) { + return nil, false + } + return o.Ready, true +} + +// HasReady returns a boolean if a field has been set. +func (o *PatchedTenantRequest) HasReady() bool { + if o != nil && !IsNil(o.Ready) { + return true + } + + return false +} + +// SetReady gets a reference to the given bool and assigns it to the Ready field. +func (o *PatchedTenantRequest) SetReady(v bool) { + o.Ready = &v +} + +func (o PatchedTenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SchemaName) { + toSerialize["schema_name"] = o.SchemaName + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Ready) { + toSerialize["ready"] = o.Ready + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTenantRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTenantRequest := _PatchedTenantRequest{} + + err = json.Unmarshal(data, &varPatchedTenantRequest) + + if err != nil { + return err + } + + *o = PatchedTenantRequest(varPatchedTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "schema_name") + delete(additionalProperties, "name") + delete(additionalProperties, "ready") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTenantRequest struct { + value *PatchedTenantRequest + isSet bool +} + +func (v NullablePatchedTenantRequest) Get() *PatchedTenantRequest { + return v.value +} + +func (v *NullablePatchedTenantRequest) Set(val *PatchedTenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTenantRequest(val *PatchedTenantRequest) *NullablePatchedTenantRequest { + return &NullablePatchedTenantRequest{value: val, isSet: true} +} + +func (v NullablePatchedTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_token_request.go b/packages/client-go/model_patched_token_request.go new file mode 100644 index 0000000000..7525d7f031 --- /dev/null +++ b/packages/client-go/model_patched_token_request.go @@ -0,0 +1,400 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedTokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTokenRequest{} + +// PatchedTokenRequest Token Serializer +type PatchedTokenRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Identifier *string `json:"identifier,omitempty" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Intent *IntentEnum `json:"intent,omitempty"` + User *int32 `json:"user,omitempty"` + Description *string `json:"description,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTokenRequest PatchedTokenRequest + +// NewPatchedTokenRequest instantiates a new PatchedTokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTokenRequest() *PatchedTokenRequest { + this := PatchedTokenRequest{} + return &this +} + +// NewPatchedTokenRequestWithDefaults instantiates a new PatchedTokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTokenRequestWithDefaults() *PatchedTokenRequest { + this := PatchedTokenRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedTokenRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedTokenRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PatchedTokenRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PatchedTokenRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PatchedTokenRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedTokenRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTokenRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedTokenRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +// GetIntent returns the Intent field value if set, zero value otherwise. +func (o *PatchedTokenRequest) GetIntent() IntentEnum { + if o == nil || IsNil(o.Intent) { + var ret IntentEnum + return ret + } + return *o.Intent +} + +// GetIntentOk returns a tuple with the Intent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTokenRequest) GetIntentOk() (*IntentEnum, bool) { + if o == nil || IsNil(o.Intent) { + return nil, false + } + return o.Intent, true +} + +// HasIntent returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasIntent() bool { + if o != nil && !IsNil(o.Intent) { + return true + } + + return false +} + +// SetIntent gets a reference to the given IntentEnum and assigns it to the Intent field. +func (o *PatchedTokenRequest) SetIntent(v IntentEnum) { + o.Intent = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedTokenRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTokenRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedTokenRequest) SetUser(v int32) { + o.User = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *PatchedTokenRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTokenRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *PatchedTokenRequest) SetDescription(v string) { + o.Description = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedTokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedTokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *PatchedTokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *PatchedTokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *PatchedTokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *PatchedTokenRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTokenRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *PatchedTokenRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *PatchedTokenRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +func (o PatchedTokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + if !IsNil(o.Intent) { + toSerialize["intent"] = o.Intent + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTokenRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTokenRequest := _PatchedTokenRequest{} + + err = json.Unmarshal(data, &varPatchedTokenRequest) + + if err != nil { + return err + } + + *o = PatchedTokenRequest(varPatchedTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "identifier") + delete(additionalProperties, "intent") + delete(additionalProperties, "user") + delete(additionalProperties, "description") + delete(additionalProperties, "expires") + delete(additionalProperties, "expiring") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTokenRequest struct { + value *PatchedTokenRequest + isSet bool +} + +func (v NullablePatchedTokenRequest) Get() *PatchedTokenRequest { + return v.value +} + +func (v *NullablePatchedTokenRequest) Set(val *PatchedTokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTokenRequest(val *PatchedTokenRequest) *NullablePatchedTokenRequest { + return &NullablePatchedTokenRequest{value: val, isSet: true} +} + +func (v NullablePatchedTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_totp_device_request.go b/packages/client-go/model_patched_totp_device_request.go new file mode 100644 index 0000000000..d370fee468 --- /dev/null +++ b/packages/client-go/model_patched_totp_device_request.go @@ -0,0 +1,155 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedTOTPDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedTOTPDeviceRequest{} + +// PatchedTOTPDeviceRequest Serializer for totp authenticator devices +type PatchedTOTPDeviceRequest struct { + // The human-readable name of this device. + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedTOTPDeviceRequest PatchedTOTPDeviceRequest + +// NewPatchedTOTPDeviceRequest instantiates a new PatchedTOTPDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedTOTPDeviceRequest() *PatchedTOTPDeviceRequest { + this := PatchedTOTPDeviceRequest{} + return &this +} + +// NewPatchedTOTPDeviceRequestWithDefaults instantiates a new PatchedTOTPDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedTOTPDeviceRequestWithDefaults() *PatchedTOTPDeviceRequest { + this := PatchedTOTPDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedTOTPDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedTOTPDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedTOTPDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedTOTPDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedTOTPDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedTOTPDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedTOTPDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedTOTPDeviceRequest := _PatchedTOTPDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedTOTPDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedTOTPDeviceRequest(varPatchedTOTPDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedTOTPDeviceRequest struct { + value *PatchedTOTPDeviceRequest + isSet bool +} + +func (v NullablePatchedTOTPDeviceRequest) Get() *PatchedTOTPDeviceRequest { + return v.value +} + +func (v *NullablePatchedTOTPDeviceRequest) Set(val *PatchedTOTPDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedTOTPDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedTOTPDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedTOTPDeviceRequest(val *PatchedTOTPDeviceRequest) *NullablePatchedTOTPDeviceRequest { + return &NullablePatchedTOTPDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedTOTPDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedTOTPDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_unique_password_policy_request.go b/packages/client-go/model_patched_unique_password_policy_request.go new file mode 100644 index 0000000000..1f526e7736 --- /dev/null +++ b/packages/client-go/model_patched_unique_password_policy_request.go @@ -0,0 +1,268 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUniquePasswordPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUniquePasswordPolicyRequest{} + +// PatchedUniquePasswordPolicyRequest Password Uniqueness Policy Serializer +type PatchedUniquePasswordPolicyRequest struct { + Name *string `json:"name,omitempty"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + // Number of passwords to check against. + NumHistoricalPasswords *int32 `json:"num_historical_passwords,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUniquePasswordPolicyRequest PatchedUniquePasswordPolicyRequest + +// NewPatchedUniquePasswordPolicyRequest instantiates a new PatchedUniquePasswordPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUniquePasswordPolicyRequest() *PatchedUniquePasswordPolicyRequest { + this := PatchedUniquePasswordPolicyRequest{} + return &this +} + +// NewPatchedUniquePasswordPolicyRequestWithDefaults instantiates a new PatchedUniquePasswordPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUniquePasswordPolicyRequestWithDefaults() *PatchedUniquePasswordPolicyRequest { + this := PatchedUniquePasswordPolicyRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUniquePasswordPolicyRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUniquePasswordPolicyRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUniquePasswordPolicyRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUniquePasswordPolicyRequest) SetName(v string) { + o.Name = &v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *PatchedUniquePasswordPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUniquePasswordPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *PatchedUniquePasswordPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *PatchedUniquePasswordPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *PatchedUniquePasswordPolicyRequest) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUniquePasswordPolicyRequest) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *PatchedUniquePasswordPolicyRequest) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *PatchedUniquePasswordPolicyRequest) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetNumHistoricalPasswords returns the NumHistoricalPasswords field value if set, zero value otherwise. +func (o *PatchedUniquePasswordPolicyRequest) GetNumHistoricalPasswords() int32 { + if o == nil || IsNil(o.NumHistoricalPasswords) { + var ret int32 + return ret + } + return *o.NumHistoricalPasswords +} + +// GetNumHistoricalPasswordsOk returns a tuple with the NumHistoricalPasswords field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUniquePasswordPolicyRequest) GetNumHistoricalPasswordsOk() (*int32, bool) { + if o == nil || IsNil(o.NumHistoricalPasswords) { + return nil, false + } + return o.NumHistoricalPasswords, true +} + +// HasNumHistoricalPasswords returns a boolean if a field has been set. +func (o *PatchedUniquePasswordPolicyRequest) HasNumHistoricalPasswords() bool { + if o != nil && !IsNil(o.NumHistoricalPasswords) { + return true + } + + return false +} + +// SetNumHistoricalPasswords gets a reference to the given int32 and assigns it to the NumHistoricalPasswords field. +func (o *PatchedUniquePasswordPolicyRequest) SetNumHistoricalPasswords(v int32) { + o.NumHistoricalPasswords = &v +} + +func (o PatchedUniquePasswordPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUniquePasswordPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.NumHistoricalPasswords) { + toSerialize["num_historical_passwords"] = o.NumHistoricalPasswords + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUniquePasswordPolicyRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUniquePasswordPolicyRequest := _PatchedUniquePasswordPolicyRequest{} + + err = json.Unmarshal(data, &varPatchedUniquePasswordPolicyRequest) + + if err != nil { + return err + } + + *o = PatchedUniquePasswordPolicyRequest(varPatchedUniquePasswordPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "password_field") + delete(additionalProperties, "num_historical_passwords") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUniquePasswordPolicyRequest struct { + value *PatchedUniquePasswordPolicyRequest + isSet bool +} + +func (v NullablePatchedUniquePasswordPolicyRequest) Get() *PatchedUniquePasswordPolicyRequest { + return v.value +} + +func (v *NullablePatchedUniquePasswordPolicyRequest) Set(val *PatchedUniquePasswordPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUniquePasswordPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUniquePasswordPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUniquePasswordPolicyRequest(val *PatchedUniquePasswordPolicyRequest) *NullablePatchedUniquePasswordPolicyRequest { + return &NullablePatchedUniquePasswordPolicyRequest{value: val, isSet: true} +} + +func (v NullablePatchedUniquePasswordPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUniquePasswordPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_delete_stage_request.go b/packages/client-go/model_patched_user_delete_stage_request.go new file mode 100644 index 0000000000..9948256109 --- /dev/null +++ b/packages/client-go/model_patched_user_delete_stage_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserDeleteStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserDeleteStageRequest{} + +// PatchedUserDeleteStageRequest UserDeleteStage Serializer +type PatchedUserDeleteStageRequest struct { + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserDeleteStageRequest PatchedUserDeleteStageRequest + +// NewPatchedUserDeleteStageRequest instantiates a new PatchedUserDeleteStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserDeleteStageRequest() *PatchedUserDeleteStageRequest { + this := PatchedUserDeleteStageRequest{} + return &this +} + +// NewPatchedUserDeleteStageRequestWithDefaults instantiates a new PatchedUserDeleteStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserDeleteStageRequestWithDefaults() *PatchedUserDeleteStageRequest { + this := PatchedUserDeleteStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUserDeleteStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserDeleteStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUserDeleteStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUserDeleteStageRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedUserDeleteStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserDeleteStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserDeleteStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserDeleteStageRequest := _PatchedUserDeleteStageRequest{} + + err = json.Unmarshal(data, &varPatchedUserDeleteStageRequest) + + if err != nil { + return err + } + + *o = PatchedUserDeleteStageRequest(varPatchedUserDeleteStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserDeleteStageRequest struct { + value *PatchedUserDeleteStageRequest + isSet bool +} + +func (v NullablePatchedUserDeleteStageRequest) Get() *PatchedUserDeleteStageRequest { + return v.value +} + +func (v *NullablePatchedUserDeleteStageRequest) Set(val *PatchedUserDeleteStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserDeleteStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserDeleteStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserDeleteStageRequest(val *PatchedUserDeleteStageRequest) *NullablePatchedUserDeleteStageRequest { + return &NullablePatchedUserDeleteStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserDeleteStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserDeleteStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_kerberos_source_connection_request.go b/packages/client-go/model_patched_user_kerberos_source_connection_request.go new file mode 100644 index 0000000000..950ceb5766 --- /dev/null +++ b/packages/client-go/model_patched_user_kerberos_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserKerberosSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserKerberosSourceConnectionRequest{} + +// PatchedUserKerberosSourceConnectionRequest User source connection +type PatchedUserKerberosSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserKerberosSourceConnectionRequest PatchedUserKerberosSourceConnectionRequest + +// NewPatchedUserKerberosSourceConnectionRequest instantiates a new PatchedUserKerberosSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserKerberosSourceConnectionRequest() *PatchedUserKerberosSourceConnectionRequest { + this := PatchedUserKerberosSourceConnectionRequest{} + return &this +} + +// NewPatchedUserKerberosSourceConnectionRequestWithDefaults instantiates a new PatchedUserKerberosSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserKerberosSourceConnectionRequestWithDefaults() *PatchedUserKerberosSourceConnectionRequest { + this := PatchedUserKerberosSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserKerberosSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserKerberosSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserKerberosSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserKerberosSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserKerberosSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserKerberosSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserKerberosSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedUserKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserKerberosSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserKerberosSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserKerberosSourceConnectionRequest := _PatchedUserKerberosSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserKerberosSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserKerberosSourceConnectionRequest(varPatchedUserKerberosSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserKerberosSourceConnectionRequest struct { + value *PatchedUserKerberosSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserKerberosSourceConnectionRequest) Get() *PatchedUserKerberosSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserKerberosSourceConnectionRequest) Set(val *PatchedUserKerberosSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserKerberosSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserKerberosSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserKerberosSourceConnectionRequest(val *PatchedUserKerberosSourceConnectionRequest) *NullablePatchedUserKerberosSourceConnectionRequest { + return &NullablePatchedUserKerberosSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserKerberosSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_ldap_source_connection_request.go b/packages/client-go/model_patched_user_ldap_source_connection_request.go new file mode 100644 index 0000000000..748ff3b29a --- /dev/null +++ b/packages/client-go/model_patched_user_ldap_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserLDAPSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserLDAPSourceConnectionRequest{} + +// PatchedUserLDAPSourceConnectionRequest User source connection +type PatchedUserLDAPSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserLDAPSourceConnectionRequest PatchedUserLDAPSourceConnectionRequest + +// NewPatchedUserLDAPSourceConnectionRequest instantiates a new PatchedUserLDAPSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserLDAPSourceConnectionRequest() *PatchedUserLDAPSourceConnectionRequest { + this := PatchedUserLDAPSourceConnectionRequest{} + return &this +} + +// NewPatchedUserLDAPSourceConnectionRequestWithDefaults instantiates a new PatchedUserLDAPSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserLDAPSourceConnectionRequestWithDefaults() *PatchedUserLDAPSourceConnectionRequest { + this := PatchedUserLDAPSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserLDAPSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserLDAPSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserLDAPSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserLDAPSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserLDAPSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserLDAPSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserLDAPSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedUserLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserLDAPSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserLDAPSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserLDAPSourceConnectionRequest := _PatchedUserLDAPSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserLDAPSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserLDAPSourceConnectionRequest(varPatchedUserLDAPSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserLDAPSourceConnectionRequest struct { + value *PatchedUserLDAPSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserLDAPSourceConnectionRequest) Get() *PatchedUserLDAPSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserLDAPSourceConnectionRequest) Set(val *PatchedUserLDAPSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserLDAPSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserLDAPSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserLDAPSourceConnectionRequest(val *PatchedUserLDAPSourceConnectionRequest) *NullablePatchedUserLDAPSourceConnectionRequest { + return &NullablePatchedUserLDAPSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserLDAPSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_login_stage_request.go b/packages/client-go/model_patched_user_login_stage_request.go new file mode 100644 index 0000000000..0557703229 --- /dev/null +++ b/packages/client-go/model_patched_user_login_stage_request.go @@ -0,0 +1,382 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserLoginStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserLoginStageRequest{} + +// PatchedUserLoginStageRequest UserLoginStage Serializer +type PatchedUserLoginStageRequest struct { + Name *string `json:"name,omitempty"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + SessionDuration *string `json:"session_duration,omitempty"` + // Terminate all other sessions of the user logging in. + TerminateOtherSessions *bool `json:"terminate_other_sessions,omitempty"` + // Offset the session will be extended by when the user picks the remember me option. Default of 0 means that the remember me option will not be shown. (Format: hours=-1;minutes=-2;seconds=-3) + RememberMeOffset *string `json:"remember_me_offset,omitempty"` + // Bind sessions created by this stage to the configured network + NetworkBinding *NetworkBindingEnum `json:"network_binding,omitempty"` + // Bind sessions created by this stage to the configured GeoIP location + GeoipBinding *GeoipBindingEnum `json:"geoip_binding,omitempty"` + // When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + RememberDevice *string `json:"remember_device,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserLoginStageRequest PatchedUserLoginStageRequest + +// NewPatchedUserLoginStageRequest instantiates a new PatchedUserLoginStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserLoginStageRequest() *PatchedUserLoginStageRequest { + this := PatchedUserLoginStageRequest{} + return &this +} + +// NewPatchedUserLoginStageRequestWithDefaults instantiates a new PatchedUserLoginStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserLoginStageRequestWithDefaults() *PatchedUserLoginStageRequest { + this := PatchedUserLoginStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUserLoginStageRequest) SetName(v string) { + o.Name = &v +} + +// GetSessionDuration returns the SessionDuration field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetSessionDuration() string { + if o == nil || IsNil(o.SessionDuration) { + var ret string + return ret + } + return *o.SessionDuration +} + +// GetSessionDurationOk returns a tuple with the SessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.SessionDuration) { + return nil, false + } + return o.SessionDuration, true +} + +// HasSessionDuration returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasSessionDuration() bool { + if o != nil && !IsNil(o.SessionDuration) { + return true + } + + return false +} + +// SetSessionDuration gets a reference to the given string and assigns it to the SessionDuration field. +func (o *PatchedUserLoginStageRequest) SetSessionDuration(v string) { + o.SessionDuration = &v +} + +// GetTerminateOtherSessions returns the TerminateOtherSessions field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetTerminateOtherSessions() bool { + if o == nil || IsNil(o.TerminateOtherSessions) { + var ret bool + return ret + } + return *o.TerminateOtherSessions +} + +// GetTerminateOtherSessionsOk returns a tuple with the TerminateOtherSessions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetTerminateOtherSessionsOk() (*bool, bool) { + if o == nil || IsNil(o.TerminateOtherSessions) { + return nil, false + } + return o.TerminateOtherSessions, true +} + +// HasTerminateOtherSessions returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasTerminateOtherSessions() bool { + if o != nil && !IsNil(o.TerminateOtherSessions) { + return true + } + + return false +} + +// SetTerminateOtherSessions gets a reference to the given bool and assigns it to the TerminateOtherSessions field. +func (o *PatchedUserLoginStageRequest) SetTerminateOtherSessions(v bool) { + o.TerminateOtherSessions = &v +} + +// GetRememberMeOffset returns the RememberMeOffset field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetRememberMeOffset() string { + if o == nil || IsNil(o.RememberMeOffset) { + var ret string + return ret + } + return *o.RememberMeOffset +} + +// GetRememberMeOffsetOk returns a tuple with the RememberMeOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetRememberMeOffsetOk() (*string, bool) { + if o == nil || IsNil(o.RememberMeOffset) { + return nil, false + } + return o.RememberMeOffset, true +} + +// HasRememberMeOffset returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasRememberMeOffset() bool { + if o != nil && !IsNil(o.RememberMeOffset) { + return true + } + + return false +} + +// SetRememberMeOffset gets a reference to the given string and assigns it to the RememberMeOffset field. +func (o *PatchedUserLoginStageRequest) SetRememberMeOffset(v string) { + o.RememberMeOffset = &v +} + +// GetNetworkBinding returns the NetworkBinding field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetNetworkBinding() NetworkBindingEnum { + if o == nil || IsNil(o.NetworkBinding) { + var ret NetworkBindingEnum + return ret + } + return *o.NetworkBinding +} + +// GetNetworkBindingOk returns a tuple with the NetworkBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetNetworkBindingOk() (*NetworkBindingEnum, bool) { + if o == nil || IsNil(o.NetworkBinding) { + return nil, false + } + return o.NetworkBinding, true +} + +// HasNetworkBinding returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasNetworkBinding() bool { + if o != nil && !IsNil(o.NetworkBinding) { + return true + } + + return false +} + +// SetNetworkBinding gets a reference to the given NetworkBindingEnum and assigns it to the NetworkBinding field. +func (o *PatchedUserLoginStageRequest) SetNetworkBinding(v NetworkBindingEnum) { + o.NetworkBinding = &v +} + +// GetGeoipBinding returns the GeoipBinding field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetGeoipBinding() GeoipBindingEnum { + if o == nil || IsNil(o.GeoipBinding) { + var ret GeoipBindingEnum + return ret + } + return *o.GeoipBinding +} + +// GetGeoipBindingOk returns a tuple with the GeoipBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetGeoipBindingOk() (*GeoipBindingEnum, bool) { + if o == nil || IsNil(o.GeoipBinding) { + return nil, false + } + return o.GeoipBinding, true +} + +// HasGeoipBinding returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasGeoipBinding() bool { + if o != nil && !IsNil(o.GeoipBinding) { + return true + } + + return false +} + +// SetGeoipBinding gets a reference to the given GeoipBindingEnum and assigns it to the GeoipBinding field. +func (o *PatchedUserLoginStageRequest) SetGeoipBinding(v GeoipBindingEnum) { + o.GeoipBinding = &v +} + +// GetRememberDevice returns the RememberDevice field value if set, zero value otherwise. +func (o *PatchedUserLoginStageRequest) GetRememberDevice() string { + if o == nil || IsNil(o.RememberDevice) { + var ret string + return ret + } + return *o.RememberDevice +} + +// GetRememberDeviceOk returns a tuple with the RememberDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLoginStageRequest) GetRememberDeviceOk() (*string, bool) { + if o == nil || IsNil(o.RememberDevice) { + return nil, false + } + return o.RememberDevice, true +} + +// HasRememberDevice returns a boolean if a field has been set. +func (o *PatchedUserLoginStageRequest) HasRememberDevice() bool { + if o != nil && !IsNil(o.RememberDevice) { + return true + } + + return false +} + +// SetRememberDevice gets a reference to the given string and assigns it to the RememberDevice field. +func (o *PatchedUserLoginStageRequest) SetRememberDevice(v string) { + o.RememberDevice = &v +} + +func (o PatchedUserLoginStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserLoginStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.SessionDuration) { + toSerialize["session_duration"] = o.SessionDuration + } + if !IsNil(o.TerminateOtherSessions) { + toSerialize["terminate_other_sessions"] = o.TerminateOtherSessions + } + if !IsNil(o.RememberMeOffset) { + toSerialize["remember_me_offset"] = o.RememberMeOffset + } + if !IsNil(o.NetworkBinding) { + toSerialize["network_binding"] = o.NetworkBinding + } + if !IsNil(o.GeoipBinding) { + toSerialize["geoip_binding"] = o.GeoipBinding + } + if !IsNil(o.RememberDevice) { + toSerialize["remember_device"] = o.RememberDevice + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserLoginStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserLoginStageRequest := _PatchedUserLoginStageRequest{} + + err = json.Unmarshal(data, &varPatchedUserLoginStageRequest) + + if err != nil { + return err + } + + *o = PatchedUserLoginStageRequest(varPatchedUserLoginStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "session_duration") + delete(additionalProperties, "terminate_other_sessions") + delete(additionalProperties, "remember_me_offset") + delete(additionalProperties, "network_binding") + delete(additionalProperties, "geoip_binding") + delete(additionalProperties, "remember_device") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserLoginStageRequest struct { + value *PatchedUserLoginStageRequest + isSet bool +} + +func (v NullablePatchedUserLoginStageRequest) Get() *PatchedUserLoginStageRequest { + return v.value +} + +func (v *NullablePatchedUserLoginStageRequest) Set(val *PatchedUserLoginStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserLoginStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserLoginStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserLoginStageRequest(val *PatchedUserLoginStageRequest) *NullablePatchedUserLoginStageRequest { + return &NullablePatchedUserLoginStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserLoginStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserLoginStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_logout_stage_request.go b/packages/client-go/model_patched_user_logout_stage_request.go new file mode 100644 index 0000000000..fe893b191f --- /dev/null +++ b/packages/client-go/model_patched_user_logout_stage_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserLogoutStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserLogoutStageRequest{} + +// PatchedUserLogoutStageRequest UserLogoutStage Serializer +type PatchedUserLogoutStageRequest struct { + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserLogoutStageRequest PatchedUserLogoutStageRequest + +// NewPatchedUserLogoutStageRequest instantiates a new PatchedUserLogoutStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserLogoutStageRequest() *PatchedUserLogoutStageRequest { + this := PatchedUserLogoutStageRequest{} + return &this +} + +// NewPatchedUserLogoutStageRequestWithDefaults instantiates a new PatchedUserLogoutStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserLogoutStageRequestWithDefaults() *PatchedUserLogoutStageRequest { + this := PatchedUserLogoutStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUserLogoutStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserLogoutStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUserLogoutStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUserLogoutStageRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedUserLogoutStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserLogoutStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserLogoutStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserLogoutStageRequest := _PatchedUserLogoutStageRequest{} + + err = json.Unmarshal(data, &varPatchedUserLogoutStageRequest) + + if err != nil { + return err + } + + *o = PatchedUserLogoutStageRequest(varPatchedUserLogoutStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserLogoutStageRequest struct { + value *PatchedUserLogoutStageRequest + isSet bool +} + +func (v NullablePatchedUserLogoutStageRequest) Get() *PatchedUserLogoutStageRequest { + return v.value +} + +func (v *NullablePatchedUserLogoutStageRequest) Set(val *PatchedUserLogoutStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserLogoutStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserLogoutStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserLogoutStageRequest(val *PatchedUserLogoutStageRequest) *NullablePatchedUserLogoutStageRequest { + return &NullablePatchedUserLogoutStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserLogoutStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserLogoutStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_o_auth_source_connection_request.go b/packages/client-go/model_patched_user_o_auth_source_connection_request.go new file mode 100644 index 0000000000..e1584935b9 --- /dev/null +++ b/packages/client-go/model_patched_user_o_auth_source_connection_request.go @@ -0,0 +1,314 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedUserOAuthSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserOAuthSourceConnectionRequest{} + +// PatchedUserOAuthSourceConnectionRequest User source connection +type PatchedUserOAuthSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AccessToken NullableString `json:"access_token,omitempty"` + Expires *time.Time `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserOAuthSourceConnectionRequest PatchedUserOAuthSourceConnectionRequest + +// NewPatchedUserOAuthSourceConnectionRequest instantiates a new PatchedUserOAuthSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserOAuthSourceConnectionRequest() *PatchedUserOAuthSourceConnectionRequest { + this := PatchedUserOAuthSourceConnectionRequest{} + return &this +} + +// NewPatchedUserOAuthSourceConnectionRequestWithDefaults instantiates a new PatchedUserOAuthSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserOAuthSourceConnectionRequestWithDefaults() *PatchedUserOAuthSourceConnectionRequest { + this := PatchedUserOAuthSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserOAuthSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserOAuthSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserOAuthSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserOAuthSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserOAuthSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserOAuthSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedUserOAuthSourceConnectionRequest) GetAccessToken() string { + if o == nil || IsNil(o.AccessToken.Get()) { + var ret string + return ret + } + return *o.AccessToken.Get() +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedUserOAuthSourceConnectionRequest) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessToken.Get(), o.AccessToken.IsSet() +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) HasAccessToken() bool { + if o != nil && o.AccessToken.IsSet() { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given NullableString and assigns it to the AccessToken field. +func (o *PatchedUserOAuthSourceConnectionRequest) SetAccessToken(v string) { + o.AccessToken.Set(&v) +} + +// SetAccessTokenNil sets the value for AccessToken to be an explicit nil +func (o *PatchedUserOAuthSourceConnectionRequest) SetAccessTokenNil() { + o.AccessToken.Set(nil) +} + +// UnsetAccessToken ensures that no value is present for AccessToken, not even an explicit nil +func (o *PatchedUserOAuthSourceConnectionRequest) UnsetAccessToken() { + o.AccessToken.Unset() +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *PatchedUserOAuthSourceConnectionRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *PatchedUserOAuthSourceConnectionRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *PatchedUserOAuthSourceConnectionRequest) SetExpires(v time.Time) { + o.Expires = &v +} + +func (o PatchedUserOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserOAuthSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + if o.AccessToken.IsSet() { + toSerialize["access_token"] = o.AccessToken.Get() + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserOAuthSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserOAuthSourceConnectionRequest := _PatchedUserOAuthSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserOAuthSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserOAuthSourceConnectionRequest(varPatchedUserOAuthSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + delete(additionalProperties, "access_token") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserOAuthSourceConnectionRequest struct { + value *PatchedUserOAuthSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserOAuthSourceConnectionRequest) Get() *PatchedUserOAuthSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserOAuthSourceConnectionRequest) Set(val *PatchedUserOAuthSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserOAuthSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserOAuthSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserOAuthSourceConnectionRequest(val *PatchedUserOAuthSourceConnectionRequest) *NullablePatchedUserOAuthSourceConnectionRequest { + return &NullablePatchedUserOAuthSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserOAuthSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_plex_source_connection_request.go b/packages/client-go/model_patched_user_plex_source_connection_request.go new file mode 100644 index 0000000000..60b3d9c4ca --- /dev/null +++ b/packages/client-go/model_patched_user_plex_source_connection_request.go @@ -0,0 +1,265 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserPlexSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserPlexSourceConnectionRequest{} + +// PatchedUserPlexSourceConnectionRequest User source connection +type PatchedUserPlexSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + PlexToken *string `json:"plex_token,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserPlexSourceConnectionRequest PatchedUserPlexSourceConnectionRequest + +// NewPatchedUserPlexSourceConnectionRequest instantiates a new PatchedUserPlexSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserPlexSourceConnectionRequest() *PatchedUserPlexSourceConnectionRequest { + this := PatchedUserPlexSourceConnectionRequest{} + return &this +} + +// NewPatchedUserPlexSourceConnectionRequestWithDefaults instantiates a new PatchedUserPlexSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserPlexSourceConnectionRequestWithDefaults() *PatchedUserPlexSourceConnectionRequest { + this := PatchedUserPlexSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserPlexSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserPlexSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserPlexSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserPlexSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserPlexSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserPlexSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserPlexSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserPlexSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserPlexSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserPlexSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserPlexSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserPlexSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +// GetPlexToken returns the PlexToken field value if set, zero value otherwise. +func (o *PatchedUserPlexSourceConnectionRequest) GetPlexToken() string { + if o == nil || IsNil(o.PlexToken) { + var ret string + return ret + } + return *o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserPlexSourceConnectionRequest) GetPlexTokenOk() (*string, bool) { + if o == nil || IsNil(o.PlexToken) { + return nil, false + } + return o.PlexToken, true +} + +// HasPlexToken returns a boolean if a field has been set. +func (o *PatchedUserPlexSourceConnectionRequest) HasPlexToken() bool { + if o != nil && !IsNil(o.PlexToken) { + return true + } + + return false +} + +// SetPlexToken gets a reference to the given string and assigns it to the PlexToken field. +func (o *PatchedUserPlexSourceConnectionRequest) SetPlexToken(v string) { + o.PlexToken = &v +} + +func (o PatchedUserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserPlexSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + if !IsNil(o.PlexToken) { + toSerialize["plex_token"] = o.PlexToken + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserPlexSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserPlexSourceConnectionRequest := _PatchedUserPlexSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserPlexSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserPlexSourceConnectionRequest(varPatchedUserPlexSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserPlexSourceConnectionRequest struct { + value *PatchedUserPlexSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserPlexSourceConnectionRequest) Get() *PatchedUserPlexSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserPlexSourceConnectionRequest) Set(val *PatchedUserPlexSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserPlexSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserPlexSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserPlexSourceConnectionRequest(val *PatchedUserPlexSourceConnectionRequest) *NullablePatchedUserPlexSourceConnectionRequest { + return &NullablePatchedUserPlexSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserPlexSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_request.go b/packages/client-go/model_patched_user_request.go new file mode 100644 index 0000000000..ed1646de0b --- /dev/null +++ b/packages/client-go/model_patched_user_request.go @@ -0,0 +1,501 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "time" +) + +// checks if the PatchedUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserRequest{} + +// PatchedUserRequest User Serializer +type PatchedUserRequest struct { + Username *string `json:"username,omitempty"` + // User's display name. + Name *string `json:"name,omitempty"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + LastLogin NullableTime `json:"last_login,omitempty"` + Groups []string `json:"groups,omitempty"` + Roles []string `json:"roles,omitempty"` + Email *string `json:"email,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Path *string `json:"path,omitempty"` + Type *UserTypeEnum `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserRequest PatchedUserRequest + +// NewPatchedUserRequest instantiates a new PatchedUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserRequest() *PatchedUserRequest { + this := PatchedUserRequest{} + return &this +} + +// NewPatchedUserRequestWithDefaults instantiates a new PatchedUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserRequestWithDefaults() *PatchedUserRequest { + this := PatchedUserRequest{} + return &this +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *PatchedUserRequest) SetUsername(v string) { + o.Username = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUserRequest) SetName(v string) { + o.Name = &v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *PatchedUserRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedUserRequest) GetLastLogin() time.Time { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret time.Time + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedUserRequest) GetLastLoginOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableTime and assigns it to the LastLogin field. +func (o *PatchedUserRequest) SetLastLogin(v time.Time) { + o.LastLogin.Set(&v) +} + +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *PatchedUserRequest) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *PatchedUserRequest) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetGroups() []string { + if o == nil || IsNil(o.Groups) { + var ret []string + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []string and assigns it to the Groups field. +func (o *PatchedUserRequest) SetGroups(v []string) { + o.Groups = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *PatchedUserRequest) SetRoles(v []string) { + o.Roles = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *PatchedUserRequest) SetEmail(v string) { + o.Email = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *PatchedUserRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *PatchedUserRequest) SetPath(v string) { + o.Path = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *PatchedUserRequest) GetType() UserTypeEnum { + if o == nil || IsNil(o.Type) { + var ret UserTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserRequest) GetTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *PatchedUserRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given UserTypeEnum and assigns it to the Type field. +func (o *PatchedUserRequest) SetType(v UserTypeEnum) { + o.Type = &v +} + +func (o PatchedUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserRequest := _PatchedUserRequest{} + + err = json.Unmarshal(data, &varPatchedUserRequest) + + if err != nil { + return err + } + + *o = PatchedUserRequest(varPatchedUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "is_active") + delete(additionalProperties, "last_login") + delete(additionalProperties, "groups") + delete(additionalProperties, "roles") + delete(additionalProperties, "email") + delete(additionalProperties, "attributes") + delete(additionalProperties, "path") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserRequest struct { + value *PatchedUserRequest + isSet bool +} + +func (v NullablePatchedUserRequest) Get() *PatchedUserRequest { + return v.value +} + +func (v *NullablePatchedUserRequest) Set(val *PatchedUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserRequest(val *PatchedUserRequest) *NullablePatchedUserRequest { + return &NullablePatchedUserRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_saml_source_connection_request.go b/packages/client-go/model_patched_user_saml_source_connection_request.go new file mode 100644 index 0000000000..e375ba50c1 --- /dev/null +++ b/packages/client-go/model_patched_user_saml_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserSAMLSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserSAMLSourceConnectionRequest{} + +// PatchedUserSAMLSourceConnectionRequest User source connection +type PatchedUserSAMLSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserSAMLSourceConnectionRequest PatchedUserSAMLSourceConnectionRequest + +// NewPatchedUserSAMLSourceConnectionRequest instantiates a new PatchedUserSAMLSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserSAMLSourceConnectionRequest() *PatchedUserSAMLSourceConnectionRequest { + this := PatchedUserSAMLSourceConnectionRequest{} + return &this +} + +// NewPatchedUserSAMLSourceConnectionRequestWithDefaults instantiates a new PatchedUserSAMLSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserSAMLSourceConnectionRequestWithDefaults() *PatchedUserSAMLSourceConnectionRequest { + this := PatchedUserSAMLSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserSAMLSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserSAMLSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserSAMLSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserSAMLSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserSAMLSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserSAMLSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserSAMLSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedUserSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserSAMLSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserSAMLSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserSAMLSourceConnectionRequest := _PatchedUserSAMLSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserSAMLSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserSAMLSourceConnectionRequest(varPatchedUserSAMLSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserSAMLSourceConnectionRequest struct { + value *PatchedUserSAMLSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserSAMLSourceConnectionRequest) Get() *PatchedUserSAMLSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserSAMLSourceConnectionRequest) Set(val *PatchedUserSAMLSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserSAMLSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserSAMLSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserSAMLSourceConnectionRequest(val *PatchedUserSAMLSourceConnectionRequest) *NullablePatchedUserSAMLSourceConnectionRequest { + return &NullablePatchedUserSAMLSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserSAMLSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_source_connection_request.go b/packages/client-go/model_patched_user_source_connection_request.go new file mode 100644 index 0000000000..081fd60749 --- /dev/null +++ b/packages/client-go/model_patched_user_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserSourceConnectionRequest{} + +// PatchedUserSourceConnectionRequest User source connection +type PatchedUserSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserSourceConnectionRequest PatchedUserSourceConnectionRequest + +// NewPatchedUserSourceConnectionRequest instantiates a new PatchedUserSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserSourceConnectionRequest() *PatchedUserSourceConnectionRequest { + this := PatchedUserSourceConnectionRequest{} + return &this +} + +// NewPatchedUserSourceConnectionRequestWithDefaults instantiates a new PatchedUserSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserSourceConnectionRequestWithDefaults() *PatchedUserSourceConnectionRequest { + this := PatchedUserSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedUserSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserSourceConnectionRequest := _PatchedUserSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserSourceConnectionRequest(varPatchedUserSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserSourceConnectionRequest struct { + value *PatchedUserSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserSourceConnectionRequest) Get() *PatchedUserSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserSourceConnectionRequest) Set(val *PatchedUserSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserSourceConnectionRequest(val *PatchedUserSourceConnectionRequest) *NullablePatchedUserSourceConnectionRequest { + return &NullablePatchedUserSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_telegram_source_connection_request.go b/packages/client-go/model_patched_user_telegram_source_connection_request.go new file mode 100644 index 0000000000..7c73cb720d --- /dev/null +++ b/packages/client-go/model_patched_user_telegram_source_connection_request.go @@ -0,0 +1,228 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserTelegramSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserTelegramSourceConnectionRequest{} + +// PatchedUserTelegramSourceConnectionRequest User source connection +type PatchedUserTelegramSourceConnectionRequest struct { + User *int32 `json:"user,omitempty"` + Source *string `json:"source,omitempty"` + Identifier *string `json:"identifier,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserTelegramSourceConnectionRequest PatchedUserTelegramSourceConnectionRequest + +// NewPatchedUserTelegramSourceConnectionRequest instantiates a new PatchedUserTelegramSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserTelegramSourceConnectionRequest() *PatchedUserTelegramSourceConnectionRequest { + this := PatchedUserTelegramSourceConnectionRequest{} + return &this +} + +// NewPatchedUserTelegramSourceConnectionRequestWithDefaults instantiates a new PatchedUserTelegramSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserTelegramSourceConnectionRequestWithDefaults() *PatchedUserTelegramSourceConnectionRequest { + this := PatchedUserTelegramSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *PatchedUserTelegramSourceConnectionRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *PatchedUserTelegramSourceConnectionRequest) SetUser(v int32) { + o.User = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *PatchedUserTelegramSourceConnectionRequest) GetSource() string { + if o == nil || IsNil(o.Source) { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *PatchedUserTelegramSourceConnectionRequest) SetSource(v string) { + o.Source = &v +} + +// GetIdentifier returns the Identifier field value if set, zero value otherwise. +func (o *PatchedUserTelegramSourceConnectionRequest) GetIdentifier() string { + if o == nil || IsNil(o.Identifier) { + var ret string + return ret + } + return *o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil || IsNil(o.Identifier) { + return nil, false + } + return o.Identifier, true +} + +// HasIdentifier returns a boolean if a field has been set. +func (o *PatchedUserTelegramSourceConnectionRequest) HasIdentifier() bool { + if o != nil && !IsNil(o.Identifier) { + return true + } + + return false +} + +// SetIdentifier gets a reference to the given string and assigns it to the Identifier field. +func (o *PatchedUserTelegramSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = &v +} + +func (o PatchedUserTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserTelegramSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Identifier) { + toSerialize["identifier"] = o.Identifier + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserTelegramSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserTelegramSourceConnectionRequest := _PatchedUserTelegramSourceConnectionRequest{} + + err = json.Unmarshal(data, &varPatchedUserTelegramSourceConnectionRequest) + + if err != nil { + return err + } + + *o = PatchedUserTelegramSourceConnectionRequest(varPatchedUserTelegramSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserTelegramSourceConnectionRequest struct { + value *PatchedUserTelegramSourceConnectionRequest + isSet bool +} + +func (v NullablePatchedUserTelegramSourceConnectionRequest) Get() *PatchedUserTelegramSourceConnectionRequest { + return v.value +} + +func (v *NullablePatchedUserTelegramSourceConnectionRequest) Set(val *PatchedUserTelegramSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserTelegramSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserTelegramSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserTelegramSourceConnectionRequest(val *PatchedUserTelegramSourceConnectionRequest) *NullablePatchedUserTelegramSourceConnectionRequest { + return &NullablePatchedUserTelegramSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserTelegramSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_user_write_stage_request.go b/packages/client-go/model_patched_user_write_stage_request.go new file mode 100644 index 0000000000..b683a6aa8a --- /dev/null +++ b/packages/client-go/model_patched_user_write_stage_request.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedUserWriteStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedUserWriteStageRequest{} + +// PatchedUserWriteStageRequest UserWriteStage Serializer +type PatchedUserWriteStageRequest struct { + Name *string `json:"name,omitempty"` + UserCreationMode *UserCreationModeEnum `json:"user_creation_mode,omitempty"` + // When set, newly created users are inactive and cannot login. + CreateUsersAsInactive *bool `json:"create_users_as_inactive,omitempty"` + // Optionally add newly created users to this group. + CreateUsersGroup NullableString `json:"create_users_group,omitempty"` + UserType *UserTypeEnum `json:"user_type,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedUserWriteStageRequest PatchedUserWriteStageRequest + +// NewPatchedUserWriteStageRequest instantiates a new PatchedUserWriteStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedUserWriteStageRequest() *PatchedUserWriteStageRequest { + this := PatchedUserWriteStageRequest{} + return &this +} + +// NewPatchedUserWriteStageRequestWithDefaults instantiates a new PatchedUserWriteStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedUserWriteStageRequestWithDefaults() *PatchedUserWriteStageRequest { + this := PatchedUserWriteStageRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedUserWriteStageRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserWriteStageRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedUserWriteStageRequest) SetName(v string) { + o.Name = &v +} + +// GetUserCreationMode returns the UserCreationMode field value if set, zero value otherwise. +func (o *PatchedUserWriteStageRequest) GetUserCreationMode() UserCreationModeEnum { + if o == nil || IsNil(o.UserCreationMode) { + var ret UserCreationModeEnum + return ret + } + return *o.UserCreationMode +} + +// GetUserCreationModeOk returns a tuple with the UserCreationMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserWriteStageRequest) GetUserCreationModeOk() (*UserCreationModeEnum, bool) { + if o == nil || IsNil(o.UserCreationMode) { + return nil, false + } + return o.UserCreationMode, true +} + +// HasUserCreationMode returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasUserCreationMode() bool { + if o != nil && !IsNil(o.UserCreationMode) { + return true + } + + return false +} + +// SetUserCreationMode gets a reference to the given UserCreationModeEnum and assigns it to the UserCreationMode field. +func (o *PatchedUserWriteStageRequest) SetUserCreationMode(v UserCreationModeEnum) { + o.UserCreationMode = &v +} + +// GetCreateUsersAsInactive returns the CreateUsersAsInactive field value if set, zero value otherwise. +func (o *PatchedUserWriteStageRequest) GetCreateUsersAsInactive() bool { + if o == nil || IsNil(o.CreateUsersAsInactive) { + var ret bool + return ret + } + return *o.CreateUsersAsInactive +} + +// GetCreateUsersAsInactiveOk returns a tuple with the CreateUsersAsInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserWriteStageRequest) GetCreateUsersAsInactiveOk() (*bool, bool) { + if o == nil || IsNil(o.CreateUsersAsInactive) { + return nil, false + } + return o.CreateUsersAsInactive, true +} + +// HasCreateUsersAsInactive returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasCreateUsersAsInactive() bool { + if o != nil && !IsNil(o.CreateUsersAsInactive) { + return true + } + + return false +} + +// SetCreateUsersAsInactive gets a reference to the given bool and assigns it to the CreateUsersAsInactive field. +func (o *PatchedUserWriteStageRequest) SetCreateUsersAsInactive(v bool) { + o.CreateUsersAsInactive = &v +} + +// GetCreateUsersGroup returns the CreateUsersGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedUserWriteStageRequest) GetCreateUsersGroup() string { + if o == nil || IsNil(o.CreateUsersGroup.Get()) { + var ret string + return ret + } + return *o.CreateUsersGroup.Get() +} + +// GetCreateUsersGroupOk returns a tuple with the CreateUsersGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedUserWriteStageRequest) GetCreateUsersGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreateUsersGroup.Get(), o.CreateUsersGroup.IsSet() +} + +// HasCreateUsersGroup returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasCreateUsersGroup() bool { + if o != nil && o.CreateUsersGroup.IsSet() { + return true + } + + return false +} + +// SetCreateUsersGroup gets a reference to the given NullableString and assigns it to the CreateUsersGroup field. +func (o *PatchedUserWriteStageRequest) SetCreateUsersGroup(v string) { + o.CreateUsersGroup.Set(&v) +} + +// SetCreateUsersGroupNil sets the value for CreateUsersGroup to be an explicit nil +func (o *PatchedUserWriteStageRequest) SetCreateUsersGroupNil() { + o.CreateUsersGroup.Set(nil) +} + +// UnsetCreateUsersGroup ensures that no value is present for CreateUsersGroup, not even an explicit nil +func (o *PatchedUserWriteStageRequest) UnsetCreateUsersGroup() { + o.CreateUsersGroup.Unset() +} + +// GetUserType returns the UserType field value if set, zero value otherwise. +func (o *PatchedUserWriteStageRequest) GetUserType() UserTypeEnum { + if o == nil || IsNil(o.UserType) { + var ret UserTypeEnum + return ret + } + return *o.UserType +} + +// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserWriteStageRequest) GetUserTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.UserType) { + return nil, false + } + return o.UserType, true +} + +// HasUserType returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasUserType() bool { + if o != nil && !IsNil(o.UserType) { + return true + } + + return false +} + +// SetUserType gets a reference to the given UserTypeEnum and assigns it to the UserType field. +func (o *PatchedUserWriteStageRequest) SetUserType(v UserTypeEnum) { + o.UserType = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PatchedUserWriteStageRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedUserWriteStageRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PatchedUserWriteStageRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PatchedUserWriteStageRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +func (o PatchedUserWriteStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedUserWriteStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.UserCreationMode) { + toSerialize["user_creation_mode"] = o.UserCreationMode + } + if !IsNil(o.CreateUsersAsInactive) { + toSerialize["create_users_as_inactive"] = o.CreateUsersAsInactive + } + if o.CreateUsersGroup.IsSet() { + toSerialize["create_users_group"] = o.CreateUsersGroup.Get() + } + if !IsNil(o.UserType) { + toSerialize["user_type"] = o.UserType + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedUserWriteStageRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedUserWriteStageRequest := _PatchedUserWriteStageRequest{} + + err = json.Unmarshal(data, &varPatchedUserWriteStageRequest) + + if err != nil { + return err + } + + *o = PatchedUserWriteStageRequest(varPatchedUserWriteStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "user_creation_mode") + delete(additionalProperties, "create_users_as_inactive") + delete(additionalProperties, "create_users_group") + delete(additionalProperties, "user_type") + delete(additionalProperties, "user_path_template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedUserWriteStageRequest struct { + value *PatchedUserWriteStageRequest + isSet bool +} + +func (v NullablePatchedUserWriteStageRequest) Get() *PatchedUserWriteStageRequest { + return v.value +} + +func (v *NullablePatchedUserWriteStageRequest) Set(val *PatchedUserWriteStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedUserWriteStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedUserWriteStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedUserWriteStageRequest(val *PatchedUserWriteStageRequest) *NullablePatchedUserWriteStageRequest { + return &NullablePatchedUserWriteStageRequest{value: val, isSet: true} +} + +func (v NullablePatchedUserWriteStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedUserWriteStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_web_authn_device_request.go b/packages/client-go/model_patched_web_authn_device_request.go new file mode 100644 index 0000000000..d14c41eb0a --- /dev/null +++ b/packages/client-go/model_patched_web_authn_device_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedWebAuthnDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWebAuthnDeviceRequest{} + +// PatchedWebAuthnDeviceRequest Serializer for WebAuthn authenticator devices +type PatchedWebAuthnDeviceRequest struct { + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWebAuthnDeviceRequest PatchedWebAuthnDeviceRequest + +// NewPatchedWebAuthnDeviceRequest instantiates a new PatchedWebAuthnDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWebAuthnDeviceRequest() *PatchedWebAuthnDeviceRequest { + this := PatchedWebAuthnDeviceRequest{} + return &this +} + +// NewPatchedWebAuthnDeviceRequestWithDefaults instantiates a new PatchedWebAuthnDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWebAuthnDeviceRequestWithDefaults() *PatchedWebAuthnDeviceRequest { + this := PatchedWebAuthnDeviceRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWebAuthnDeviceRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWebAuthnDeviceRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWebAuthnDeviceRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWebAuthnDeviceRequest) SetName(v string) { + o.Name = &v +} + +func (o PatchedWebAuthnDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWebAuthnDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWebAuthnDeviceRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWebAuthnDeviceRequest := _PatchedWebAuthnDeviceRequest{} + + err = json.Unmarshal(data, &varPatchedWebAuthnDeviceRequest) + + if err != nil { + return err + } + + *o = PatchedWebAuthnDeviceRequest(varPatchedWebAuthnDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWebAuthnDeviceRequest struct { + value *PatchedWebAuthnDeviceRequest + isSet bool +} + +func (v NullablePatchedWebAuthnDeviceRequest) Get() *PatchedWebAuthnDeviceRequest { + return v.value +} + +func (v *NullablePatchedWebAuthnDeviceRequest) Set(val *PatchedWebAuthnDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWebAuthnDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWebAuthnDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWebAuthnDeviceRequest(val *PatchedWebAuthnDeviceRequest) *NullablePatchedWebAuthnDeviceRequest { + return &NullablePatchedWebAuthnDeviceRequest{value: val, isSet: true} +} + +func (v NullablePatchedWebAuthnDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWebAuthnDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_patched_ws_federation_provider_request.go b/packages/client-go/model_patched_ws_federation_provider_request.go new file mode 100644 index 0000000000..5a4ae7517c --- /dev/null +++ b/packages/client-go/model_patched_ws_federation_provider_request.go @@ -0,0 +1,885 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PatchedWSFederationProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchedWSFederationProviderRequest{} + +// PatchedWSFederationProviderRequest WSFederationProvider Serializer +type PatchedWSFederationProviderRequest struct { + Name *string `json:"name,omitempty"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow *string `json:"authorization_flow,omitempty"` + // Flow used ending the session from a provider. + InvalidationFlow *string `json:"invalidation_flow,omitempty"` + PropertyMappings []string `json:"property_mappings,omitempty"` + ReplyUrl *string `json:"reply_url,omitempty"` + Wtrealm *string `json:"wtrealm,omitempty"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PatchedWSFederationProviderRequest PatchedWSFederationProviderRequest + +// NewPatchedWSFederationProviderRequest instantiates a new PatchedWSFederationProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchedWSFederationProviderRequest() *PatchedWSFederationProviderRequest { + this := PatchedWSFederationProviderRequest{} + return &this +} + +// NewPatchedWSFederationProviderRequestWithDefaults instantiates a new PatchedWSFederationProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchedWSFederationProviderRequestWithDefaults() *PatchedWSFederationProviderRequest { + this := PatchedWSFederationProviderRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PatchedWSFederationProviderRequest) SetName(v string) { + o.Name = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWSFederationProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWSFederationProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PatchedWSFederationProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PatchedWSFederationProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PatchedWSFederationProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetAuthorizationFlow() string { + if o == nil || IsNil(o.AuthorizationFlow) { + var ret string + return ret + } + return *o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil || IsNil(o.AuthorizationFlow) { + return nil, false + } + return o.AuthorizationFlow, true +} + +// HasAuthorizationFlow returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasAuthorizationFlow() bool { + if o != nil && !IsNil(o.AuthorizationFlow) { + return true + } + + return false +} + +// SetAuthorizationFlow gets a reference to the given string and assigns it to the AuthorizationFlow field. +func (o *PatchedWSFederationProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = &v +} + +// GetInvalidationFlow returns the InvalidationFlow field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetInvalidationFlow() string { + if o == nil || IsNil(o.InvalidationFlow) { + var ret string + return ret + } + return *o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlow) { + return nil, false + } + return o.InvalidationFlow, true +} + +// HasInvalidationFlow returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasInvalidationFlow() bool { + if o != nil && !IsNil(o.InvalidationFlow) { + return true + } + + return false +} + +// SetInvalidationFlow gets a reference to the given string and assigns it to the InvalidationFlow field. +func (o *PatchedWSFederationProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = &v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *PatchedWSFederationProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetReplyUrl returns the ReplyUrl field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetReplyUrl() string { + if o == nil || IsNil(o.ReplyUrl) { + var ret string + return ret + } + return *o.ReplyUrl +} + +// GetReplyUrlOk returns a tuple with the ReplyUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetReplyUrlOk() (*string, bool) { + if o == nil || IsNil(o.ReplyUrl) { + return nil, false + } + return o.ReplyUrl, true +} + +// HasReplyUrl returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasReplyUrl() bool { + if o != nil && !IsNil(o.ReplyUrl) { + return true + } + + return false +} + +// SetReplyUrl gets a reference to the given string and assigns it to the ReplyUrl field. +func (o *PatchedWSFederationProviderRequest) SetReplyUrl(v string) { + o.ReplyUrl = &v +} + +// GetWtrealm returns the Wtrealm field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetWtrealm() string { + if o == nil || IsNil(o.Wtrealm) { + var ret string + return ret + } + return *o.Wtrealm +} + +// GetWtrealmOk returns a tuple with the Wtrealm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetWtrealmOk() (*string, bool) { + if o == nil || IsNil(o.Wtrealm) { + return nil, false + } + return o.Wtrealm, true +} + +// HasWtrealm returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasWtrealm() bool { + if o != nil && !IsNil(o.Wtrealm) { + return true + } + + return false +} + +// SetWtrealm gets a reference to the given string and assigns it to the Wtrealm field. +func (o *PatchedWSFederationProviderRequest) SetWtrealm(v string) { + o.Wtrealm = &v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *PatchedWSFederationProviderRequest) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *PatchedWSFederationProviderRequest) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *PatchedWSFederationProviderRequest) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWSFederationProviderRequest) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWSFederationProviderRequest) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *PatchedWSFederationProviderRequest) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *PatchedWSFederationProviderRequest) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *PatchedWSFederationProviderRequest) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWSFederationProviderRequest) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWSFederationProviderRequest) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *PatchedWSFederationProviderRequest) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *PatchedWSFederationProviderRequest) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *PatchedWSFederationProviderRequest) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *PatchedWSFederationProviderRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *PatchedWSFederationProviderRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWSFederationProviderRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWSFederationProviderRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *PatchedWSFederationProviderRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *PatchedWSFederationProviderRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *PatchedWSFederationProviderRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchedWSFederationProviderRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchedWSFederationProviderRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *PatchedWSFederationProviderRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *PatchedWSFederationProviderRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *PatchedWSFederationProviderRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *PatchedWSFederationProviderRequest) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *PatchedWSFederationProviderRequest) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *PatchedWSFederationProviderRequest) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchedWSFederationProviderRequest) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *PatchedWSFederationProviderRequest) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *PatchedWSFederationProviderRequest) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +func (o PatchedWSFederationProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchedWSFederationProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if !IsNil(o.AuthorizationFlow) { + toSerialize["authorization_flow"] = o.AuthorizationFlow + } + if !IsNil(o.InvalidationFlow) { + toSerialize["invalidation_flow"] = o.InvalidationFlow + } + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.ReplyUrl) { + toSerialize["reply_url"] = o.ReplyUrl + } + if !IsNil(o.Wtrealm) { + toSerialize["wtrealm"] = o.Wtrealm + } + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PatchedWSFederationProviderRequest) UnmarshalJSON(data []byte) (err error) { + varPatchedWSFederationProviderRequest := _PatchedWSFederationProviderRequest{} + + err = json.Unmarshal(data, &varPatchedWSFederationProviderRequest) + + if err != nil { + return err + } + + *o = PatchedWSFederationProviderRequest(varPatchedWSFederationProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "reply_url") + delete(additionalProperties, "wtrealm") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "default_name_id_policy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePatchedWSFederationProviderRequest struct { + value *PatchedWSFederationProviderRequest + isSet bool +} + +func (v NullablePatchedWSFederationProviderRequest) Get() *PatchedWSFederationProviderRequest { + return v.value +} + +func (v *NullablePatchedWSFederationProviderRequest) Set(val *PatchedWSFederationProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePatchedWSFederationProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchedWSFederationProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchedWSFederationProviderRequest(val *PatchedWSFederationProviderRequest) *NullablePatchedWSFederationProviderRequest { + return &NullablePatchedWSFederationProviderRequest{value: val, isSet: true} +} + +func (v NullablePatchedWSFederationProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchedWSFederationProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_permission.go b/packages/client-go/model_permission.go new file mode 100644 index 0000000000..dcb2cdffbb --- /dev/null +++ b/packages/client-go/model_permission.go @@ -0,0 +1,343 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Permission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Permission{} + +// Permission Global permission +type Permission struct { + Id int32 `json:"id"` + Name string `json:"name"` + Codename string `json:"codename"` + Model string `json:"model"` + AppLabel string `json:"app_label"` + // Human-readable app label + AppLabelVerbose string `json:"app_label_verbose"` + // Human-readable model name + ModelVerbose string `json:"model_verbose"` + AdditionalProperties map[string]interface{} +} + +type _Permission Permission + +// NewPermission instantiates a new Permission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermission(id int32, name string, codename string, model string, appLabel string, appLabelVerbose string, modelVerbose string) *Permission { + this := Permission{} + this.Id = id + this.Name = name + this.Codename = codename + this.Model = model + this.AppLabel = appLabel + this.AppLabelVerbose = appLabelVerbose + this.ModelVerbose = modelVerbose + return &this +} + +// NewPermissionWithDefaults instantiates a new Permission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionWithDefaults() *Permission { + this := Permission{} + return &this +} + +// GetId returns the Id field value +func (o *Permission) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Permission) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Permission) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Permission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Permission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Permission) SetName(v string) { + o.Name = v +} + +// GetCodename returns the Codename field value +func (o *Permission) GetCodename() string { + if o == nil { + var ret string + return ret + } + + return o.Codename +} + +// GetCodenameOk returns a tuple with the Codename field value +// and a boolean to check if the value has been set. +func (o *Permission) GetCodenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Codename, true +} + +// SetCodename sets field value +func (o *Permission) SetCodename(v string) { + o.Codename = v +} + +// GetModel returns the Model field value +func (o *Permission) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *Permission) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *Permission) SetModel(v string) { + o.Model = v +} + +// GetAppLabel returns the AppLabel field value +func (o *Permission) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *Permission) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *Permission) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetAppLabelVerbose returns the AppLabelVerbose field value +func (o *Permission) GetAppLabelVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabelVerbose +} + +// GetAppLabelVerboseOk returns a tuple with the AppLabelVerbose field value +// and a boolean to check if the value has been set. +func (o *Permission) GetAppLabelVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabelVerbose, true +} + +// SetAppLabelVerbose sets field value +func (o *Permission) SetAppLabelVerbose(v string) { + o.AppLabelVerbose = v +} + +// GetModelVerbose returns the ModelVerbose field value +func (o *Permission) GetModelVerbose() string { + if o == nil { + var ret string + return ret + } + + return o.ModelVerbose +} + +// GetModelVerboseOk returns a tuple with the ModelVerbose field value +// and a boolean to check if the value has been set. +func (o *Permission) GetModelVerboseOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelVerbose, true +} + +// SetModelVerbose sets field value +func (o *Permission) SetModelVerbose(v string) { + o.ModelVerbose = v +} + +func (o Permission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Permission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["codename"] = o.Codename + toSerialize["model"] = o.Model + toSerialize["app_label"] = o.AppLabel + toSerialize["app_label_verbose"] = o.AppLabelVerbose + toSerialize["model_verbose"] = o.ModelVerbose + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Permission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "codename", + "model", + "app_label", + "app_label_verbose", + "model_verbose", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermission := _Permission{} + + err = json.Unmarshal(data, &varPermission) + + if err != nil { + return err + } + + *o = Permission(varPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "codename") + delete(additionalProperties, "model") + delete(additionalProperties, "app_label") + delete(additionalProperties, "app_label_verbose") + delete(additionalProperties, "model_verbose") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePermission struct { + value *Permission + isSet bool +} + +func (v NullablePermission) Get() *Permission { + return v.value +} + +func (v *NullablePermission) Set(val *Permission) { + v.value = val + v.isSet = true +} + +func (v NullablePermission) IsSet() bool { + return v.isSet +} + +func (v *NullablePermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermission(val *Permission) *NullablePermission { + return &NullablePermission{value: val, isSet: true} +} + +func (v NullablePermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_permission_assign_request.go b/packages/client-go/model_permission_assign_request.go new file mode 100644 index 0000000000..bae2aae8ec --- /dev/null +++ b/packages/client-go/model_permission_assign_request.go @@ -0,0 +1,241 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PermissionAssignRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionAssignRequest{} + +// PermissionAssignRequest Request to assign a new permission +type PermissionAssignRequest struct { + Permissions []string `json:"permissions"` + Model *ModelEnum `json:"model,omitempty"` + ObjectPk *string `json:"object_pk,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PermissionAssignRequest PermissionAssignRequest + +// NewPermissionAssignRequest instantiates a new PermissionAssignRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionAssignRequest(permissions []string) *PermissionAssignRequest { + this := PermissionAssignRequest{} + this.Permissions = permissions + return &this +} + +// NewPermissionAssignRequestWithDefaults instantiates a new PermissionAssignRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionAssignRequestWithDefaults() *PermissionAssignRequest { + this := PermissionAssignRequest{} + return &this +} + +// GetPermissions returns the Permissions field value +func (o *PermissionAssignRequest) GetPermissions() []string { + if o == nil { + var ret []string + return ret + } + + return o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value +// and a boolean to check if the value has been set. +func (o *PermissionAssignRequest) GetPermissionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Permissions, true +} + +// SetPermissions sets field value +func (o *PermissionAssignRequest) SetPermissions(v []string) { + o.Permissions = v +} + +// GetModel returns the Model field value if set, zero value otherwise. +func (o *PermissionAssignRequest) GetModel() ModelEnum { + if o == nil || IsNil(o.Model) { + var ret ModelEnum + return ret + } + return *o.Model +} + +// GetModelOk returns a tuple with the Model field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PermissionAssignRequest) GetModelOk() (*ModelEnum, bool) { + if o == nil || IsNil(o.Model) { + return nil, false + } + return o.Model, true +} + +// HasModel returns a boolean if a field has been set. +func (o *PermissionAssignRequest) HasModel() bool { + if o != nil && !IsNil(o.Model) { + return true + } + + return false +} + +// SetModel gets a reference to the given ModelEnum and assigns it to the Model field. +func (o *PermissionAssignRequest) SetModel(v ModelEnum) { + o.Model = &v +} + +// GetObjectPk returns the ObjectPk field value if set, zero value otherwise. +func (o *PermissionAssignRequest) GetObjectPk() string { + if o == nil || IsNil(o.ObjectPk) { + var ret string + return ret + } + return *o.ObjectPk +} + +// GetObjectPkOk returns a tuple with the ObjectPk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PermissionAssignRequest) GetObjectPkOk() (*string, bool) { + if o == nil || IsNil(o.ObjectPk) { + return nil, false + } + return o.ObjectPk, true +} + +// HasObjectPk returns a boolean if a field has been set. +func (o *PermissionAssignRequest) HasObjectPk() bool { + if o != nil && !IsNil(o.ObjectPk) { + return true + } + + return false +} + +// SetObjectPk gets a reference to the given string and assigns it to the ObjectPk field. +func (o *PermissionAssignRequest) SetObjectPk(v string) { + o.ObjectPk = &v +} + +func (o PermissionAssignRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionAssignRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["permissions"] = o.Permissions + if !IsNil(o.Model) { + toSerialize["model"] = o.Model + } + if !IsNil(o.ObjectPk) { + toSerialize["object_pk"] = o.ObjectPk + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PermissionAssignRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionAssignRequest := _PermissionAssignRequest{} + + err = json.Unmarshal(data, &varPermissionAssignRequest) + + if err != nil { + return err + } + + *o = PermissionAssignRequest(varPermissionAssignRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "permissions") + delete(additionalProperties, "model") + delete(additionalProperties, "object_pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePermissionAssignRequest struct { + value *PermissionAssignRequest + isSet bool +} + +func (v NullablePermissionAssignRequest) Get() *PermissionAssignRequest { + return v.value +} + +func (v *NullablePermissionAssignRequest) Set(val *PermissionAssignRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionAssignRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionAssignRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionAssignRequest(val *PermissionAssignRequest) *NullablePermissionAssignRequest { + return &NullablePermissionAssignRequest{value: val, isSet: true} +} + +func (v NullablePermissionAssignRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionAssignRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_permission_assign_result.go b/packages/client-go/model_permission_assign_result.go new file mode 100644 index 0000000000..4906fa721c --- /dev/null +++ b/packages/client-go/model_permission_assign_result.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PermissionAssignResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PermissionAssignResult{} + +// PermissionAssignResult Result from assigning permissions to a user/role +type PermissionAssignResult struct { + Id string `json:"id"` + AdditionalProperties map[string]interface{} +} + +type _PermissionAssignResult PermissionAssignResult + +// NewPermissionAssignResult instantiates a new PermissionAssignResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPermissionAssignResult(id string) *PermissionAssignResult { + this := PermissionAssignResult{} + this.Id = id + return &this +} + +// NewPermissionAssignResultWithDefaults instantiates a new PermissionAssignResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPermissionAssignResultWithDefaults() *PermissionAssignResult { + this := PermissionAssignResult{} + return &this +} + +// GetId returns the Id field value +func (o *PermissionAssignResult) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *PermissionAssignResult) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *PermissionAssignResult) SetId(v string) { + o.Id = v +} + +func (o PermissionAssignResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PermissionAssignResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PermissionAssignResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPermissionAssignResult := _PermissionAssignResult{} + + err = json.Unmarshal(data, &varPermissionAssignResult) + + if err != nil { + return err + } + + *o = PermissionAssignResult(varPermissionAssignResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePermissionAssignResult struct { + value *PermissionAssignResult + isSet bool +} + +func (v NullablePermissionAssignResult) Get() *PermissionAssignResult { + return v.value +} + +func (v *NullablePermissionAssignResult) Set(val *PermissionAssignResult) { + v.value = val + v.isSet = true +} + +func (v NullablePermissionAssignResult) IsSet() bool { + return v.isSet +} + +func (v *NullablePermissionAssignResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePermissionAssignResult(val *PermissionAssignResult) *NullablePermissionAssignResult { + return &NullablePermissionAssignResult{value: val, isSet: true} +} + +func (v NullablePermissionAssignResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePermissionAssignResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_pkce_method_enum.go b/packages/client-go/model_pkce_method_enum.go new file mode 100644 index 0000000000..6b29cef632 --- /dev/null +++ b/packages/client-go/model_pkce_method_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// PKCEMethodEnum the model 'PKCEMethodEnum' +type PKCEMethodEnum string + +// List of PKCEMethodEnum +const ( + PKCEMETHODENUM_NONE PKCEMethodEnum = "none" + PKCEMETHODENUM_PLAIN PKCEMethodEnum = "plain" + PKCEMETHODENUM_S256 PKCEMethodEnum = "S256" +) + +// All allowed values of PKCEMethodEnum enum +var AllowedPKCEMethodEnumEnumValues = []PKCEMethodEnum{ + "none", + "plain", + "S256", +} + +func (v *PKCEMethodEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PKCEMethodEnum(value) + for _, existing := range AllowedPKCEMethodEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PKCEMethodEnum", value) +} + +// NewPKCEMethodEnumFromValue returns a pointer to a valid PKCEMethodEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPKCEMethodEnumFromValue(v string) (*PKCEMethodEnum, error) { + ev := PKCEMethodEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PKCEMethodEnum: valid values are %v", v, AllowedPKCEMethodEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PKCEMethodEnum) IsValid() bool { + for _, existing := range AllowedPKCEMethodEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PKCEMethodEnum value +func (v PKCEMethodEnum) Ptr() *PKCEMethodEnum { + return &v +} + +type NullablePKCEMethodEnum struct { + value *PKCEMethodEnum + isSet bool +} + +func (v NullablePKCEMethodEnum) Get() *PKCEMethodEnum { + return v.value +} + +func (v *NullablePKCEMethodEnum) Set(val *PKCEMethodEnum) { + v.value = val + v.isSet = true +} + +func (v NullablePKCEMethodEnum) IsSet() bool { + return v.isSet +} + +func (v *NullablePKCEMethodEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePKCEMethodEnum(val *PKCEMethodEnum) *NullablePKCEMethodEnum { + return &NullablePKCEMethodEnum{value: val, isSet: true} +} + +func (v NullablePKCEMethodEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePKCEMethodEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_authentication_challenge.go b/packages/client-go/model_plex_authentication_challenge.go new file mode 100644 index 0000000000..69d62ed893 --- /dev/null +++ b/packages/client-go/model_plex_authentication_challenge.go @@ -0,0 +1,311 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexAuthenticationChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexAuthenticationChallenge{} + +// PlexAuthenticationChallenge Challenge shown to the user in identification stage +type PlexAuthenticationChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + ClientId string `json:"client_id"` + Slug string `json:"slug"` + AdditionalProperties map[string]interface{} +} + +type _PlexAuthenticationChallenge PlexAuthenticationChallenge + +// NewPlexAuthenticationChallenge instantiates a new PlexAuthenticationChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexAuthenticationChallenge(clientId string, slug string) *PlexAuthenticationChallenge { + this := PlexAuthenticationChallenge{} + var component string = "ak-source-plex" + this.Component = &component + this.ClientId = clientId + this.Slug = slug + return &this +} + +// NewPlexAuthenticationChallengeWithDefaults instantiates a new PlexAuthenticationChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexAuthenticationChallengeWithDefaults() *PlexAuthenticationChallenge { + this := PlexAuthenticationChallenge{} + var component string = "ak-source-plex" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *PlexAuthenticationChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *PlexAuthenticationChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *PlexAuthenticationChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PlexAuthenticationChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PlexAuthenticationChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PlexAuthenticationChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *PlexAuthenticationChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *PlexAuthenticationChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *PlexAuthenticationChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetClientId returns the ClientId field value +func (o *PlexAuthenticationChallenge) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallenge) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *PlexAuthenticationChallenge) SetClientId(v string) { + o.ClientId = v +} + +// GetSlug returns the Slug field value +func (o *PlexAuthenticationChallenge) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallenge) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *PlexAuthenticationChallenge) SetSlug(v string) { + o.Slug = v +} + +func (o PlexAuthenticationChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexAuthenticationChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["client_id"] = o.ClientId + toSerialize["slug"] = o.Slug + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexAuthenticationChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "client_id", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexAuthenticationChallenge := _PlexAuthenticationChallenge{} + + err = json.Unmarshal(data, &varPlexAuthenticationChallenge) + + if err != nil { + return err + } + + *o = PlexAuthenticationChallenge(varPlexAuthenticationChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "client_id") + delete(additionalProperties, "slug") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexAuthenticationChallenge struct { + value *PlexAuthenticationChallenge + isSet bool +} + +func (v NullablePlexAuthenticationChallenge) Get() *PlexAuthenticationChallenge { + return v.value +} + +func (v *NullablePlexAuthenticationChallenge) Set(val *PlexAuthenticationChallenge) { + v.value = val + v.isSet = true +} + +func (v NullablePlexAuthenticationChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexAuthenticationChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexAuthenticationChallenge(val *PlexAuthenticationChallenge) *NullablePlexAuthenticationChallenge { + return &NullablePlexAuthenticationChallenge{value: val, isSet: true} +} + +func (v NullablePlexAuthenticationChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexAuthenticationChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_authentication_challenge_response_request.go b/packages/client-go/model_plex_authentication_challenge_response_request.go new file mode 100644 index 0000000000..fa580f4363 --- /dev/null +++ b/packages/client-go/model_plex_authentication_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PlexAuthenticationChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexAuthenticationChallengeResponseRequest{} + +// PlexAuthenticationChallengeResponseRequest Pseudo class for plex response +type PlexAuthenticationChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PlexAuthenticationChallengeResponseRequest PlexAuthenticationChallengeResponseRequest + +// NewPlexAuthenticationChallengeResponseRequest instantiates a new PlexAuthenticationChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexAuthenticationChallengeResponseRequest() *PlexAuthenticationChallengeResponseRequest { + this := PlexAuthenticationChallengeResponseRequest{} + var component string = "ak-source-plex" + this.Component = &component + return &this +} + +// NewPlexAuthenticationChallengeResponseRequestWithDefaults instantiates a new PlexAuthenticationChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexAuthenticationChallengeResponseRequestWithDefaults() *PlexAuthenticationChallengeResponseRequest { + this := PlexAuthenticationChallengeResponseRequest{} + var component string = "ak-source-plex" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PlexAuthenticationChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexAuthenticationChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PlexAuthenticationChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PlexAuthenticationChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o PlexAuthenticationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexAuthenticationChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexAuthenticationChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varPlexAuthenticationChallengeResponseRequest := _PlexAuthenticationChallengeResponseRequest{} + + err = json.Unmarshal(data, &varPlexAuthenticationChallengeResponseRequest) + + if err != nil { + return err + } + + *o = PlexAuthenticationChallengeResponseRequest(varPlexAuthenticationChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexAuthenticationChallengeResponseRequest struct { + value *PlexAuthenticationChallengeResponseRequest + isSet bool +} + +func (v NullablePlexAuthenticationChallengeResponseRequest) Get() *PlexAuthenticationChallengeResponseRequest { + return v.value +} + +func (v *NullablePlexAuthenticationChallengeResponseRequest) Set(val *PlexAuthenticationChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePlexAuthenticationChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexAuthenticationChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexAuthenticationChallengeResponseRequest(val *PlexAuthenticationChallengeResponseRequest) *NullablePlexAuthenticationChallengeResponseRequest { + return &NullablePlexAuthenticationChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullablePlexAuthenticationChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexAuthenticationChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_source.go b/packages/client-go/model_plex_source.go new file mode 100644 index 0000000000..3a690a6d4e --- /dev/null +++ b/packages/client-go/model_plex_source.go @@ -0,0 +1,1017 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexSource{} + +// PlexSource Plex Source Serializer +type PlexSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl string `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Client identifier used to talk to Plex. + ClientId *string `json:"client_id,omitempty"` + // Which servers a user has to be a member of to be granted access. Empty list allows every server. + AllowedServers []string `json:"allowed_servers,omitempty"` + // Allow friends to authenticate, even if you don't share a server. + AllowFriends *bool `json:"allow_friends,omitempty"` + // Plex token used to check friends + PlexToken string `json:"plex_token"` + AdditionalProperties map[string]interface{} +} + +type _PlexSource PlexSource + +// NewPlexSource instantiates a new PlexSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl string, iconThemedUrls NullableThemedUrls, plexToken string) *PlexSource { + this := PlexSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.PlexToken = plexToken + return &this +} + +// NewPlexSourceWithDefaults instantiates a new PlexSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexSourceWithDefaults() *PlexSource { + this := PlexSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *PlexSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PlexSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *PlexSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PlexSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *PlexSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *PlexSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PlexSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PlexSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PlexSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PlexSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PlexSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PlexSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PlexSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PlexSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PlexSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PlexSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PlexSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PlexSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PlexSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PlexSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PlexSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PlexSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PlexSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PlexSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PlexSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PlexSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *PlexSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PlexSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PlexSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PlexSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PlexSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PlexSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PlexSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PlexSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PlexSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PlexSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PlexSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PlexSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PlexSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PlexSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *PlexSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *PlexSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PlexSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PlexSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PlexSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PlexSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PlexSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PlexSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +func (o *PlexSource) GetIconUrl() string { + if o == nil { + var ret string + return ret + } + + return o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IconUrl, true +} + +// SetIconUrl sets field value +func (o *PlexSource) SetIconUrl(v string) { + o.IconUrl = v +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *PlexSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *PlexSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PlexSource) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PlexSource) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PlexSource) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PlexSource) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PlexSource) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PlexSource) SetClientId(v string) { + o.ClientId = &v +} + +// GetAllowedServers returns the AllowedServers field value if set, zero value otherwise. +func (o *PlexSource) GetAllowedServers() []string { + if o == nil || IsNil(o.AllowedServers) { + var ret []string + return ret + } + return o.AllowedServers +} + +// GetAllowedServersOk returns a tuple with the AllowedServers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetAllowedServersOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedServers) { + return nil, false + } + return o.AllowedServers, true +} + +// HasAllowedServers returns a boolean if a field has been set. +func (o *PlexSource) HasAllowedServers() bool { + if o != nil && !IsNil(o.AllowedServers) { + return true + } + + return false +} + +// SetAllowedServers gets a reference to the given []string and assigns it to the AllowedServers field. +func (o *PlexSource) SetAllowedServers(v []string) { + o.AllowedServers = v +} + +// GetAllowFriends returns the AllowFriends field value if set, zero value otherwise. +func (o *PlexSource) GetAllowFriends() bool { + if o == nil || IsNil(o.AllowFriends) { + var ret bool + return ret + } + return *o.AllowFriends +} + +// GetAllowFriendsOk returns a tuple with the AllowFriends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSource) GetAllowFriendsOk() (*bool, bool) { + if o == nil || IsNil(o.AllowFriends) { + return nil, false + } + return o.AllowFriends, true +} + +// HasAllowFriends returns a boolean if a field has been set. +func (o *PlexSource) HasAllowFriends() bool { + if o != nil && !IsNil(o.AllowFriends) { + return true + } + + return false +} + +// SetAllowFriends gets a reference to the given bool and assigns it to the AllowFriends field. +func (o *PlexSource) SetAllowFriends(v bool) { + o.AllowFriends = &v +} + +// GetPlexToken returns the PlexToken field value +func (o *PlexSource) GetPlexToken() string { + if o == nil { + var ret string + return ret + } + + return o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value +// and a boolean to check if the value has been set. +func (o *PlexSource) GetPlexTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlexToken, true +} + +// SetPlexToken sets field value +func (o *PlexSource) SetPlexToken(v string) { + o.PlexToken = v +} + +func (o PlexSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.AllowedServers) { + toSerialize["allowed_servers"] = o.AllowedServers + } + if !IsNil(o.AllowFriends) { + toSerialize["allow_friends"] = o.AllowFriends + } + toSerialize["plex_token"] = o.PlexToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "plex_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexSource := _PlexSource{} + + err = json.Unmarshal(data, &varPlexSource) + + if err != nil { + return err + } + + *o = PlexSource(varPlexSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "client_id") + delete(additionalProperties, "allowed_servers") + delete(additionalProperties, "allow_friends") + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexSource struct { + value *PlexSource + isSet bool +} + +func (v NullablePlexSource) Get() *PlexSource { + return v.value +} + +func (v *NullablePlexSource) Set(val *PlexSource) { + v.value = val + v.isSet = true +} + +func (v NullablePlexSource) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexSource(val *PlexSource) *NullablePlexSource { + return &NullablePlexSource{value: val, isSet: true} +} + +func (v NullablePlexSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_source_property_mapping.go b/packages/client-go/model_plex_source_property_mapping.go new file mode 100644 index 0000000000..a2e8660ebe --- /dev/null +++ b/packages/client-go/model_plex_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexSourcePropertyMapping{} + +// PlexSourcePropertyMapping PlexSourcePropertyMapping Serializer +type PlexSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _PlexSourcePropertyMapping PlexSourcePropertyMapping + +// NewPlexSourcePropertyMapping instantiates a new PlexSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *PlexSourcePropertyMapping { + this := PlexSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewPlexSourcePropertyMappingWithDefaults instantiates a new PlexSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexSourcePropertyMappingWithDefaults() *PlexSourcePropertyMapping { + this := PlexSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *PlexSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PlexSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PlexSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PlexSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PlexSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PlexSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *PlexSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PlexSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *PlexSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *PlexSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *PlexSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PlexSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PlexSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PlexSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PlexSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PlexSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PlexSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PlexSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o PlexSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexSourcePropertyMapping := _PlexSourcePropertyMapping{} + + err = json.Unmarshal(data, &varPlexSourcePropertyMapping) + + if err != nil { + return err + } + + *o = PlexSourcePropertyMapping(varPlexSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexSourcePropertyMapping struct { + value *PlexSourcePropertyMapping + isSet bool +} + +func (v NullablePlexSourcePropertyMapping) Get() *PlexSourcePropertyMapping { + return v.value +} + +func (v *NullablePlexSourcePropertyMapping) Set(val *PlexSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullablePlexSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexSourcePropertyMapping(val *PlexSourcePropertyMapping) *NullablePlexSourcePropertyMapping { + return &NullablePlexSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullablePlexSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_source_property_mapping_request.go b/packages/client-go/model_plex_source_property_mapping_request.go new file mode 100644 index 0000000000..337abf5432 --- /dev/null +++ b/packages/client-go/model_plex_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexSourcePropertyMappingRequest{} + +// PlexSourcePropertyMappingRequest PlexSourcePropertyMapping Serializer +type PlexSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _PlexSourcePropertyMappingRequest PlexSourcePropertyMappingRequest + +// NewPlexSourcePropertyMappingRequest instantiates a new PlexSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexSourcePropertyMappingRequest(name string, expression string) *PlexSourcePropertyMappingRequest { + this := PlexSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewPlexSourcePropertyMappingRequestWithDefaults instantiates a new PlexSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexSourcePropertyMappingRequestWithDefaults() *PlexSourcePropertyMappingRequest { + this := PlexSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PlexSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PlexSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PlexSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PlexSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *PlexSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PlexSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *PlexSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *PlexSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *PlexSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o PlexSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexSourcePropertyMappingRequest := _PlexSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varPlexSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = PlexSourcePropertyMappingRequest(varPlexSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexSourcePropertyMappingRequest struct { + value *PlexSourcePropertyMappingRequest + isSet bool +} + +func (v NullablePlexSourcePropertyMappingRequest) Get() *PlexSourcePropertyMappingRequest { + return v.value +} + +func (v *NullablePlexSourcePropertyMappingRequest) Set(val *PlexSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePlexSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexSourcePropertyMappingRequest(val *PlexSourcePropertyMappingRequest) *NullablePlexSourcePropertyMappingRequest { + return &NullablePlexSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullablePlexSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_source_request.go b/packages/client-go/model_plex_source_request.go new file mode 100644 index 0000000000..443478b4f4 --- /dev/null +++ b/packages/client-go/model_plex_source_request.go @@ -0,0 +1,776 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexSourceRequest{} + +// PlexSourceRequest Plex Source Serializer +type PlexSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Client identifier used to talk to Plex. + ClientId *string `json:"client_id,omitempty"` + // Which servers a user has to be a member of to be granted access. Empty list allows every server. + AllowedServers []string `json:"allowed_servers,omitempty"` + // Allow friends to authenticate, even if you don't share a server. + AllowFriends *bool `json:"allow_friends,omitempty"` + // Plex token used to check friends + PlexToken string `json:"plex_token"` + AdditionalProperties map[string]interface{} +} + +type _PlexSourceRequest PlexSourceRequest + +// NewPlexSourceRequest instantiates a new PlexSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexSourceRequest(name string, slug string, plexToken string) *PlexSourceRequest { + this := PlexSourceRequest{} + this.Name = name + this.Slug = slug + this.PlexToken = plexToken + return &this +} + +// NewPlexSourceRequestWithDefaults instantiates a new PlexSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexSourceRequestWithDefaults() *PlexSourceRequest { + this := PlexSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PlexSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PlexSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *PlexSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *PlexSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PlexSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *PlexSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *PlexSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *PlexSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *PlexSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PlexSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PlexSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *PlexSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *PlexSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *PlexSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *PlexSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *PlexSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *PlexSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *PlexSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *PlexSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *PlexSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *PlexSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PlexSourceRequest) SetClientId(v string) { + o.ClientId = &v +} + +// GetAllowedServers returns the AllowedServers field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetAllowedServers() []string { + if o == nil || IsNil(o.AllowedServers) { + var ret []string + return ret + } + return o.AllowedServers +} + +// GetAllowedServersOk returns a tuple with the AllowedServers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetAllowedServersOk() ([]string, bool) { + if o == nil || IsNil(o.AllowedServers) { + return nil, false + } + return o.AllowedServers, true +} + +// HasAllowedServers returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasAllowedServers() bool { + if o != nil && !IsNil(o.AllowedServers) { + return true + } + + return false +} + +// SetAllowedServers gets a reference to the given []string and assigns it to the AllowedServers field. +func (o *PlexSourceRequest) SetAllowedServers(v []string) { + o.AllowedServers = v +} + +// GetAllowFriends returns the AllowFriends field value if set, zero value otherwise. +func (o *PlexSourceRequest) GetAllowFriends() bool { + if o == nil || IsNil(o.AllowFriends) { + var ret bool + return ret + } + return *o.AllowFriends +} + +// GetAllowFriendsOk returns a tuple with the AllowFriends field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetAllowFriendsOk() (*bool, bool) { + if o == nil || IsNil(o.AllowFriends) { + return nil, false + } + return o.AllowFriends, true +} + +// HasAllowFriends returns a boolean if a field has been set. +func (o *PlexSourceRequest) HasAllowFriends() bool { + if o != nil && !IsNil(o.AllowFriends) { + return true + } + + return false +} + +// SetAllowFriends gets a reference to the given bool and assigns it to the AllowFriends field. +func (o *PlexSourceRequest) SetAllowFriends(v bool) { + o.AllowFriends = &v +} + +// GetPlexToken returns the PlexToken field value +func (o *PlexSourceRequest) GetPlexToken() string { + if o == nil { + var ret string + return ret + } + + return o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value +// and a boolean to check if the value has been set. +func (o *PlexSourceRequest) GetPlexTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlexToken, true +} + +// SetPlexToken sets field value +func (o *PlexSourceRequest) SetPlexToken(v string) { + o.PlexToken = v +} + +func (o PlexSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.AllowedServers) { + toSerialize["allowed_servers"] = o.AllowedServers + } + if !IsNil(o.AllowFriends) { + toSerialize["allow_friends"] = o.AllowFriends + } + toSerialize["plex_token"] = o.PlexToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "plex_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexSourceRequest := _PlexSourceRequest{} + + err = json.Unmarshal(data, &varPlexSourceRequest) + + if err != nil { + return err + } + + *o = PlexSourceRequest(varPlexSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "client_id") + delete(additionalProperties, "allowed_servers") + delete(additionalProperties, "allow_friends") + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexSourceRequest struct { + value *PlexSourceRequest + isSet bool +} + +func (v NullablePlexSourceRequest) Get() *PlexSourceRequest { + return v.value +} + +func (v *NullablePlexSourceRequest) Set(val *PlexSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePlexSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexSourceRequest(val *PlexSourceRequest) *NullablePlexSourceRequest { + return &NullablePlexSourceRequest{value: val, isSet: true} +} + +func (v NullablePlexSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_plex_token_redeem_request.go b/packages/client-go/model_plex_token_redeem_request.go new file mode 100644 index 0000000000..9c8c60e8db --- /dev/null +++ b/packages/client-go/model_plex_token_redeem_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PlexTokenRedeemRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PlexTokenRedeemRequest{} + +// PlexTokenRedeemRequest Serializer to redeem a plex token +type PlexTokenRedeemRequest struct { + PlexToken string `json:"plex_token"` + AdditionalProperties map[string]interface{} +} + +type _PlexTokenRedeemRequest PlexTokenRedeemRequest + +// NewPlexTokenRedeemRequest instantiates a new PlexTokenRedeemRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPlexTokenRedeemRequest(plexToken string) *PlexTokenRedeemRequest { + this := PlexTokenRedeemRequest{} + this.PlexToken = plexToken + return &this +} + +// NewPlexTokenRedeemRequestWithDefaults instantiates a new PlexTokenRedeemRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPlexTokenRedeemRequestWithDefaults() *PlexTokenRedeemRequest { + this := PlexTokenRedeemRequest{} + return &this +} + +// GetPlexToken returns the PlexToken field value +func (o *PlexTokenRedeemRequest) GetPlexToken() string { + if o == nil { + var ret string + return ret + } + + return o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value +// and a boolean to check if the value has been set. +func (o *PlexTokenRedeemRequest) GetPlexTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlexToken, true +} + +// SetPlexToken sets field value +func (o *PlexTokenRedeemRequest) SetPlexToken(v string) { + o.PlexToken = v +} + +func (o PlexTokenRedeemRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PlexTokenRedeemRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["plex_token"] = o.PlexToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PlexTokenRedeemRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "plex_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPlexTokenRedeemRequest := _PlexTokenRedeemRequest{} + + err = json.Unmarshal(data, &varPlexTokenRedeemRequest) + + if err != nil { + return err + } + + *o = PlexTokenRedeemRequest(varPlexTokenRedeemRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePlexTokenRedeemRequest struct { + value *PlexTokenRedeemRequest + isSet bool +} + +func (v NullablePlexTokenRedeemRequest) Get() *PlexTokenRedeemRequest { + return v.value +} + +func (v *NullablePlexTokenRedeemRequest) Set(val *PlexTokenRedeemRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePlexTokenRedeemRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePlexTokenRedeemRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePlexTokenRedeemRequest(val *PlexTokenRedeemRequest) *NullablePlexTokenRedeemRequest { + return &NullablePlexTokenRedeemRequest{value: val, isSet: true} +} + +func (v NullablePlexTokenRedeemRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePlexTokenRedeemRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy.go b/packages/client-go/model_policy.go new file mode 100644 index 0000000000..cf542de001 --- /dev/null +++ b/packages/client-go/model_policy.go @@ -0,0 +1,384 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Policy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Policy{} + +// Policy Policy Serializer +type Policy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + AdditionalProperties map[string]interface{} +} + +type _Policy Policy + +// NewPolicy instantiates a new Policy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *Policy { + this := Policy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewPolicyWithDefaults instantiates a new Policy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolicyWithDefaults() *Policy { + this := Policy{} + return &this +} + +// GetPk returns the Pk field value +func (o *Policy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Policy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Policy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Policy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Policy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Policy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *Policy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Policy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *Policy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *Policy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *Policy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *Policy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *Policy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *Policy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Policy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Policy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Policy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Policy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Policy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Policy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Policy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Policy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *Policy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *Policy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *Policy) SetBoundTo(v int32) { + o.BoundTo = v +} + +func (o Policy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Policy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Policy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPolicy := _Policy{} + + err = json.Unmarshal(data, &varPolicy) + + if err != nil { + return err + } + + *o = Policy(varPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolicy struct { + value *Policy + isSet bool +} + +func (v NullablePolicy) Get() *Policy { + return v.value +} + +func (v *NullablePolicy) Set(val *Policy) { + v.value = val + v.isSet = true +} + +func (v NullablePolicy) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicy(val *Policy) *NullablePolicy { + return &NullablePolicy{value: val, isSet: true} +} + +func (v NullablePolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy_binding.go b/packages/client-go/model_policy_binding.go new file mode 100644 index 0000000000..ed4c3585f9 --- /dev/null +++ b/packages/client-go/model_policy_binding.go @@ -0,0 +1,607 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PolicyBinding type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PolicyBinding{} + +// PolicyBinding PolicyBinding Serializer +type PolicyBinding struct { + Pk string `json:"pk"` + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + PolicyObj Policy `json:"policy_obj"` + GroupObj PartialGroup `json:"group_obj"` + UserObj PartialUser `json:"user_obj"` + Target string `json:"target"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order int32 `json:"order"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PolicyBinding PolicyBinding + +// NewPolicyBinding instantiates a new PolicyBinding object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolicyBinding(pk string, policyObj Policy, groupObj PartialGroup, userObj PartialUser, target string, order int32) *PolicyBinding { + this := PolicyBinding{} + this.Pk = pk + this.PolicyObj = policyObj + this.GroupObj = groupObj + this.UserObj = userObj + this.Target = target + this.Order = order + return &this +} + +// NewPolicyBindingWithDefaults instantiates a new PolicyBinding object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolicyBindingWithDefaults() *PolicyBinding { + this := PolicyBinding{} + return &this +} + +// GetPk returns the Pk field value +func (o *PolicyBinding) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PolicyBinding) SetPk(v string) { + o.Pk = v +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBinding) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBinding) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *PolicyBinding) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *PolicyBinding) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *PolicyBinding) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *PolicyBinding) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBinding) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBinding) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PolicyBinding) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *PolicyBinding) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PolicyBinding) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PolicyBinding) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBinding) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBinding) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PolicyBinding) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PolicyBinding) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PolicyBinding) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PolicyBinding) UnsetUser() { + o.User.Unset() +} + +// GetPolicyObj returns the PolicyObj field value +func (o *PolicyBinding) GetPolicyObj() Policy { + if o == nil { + var ret Policy + return ret + } + + return o.PolicyObj +} + +// GetPolicyObjOk returns a tuple with the PolicyObj field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetPolicyObjOk() (*Policy, bool) { + if o == nil { + return nil, false + } + return &o.PolicyObj, true +} + +// SetPolicyObj sets field value +func (o *PolicyBinding) SetPolicyObj(v Policy) { + o.PolicyObj = v +} + +// GetGroupObj returns the GroupObj field value +func (o *PolicyBinding) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *PolicyBinding) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetUserObj returns the UserObj field value +func (o *PolicyBinding) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *PolicyBinding) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetTarget returns the Target field value +func (o *PolicyBinding) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *PolicyBinding) SetTarget(v string) { + o.Target = v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *PolicyBinding) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *PolicyBinding) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *PolicyBinding) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PolicyBinding) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PolicyBinding) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PolicyBinding) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value +func (o *PolicyBinding) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *PolicyBinding) SetOrder(v int32) { + o.Order = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PolicyBinding) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PolicyBinding) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PolicyBinding) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *PolicyBinding) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBinding) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *PolicyBinding) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *PolicyBinding) SetFailureResult(v bool) { + o.FailureResult = &v +} + +func (o PolicyBinding) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PolicyBinding) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + toSerialize["policy_obj"] = o.PolicyObj + toSerialize["group_obj"] = o.GroupObj + toSerialize["user_obj"] = o.UserObj + toSerialize["target"] = o.Target + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["order"] = o.Order + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PolicyBinding) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "policy_obj", + "group_obj", + "user_obj", + "target", + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPolicyBinding := _PolicyBinding{} + + err = json.Unmarshal(data, &varPolicyBinding) + + if err != nil { + return err + } + + *o = PolicyBinding(varPolicyBinding) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "policy_obj") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolicyBinding struct { + value *PolicyBinding + isSet bool +} + +func (v NullablePolicyBinding) Get() *PolicyBinding { + return v.value +} + +func (v *NullablePolicyBinding) Set(val *PolicyBinding) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyBinding) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyBinding) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyBinding(val *PolicyBinding) *NullablePolicyBinding { + return &NullablePolicyBinding{value: val, isSet: true} +} + +func (v NullablePolicyBinding) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyBinding) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy_binding_request.go b/packages/client-go/model_policy_binding_request.go new file mode 100644 index 0000000000..cd47baf68d --- /dev/null +++ b/packages/client-go/model_policy_binding_request.go @@ -0,0 +1,491 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PolicyBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PolicyBindingRequest{} + +// PolicyBindingRequest PolicyBinding Serializer +type PolicyBindingRequest struct { + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + Target string `json:"target"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order int32 `json:"order"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PolicyBindingRequest PolicyBindingRequest + +// NewPolicyBindingRequest instantiates a new PolicyBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolicyBindingRequest(target string, order int32) *PolicyBindingRequest { + this := PolicyBindingRequest{} + this.Target = target + this.Order = order + return &this +} + +// NewPolicyBindingRequestWithDefaults instantiates a new PolicyBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolicyBindingRequestWithDefaults() *PolicyBindingRequest { + this := PolicyBindingRequest{} + return &this +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBindingRequest) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBindingRequest) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *PolicyBindingRequest) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *PolicyBindingRequest) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *PolicyBindingRequest) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBindingRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBindingRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *PolicyBindingRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PolicyBindingRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PolicyBindingRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PolicyBindingRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PolicyBindingRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PolicyBindingRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PolicyBindingRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PolicyBindingRequest) UnsetUser() { + o.User.Unset() +} + +// GetTarget returns the Target field value +func (o *PolicyBindingRequest) GetTarget() string { + if o == nil { + var ret string + return ret + } + + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetTargetOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Target, true +} + +// SetTarget sets field value +func (o *PolicyBindingRequest) SetTarget(v string) { + o.Target = v +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *PolicyBindingRequest) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *PolicyBindingRequest) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *PolicyBindingRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *PolicyBindingRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value +func (o *PolicyBindingRequest) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *PolicyBindingRequest) SetOrder(v int32) { + o.Order = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *PolicyBindingRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *PolicyBindingRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *PolicyBindingRequest) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyBindingRequest) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *PolicyBindingRequest) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *PolicyBindingRequest) SetFailureResult(v bool) { + o.FailureResult = &v +} + +func (o PolicyBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PolicyBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + toSerialize["target"] = o.Target + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["order"] = o.Order + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PolicyBindingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "target", + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPolicyBindingRequest := _PolicyBindingRequest{} + + err = json.Unmarshal(data, &varPolicyBindingRequest) + + if err != nil { + return err + } + + *o = PolicyBindingRequest(varPolicyBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "target") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolicyBindingRequest struct { + value *PolicyBindingRequest + isSet bool +} + +func (v NullablePolicyBindingRequest) Get() *PolicyBindingRequest { + return v.value +} + +func (v *NullablePolicyBindingRequest) Set(val *PolicyBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyBindingRequest(val *PolicyBindingRequest) *NullablePolicyBindingRequest { + return &NullablePolicyBindingRequest{value: val, isSet: true} +} + +func (v NullablePolicyBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy_engine_mode.go b/packages/client-go/model_policy_engine_mode.go new file mode 100644 index 0000000000..5e55b2b773 --- /dev/null +++ b/packages/client-go/model_policy_engine_mode.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// PolicyEngineMode the model 'PolicyEngineMode' +type PolicyEngineMode string + +// List of PolicyEngineMode +const ( + POLICYENGINEMODE_ALL PolicyEngineMode = "all" + POLICYENGINEMODE_ANY PolicyEngineMode = "any" +) + +// All allowed values of PolicyEngineMode enum +var AllowedPolicyEngineModeEnumValues = []PolicyEngineMode{ + "all", + "any", +} + +func (v *PolicyEngineMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PolicyEngineMode(value) + for _, existing := range AllowedPolicyEngineModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PolicyEngineMode", value) +} + +// NewPolicyEngineModeFromValue returns a pointer to a valid PolicyEngineMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPolicyEngineModeFromValue(v string) (*PolicyEngineMode, error) { + ev := PolicyEngineMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PolicyEngineMode: valid values are %v", v, AllowedPolicyEngineModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PolicyEngineMode) IsValid() bool { + for _, existing := range AllowedPolicyEngineModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PolicyEngineMode value +func (v PolicyEngineMode) Ptr() *PolicyEngineMode { + return &v +} + +type NullablePolicyEngineMode struct { + value *PolicyEngineMode + isSet bool +} + +func (v NullablePolicyEngineMode) Get() *PolicyEngineMode { + return v.value +} + +func (v *NullablePolicyEngineMode) Set(val *PolicyEngineMode) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyEngineMode) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyEngineMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyEngineMode(val *PolicyEngineMode) *NullablePolicyEngineMode { + return &NullablePolicyEngineMode{value: val, isSet: true} +} + +func (v NullablePolicyEngineMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyEngineMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy_test_request.go b/packages/client-go/model_policy_test_request.go new file mode 100644 index 0000000000..2393a7f1d6 --- /dev/null +++ b/packages/client-go/model_policy_test_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PolicyTestRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PolicyTestRequest{} + +// PolicyTestRequest Test policy execution for a user with context +type PolicyTestRequest struct { + User int32 `json:"user"` + Context map[string]interface{} `json:"context,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PolicyTestRequest PolicyTestRequest + +// NewPolicyTestRequest instantiates a new PolicyTestRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolicyTestRequest(user int32) *PolicyTestRequest { + this := PolicyTestRequest{} + this.User = user + return &this +} + +// NewPolicyTestRequestWithDefaults instantiates a new PolicyTestRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolicyTestRequestWithDefaults() *PolicyTestRequest { + this := PolicyTestRequest{} + return &this +} + +// GetUser returns the User field value +func (o *PolicyTestRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *PolicyTestRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *PolicyTestRequest) SetUser(v int32) { + o.User = v +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PolicyTestRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PolicyTestRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PolicyTestRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *PolicyTestRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +func (o PolicyTestRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PolicyTestRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PolicyTestRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPolicyTestRequest := _PolicyTestRequest{} + + err = json.Unmarshal(data, &varPolicyTestRequest) + + if err != nil { + return err + } + + *o = PolicyTestRequest(varPolicyTestRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "context") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolicyTestRequest struct { + value *PolicyTestRequest + isSet bool +} + +func (v NullablePolicyTestRequest) Get() *PolicyTestRequest { + return v.value +} + +func (v *NullablePolicyTestRequest) Set(val *PolicyTestRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyTestRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyTestRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyTestRequest(val *PolicyTestRequest) *NullablePolicyTestRequest { + return &NullablePolicyTestRequest{value: val, isSet: true} +} + +func (v NullablePolicyTestRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyTestRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_policy_test_result.go b/packages/client-go/model_policy_test_result.go new file mode 100644 index 0000000000..42ebeb1382 --- /dev/null +++ b/packages/client-go/model_policy_test_result.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PolicyTestResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PolicyTestResult{} + +// PolicyTestResult result of a policy test +type PolicyTestResult struct { + Passing bool `json:"passing"` + Messages []string `json:"messages"` + LogMessages []LogEvent `json:"log_messages"` + AdditionalProperties map[string]interface{} +} + +type _PolicyTestResult PolicyTestResult + +// NewPolicyTestResult instantiates a new PolicyTestResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPolicyTestResult(passing bool, messages []string, logMessages []LogEvent) *PolicyTestResult { + this := PolicyTestResult{} + this.Passing = passing + this.Messages = messages + this.LogMessages = logMessages + return &this +} + +// NewPolicyTestResultWithDefaults instantiates a new PolicyTestResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPolicyTestResultWithDefaults() *PolicyTestResult { + this := PolicyTestResult{} + return &this +} + +// GetPassing returns the Passing field value +func (o *PolicyTestResult) GetPassing() bool { + if o == nil { + var ret bool + return ret + } + + return o.Passing +} + +// GetPassingOk returns a tuple with the Passing field value +// and a boolean to check if the value has been set. +func (o *PolicyTestResult) GetPassingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Passing, true +} + +// SetPassing sets field value +func (o *PolicyTestResult) SetPassing(v bool) { + o.Passing = v +} + +// GetMessages returns the Messages field value +func (o *PolicyTestResult) GetMessages() []string { + if o == nil { + var ret []string + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *PolicyTestResult) GetMessagesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Messages, true +} + +// SetMessages sets field value +func (o *PolicyTestResult) SetMessages(v []string) { + o.Messages = v +} + +// GetLogMessages returns the LogMessages field value +func (o *PolicyTestResult) GetLogMessages() []LogEvent { + if o == nil { + var ret []LogEvent + return ret + } + + return o.LogMessages +} + +// GetLogMessagesOk returns a tuple with the LogMessages field value +// and a boolean to check if the value has been set. +func (o *PolicyTestResult) GetLogMessagesOk() ([]LogEvent, bool) { + if o == nil { + return nil, false + } + return o.LogMessages, true +} + +// SetLogMessages sets field value +func (o *PolicyTestResult) SetLogMessages(v []LogEvent) { + o.LogMessages = v +} + +func (o PolicyTestResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PolicyTestResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["passing"] = o.Passing + toSerialize["messages"] = o.Messages + toSerialize["log_messages"] = o.LogMessages + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PolicyTestResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "passing", + "messages", + "log_messages", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPolicyTestResult := _PolicyTestResult{} + + err = json.Unmarshal(data, &varPolicyTestResult) + + if err != nil { + return err + } + + *o = PolicyTestResult(varPolicyTestResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "passing") + delete(additionalProperties, "messages") + delete(additionalProperties, "log_messages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePolicyTestResult struct { + value *PolicyTestResult + isSet bool +} + +func (v NullablePolicyTestResult) Get() *PolicyTestResult { + return v.value +} + +func (v *NullablePolicyTestResult) Set(val *PolicyTestResult) { + v.value = val + v.isSet = true +} + +func (v NullablePolicyTestResult) IsSet() bool { + return v.isSet +} + +func (v *NullablePolicyTestResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePolicyTestResult(val *PolicyTestResult) *NullablePolicyTestResult { + return &NullablePolicyTestResult{value: val, isSet: true} +} + +func (v NullablePolicyTestResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePolicyTestResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_process.go b/packages/client-go/model_process.go new file mode 100644 index 0000000000..b93aef5ffd --- /dev/null +++ b/packages/client-go/model_process.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Process type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Process{} + +// Process struct for Process +type Process struct { + Id int32 `json:"id"` + Name string `json:"name"` + User *string `json:"user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Process Process + +// NewProcess instantiates a new Process object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProcess(id int32, name string) *Process { + this := Process{} + this.Id = id + this.Name = name + return &this +} + +// NewProcessWithDefaults instantiates a new Process object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProcessWithDefaults() *Process { + this := Process{} + return &this +} + +// GetId returns the Id field value +func (o *Process) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Process) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Process) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Process) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Process) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Process) SetName(v string) { + o.Name = v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *Process) GetUser() string { + if o == nil || IsNil(o.User) { + var ret string + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Process) GetUserOk() (*string, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *Process) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given string and assigns it to the User field. +func (o *Process) SetUser(v string) { + o.User = &v +} + +func (o Process) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Process) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Process) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProcess := _Process{} + + err = json.Unmarshal(data, &varProcess) + + if err != nil { + return err + } + + *o = Process(varProcess) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProcess struct { + value *Process + isSet bool +} + +func (v NullableProcess) Get() *Process { + return v.value +} + +func (v *NullableProcess) Set(val *Process) { + v.value = val + v.isSet = true +} + +func (v NullableProcess) IsSet() bool { + return v.isSet +} + +func (v *NullableProcess) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProcess(val *Process) *NullableProcess { + return &NullableProcess{value: val, isSet: true} +} + +func (v NullableProcess) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProcess) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_process_request.go b/packages/client-go/model_process_request.go new file mode 100644 index 0000000000..41dee798b0 --- /dev/null +++ b/packages/client-go/model_process_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProcessRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProcessRequest{} + +// ProcessRequest struct for ProcessRequest +type ProcessRequest struct { + Id int32 `json:"id"` + Name string `json:"name"` + User *string `json:"user,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProcessRequest ProcessRequest + +// NewProcessRequest instantiates a new ProcessRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProcessRequest(id int32, name string) *ProcessRequest { + this := ProcessRequest{} + this.Id = id + this.Name = name + return &this +} + +// NewProcessRequestWithDefaults instantiates a new ProcessRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProcessRequestWithDefaults() *ProcessRequest { + this := ProcessRequest{} + return &this +} + +// GetId returns the Id field value +func (o *ProcessRequest) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ProcessRequest) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ProcessRequest) SetId(v int32) { + o.Id = v +} + +// GetName returns the Name field value +func (o *ProcessRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProcessRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProcessRequest) SetName(v string) { + o.Name = v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *ProcessRequest) GetUser() string { + if o == nil || IsNil(o.User) { + var ret string + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProcessRequest) GetUserOk() (*string, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *ProcessRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given string and assigns it to the User field. +func (o *ProcessRequest) SetUser(v string) { + o.User = &v +} + +func (o ProcessRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProcessRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProcessRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProcessRequest := _ProcessRequest{} + + err = json.Unmarshal(data, &varProcessRequest) + + if err != nil { + return err + } + + *o = ProcessRequest(varProcessRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProcessRequest struct { + value *ProcessRequest + isSet bool +} + +func (v NullableProcessRequest) Get() *ProcessRequest { + return v.value +} + +func (v *NullableProcessRequest) Set(val *ProcessRequest) { + v.value = val + v.isSet = true +} + +func (v NullableProcessRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableProcessRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProcessRequest(val *ProcessRequest) *NullableProcessRequest { + return &NullableProcessRequest{value: val, isSet: true} +} + +func (v NullableProcessRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProcessRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt.go b/packages/client-go/model_prompt.go new file mode 100644 index 0000000000..9cb7e8446e --- /dev/null +++ b/packages/client-go/model_prompt.go @@ -0,0 +1,574 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Prompt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Prompt{} + +// Prompt Prompt Serializer +type Prompt struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Name of the form field, also used to store the value + FieldKey string `json:"field_key"` + Label string `json:"label"` + Type PromptTypeEnum `json:"type"` + Required *bool `json:"required,omitempty"` + // Optionally provide a short hint that describes the expected input value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple choices. + Placeholder *string `json:"placeholder,omitempty"` + // Optionally pre-fill the input with an initial value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple default choices. + InitialValue *string `json:"initial_value,omitempty"` + Order *int32 `json:"order,omitempty"` + PromptStagesObj []PromptStage `json:"prompt_stages_obj"` + SubText *string `json:"sub_text,omitempty"` + PlaceholderExpression *bool `json:"placeholder_expression,omitempty"` + InitialValueExpression *bool `json:"initial_value_expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Prompt Prompt + +// NewPrompt instantiates a new Prompt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPrompt(pk string, name string, fieldKey string, label string, type_ PromptTypeEnum, promptStagesObj []PromptStage) *Prompt { + this := Prompt{} + this.Pk = pk + this.Name = name + this.FieldKey = fieldKey + this.Label = label + this.Type = type_ + this.PromptStagesObj = promptStagesObj + return &this +} + +// NewPromptWithDefaults instantiates a new Prompt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptWithDefaults() *Prompt { + this := Prompt{} + return &this +} + +// GetPk returns the Pk field value +func (o *Prompt) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Prompt) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Prompt) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Prompt) SetName(v string) { + o.Name = v +} + +// GetFieldKey returns the FieldKey field value +func (o *Prompt) GetFieldKey() string { + if o == nil { + var ret string + return ret + } + + return o.FieldKey +} + +// GetFieldKeyOk returns a tuple with the FieldKey field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetFieldKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FieldKey, true +} + +// SetFieldKey sets field value +func (o *Prompt) SetFieldKey(v string) { + o.FieldKey = v +} + +// GetLabel returns the Label field value +func (o *Prompt) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *Prompt) SetLabel(v string) { + o.Label = v +} + +// GetType returns the Type field value +func (o *Prompt) GetType() PromptTypeEnum { + if o == nil { + var ret PromptTypeEnum + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetTypeOk() (*PromptTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *Prompt) SetType(v PromptTypeEnum) { + o.Type = v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *Prompt) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *Prompt) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *Prompt) SetRequired(v bool) { + o.Required = &v +} + +// GetPlaceholder returns the Placeholder field value if set, zero value otherwise. +func (o *Prompt) GetPlaceholder() string { + if o == nil || IsNil(o.Placeholder) { + var ret string + return ret + } + return *o.Placeholder +} + +// GetPlaceholderOk returns a tuple with the Placeholder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetPlaceholderOk() (*string, bool) { + if o == nil || IsNil(o.Placeholder) { + return nil, false + } + return o.Placeholder, true +} + +// HasPlaceholder returns a boolean if a field has been set. +func (o *Prompt) HasPlaceholder() bool { + if o != nil && !IsNil(o.Placeholder) { + return true + } + + return false +} + +// SetPlaceholder gets a reference to the given string and assigns it to the Placeholder field. +func (o *Prompt) SetPlaceholder(v string) { + o.Placeholder = &v +} + +// GetInitialValue returns the InitialValue field value if set, zero value otherwise. +func (o *Prompt) GetInitialValue() string { + if o == nil || IsNil(o.InitialValue) { + var ret string + return ret + } + return *o.InitialValue +} + +// GetInitialValueOk returns a tuple with the InitialValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetInitialValueOk() (*string, bool) { + if o == nil || IsNil(o.InitialValue) { + return nil, false + } + return o.InitialValue, true +} + +// HasInitialValue returns a boolean if a field has been set. +func (o *Prompt) HasInitialValue() bool { + if o != nil && !IsNil(o.InitialValue) { + return true + } + + return false +} + +// SetInitialValue gets a reference to the given string and assigns it to the InitialValue field. +func (o *Prompt) SetInitialValue(v string) { + o.InitialValue = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *Prompt) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *Prompt) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *Prompt) SetOrder(v int32) { + o.Order = &v +} + +// GetPromptStagesObj returns the PromptStagesObj field value +func (o *Prompt) GetPromptStagesObj() []PromptStage { + if o == nil { + var ret []PromptStage + return ret + } + + return o.PromptStagesObj +} + +// GetPromptStagesObjOk returns a tuple with the PromptStagesObj field value +// and a boolean to check if the value has been set. +func (o *Prompt) GetPromptStagesObjOk() ([]PromptStage, bool) { + if o == nil { + return nil, false + } + return o.PromptStagesObj, true +} + +// SetPromptStagesObj sets field value +func (o *Prompt) SetPromptStagesObj(v []PromptStage) { + o.PromptStagesObj = v +} + +// GetSubText returns the SubText field value if set, zero value otherwise. +func (o *Prompt) GetSubText() string { + if o == nil || IsNil(o.SubText) { + var ret string + return ret + } + return *o.SubText +} + +// GetSubTextOk returns a tuple with the SubText field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetSubTextOk() (*string, bool) { + if o == nil || IsNil(o.SubText) { + return nil, false + } + return o.SubText, true +} + +// HasSubText returns a boolean if a field has been set. +func (o *Prompt) HasSubText() bool { + if o != nil && !IsNil(o.SubText) { + return true + } + + return false +} + +// SetSubText gets a reference to the given string and assigns it to the SubText field. +func (o *Prompt) SetSubText(v string) { + o.SubText = &v +} + +// GetPlaceholderExpression returns the PlaceholderExpression field value if set, zero value otherwise. +func (o *Prompt) GetPlaceholderExpression() bool { + if o == nil || IsNil(o.PlaceholderExpression) { + var ret bool + return ret + } + return *o.PlaceholderExpression +} + +// GetPlaceholderExpressionOk returns a tuple with the PlaceholderExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetPlaceholderExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.PlaceholderExpression) { + return nil, false + } + return o.PlaceholderExpression, true +} + +// HasPlaceholderExpression returns a boolean if a field has been set. +func (o *Prompt) HasPlaceholderExpression() bool { + if o != nil && !IsNil(o.PlaceholderExpression) { + return true + } + + return false +} + +// SetPlaceholderExpression gets a reference to the given bool and assigns it to the PlaceholderExpression field. +func (o *Prompt) SetPlaceholderExpression(v bool) { + o.PlaceholderExpression = &v +} + +// GetInitialValueExpression returns the InitialValueExpression field value if set, zero value otherwise. +func (o *Prompt) GetInitialValueExpression() bool { + if o == nil || IsNil(o.InitialValueExpression) { + var ret bool + return ret + } + return *o.InitialValueExpression +} + +// GetInitialValueExpressionOk returns a tuple with the InitialValueExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Prompt) GetInitialValueExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.InitialValueExpression) { + return nil, false + } + return o.InitialValueExpression, true +} + +// HasInitialValueExpression returns a boolean if a field has been set. +func (o *Prompt) HasInitialValueExpression() bool { + if o != nil && !IsNil(o.InitialValueExpression) { + return true + } + + return false +} + +// SetInitialValueExpression gets a reference to the given bool and assigns it to the InitialValueExpression field. +func (o *Prompt) SetInitialValueExpression(v bool) { + o.InitialValueExpression = &v +} + +func (o Prompt) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Prompt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["field_key"] = o.FieldKey + toSerialize["label"] = o.Label + toSerialize["type"] = o.Type + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.Placeholder) { + toSerialize["placeholder"] = o.Placeholder + } + if !IsNil(o.InitialValue) { + toSerialize["initial_value"] = o.InitialValue + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + toSerialize["prompt_stages_obj"] = o.PromptStagesObj + if !IsNil(o.SubText) { + toSerialize["sub_text"] = o.SubText + } + if !IsNil(o.PlaceholderExpression) { + toSerialize["placeholder_expression"] = o.PlaceholderExpression + } + if !IsNil(o.InitialValueExpression) { + toSerialize["initial_value_expression"] = o.InitialValueExpression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Prompt) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "field_key", + "label", + "type", + "prompt_stages_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPrompt := _Prompt{} + + err = json.Unmarshal(data, &varPrompt) + + if err != nil { + return err + } + + *o = Prompt(varPrompt) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "field_key") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "required") + delete(additionalProperties, "placeholder") + delete(additionalProperties, "initial_value") + delete(additionalProperties, "order") + delete(additionalProperties, "prompt_stages_obj") + delete(additionalProperties, "sub_text") + delete(additionalProperties, "placeholder_expression") + delete(additionalProperties, "initial_value_expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePrompt struct { + value *Prompt + isSet bool +} + +func (v NullablePrompt) Get() *Prompt { + return v.value +} + +func (v *NullablePrompt) Set(val *Prompt) { + v.value = val + v.isSet = true +} + +func (v NullablePrompt) IsSet() bool { + return v.isSet +} + +func (v *NullablePrompt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePrompt(val *Prompt) *NullablePrompt { + return &NullablePrompt{value: val, isSet: true} +} + +func (v NullablePrompt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePrompt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_challenge.go b/packages/client-go/model_prompt_challenge.go new file mode 100644 index 0000000000..f31b501519 --- /dev/null +++ b/packages/client-go/model_prompt_challenge.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PromptChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptChallenge{} + +// PromptChallenge Initial challenge being sent, define fields +type PromptChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Fields []StagePrompt `json:"fields"` + AdditionalProperties map[string]interface{} +} + +type _PromptChallenge PromptChallenge + +// NewPromptChallenge instantiates a new PromptChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptChallenge(fields []StagePrompt) *PromptChallenge { + this := PromptChallenge{} + var component string = "ak-stage-prompt" + this.Component = &component + this.Fields = fields + return &this +} + +// NewPromptChallengeWithDefaults instantiates a new PromptChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptChallengeWithDefaults() *PromptChallenge { + this := PromptChallenge{} + var component string = "ak-stage-prompt" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *PromptChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *PromptChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *PromptChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PromptChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PromptChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PromptChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *PromptChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *PromptChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *PromptChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetFields returns the Fields field value +func (o *PromptChallenge) GetFields() []StagePrompt { + if o == nil { + var ret []StagePrompt + return ret + } + + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value +// and a boolean to check if the value has been set. +func (o *PromptChallenge) GetFieldsOk() ([]StagePrompt, bool) { + if o == nil { + return nil, false + } + return o.Fields, true +} + +// SetFields sets field value +func (o *PromptChallenge) SetFields(v []StagePrompt) { + o.Fields = v +} + +func (o PromptChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["fields"] = o.Fields + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "fields", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPromptChallenge := _PromptChallenge{} + + err = json.Unmarshal(data, &varPromptChallenge) + + if err != nil { + return err + } + + *o = PromptChallenge(varPromptChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "fields") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptChallenge struct { + value *PromptChallenge + isSet bool +} + +func (v NullablePromptChallenge) Get() *PromptChallenge { + return v.value +} + +func (v *NullablePromptChallenge) Set(val *PromptChallenge) { + v.value = val + v.isSet = true +} + +func (v NullablePromptChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptChallenge(val *PromptChallenge) *NullablePromptChallenge { + return &NullablePromptChallenge{value: val, isSet: true} +} + +func (v NullablePromptChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_challenge_response_request.go b/packages/client-go/model_prompt_challenge_response_request.go new file mode 100644 index 0000000000..592c478e25 --- /dev/null +++ b/packages/client-go/model_prompt_challenge_response_request.go @@ -0,0 +1,158 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PromptChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptChallengeResponseRequest{} + +// PromptChallengeResponseRequest Validate response, fields are dynamically created based on the stage +type PromptChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PromptChallengeResponseRequest PromptChallengeResponseRequest + +// NewPromptChallengeResponseRequest instantiates a new PromptChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptChallengeResponseRequest() *PromptChallengeResponseRequest { + this := PromptChallengeResponseRequest{} + var component string = "ak-stage-prompt" + this.Component = &component + return &this +} + +// NewPromptChallengeResponseRequestWithDefaults instantiates a new PromptChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptChallengeResponseRequestWithDefaults() *PromptChallengeResponseRequest { + this := PromptChallengeResponseRequest{} + var component string = "ak-stage-prompt" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *PromptChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *PromptChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *PromptChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o PromptChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + varPromptChallengeResponseRequest := _PromptChallengeResponseRequest{} + + err = json.Unmarshal(data, &varPromptChallengeResponseRequest) + + if err != nil { + return err + } + + *o = PromptChallengeResponseRequest(varPromptChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptChallengeResponseRequest struct { + value *PromptChallengeResponseRequest + isSet bool +} + +func (v NullablePromptChallengeResponseRequest) Get() *PromptChallengeResponseRequest { + return v.value +} + +func (v *NullablePromptChallengeResponseRequest) Set(val *PromptChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePromptChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptChallengeResponseRequest(val *PromptChallengeResponseRequest) *NullablePromptChallengeResponseRequest { + return &NullablePromptChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullablePromptChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_choice.go b/packages/client-go/model_prompt_choice.go new file mode 100644 index 0000000000..c6cb5305a6 --- /dev/null +++ b/packages/client-go/model_prompt_choice.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PromptChoice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptChoice{} + +// PromptChoice Serializer for a single Choice field +type PromptChoice struct { + Value string `json:"value"` + Label string `json:"label"` + AdditionalProperties map[string]interface{} +} + +type _PromptChoice PromptChoice + +// NewPromptChoice instantiates a new PromptChoice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptChoice(value string, label string) *PromptChoice { + this := PromptChoice{} + this.Value = value + this.Label = label + return &this +} + +// NewPromptChoiceWithDefaults instantiates a new PromptChoice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptChoiceWithDefaults() *PromptChoice { + this := PromptChoice{} + return &this +} + +// GetValue returns the Value field value +func (o *PromptChoice) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *PromptChoice) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *PromptChoice) SetValue(v string) { + o.Value = v +} + +// GetLabel returns the Label field value +func (o *PromptChoice) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *PromptChoice) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *PromptChoice) SetLabel(v string) { + o.Label = v +} + +func (o PromptChoice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptChoice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["value"] = o.Value + toSerialize["label"] = o.Label + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptChoice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "value", + "label", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPromptChoice := _PromptChoice{} + + err = json.Unmarshal(data, &varPromptChoice) + + if err != nil { + return err + } + + *o = PromptChoice(varPromptChoice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "label") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptChoice struct { + value *PromptChoice + isSet bool +} + +func (v NullablePromptChoice) Get() *PromptChoice { + return v.value +} + +func (v *NullablePromptChoice) Set(val *PromptChoice) { + v.value = val + v.isSet = true +} + +func (v NullablePromptChoice) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptChoice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptChoice(val *PromptChoice) *NullablePromptChoice { + return &NullablePromptChoice{value: val, isSet: true} +} + +func (v NullablePromptChoice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptChoice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_request.go b/packages/client-go/model_prompt_request.go new file mode 100644 index 0000000000..fe1a3cc990 --- /dev/null +++ b/packages/client-go/model_prompt_request.go @@ -0,0 +1,516 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PromptRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptRequest{} + +// PromptRequest Prompt Serializer +type PromptRequest struct { + Name string `json:"name"` + // Name of the form field, also used to store the value + FieldKey string `json:"field_key"` + Label string `json:"label"` + Type PromptTypeEnum `json:"type"` + Required *bool `json:"required,omitempty"` + // Optionally provide a short hint that describes the expected input value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple choices. + Placeholder *string `json:"placeholder,omitempty"` + // Optionally pre-fill the input with an initial value. When creating a fixed choice field, enable interpreting as expression and return a list to return multiple default choices. + InitialValue *string `json:"initial_value,omitempty"` + Order *int32 `json:"order,omitempty"` + SubText *string `json:"sub_text,omitempty"` + PlaceholderExpression *bool `json:"placeholder_expression,omitempty"` + InitialValueExpression *bool `json:"initial_value_expression,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PromptRequest PromptRequest + +// NewPromptRequest instantiates a new PromptRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptRequest(name string, fieldKey string, label string, type_ PromptTypeEnum) *PromptRequest { + this := PromptRequest{} + this.Name = name + this.FieldKey = fieldKey + this.Label = label + this.Type = type_ + return &this +} + +// NewPromptRequestWithDefaults instantiates a new PromptRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptRequestWithDefaults() *PromptRequest { + this := PromptRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PromptRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PromptRequest) SetName(v string) { + o.Name = v +} + +// GetFieldKey returns the FieldKey field value +func (o *PromptRequest) GetFieldKey() string { + if o == nil { + var ret string + return ret + } + + return o.FieldKey +} + +// GetFieldKeyOk returns a tuple with the FieldKey field value +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetFieldKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FieldKey, true +} + +// SetFieldKey sets field value +func (o *PromptRequest) SetFieldKey(v string) { + o.FieldKey = v +} + +// GetLabel returns the Label field value +func (o *PromptRequest) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *PromptRequest) SetLabel(v string) { + o.Label = v +} + +// GetType returns the Type field value +func (o *PromptRequest) GetType() PromptTypeEnum { + if o == nil { + var ret PromptTypeEnum + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetTypeOk() (*PromptTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *PromptRequest) SetType(v PromptTypeEnum) { + o.Type = v +} + +// GetRequired returns the Required field value if set, zero value otherwise. +func (o *PromptRequest) GetRequired() bool { + if o == nil || IsNil(o.Required) { + var ret bool + return ret + } + return *o.Required +} + +// GetRequiredOk returns a tuple with the Required field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetRequiredOk() (*bool, bool) { + if o == nil || IsNil(o.Required) { + return nil, false + } + return o.Required, true +} + +// HasRequired returns a boolean if a field has been set. +func (o *PromptRequest) HasRequired() bool { + if o != nil && !IsNil(o.Required) { + return true + } + + return false +} + +// SetRequired gets a reference to the given bool and assigns it to the Required field. +func (o *PromptRequest) SetRequired(v bool) { + o.Required = &v +} + +// GetPlaceholder returns the Placeholder field value if set, zero value otherwise. +func (o *PromptRequest) GetPlaceholder() string { + if o == nil || IsNil(o.Placeholder) { + var ret string + return ret + } + return *o.Placeholder +} + +// GetPlaceholderOk returns a tuple with the Placeholder field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetPlaceholderOk() (*string, bool) { + if o == nil || IsNil(o.Placeholder) { + return nil, false + } + return o.Placeholder, true +} + +// HasPlaceholder returns a boolean if a field has been set. +func (o *PromptRequest) HasPlaceholder() bool { + if o != nil && !IsNil(o.Placeholder) { + return true + } + + return false +} + +// SetPlaceholder gets a reference to the given string and assigns it to the Placeholder field. +func (o *PromptRequest) SetPlaceholder(v string) { + o.Placeholder = &v +} + +// GetInitialValue returns the InitialValue field value if set, zero value otherwise. +func (o *PromptRequest) GetInitialValue() string { + if o == nil || IsNil(o.InitialValue) { + var ret string + return ret + } + return *o.InitialValue +} + +// GetInitialValueOk returns a tuple with the InitialValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetInitialValueOk() (*string, bool) { + if o == nil || IsNil(o.InitialValue) { + return nil, false + } + return o.InitialValue, true +} + +// HasInitialValue returns a boolean if a field has been set. +func (o *PromptRequest) HasInitialValue() bool { + if o != nil && !IsNil(o.InitialValue) { + return true + } + + return false +} + +// SetInitialValue gets a reference to the given string and assigns it to the InitialValue field. +func (o *PromptRequest) SetInitialValue(v string) { + o.InitialValue = &v +} + +// GetOrder returns the Order field value if set, zero value otherwise. +func (o *PromptRequest) GetOrder() int32 { + if o == nil || IsNil(o.Order) { + var ret int32 + return ret + } + return *o.Order +} + +// GetOrderOk returns a tuple with the Order field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetOrderOk() (*int32, bool) { + if o == nil || IsNil(o.Order) { + return nil, false + } + return o.Order, true +} + +// HasOrder returns a boolean if a field has been set. +func (o *PromptRequest) HasOrder() bool { + if o != nil && !IsNil(o.Order) { + return true + } + + return false +} + +// SetOrder gets a reference to the given int32 and assigns it to the Order field. +func (o *PromptRequest) SetOrder(v int32) { + o.Order = &v +} + +// GetSubText returns the SubText field value if set, zero value otherwise. +func (o *PromptRequest) GetSubText() string { + if o == nil || IsNil(o.SubText) { + var ret string + return ret + } + return *o.SubText +} + +// GetSubTextOk returns a tuple with the SubText field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetSubTextOk() (*string, bool) { + if o == nil || IsNil(o.SubText) { + return nil, false + } + return o.SubText, true +} + +// HasSubText returns a boolean if a field has been set. +func (o *PromptRequest) HasSubText() bool { + if o != nil && !IsNil(o.SubText) { + return true + } + + return false +} + +// SetSubText gets a reference to the given string and assigns it to the SubText field. +func (o *PromptRequest) SetSubText(v string) { + o.SubText = &v +} + +// GetPlaceholderExpression returns the PlaceholderExpression field value if set, zero value otherwise. +func (o *PromptRequest) GetPlaceholderExpression() bool { + if o == nil || IsNil(o.PlaceholderExpression) { + var ret bool + return ret + } + return *o.PlaceholderExpression +} + +// GetPlaceholderExpressionOk returns a tuple with the PlaceholderExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetPlaceholderExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.PlaceholderExpression) { + return nil, false + } + return o.PlaceholderExpression, true +} + +// HasPlaceholderExpression returns a boolean if a field has been set. +func (o *PromptRequest) HasPlaceholderExpression() bool { + if o != nil && !IsNil(o.PlaceholderExpression) { + return true + } + + return false +} + +// SetPlaceholderExpression gets a reference to the given bool and assigns it to the PlaceholderExpression field. +func (o *PromptRequest) SetPlaceholderExpression(v bool) { + o.PlaceholderExpression = &v +} + +// GetInitialValueExpression returns the InitialValueExpression field value if set, zero value otherwise. +func (o *PromptRequest) GetInitialValueExpression() bool { + if o == nil || IsNil(o.InitialValueExpression) { + var ret bool + return ret + } + return *o.InitialValueExpression +} + +// GetInitialValueExpressionOk returns a tuple with the InitialValueExpression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptRequest) GetInitialValueExpressionOk() (*bool, bool) { + if o == nil || IsNil(o.InitialValueExpression) { + return nil, false + } + return o.InitialValueExpression, true +} + +// HasInitialValueExpression returns a boolean if a field has been set. +func (o *PromptRequest) HasInitialValueExpression() bool { + if o != nil && !IsNil(o.InitialValueExpression) { + return true + } + + return false +} + +// SetInitialValueExpression gets a reference to the given bool and assigns it to the InitialValueExpression field. +func (o *PromptRequest) SetInitialValueExpression(v bool) { + o.InitialValueExpression = &v +} + +func (o PromptRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["field_key"] = o.FieldKey + toSerialize["label"] = o.Label + toSerialize["type"] = o.Type + if !IsNil(o.Required) { + toSerialize["required"] = o.Required + } + if !IsNil(o.Placeholder) { + toSerialize["placeholder"] = o.Placeholder + } + if !IsNil(o.InitialValue) { + toSerialize["initial_value"] = o.InitialValue + } + if !IsNil(o.Order) { + toSerialize["order"] = o.Order + } + if !IsNil(o.SubText) { + toSerialize["sub_text"] = o.SubText + } + if !IsNil(o.PlaceholderExpression) { + toSerialize["placeholder_expression"] = o.PlaceholderExpression + } + if !IsNil(o.InitialValueExpression) { + toSerialize["initial_value_expression"] = o.InitialValueExpression + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "field_key", + "label", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPromptRequest := _PromptRequest{} + + err = json.Unmarshal(data, &varPromptRequest) + + if err != nil { + return err + } + + *o = PromptRequest(varPromptRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "field_key") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "required") + delete(additionalProperties, "placeholder") + delete(additionalProperties, "initial_value") + delete(additionalProperties, "order") + delete(additionalProperties, "sub_text") + delete(additionalProperties, "placeholder_expression") + delete(additionalProperties, "initial_value_expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptRequest struct { + value *PromptRequest + isSet bool +} + +func (v NullablePromptRequest) Get() *PromptRequest { + return v.value +} + +func (v *NullablePromptRequest) Set(val *PromptRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePromptRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptRequest(val *PromptRequest) *NullablePromptRequest { + return &NullablePromptRequest{value: val, isSet: true} +} + +func (v NullablePromptRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_stage.go b/packages/client-go/model_prompt_stage.go new file mode 100644 index 0000000000..2ac17a4bac --- /dev/null +++ b/packages/client-go/model_prompt_stage.go @@ -0,0 +1,411 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PromptStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptStage{} + +// PromptStage PromptStage Serializer +type PromptStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + Fields []string `json:"fields"` + ValidationPolicies []string `json:"validation_policies,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PromptStage PromptStage + +// NewPromptStage instantiates a new PromptStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, fields []string) *PromptStage { + this := PromptStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Fields = fields + return &this +} + +// NewPromptStageWithDefaults instantiates a new PromptStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptStageWithDefaults() *PromptStage { + this := PromptStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *PromptStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PromptStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *PromptStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PromptStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *PromptStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PromptStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PromptStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PromptStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PromptStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PromptStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PromptStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PromptStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *PromptStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *PromptStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetFields returns the Fields field value +func (o *PromptStage) GetFields() []string { + if o == nil { + var ret []string + return ret + } + + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value +// and a boolean to check if the value has been set. +func (o *PromptStage) GetFieldsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Fields, true +} + +// SetFields sets field value +func (o *PromptStage) SetFields(v []string) { + o.Fields = v +} + +// GetValidationPolicies returns the ValidationPolicies field value if set, zero value otherwise. +func (o *PromptStage) GetValidationPolicies() []string { + if o == nil || IsNil(o.ValidationPolicies) { + var ret []string + return ret + } + return o.ValidationPolicies +} + +// GetValidationPoliciesOk returns a tuple with the ValidationPolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptStage) GetValidationPoliciesOk() ([]string, bool) { + if o == nil || IsNil(o.ValidationPolicies) { + return nil, false + } + return o.ValidationPolicies, true +} + +// HasValidationPolicies returns a boolean if a field has been set. +func (o *PromptStage) HasValidationPolicies() bool { + if o != nil && !IsNil(o.ValidationPolicies) { + return true + } + + return false +} + +// SetValidationPolicies gets a reference to the given []string and assigns it to the ValidationPolicies field. +func (o *PromptStage) SetValidationPolicies(v []string) { + o.ValidationPolicies = v +} + +func (o PromptStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["fields"] = o.Fields + if !IsNil(o.ValidationPolicies) { + toSerialize["validation_policies"] = o.ValidationPolicies + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "fields", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPromptStage := _PromptStage{} + + err = json.Unmarshal(data, &varPromptStage) + + if err != nil { + return err + } + + *o = PromptStage(varPromptStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "fields") + delete(additionalProperties, "validation_policies") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptStage struct { + value *PromptStage + isSet bool +} + +func (v NullablePromptStage) Get() *PromptStage { + return v.value +} + +func (v *NullablePromptStage) Set(val *PromptStage) { + v.value = val + v.isSet = true +} + +func (v NullablePromptStage) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptStage(val *PromptStage) *NullablePromptStage { + return &NullablePromptStage{value: val, isSet: true} +} + +func (v NullablePromptStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_stage_request.go b/packages/client-go/model_prompt_stage_request.go new file mode 100644 index 0000000000..573b8698ff --- /dev/null +++ b/packages/client-go/model_prompt_stage_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PromptStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PromptStageRequest{} + +// PromptStageRequest PromptStage Serializer +type PromptStageRequest struct { + Name string `json:"name"` + Fields []string `json:"fields"` + ValidationPolicies []string `json:"validation_policies,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PromptStageRequest PromptStageRequest + +// NewPromptStageRequest instantiates a new PromptStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPromptStageRequest(name string, fields []string) *PromptStageRequest { + this := PromptStageRequest{} + this.Name = name + this.Fields = fields + return &this +} + +// NewPromptStageRequestWithDefaults instantiates a new PromptStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPromptStageRequestWithDefaults() *PromptStageRequest { + this := PromptStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *PromptStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PromptStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PromptStageRequest) SetName(v string) { + o.Name = v +} + +// GetFields returns the Fields field value +func (o *PromptStageRequest) GetFields() []string { + if o == nil { + var ret []string + return ret + } + + return o.Fields +} + +// GetFieldsOk returns a tuple with the Fields field value +// and a boolean to check if the value has been set. +func (o *PromptStageRequest) GetFieldsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Fields, true +} + +// SetFields sets field value +func (o *PromptStageRequest) SetFields(v []string) { + o.Fields = v +} + +// GetValidationPolicies returns the ValidationPolicies field value if set, zero value otherwise. +func (o *PromptStageRequest) GetValidationPolicies() []string { + if o == nil || IsNil(o.ValidationPolicies) { + var ret []string + return ret + } + return o.ValidationPolicies +} + +// GetValidationPoliciesOk returns a tuple with the ValidationPolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PromptStageRequest) GetValidationPoliciesOk() ([]string, bool) { + if o == nil || IsNil(o.ValidationPolicies) { + return nil, false + } + return o.ValidationPolicies, true +} + +// HasValidationPolicies returns a boolean if a field has been set. +func (o *PromptStageRequest) HasValidationPolicies() bool { + if o != nil && !IsNil(o.ValidationPolicies) { + return true + } + + return false +} + +// SetValidationPolicies gets a reference to the given []string and assigns it to the ValidationPolicies field. +func (o *PromptStageRequest) SetValidationPolicies(v []string) { + o.ValidationPolicies = v +} + +func (o PromptStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PromptStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["fields"] = o.Fields + if !IsNil(o.ValidationPolicies) { + toSerialize["validation_policies"] = o.ValidationPolicies + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PromptStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "fields", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPromptStageRequest := _PromptStageRequest{} + + err = json.Unmarshal(data, &varPromptStageRequest) + + if err != nil { + return err + } + + *o = PromptStageRequest(varPromptStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "fields") + delete(additionalProperties, "validation_policies") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePromptStageRequest struct { + value *PromptStageRequest + isSet bool +} + +func (v NullablePromptStageRequest) Get() *PromptStageRequest { + return v.value +} + +func (v *NullablePromptStageRequest) Set(val *PromptStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePromptStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptStageRequest(val *PromptStageRequest) *NullablePromptStageRequest { + return &NullablePromptStageRequest{value: val, isSet: true} +} + +func (v NullablePromptStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_prompt_type_enum.go b/packages/client-go/model_prompt_type_enum.go new file mode 100644 index 0000000000..b771328418 --- /dev/null +++ b/packages/client-go/model_prompt_type_enum.go @@ -0,0 +1,143 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// PromptTypeEnum the model 'PromptTypeEnum' +type PromptTypeEnum string + +// List of PromptTypeEnum +const ( + PROMPTTYPEENUM_TEXT PromptTypeEnum = "text" + PROMPTTYPEENUM_TEXT_AREA PromptTypeEnum = "text_area" + PROMPTTYPEENUM_TEXT_READ_ONLY PromptTypeEnum = "text_read_only" + PROMPTTYPEENUM_TEXT_AREA_READ_ONLY PromptTypeEnum = "text_area_read_only" + PROMPTTYPEENUM_USERNAME PromptTypeEnum = "username" + PROMPTTYPEENUM_EMAIL PromptTypeEnum = "email" + PROMPTTYPEENUM_PASSWORD PromptTypeEnum = "password" + PROMPTTYPEENUM_NUMBER PromptTypeEnum = "number" + PROMPTTYPEENUM_CHECKBOX PromptTypeEnum = "checkbox" + PROMPTTYPEENUM_RADIO_BUTTON_GROUP PromptTypeEnum = "radio-button-group" + PROMPTTYPEENUM_DROPDOWN PromptTypeEnum = "dropdown" + PROMPTTYPEENUM_DATE PromptTypeEnum = "date" + PROMPTTYPEENUM_DATE_TIME PromptTypeEnum = "date-time" + PROMPTTYPEENUM_FILE PromptTypeEnum = "file" + PROMPTTYPEENUM_SEPARATOR PromptTypeEnum = "separator" + PROMPTTYPEENUM_HIDDEN PromptTypeEnum = "hidden" + PROMPTTYPEENUM_STATIC PromptTypeEnum = "static" + PROMPTTYPEENUM_AK_LOCALE PromptTypeEnum = "ak-locale" +) + +// All allowed values of PromptTypeEnum enum +var AllowedPromptTypeEnumEnumValues = []PromptTypeEnum{ + "text", + "text_area", + "text_read_only", + "text_area_read_only", + "username", + "email", + "password", + "number", + "checkbox", + "radio-button-group", + "dropdown", + "date", + "date-time", + "file", + "separator", + "hidden", + "static", + "ak-locale", +} + +func (v *PromptTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := PromptTypeEnum(value) + for _, existing := range AllowedPromptTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid PromptTypeEnum", value) +} + +// NewPromptTypeEnumFromValue returns a pointer to a valid PromptTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewPromptTypeEnumFromValue(v string) (*PromptTypeEnum, error) { + ev := PromptTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for PromptTypeEnum: valid values are %v", v, AllowedPromptTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v PromptTypeEnum) IsValid() bool { + for _, existing := range AllowedPromptTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to PromptTypeEnum value +func (v PromptTypeEnum) Ptr() *PromptTypeEnum { + return &v +} + +type NullablePromptTypeEnum struct { + value *PromptTypeEnum + isSet bool +} + +func (v NullablePromptTypeEnum) Get() *PromptTypeEnum { + return v.value +} + +func (v *NullablePromptTypeEnum) Set(val *PromptTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullablePromptTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullablePromptTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePromptTypeEnum(val *PromptTypeEnum) *NullablePromptTypeEnum { + return &NullablePromptTypeEnum{value: val, isSet: true} +} + +func (v NullablePromptTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePromptTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_property_mapping.go b/packages/client-go/model_property_mapping.go new file mode 100644 index 0000000000..3e35a14cb6 --- /dev/null +++ b/packages/client-go/model_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PropertyMapping{} + +// PropertyMapping PropertyMapping Serializer +type PropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _PropertyMapping PropertyMapping + +// NewPropertyMapping instantiates a new PropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *PropertyMapping { + this := PropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewPropertyMappingWithDefaults instantiates a new PropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertyMappingWithDefaults() *PropertyMapping { + this := PropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *PropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *PropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *PropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *PropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *PropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *PropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *PropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *PropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *PropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *PropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *PropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *PropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *PropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *PropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *PropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *PropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *PropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *PropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *PropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o PropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPropertyMapping := _PropertyMapping{} + + err = json.Unmarshal(data, &varPropertyMapping) + + if err != nil { + return err + } + + *o = PropertyMapping(varPropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertyMapping struct { + value *PropertyMapping + isSet bool +} + +func (v NullablePropertyMapping) Get() *PropertyMapping { + return v.value +} + +func (v *NullablePropertyMapping) Set(val *PropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullablePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertyMapping(val *PropertyMapping) *NullablePropertyMapping { + return &NullablePropertyMapping{value: val, isSet: true} +} + +func (v NullablePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_property_mapping_preview.go b/packages/client-go/model_property_mapping_preview.go new file mode 100644 index 0000000000..233ff829d7 --- /dev/null +++ b/packages/client-go/model_property_mapping_preview.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PropertyMappingPreview type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PropertyMappingPreview{} + +// PropertyMappingPreview Preview how the current user is mapped via the property mappings selected in a provider +type PropertyMappingPreview struct { + Preview map[string]interface{} `json:"preview"` + AdditionalProperties map[string]interface{} +} + +type _PropertyMappingPreview PropertyMappingPreview + +// NewPropertyMappingPreview instantiates a new PropertyMappingPreview object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertyMappingPreview(preview map[string]interface{}) *PropertyMappingPreview { + this := PropertyMappingPreview{} + this.Preview = preview + return &this +} + +// NewPropertyMappingPreviewWithDefaults instantiates a new PropertyMappingPreview object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertyMappingPreviewWithDefaults() *PropertyMappingPreview { + this := PropertyMappingPreview{} + return &this +} + +// GetPreview returns the Preview field value +func (o *PropertyMappingPreview) GetPreview() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Preview +} + +// GetPreviewOk returns a tuple with the Preview field value +// and a boolean to check if the value has been set. +func (o *PropertyMappingPreview) GetPreviewOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Preview, true +} + +// SetPreview sets field value +func (o *PropertyMappingPreview) SetPreview(v map[string]interface{}) { + o.Preview = v +} + +func (o PropertyMappingPreview) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PropertyMappingPreview) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["preview"] = o.Preview + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PropertyMappingPreview) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "preview", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPropertyMappingPreview := _PropertyMappingPreview{} + + err = json.Unmarshal(data, &varPropertyMappingPreview) + + if err != nil { + return err + } + + *o = PropertyMappingPreview(varPropertyMappingPreview) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "preview") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertyMappingPreview struct { + value *PropertyMappingPreview + isSet bool +} + +func (v NullablePropertyMappingPreview) Get() *PropertyMappingPreview { + return v.value +} + +func (v *NullablePropertyMappingPreview) Set(val *PropertyMappingPreview) { + v.value = val + v.isSet = true +} + +func (v NullablePropertyMappingPreview) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertyMappingPreview) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertyMappingPreview(val *PropertyMappingPreview) *NullablePropertyMappingPreview { + return &NullablePropertyMappingPreview{value: val, isSet: true} +} + +func (v NullablePropertyMappingPreview) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertyMappingPreview) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_property_mapping_test_request.go b/packages/client-go/model_property_mapping_test_request.go new file mode 100644 index 0000000000..3c194d5b32 --- /dev/null +++ b/packages/client-go/model_property_mapping_test_request.go @@ -0,0 +1,250 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the PropertyMappingTestRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PropertyMappingTestRequest{} + +// PropertyMappingTestRequest Test property mapping execution for a user/group with context +type PropertyMappingTestRequest struct { + User NullableInt32 `json:"user,omitempty"` + Context map[string]interface{} `json:"context,omitempty"` + Group NullableString `json:"group,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _PropertyMappingTestRequest PropertyMappingTestRequest + +// NewPropertyMappingTestRequest instantiates a new PropertyMappingTestRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertyMappingTestRequest() *PropertyMappingTestRequest { + this := PropertyMappingTestRequest{} + return &this +} + +// NewPropertyMappingTestRequestWithDefaults instantiates a new PropertyMappingTestRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertyMappingTestRequestWithDefaults() *PropertyMappingTestRequest { + this := PropertyMappingTestRequest{} + return &this +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PropertyMappingTestRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PropertyMappingTestRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *PropertyMappingTestRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *PropertyMappingTestRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *PropertyMappingTestRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *PropertyMappingTestRequest) UnsetUser() { + o.User.Unset() +} + +// GetContext returns the Context field value if set, zero value otherwise. +func (o *PropertyMappingTestRequest) GetContext() map[string]interface{} { + if o == nil || IsNil(o.Context) { + var ret map[string]interface{} + return ret + } + return o.Context +} + +// GetContextOk returns a tuple with the Context field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PropertyMappingTestRequest) GetContextOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Context) { + return map[string]interface{}{}, false + } + return o.Context, true +} + +// HasContext returns a boolean if a field has been set. +func (o *PropertyMappingTestRequest) HasContext() bool { + if o != nil && !IsNil(o.Context) { + return true + } + + return false +} + +// SetContext gets a reference to the given map[string]interface{} and assigns it to the Context field. +func (o *PropertyMappingTestRequest) SetContext(v map[string]interface{}) { + o.Context = v +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PropertyMappingTestRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PropertyMappingTestRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *PropertyMappingTestRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *PropertyMappingTestRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *PropertyMappingTestRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *PropertyMappingTestRequest) UnsetGroup() { + o.Group.Unset() +} + +func (o PropertyMappingTestRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PropertyMappingTestRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Context) { + toSerialize["context"] = o.Context + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PropertyMappingTestRequest) UnmarshalJSON(data []byte) (err error) { + varPropertyMappingTestRequest := _PropertyMappingTestRequest{} + + err = json.Unmarshal(data, &varPropertyMappingTestRequest) + + if err != nil { + return err + } + + *o = PropertyMappingTestRequest(varPropertyMappingTestRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "context") + delete(additionalProperties, "group") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertyMappingTestRequest struct { + value *PropertyMappingTestRequest + isSet bool +} + +func (v NullablePropertyMappingTestRequest) Get() *PropertyMappingTestRequest { + return v.value +} + +func (v *NullablePropertyMappingTestRequest) Set(val *PropertyMappingTestRequest) { + v.value = val + v.isSet = true +} + +func (v NullablePropertyMappingTestRequest) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertyMappingTestRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertyMappingTestRequest(val *PropertyMappingTestRequest) *NullablePropertyMappingTestRequest { + return &NullablePropertyMappingTestRequest{value: val, isSet: true} +} + +func (v NullablePropertyMappingTestRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertyMappingTestRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_property_mapping_test_result.go b/packages/client-go/model_property_mapping_test_result.go new file mode 100644 index 0000000000..89755ccd05 --- /dev/null +++ b/packages/client-go/model_property_mapping_test_result.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the PropertyMappingTestResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PropertyMappingTestResult{} + +// PropertyMappingTestResult Result of a Property-mapping test +type PropertyMappingTestResult struct { + Result string `json:"result"` + Successful bool `json:"successful"` + AdditionalProperties map[string]interface{} +} + +type _PropertyMappingTestResult PropertyMappingTestResult + +// NewPropertyMappingTestResult instantiates a new PropertyMappingTestResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPropertyMappingTestResult(result string, successful bool) *PropertyMappingTestResult { + this := PropertyMappingTestResult{} + this.Result = result + this.Successful = successful + return &this +} + +// NewPropertyMappingTestResultWithDefaults instantiates a new PropertyMappingTestResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPropertyMappingTestResultWithDefaults() *PropertyMappingTestResult { + this := PropertyMappingTestResult{} + return &this +} + +// GetResult returns the Result field value +func (o *PropertyMappingTestResult) GetResult() string { + if o == nil { + var ret string + return ret + } + + return o.Result +} + +// GetResultOk returns a tuple with the Result field value +// and a boolean to check if the value has been set. +func (o *PropertyMappingTestResult) GetResultOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Result, true +} + +// SetResult sets field value +func (o *PropertyMappingTestResult) SetResult(v string) { + o.Result = v +} + +// GetSuccessful returns the Successful field value +func (o *PropertyMappingTestResult) GetSuccessful() bool { + if o == nil { + var ret bool + return ret + } + + return o.Successful +} + +// GetSuccessfulOk returns a tuple with the Successful field value +// and a boolean to check if the value has been set. +func (o *PropertyMappingTestResult) GetSuccessfulOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Successful, true +} + +// SetSuccessful sets field value +func (o *PropertyMappingTestResult) SetSuccessful(v bool) { + o.Successful = v +} + +func (o PropertyMappingTestResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PropertyMappingTestResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["result"] = o.Result + toSerialize["successful"] = o.Successful + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *PropertyMappingTestResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "result", + "successful", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPropertyMappingTestResult := _PropertyMappingTestResult{} + + err = json.Unmarshal(data, &varPropertyMappingTestResult) + + if err != nil { + return err + } + + *o = PropertyMappingTestResult(varPropertyMappingTestResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "result") + delete(additionalProperties, "successful") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullablePropertyMappingTestResult struct { + value *PropertyMappingTestResult + isSet bool +} + +func (v NullablePropertyMappingTestResult) Get() *PropertyMappingTestResult { + return v.value +} + +func (v *NullablePropertyMappingTestResult) Set(val *PropertyMappingTestResult) { + v.value = val + v.isSet = true +} + +func (v NullablePropertyMappingTestResult) IsSet() bool { + return v.isSet +} + +func (v *NullablePropertyMappingTestResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePropertyMappingTestResult(val *PropertyMappingTestResult) *NullablePropertyMappingTestResult { + return &NullablePropertyMappingTestResult{value: val, isSet: true} +} + +func (v NullablePropertyMappingTestResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePropertyMappingTestResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_protocol_enum.go b/packages/client-go/model_protocol_enum.go new file mode 100644 index 0000000000..1109584c8e --- /dev/null +++ b/packages/client-go/model_protocol_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ProtocolEnum the model 'ProtocolEnum' +type ProtocolEnum string + +// List of ProtocolEnum +const ( + PROTOCOLENUM_RDP ProtocolEnum = "rdp" + PROTOCOLENUM_VNC ProtocolEnum = "vnc" + PROTOCOLENUM_SSH ProtocolEnum = "ssh" +) + +// All allowed values of ProtocolEnum enum +var AllowedProtocolEnumEnumValues = []ProtocolEnum{ + "rdp", + "vnc", + "ssh", +} + +func (v *ProtocolEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProtocolEnum(value) + for _, existing := range AllowedProtocolEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProtocolEnum", value) +} + +// NewProtocolEnumFromValue returns a pointer to a valid ProtocolEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProtocolEnumFromValue(v string) (*ProtocolEnum, error) { + ev := ProtocolEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProtocolEnum: valid values are %v", v, AllowedProtocolEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProtocolEnum) IsValid() bool { + for _, existing := range AllowedProtocolEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProtocolEnum value +func (v ProtocolEnum) Ptr() *ProtocolEnum { + return &v +} + +type NullableProtocolEnum struct { + value *ProtocolEnum + isSet bool +} + +func (v NullableProtocolEnum) Get() *ProtocolEnum { + return v.value +} + +func (v *NullableProtocolEnum) Set(val *ProtocolEnum) { + v.value = val + v.isSet = true +} + +func (v NullableProtocolEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocolEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocolEnum(val *ProtocolEnum) *NullableProtocolEnum { + return &NullableProtocolEnum{value: val, isSet: true} +} + +func (v NullableProtocolEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocolEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_provider.go b/packages/client-go/model_provider.go new file mode 100644 index 0000000000..22c2373ecd --- /dev/null +++ b/packages/client-go/model_provider.go @@ -0,0 +1,590 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Provider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Provider{} + +// Provider Provider Serializer +type Provider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _Provider Provider + +// NewProvider instantiates a new Provider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string) *Provider { + this := Provider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewProviderWithDefaults instantiates a new Provider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProviderWithDefaults() *Provider { + this := Provider{} + return &this +} + +// GetPk returns the Pk field value +func (o *Provider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Provider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Provider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Provider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Provider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Provider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Provider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *Provider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *Provider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *Provider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *Provider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *Provider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *Provider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *Provider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *Provider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *Provider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *Provider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *Provider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Provider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *Provider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *Provider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *Provider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *Provider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *Provider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Provider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *Provider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Provider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *Provider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Provider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *Provider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Provider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Provider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *Provider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *Provider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Provider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Provider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Provider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Provider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Provider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Provider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Provider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Provider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o Provider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Provider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Provider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProvider := _Provider{} + + err = json.Unmarshal(data, &varProvider) + + if err != nil { + return err + } + + *o = Provider(varProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProvider struct { + value *Provider + isSet bool +} + +func (v NullableProvider) Get() *Provider { + return v.value +} + +func (v *NullableProvider) Set(val *Provider) { + v.value = val + v.isSet = true +} + +func (v NullableProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProvider(val *Provider) *NullableProvider { + return &NullableProvider{value: val, isSet: true} +} + +func (v NullableProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_provider_enum.go b/packages/client-go/model_provider_enum.go new file mode 100644 index 0000000000..75af56e378 --- /dev/null +++ b/packages/client-go/model_provider_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ProviderEnum the model 'ProviderEnum' +type ProviderEnum string + +// List of ProviderEnum +const ( + PROVIDERENUM_TWILIO ProviderEnum = "twilio" + PROVIDERENUM_GENERIC ProviderEnum = "generic" +) + +// All allowed values of ProviderEnum enum +var AllowedProviderEnumEnumValues = []ProviderEnum{ + "twilio", + "generic", +} + +func (v *ProviderEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProviderEnum(value) + for _, existing := range AllowedProviderEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProviderEnum", value) +} + +// NewProviderEnumFromValue returns a pointer to a valid ProviderEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProviderEnumFromValue(v string) (*ProviderEnum, error) { + ev := ProviderEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProviderEnum: valid values are %v", v, AllowedProviderEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProviderEnum) IsValid() bool { + for _, existing := range AllowedProviderEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProviderEnum value +func (v ProviderEnum) Ptr() *ProviderEnum { + return &v +} + +type NullableProviderEnum struct { + value *ProviderEnum + isSet bool +} + +func (v NullableProviderEnum) Get() *ProviderEnum { + return v.value +} + +func (v *NullableProviderEnum) Set(val *ProviderEnum) { + v.value = val + v.isSet = true +} + +func (v NullableProviderEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderEnum(val *ProviderEnum) *NullableProviderEnum { + return &NullableProviderEnum{value: val, isSet: true} +} + +func (v NullableProviderEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_provider_model_enum.go b/packages/client-go/model_provider_model_enum.go new file mode 100644 index 0000000000..ff480e5ff2 --- /dev/null +++ b/packages/client-go/model_provider_model_enum.go @@ -0,0 +1,129 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ProviderModelEnum the model 'ProviderModelEnum' +type ProviderModelEnum string + +// List of ProviderModelEnum +const ( + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_GOOGLE_WORKSPACE_GOOGLEWORKSPACEPROVIDER ProviderModelEnum = "authentik_providers_google_workspace.googleworkspaceprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_LDAP_LDAPPROVIDER ProviderModelEnum = "authentik_providers_ldap.ldapprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_MICROSOFT_ENTRA_MICROSOFTENTRAPROVIDER ProviderModelEnum = "authentik_providers_microsoft_entra.microsoftentraprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_OAUTH2_OAUTH2PROVIDER ProviderModelEnum = "authentik_providers_oauth2.oauth2provider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_PROXY_PROXYPROVIDER ProviderModelEnum = "authentik_providers_proxy.proxyprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_RAC_RACPROVIDER ProviderModelEnum = "authentik_providers_rac.racprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_RADIUS_RADIUSPROVIDER ProviderModelEnum = "authentik_providers_radius.radiusprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_SAML_SAMLPROVIDER ProviderModelEnum = "authentik_providers_saml.samlprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_SCIM_SCIMPROVIDER ProviderModelEnum = "authentik_providers_scim.scimprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_SSF_SSFPROVIDER ProviderModelEnum = "authentik_providers_ssf.ssfprovider" + PROVIDERMODELENUM_AUTHENTIK_PROVIDERS_WS_FEDERATION_WSFEDERATIONPROVIDER ProviderModelEnum = "authentik_providers_ws_federation.wsfederationprovider" +) + +// All allowed values of ProviderModelEnum enum +var AllowedProviderModelEnumEnumValues = []ProviderModelEnum{ + "authentik_providers_google_workspace.googleworkspaceprovider", + "authentik_providers_ldap.ldapprovider", + "authentik_providers_microsoft_entra.microsoftentraprovider", + "authentik_providers_oauth2.oauth2provider", + "authentik_providers_proxy.proxyprovider", + "authentik_providers_rac.racprovider", + "authentik_providers_radius.radiusprovider", + "authentik_providers_saml.samlprovider", + "authentik_providers_scim.scimprovider", + "authentik_providers_ssf.ssfprovider", + "authentik_providers_ws_federation.wsfederationprovider", +} + +func (v *ProviderModelEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProviderModelEnum(value) + for _, existing := range AllowedProviderModelEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProviderModelEnum", value) +} + +// NewProviderModelEnumFromValue returns a pointer to a valid ProviderModelEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProviderModelEnumFromValue(v string) (*ProviderModelEnum, error) { + ev := ProviderModelEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProviderModelEnum: valid values are %v", v, AllowedProviderModelEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProviderModelEnum) IsValid() bool { + for _, existing := range AllowedProviderModelEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProviderModelEnum value +func (v ProviderModelEnum) Ptr() *ProviderModelEnum { + return &v +} + +type NullableProviderModelEnum struct { + value *ProviderModelEnum + isSet bool +} + +func (v NullableProviderModelEnum) Get() *ProviderModelEnum { + return v.value +} + +func (v *NullableProviderModelEnum) Set(val *ProviderModelEnum) { + v.value = val + v.isSet = true +} + +func (v NullableProviderModelEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderModelEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderModelEnum(val *ProviderModelEnum) *NullableProviderModelEnum { + return &NullableProviderModelEnum{value: val, isSet: true} +} + +func (v NullableProviderModelEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderModelEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_provider_type_enum.go b/packages/client-go/model_provider_type_enum.go new file mode 100644 index 0000000000..61b0ed4f4a --- /dev/null +++ b/packages/client-go/model_provider_type_enum.go @@ -0,0 +1,141 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ProviderTypeEnum the model 'ProviderTypeEnum' +type ProviderTypeEnum string + +// List of ProviderTypeEnum +const ( + PROVIDERTYPEENUM_APPLE ProviderTypeEnum = "apple" + PROVIDERTYPEENUM_OPENIDCONNECT ProviderTypeEnum = "openidconnect" + PROVIDERTYPEENUM_ENTRAID ProviderTypeEnum = "entraid" + PROVIDERTYPEENUM_AZUREAD ProviderTypeEnum = "azuread" + PROVIDERTYPEENUM_DISCORD ProviderTypeEnum = "discord" + PROVIDERTYPEENUM_FACEBOOK ProviderTypeEnum = "facebook" + PROVIDERTYPEENUM_GITHUB ProviderTypeEnum = "github" + PROVIDERTYPEENUM_GITLAB ProviderTypeEnum = "gitlab" + PROVIDERTYPEENUM_GOOGLE ProviderTypeEnum = "google" + PROVIDERTYPEENUM_MAILCOW ProviderTypeEnum = "mailcow" + PROVIDERTYPEENUM_OKTA ProviderTypeEnum = "okta" + PROVIDERTYPEENUM_PATREON ProviderTypeEnum = "patreon" + PROVIDERTYPEENUM_REDDIT ProviderTypeEnum = "reddit" + PROVIDERTYPEENUM_SLACK ProviderTypeEnum = "slack" + PROVIDERTYPEENUM_TWITCH ProviderTypeEnum = "twitch" + PROVIDERTYPEENUM_TWITTER ProviderTypeEnum = "twitter" + PROVIDERTYPEENUM_WECHAT ProviderTypeEnum = "wechat" +) + +// All allowed values of ProviderTypeEnum enum +var AllowedProviderTypeEnumEnumValues = []ProviderTypeEnum{ + "apple", + "openidconnect", + "entraid", + "azuread", + "discord", + "facebook", + "github", + "gitlab", + "google", + "mailcow", + "okta", + "patreon", + "reddit", + "slack", + "twitch", + "twitter", + "wechat", +} + +func (v *ProviderTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProviderTypeEnum(value) + for _, existing := range AllowedProviderTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProviderTypeEnum", value) +} + +// NewProviderTypeEnumFromValue returns a pointer to a valid ProviderTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProviderTypeEnumFromValue(v string) (*ProviderTypeEnum, error) { + ev := ProviderTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProviderTypeEnum: valid values are %v", v, AllowedProviderTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProviderTypeEnum) IsValid() bool { + for _, existing := range AllowedProviderTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProviderTypeEnum value +func (v ProviderTypeEnum) Ptr() *ProviderTypeEnum { + return &v +} + +type NullableProviderTypeEnum struct { + value *ProviderTypeEnum + isSet bool +} + +func (v NullableProviderTypeEnum) Get() *ProviderTypeEnum { + return v.value +} + +func (v *NullableProviderTypeEnum) Set(val *ProviderTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableProviderTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableProviderTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProviderTypeEnum(val *ProviderTypeEnum) *NullableProviderTypeEnum { + return &NullableProviderTypeEnum{value: val, isSet: true} +} + +func (v NullableProviderTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProviderTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_proxy_mode.go b/packages/client-go/model_proxy_mode.go new file mode 100644 index 0000000000..a0aa637b93 --- /dev/null +++ b/packages/client-go/model_proxy_mode.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ProxyMode the model 'ProxyMode' +type ProxyMode string + +// List of ProxyMode +const ( + PROXYMODE_PROXY ProxyMode = "proxy" + PROXYMODE_FORWARD_SINGLE ProxyMode = "forward_single" + PROXYMODE_FORWARD_DOMAIN ProxyMode = "forward_domain" +) + +// All allowed values of ProxyMode enum +var AllowedProxyModeEnumValues = []ProxyMode{ + "proxy", + "forward_single", + "forward_domain", +} + +func (v *ProxyMode) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ProxyMode(value) + for _, existing := range AllowedProxyModeEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ProxyMode", value) +} + +// NewProxyModeFromValue returns a pointer to a valid ProxyMode +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewProxyModeFromValue(v string) (*ProxyMode, error) { + ev := ProxyMode(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ProxyMode: valid values are %v", v, AllowedProxyModeEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ProxyMode) IsValid() bool { + for _, existing := range AllowedProxyModeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ProxyMode value +func (v ProxyMode) Ptr() *ProxyMode { + return &v +} + +type NullableProxyMode struct { + value *ProxyMode + isSet bool +} + +func (v NullableProxyMode) Get() *ProxyMode { + return v.value +} + +func (v *NullableProxyMode) Set(val *ProxyMode) { + v.value = val + v.isSet = true +} + +func (v NullableProxyMode) IsSet() bool { + return v.isSet +} + +func (v *NullableProxyMode) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxyMode(val *ProxyMode) *NullableProxyMode { + return &NullableProxyMode{value: val, isSet: true} +} + +func (v NullableProxyMode) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxyMode) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_proxy_outpost_config.go b/packages/client-go/model_proxy_outpost_config.go new file mode 100644 index 0000000000..7751ac0d5e --- /dev/null +++ b/packages/client-go/model_proxy_outpost_config.go @@ -0,0 +1,875 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProxyOutpostConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProxyOutpostConfig{} + +// ProxyOutpostConfig Proxy provider serializer for outposts +type ProxyOutpostConfig struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + InternalHost *string `json:"internal_host,omitempty"` + ExternalHost string `json:"external_host"` + // Validate SSL Certificates of upstream servers + InternalHostSslValidation *bool `json:"internal_host_ssl_validation,omitempty"` + ClientId *string `json:"client_id,omitempty"` + ClientSecret *string `json:"client_secret,omitempty"` + OidcConfiguration OpenIDConnectConfiguration `json:"oidc_configuration"` + CookieSecret *string `json:"cookie_secret,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + // Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression. + SkipPathRegex *string `json:"skip_path_regex,omitempty"` + // Set a custom HTTP-Basic Authentication header based on values from authentik. + BasicAuthEnabled *bool `json:"basic_auth_enabled,omitempty"` + // User/Group Attribute used for the password part of the HTTP-Basic Header. + BasicAuthPasswordAttribute *string `json:"basic_auth_password_attribute,omitempty"` + // User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used. + BasicAuthUserAttribute *string `json:"basic_auth_user_attribute,omitempty"` + // Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host. + Mode *ProxyMode `json:"mode,omitempty"` + CookieDomain *string `json:"cookie_domain,omitempty"` + // Get token validity as second count + AccessTokenValidity NullableFloat64 `json:"access_token_validity"` + // When enabled, this provider will intercept the authorization header and authenticate requests based on its value. + InterceptHeaderAuth *bool `json:"intercept_header_auth,omitempty"` + // Get all the scope names the outpost should request, including custom-defined ones + ScopesToRequest []string `json:"scopes_to_request"` + // Internal application name, used in URLs. + AssignedApplicationSlug string `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName string `json:"assigned_application_name"` + AdditionalProperties map[string]interface{} +} + +type _ProxyOutpostConfig ProxyOutpostConfig + +// NewProxyOutpostConfig instantiates a new ProxyOutpostConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProxyOutpostConfig(pk int32, name string, externalHost string, oidcConfiguration OpenIDConnectConfiguration, accessTokenValidity NullableFloat64, scopesToRequest []string, assignedApplicationSlug string, assignedApplicationName string) *ProxyOutpostConfig { + this := ProxyOutpostConfig{} + this.Pk = pk + this.Name = name + this.ExternalHost = externalHost + this.OidcConfiguration = oidcConfiguration + this.AccessTokenValidity = accessTokenValidity + this.ScopesToRequest = scopesToRequest + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + return &this +} + +// NewProxyOutpostConfigWithDefaults instantiates a new ProxyOutpostConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProxyOutpostConfigWithDefaults() *ProxyOutpostConfig { + this := ProxyOutpostConfig{} + return &this +} + +// GetPk returns the Pk field value +func (o *ProxyOutpostConfig) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ProxyOutpostConfig) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ProxyOutpostConfig) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProxyOutpostConfig) SetName(v string) { + o.Name = v +} + +// GetInternalHost returns the InternalHost field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetInternalHost() string { + if o == nil || IsNil(o.InternalHost) { + var ret string + return ret + } + return *o.InternalHost +} + +// GetInternalHostOk returns a tuple with the InternalHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetInternalHostOk() (*string, bool) { + if o == nil || IsNil(o.InternalHost) { + return nil, false + } + return o.InternalHost, true +} + +// HasInternalHost returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasInternalHost() bool { + if o != nil && !IsNil(o.InternalHost) { + return true + } + + return false +} + +// SetInternalHost gets a reference to the given string and assigns it to the InternalHost field. +func (o *ProxyOutpostConfig) SetInternalHost(v string) { + o.InternalHost = &v +} + +// GetExternalHost returns the ExternalHost field value +func (o *ProxyOutpostConfig) GetExternalHost() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalHost +} + +// GetExternalHostOk returns a tuple with the ExternalHost field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetExternalHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalHost, true +} + +// SetExternalHost sets field value +func (o *ProxyOutpostConfig) SetExternalHost(v string) { + o.ExternalHost = v +} + +// GetInternalHostSslValidation returns the InternalHostSslValidation field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetInternalHostSslValidation() bool { + if o == nil || IsNil(o.InternalHostSslValidation) { + var ret bool + return ret + } + return *o.InternalHostSslValidation +} + +// GetInternalHostSslValidationOk returns a tuple with the InternalHostSslValidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetInternalHostSslValidationOk() (*bool, bool) { + if o == nil || IsNil(o.InternalHostSslValidation) { + return nil, false + } + return o.InternalHostSslValidation, true +} + +// HasInternalHostSslValidation returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasInternalHostSslValidation() bool { + if o != nil && !IsNil(o.InternalHostSslValidation) { + return true + } + + return false +} + +// SetInternalHostSslValidation gets a reference to the given bool and assigns it to the InternalHostSslValidation field. +func (o *ProxyOutpostConfig) SetInternalHostSslValidation(v bool) { + o.InternalHostSslValidation = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *ProxyOutpostConfig) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *ProxyOutpostConfig) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetOidcConfiguration returns the OidcConfiguration field value +func (o *ProxyOutpostConfig) GetOidcConfiguration() OpenIDConnectConfiguration { + if o == nil { + var ret OpenIDConnectConfiguration + return ret + } + + return o.OidcConfiguration +} + +// GetOidcConfigurationOk returns a tuple with the OidcConfiguration field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetOidcConfigurationOk() (*OpenIDConnectConfiguration, bool) { + if o == nil { + return nil, false + } + return &o.OidcConfiguration, true +} + +// SetOidcConfiguration sets field value +func (o *ProxyOutpostConfig) SetOidcConfiguration(v OpenIDConnectConfiguration) { + o.OidcConfiguration = v +} + +// GetCookieSecret returns the CookieSecret field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetCookieSecret() string { + if o == nil || IsNil(o.CookieSecret) { + var ret string + return ret + } + return *o.CookieSecret +} + +// GetCookieSecretOk returns a tuple with the CookieSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetCookieSecretOk() (*string, bool) { + if o == nil || IsNil(o.CookieSecret) { + return nil, false + } + return o.CookieSecret, true +} + +// HasCookieSecret returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasCookieSecret() bool { + if o != nil && !IsNil(o.CookieSecret) { + return true + } + + return false +} + +// SetCookieSecret gets a reference to the given string and assigns it to the CookieSecret field. +func (o *ProxyOutpostConfig) SetCookieSecret(v string) { + o.CookieSecret = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProxyOutpostConfig) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyOutpostConfig) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *ProxyOutpostConfig) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *ProxyOutpostConfig) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *ProxyOutpostConfig) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetSkipPathRegex returns the SkipPathRegex field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetSkipPathRegex() string { + if o == nil || IsNil(o.SkipPathRegex) { + var ret string + return ret + } + return *o.SkipPathRegex +} + +// GetSkipPathRegexOk returns a tuple with the SkipPathRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetSkipPathRegexOk() (*string, bool) { + if o == nil || IsNil(o.SkipPathRegex) { + return nil, false + } + return o.SkipPathRegex, true +} + +// HasSkipPathRegex returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasSkipPathRegex() bool { + if o != nil && !IsNil(o.SkipPathRegex) { + return true + } + + return false +} + +// SetSkipPathRegex gets a reference to the given string and assigns it to the SkipPathRegex field. +func (o *ProxyOutpostConfig) SetSkipPathRegex(v string) { + o.SkipPathRegex = &v +} + +// GetBasicAuthEnabled returns the BasicAuthEnabled field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetBasicAuthEnabled() bool { + if o == nil || IsNil(o.BasicAuthEnabled) { + var ret bool + return ret + } + return *o.BasicAuthEnabled +} + +// GetBasicAuthEnabledOk returns a tuple with the BasicAuthEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetBasicAuthEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BasicAuthEnabled) { + return nil, false + } + return o.BasicAuthEnabled, true +} + +// HasBasicAuthEnabled returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasBasicAuthEnabled() bool { + if o != nil && !IsNil(o.BasicAuthEnabled) { + return true + } + + return false +} + +// SetBasicAuthEnabled gets a reference to the given bool and assigns it to the BasicAuthEnabled field. +func (o *ProxyOutpostConfig) SetBasicAuthEnabled(v bool) { + o.BasicAuthEnabled = &v +} + +// GetBasicAuthPasswordAttribute returns the BasicAuthPasswordAttribute field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetBasicAuthPasswordAttribute() string { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + var ret string + return ret + } + return *o.BasicAuthPasswordAttribute +} + +// GetBasicAuthPasswordAttributeOk returns a tuple with the BasicAuthPasswordAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetBasicAuthPasswordAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + return nil, false + } + return o.BasicAuthPasswordAttribute, true +} + +// HasBasicAuthPasswordAttribute returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasBasicAuthPasswordAttribute() bool { + if o != nil && !IsNil(o.BasicAuthPasswordAttribute) { + return true + } + + return false +} + +// SetBasicAuthPasswordAttribute gets a reference to the given string and assigns it to the BasicAuthPasswordAttribute field. +func (o *ProxyOutpostConfig) SetBasicAuthPasswordAttribute(v string) { + o.BasicAuthPasswordAttribute = &v +} + +// GetBasicAuthUserAttribute returns the BasicAuthUserAttribute field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetBasicAuthUserAttribute() string { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + var ret string + return ret + } + return *o.BasicAuthUserAttribute +} + +// GetBasicAuthUserAttributeOk returns a tuple with the BasicAuthUserAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetBasicAuthUserAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + return nil, false + } + return o.BasicAuthUserAttribute, true +} + +// HasBasicAuthUserAttribute returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasBasicAuthUserAttribute() bool { + if o != nil && !IsNil(o.BasicAuthUserAttribute) { + return true + } + + return false +} + +// SetBasicAuthUserAttribute gets a reference to the given string and assigns it to the BasicAuthUserAttribute field. +func (o *ProxyOutpostConfig) SetBasicAuthUserAttribute(v string) { + o.BasicAuthUserAttribute = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetMode() ProxyMode { + if o == nil || IsNil(o.Mode) { + var ret ProxyMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetModeOk() (*ProxyMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ProxyMode and assigns it to the Mode field. +func (o *ProxyOutpostConfig) SetMode(v ProxyMode) { + o.Mode = &v +} + +// GetCookieDomain returns the CookieDomain field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetCookieDomain() string { + if o == nil || IsNil(o.CookieDomain) { + var ret string + return ret + } + return *o.CookieDomain +} + +// GetCookieDomainOk returns a tuple with the CookieDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetCookieDomainOk() (*string, bool) { + if o == nil || IsNil(o.CookieDomain) { + return nil, false + } + return o.CookieDomain, true +} + +// HasCookieDomain returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasCookieDomain() bool { + if o != nil && !IsNil(o.CookieDomain) { + return true + } + + return false +} + +// SetCookieDomain gets a reference to the given string and assigns it to the CookieDomain field. +func (o *ProxyOutpostConfig) SetCookieDomain(v string) { + o.CookieDomain = &v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value +// If the value is explicit nil, the zero value for float64 will be returned +func (o *ProxyOutpostConfig) GetAccessTokenValidity() float64 { + if o == nil || o.AccessTokenValidity.Get() == nil { + var ret float64 + return ret + } + + return *o.AccessTokenValidity.Get() +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyOutpostConfig) GetAccessTokenValidityOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.AccessTokenValidity.Get(), o.AccessTokenValidity.IsSet() +} + +// SetAccessTokenValidity sets field value +func (o *ProxyOutpostConfig) SetAccessTokenValidity(v float64) { + o.AccessTokenValidity.Set(&v) +} + +// GetInterceptHeaderAuth returns the InterceptHeaderAuth field value if set, zero value otherwise. +func (o *ProxyOutpostConfig) GetInterceptHeaderAuth() bool { + if o == nil || IsNil(o.InterceptHeaderAuth) { + var ret bool + return ret + } + return *o.InterceptHeaderAuth +} + +// GetInterceptHeaderAuthOk returns a tuple with the InterceptHeaderAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetInterceptHeaderAuthOk() (*bool, bool) { + if o == nil || IsNil(o.InterceptHeaderAuth) { + return nil, false + } + return o.InterceptHeaderAuth, true +} + +// HasInterceptHeaderAuth returns a boolean if a field has been set. +func (o *ProxyOutpostConfig) HasInterceptHeaderAuth() bool { + if o != nil && !IsNil(o.InterceptHeaderAuth) { + return true + } + + return false +} + +// SetInterceptHeaderAuth gets a reference to the given bool and assigns it to the InterceptHeaderAuth field. +func (o *ProxyOutpostConfig) SetInterceptHeaderAuth(v bool) { + o.InterceptHeaderAuth = &v +} + +// GetScopesToRequest returns the ScopesToRequest field value +func (o *ProxyOutpostConfig) GetScopesToRequest() []string { + if o == nil { + var ret []string + return ret + } + + return o.ScopesToRequest +} + +// GetScopesToRequestOk returns a tuple with the ScopesToRequest field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetScopesToRequestOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.ScopesToRequest, true +} + +// SetScopesToRequest sets field value +func (o *ProxyOutpostConfig) SetScopesToRequest(v []string) { + o.ScopesToRequest = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +func (o *ProxyOutpostConfig) GetAssignedApplicationSlug() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedApplicationSlug +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedApplicationSlug, true +} + +// SetAssignedApplicationSlug sets field value +func (o *ProxyOutpostConfig) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug = v +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +func (o *ProxyOutpostConfig) GetAssignedApplicationName() string { + if o == nil { + var ret string + return ret + } + + return o.AssignedApplicationName +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +func (o *ProxyOutpostConfig) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AssignedApplicationName, true +} + +// SetAssignedApplicationName sets field value +func (o *ProxyOutpostConfig) SetAssignedApplicationName(v string) { + o.AssignedApplicationName = v +} + +func (o ProxyOutpostConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProxyOutpostConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.InternalHost) { + toSerialize["internal_host"] = o.InternalHost + } + toSerialize["external_host"] = o.ExternalHost + if !IsNil(o.InternalHostSslValidation) { + toSerialize["internal_host_ssl_validation"] = o.InternalHostSslValidation + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + toSerialize["oidc_configuration"] = o.OidcConfiguration + if !IsNil(o.CookieSecret) { + toSerialize["cookie_secret"] = o.CookieSecret + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.SkipPathRegex) { + toSerialize["skip_path_regex"] = o.SkipPathRegex + } + if !IsNil(o.BasicAuthEnabled) { + toSerialize["basic_auth_enabled"] = o.BasicAuthEnabled + } + if !IsNil(o.BasicAuthPasswordAttribute) { + toSerialize["basic_auth_password_attribute"] = o.BasicAuthPasswordAttribute + } + if !IsNil(o.BasicAuthUserAttribute) { + toSerialize["basic_auth_user_attribute"] = o.BasicAuthUserAttribute + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.CookieDomain) { + toSerialize["cookie_domain"] = o.CookieDomain + } + toSerialize["access_token_validity"] = o.AccessTokenValidity.Get() + if !IsNil(o.InterceptHeaderAuth) { + toSerialize["intercept_header_auth"] = o.InterceptHeaderAuth + } + toSerialize["scopes_to_request"] = o.ScopesToRequest + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug + toSerialize["assigned_application_name"] = o.AssignedApplicationName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProxyOutpostConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "external_host", + "oidc_configuration", + "access_token_validity", + "scopes_to_request", + "assigned_application_slug", + "assigned_application_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProxyOutpostConfig := _ProxyOutpostConfig{} + + err = json.Unmarshal(data, &varProxyOutpostConfig) + + if err != nil { + return err + } + + *o = ProxyOutpostConfig(varProxyOutpostConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "internal_host") + delete(additionalProperties, "external_host") + delete(additionalProperties, "internal_host_ssl_validation") + delete(additionalProperties, "client_id") + delete(additionalProperties, "client_secret") + delete(additionalProperties, "oidc_configuration") + delete(additionalProperties, "cookie_secret") + delete(additionalProperties, "certificate") + delete(additionalProperties, "skip_path_regex") + delete(additionalProperties, "basic_auth_enabled") + delete(additionalProperties, "basic_auth_password_attribute") + delete(additionalProperties, "basic_auth_user_attribute") + delete(additionalProperties, "mode") + delete(additionalProperties, "cookie_domain") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "intercept_header_auth") + delete(additionalProperties, "scopes_to_request") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProxyOutpostConfig struct { + value *ProxyOutpostConfig + isSet bool +} + +func (v NullableProxyOutpostConfig) Get() *ProxyOutpostConfig { + return v.value +} + +func (v *NullableProxyOutpostConfig) Set(val *ProxyOutpostConfig) { + v.value = val + v.isSet = true +} + +func (v NullableProxyOutpostConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableProxyOutpostConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxyOutpostConfig(val *ProxyOutpostConfig) *NullableProxyOutpostConfig { + return &NullableProxyOutpostConfig{value: val, isSet: true} +} + +func (v NullableProxyOutpostConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxyOutpostConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_proxy_provider.go b/packages/client-go/model_proxy_provider.go new file mode 100644 index 0000000000..d95f3cd409 --- /dev/null +++ b/packages/client-go/model_proxy_provider.go @@ -0,0 +1,1244 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProxyProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProxyProvider{} + +// ProxyProvider ProxyProvider Serializer +type ProxyProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + ClientId string `json:"client_id"` + InternalHost *string `json:"internal_host,omitempty"` + ExternalHost string `json:"external_host"` + // Validate SSL Certificates of upstream servers + InternalHostSslValidation *bool `json:"internal_host_ssl_validation,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + // Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression. + SkipPathRegex *string `json:"skip_path_regex,omitempty"` + // Set a custom HTTP-Basic Authentication header based on values from authentik. + BasicAuthEnabled *bool `json:"basic_auth_enabled,omitempty"` + // User/Group Attribute used for the password part of the HTTP-Basic Header. + BasicAuthPasswordAttribute *string `json:"basic_auth_password_attribute,omitempty"` + // User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used. + BasicAuthUserAttribute *string `json:"basic_auth_user_attribute,omitempty"` + // Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host. + Mode *ProxyMode `json:"mode,omitempty"` + // When enabled, this provider will intercept the authorization header and authenticate requests based on its value. + InterceptHeaderAuth *bool `json:"intercept_header_auth,omitempty"` + RedirectUris []RedirectURI `json:"redirect_uris"` + CookieDomain *string `json:"cookie_domain,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + OutpostSet []string `json:"outpost_set"` + AdditionalProperties map[string]interface{} +} + +type _ProxyProvider ProxyProvider + +// NewProxyProvider instantiates a new ProxyProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProxyProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, clientId string, externalHost string, redirectUris []RedirectURI, outpostSet []string) *ProxyProvider { + this := ProxyProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.ClientId = clientId + this.ExternalHost = externalHost + this.RedirectUris = redirectUris + this.OutpostSet = outpostSet + return &this +} + +// NewProxyProviderWithDefaults instantiates a new ProxyProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProxyProviderWithDefaults() *ProxyProvider { + this := ProxyProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *ProxyProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ProxyProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ProxyProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProxyProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProxyProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *ProxyProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *ProxyProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *ProxyProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *ProxyProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *ProxyProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *ProxyProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *ProxyProvider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *ProxyProvider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *ProxyProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *ProxyProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *ProxyProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *ProxyProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ProxyProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ProxyProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *ProxyProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ProxyProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *ProxyProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ProxyProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *ProxyProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *ProxyProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *ProxyProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *ProxyProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ProxyProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ProxyProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ProxyProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ProxyProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ProxyProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetClientId returns the ClientId field value +func (o *ProxyProvider) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *ProxyProvider) SetClientId(v string) { + o.ClientId = v +} + +// GetInternalHost returns the InternalHost field value if set, zero value otherwise. +func (o *ProxyProvider) GetInternalHost() string { + if o == nil || IsNil(o.InternalHost) { + var ret string + return ret + } + return *o.InternalHost +} + +// GetInternalHostOk returns a tuple with the InternalHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetInternalHostOk() (*string, bool) { + if o == nil || IsNil(o.InternalHost) { + return nil, false + } + return o.InternalHost, true +} + +// HasInternalHost returns a boolean if a field has been set. +func (o *ProxyProvider) HasInternalHost() bool { + if o != nil && !IsNil(o.InternalHost) { + return true + } + + return false +} + +// SetInternalHost gets a reference to the given string and assigns it to the InternalHost field. +func (o *ProxyProvider) SetInternalHost(v string) { + o.InternalHost = &v +} + +// GetExternalHost returns the ExternalHost field value +func (o *ProxyProvider) GetExternalHost() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalHost +} + +// GetExternalHostOk returns a tuple with the ExternalHost field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetExternalHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalHost, true +} + +// SetExternalHost sets field value +func (o *ProxyProvider) SetExternalHost(v string) { + o.ExternalHost = v +} + +// GetInternalHostSslValidation returns the InternalHostSslValidation field value if set, zero value otherwise. +func (o *ProxyProvider) GetInternalHostSslValidation() bool { + if o == nil || IsNil(o.InternalHostSslValidation) { + var ret bool + return ret + } + return *o.InternalHostSslValidation +} + +// GetInternalHostSslValidationOk returns a tuple with the InternalHostSslValidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetInternalHostSslValidationOk() (*bool, bool) { + if o == nil || IsNil(o.InternalHostSslValidation) { + return nil, false + } + return o.InternalHostSslValidation, true +} + +// HasInternalHostSslValidation returns a boolean if a field has been set. +func (o *ProxyProvider) HasInternalHostSslValidation() bool { + if o != nil && !IsNil(o.InternalHostSslValidation) { + return true + } + + return false +} + +// SetInternalHostSslValidation gets a reference to the given bool and assigns it to the InternalHostSslValidation field. +func (o *ProxyProvider) SetInternalHostSslValidation(v bool) { + o.InternalHostSslValidation = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProxyProvider) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProvider) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *ProxyProvider) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *ProxyProvider) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *ProxyProvider) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *ProxyProvider) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetSkipPathRegex returns the SkipPathRegex field value if set, zero value otherwise. +func (o *ProxyProvider) GetSkipPathRegex() string { + if o == nil || IsNil(o.SkipPathRegex) { + var ret string + return ret + } + return *o.SkipPathRegex +} + +// GetSkipPathRegexOk returns a tuple with the SkipPathRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetSkipPathRegexOk() (*string, bool) { + if o == nil || IsNil(o.SkipPathRegex) { + return nil, false + } + return o.SkipPathRegex, true +} + +// HasSkipPathRegex returns a boolean if a field has been set. +func (o *ProxyProvider) HasSkipPathRegex() bool { + if o != nil && !IsNil(o.SkipPathRegex) { + return true + } + + return false +} + +// SetSkipPathRegex gets a reference to the given string and assigns it to the SkipPathRegex field. +func (o *ProxyProvider) SetSkipPathRegex(v string) { + o.SkipPathRegex = &v +} + +// GetBasicAuthEnabled returns the BasicAuthEnabled field value if set, zero value otherwise. +func (o *ProxyProvider) GetBasicAuthEnabled() bool { + if o == nil || IsNil(o.BasicAuthEnabled) { + var ret bool + return ret + } + return *o.BasicAuthEnabled +} + +// GetBasicAuthEnabledOk returns a tuple with the BasicAuthEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetBasicAuthEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BasicAuthEnabled) { + return nil, false + } + return o.BasicAuthEnabled, true +} + +// HasBasicAuthEnabled returns a boolean if a field has been set. +func (o *ProxyProvider) HasBasicAuthEnabled() bool { + if o != nil && !IsNil(o.BasicAuthEnabled) { + return true + } + + return false +} + +// SetBasicAuthEnabled gets a reference to the given bool and assigns it to the BasicAuthEnabled field. +func (o *ProxyProvider) SetBasicAuthEnabled(v bool) { + o.BasicAuthEnabled = &v +} + +// GetBasicAuthPasswordAttribute returns the BasicAuthPasswordAttribute field value if set, zero value otherwise. +func (o *ProxyProvider) GetBasicAuthPasswordAttribute() string { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + var ret string + return ret + } + return *o.BasicAuthPasswordAttribute +} + +// GetBasicAuthPasswordAttributeOk returns a tuple with the BasicAuthPasswordAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetBasicAuthPasswordAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + return nil, false + } + return o.BasicAuthPasswordAttribute, true +} + +// HasBasicAuthPasswordAttribute returns a boolean if a field has been set. +func (o *ProxyProvider) HasBasicAuthPasswordAttribute() bool { + if o != nil && !IsNil(o.BasicAuthPasswordAttribute) { + return true + } + + return false +} + +// SetBasicAuthPasswordAttribute gets a reference to the given string and assigns it to the BasicAuthPasswordAttribute field. +func (o *ProxyProvider) SetBasicAuthPasswordAttribute(v string) { + o.BasicAuthPasswordAttribute = &v +} + +// GetBasicAuthUserAttribute returns the BasicAuthUserAttribute field value if set, zero value otherwise. +func (o *ProxyProvider) GetBasicAuthUserAttribute() string { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + var ret string + return ret + } + return *o.BasicAuthUserAttribute +} + +// GetBasicAuthUserAttributeOk returns a tuple with the BasicAuthUserAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetBasicAuthUserAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + return nil, false + } + return o.BasicAuthUserAttribute, true +} + +// HasBasicAuthUserAttribute returns a boolean if a field has been set. +func (o *ProxyProvider) HasBasicAuthUserAttribute() bool { + if o != nil && !IsNil(o.BasicAuthUserAttribute) { + return true + } + + return false +} + +// SetBasicAuthUserAttribute gets a reference to the given string and assigns it to the BasicAuthUserAttribute field. +func (o *ProxyProvider) SetBasicAuthUserAttribute(v string) { + o.BasicAuthUserAttribute = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ProxyProvider) GetMode() ProxyMode { + if o == nil || IsNil(o.Mode) { + var ret ProxyMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetModeOk() (*ProxyMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ProxyProvider) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ProxyMode and assigns it to the Mode field. +func (o *ProxyProvider) SetMode(v ProxyMode) { + o.Mode = &v +} + +// GetInterceptHeaderAuth returns the InterceptHeaderAuth field value if set, zero value otherwise. +func (o *ProxyProvider) GetInterceptHeaderAuth() bool { + if o == nil || IsNil(o.InterceptHeaderAuth) { + var ret bool + return ret + } + return *o.InterceptHeaderAuth +} + +// GetInterceptHeaderAuthOk returns a tuple with the InterceptHeaderAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetInterceptHeaderAuthOk() (*bool, bool) { + if o == nil || IsNil(o.InterceptHeaderAuth) { + return nil, false + } + return o.InterceptHeaderAuth, true +} + +// HasInterceptHeaderAuth returns a boolean if a field has been set. +func (o *ProxyProvider) HasInterceptHeaderAuth() bool { + if o != nil && !IsNil(o.InterceptHeaderAuth) { + return true + } + + return false +} + +// SetInterceptHeaderAuth gets a reference to the given bool and assigns it to the InterceptHeaderAuth field. +func (o *ProxyProvider) SetInterceptHeaderAuth(v bool) { + o.InterceptHeaderAuth = &v +} + +// GetRedirectUris returns the RedirectUris field value +func (o *ProxyProvider) GetRedirectUris() []RedirectURI { + if o == nil { + var ret []RedirectURI + return ret + } + + return o.RedirectUris +} + +// GetRedirectUrisOk returns a tuple with the RedirectUris field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetRedirectUrisOk() ([]RedirectURI, bool) { + if o == nil { + return nil, false + } + return o.RedirectUris, true +} + +// SetRedirectUris sets field value +func (o *ProxyProvider) SetRedirectUris(v []RedirectURI) { + o.RedirectUris = v +} + +// GetCookieDomain returns the CookieDomain field value if set, zero value otherwise. +func (o *ProxyProvider) GetCookieDomain() string { + if o == nil || IsNil(o.CookieDomain) { + var ret string + return ret + } + return *o.CookieDomain +} + +// GetCookieDomainOk returns a tuple with the CookieDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetCookieDomainOk() (*string, bool) { + if o == nil || IsNil(o.CookieDomain) { + return nil, false + } + return o.CookieDomain, true +} + +// HasCookieDomain returns a boolean if a field has been set. +func (o *ProxyProvider) HasCookieDomain() bool { + if o != nil && !IsNil(o.CookieDomain) { + return true + } + + return false +} + +// SetCookieDomain gets a reference to the given string and assigns it to the CookieDomain field. +func (o *ProxyProvider) SetCookieDomain(v string) { + o.CookieDomain = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *ProxyProvider) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *ProxyProvider) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *ProxyProvider) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *ProxyProvider) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *ProxyProvider) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *ProxyProvider) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *ProxyProvider) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *ProxyProvider) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *ProxyProvider) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *ProxyProvider) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *ProxyProvider) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *ProxyProvider) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +// GetOutpostSet returns the OutpostSet field value +func (o *ProxyProvider) GetOutpostSet() []string { + if o == nil { + var ret []string + return ret + } + + return o.OutpostSet +} + +// GetOutpostSetOk returns a tuple with the OutpostSet field value +// and a boolean to check if the value has been set. +func (o *ProxyProvider) GetOutpostSetOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.OutpostSet, true +} + +// SetOutpostSet sets field value +func (o *ProxyProvider) SetOutpostSet(v []string) { + o.OutpostSet = v +} + +func (o ProxyProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProxyProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["client_id"] = o.ClientId + if !IsNil(o.InternalHost) { + toSerialize["internal_host"] = o.InternalHost + } + toSerialize["external_host"] = o.ExternalHost + if !IsNil(o.InternalHostSslValidation) { + toSerialize["internal_host_ssl_validation"] = o.InternalHostSslValidation + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.SkipPathRegex) { + toSerialize["skip_path_regex"] = o.SkipPathRegex + } + if !IsNil(o.BasicAuthEnabled) { + toSerialize["basic_auth_enabled"] = o.BasicAuthEnabled + } + if !IsNil(o.BasicAuthPasswordAttribute) { + toSerialize["basic_auth_password_attribute"] = o.BasicAuthPasswordAttribute + } + if !IsNil(o.BasicAuthUserAttribute) { + toSerialize["basic_auth_user_attribute"] = o.BasicAuthUserAttribute + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.InterceptHeaderAuth) { + toSerialize["intercept_header_auth"] = o.InterceptHeaderAuth + } + toSerialize["redirect_uris"] = o.RedirectUris + if !IsNil(o.CookieDomain) { + toSerialize["cookie_domain"] = o.CookieDomain + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + toSerialize["outpost_set"] = o.OutpostSet + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProxyProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "client_id", + "external_host", + "redirect_uris", + "outpost_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProxyProvider := _ProxyProvider{} + + err = json.Unmarshal(data, &varProxyProvider) + + if err != nil { + return err + } + + *o = ProxyProvider(varProxyProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "client_id") + delete(additionalProperties, "internal_host") + delete(additionalProperties, "external_host") + delete(additionalProperties, "internal_host_ssl_validation") + delete(additionalProperties, "certificate") + delete(additionalProperties, "skip_path_regex") + delete(additionalProperties, "basic_auth_enabled") + delete(additionalProperties, "basic_auth_password_attribute") + delete(additionalProperties, "basic_auth_user_attribute") + delete(additionalProperties, "mode") + delete(additionalProperties, "intercept_header_auth") + delete(additionalProperties, "redirect_uris") + delete(additionalProperties, "cookie_domain") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + delete(additionalProperties, "outpost_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProxyProvider struct { + value *ProxyProvider + isSet bool +} + +func (v NullableProxyProvider) Get() *ProxyProvider { + return v.value +} + +func (v *NullableProxyProvider) Set(val *ProxyProvider) { + v.value = val + v.isSet = true +} + +func (v NullableProxyProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableProxyProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxyProvider(val *ProxyProvider) *NullableProxyProvider { + return &NullableProxyProvider{value: val, isSet: true} +} + +func (v NullableProxyProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxyProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_proxy_provider_request.go b/packages/client-go/model_proxy_provider_request.go new file mode 100644 index 0000000000..ce59d648f2 --- /dev/null +++ b/packages/client-go/model_proxy_provider_request.go @@ -0,0 +1,880 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ProxyProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProxyProviderRequest{} + +// ProxyProviderRequest ProxyProvider Serializer +type ProxyProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + InternalHost *string `json:"internal_host,omitempty"` + ExternalHost string `json:"external_host"` + // Validate SSL Certificates of upstream servers + InternalHostSslValidation *bool `json:"internal_host_ssl_validation,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + // Regular expressions for which authentication is not required. Each new line is interpreted as a new Regular Expression. + SkipPathRegex *string `json:"skip_path_regex,omitempty"` + // Set a custom HTTP-Basic Authentication header based on values from authentik. + BasicAuthEnabled *bool `json:"basic_auth_enabled,omitempty"` + // User/Group Attribute used for the password part of the HTTP-Basic Header. + BasicAuthPasswordAttribute *string `json:"basic_auth_password_attribute,omitempty"` + // User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the user's Email address is used. + BasicAuthUserAttribute *string `json:"basic_auth_user_attribute,omitempty"` + // Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with internal_host. + Mode *ProxyMode `json:"mode,omitempty"` + // When enabled, this provider will intercept the authorization header and authenticate requests based on its value. + InterceptHeaderAuth *bool `json:"intercept_header_auth,omitempty"` + CookieDomain *string `json:"cookie_domain,omitempty"` + JwtFederationSources []string `json:"jwt_federation_sources,omitempty"` + JwtFederationProviders []int32 `json:"jwt_federation_providers,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AccessTokenValidity *string `json:"access_token_validity,omitempty"` + // Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + RefreshTokenValidity *string `json:"refresh_token_validity,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ProxyProviderRequest ProxyProviderRequest + +// NewProxyProviderRequest instantiates a new ProxyProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProxyProviderRequest(name string, authorizationFlow string, invalidationFlow string, externalHost string) *ProxyProviderRequest { + this := ProxyProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.ExternalHost = externalHost + return &this +} + +// NewProxyProviderRequestWithDefaults instantiates a new ProxyProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProxyProviderRequestWithDefaults() *ProxyProviderRequest { + this := ProxyProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ProxyProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ProxyProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProxyProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *ProxyProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *ProxyProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *ProxyProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *ProxyProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *ProxyProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *ProxyProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *ProxyProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *ProxyProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetInternalHost returns the InternalHost field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetInternalHost() string { + if o == nil || IsNil(o.InternalHost) { + var ret string + return ret + } + return *o.InternalHost +} + +// GetInternalHostOk returns a tuple with the InternalHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetInternalHostOk() (*string, bool) { + if o == nil || IsNil(o.InternalHost) { + return nil, false + } + return o.InternalHost, true +} + +// HasInternalHost returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasInternalHost() bool { + if o != nil && !IsNil(o.InternalHost) { + return true + } + + return false +} + +// SetInternalHost gets a reference to the given string and assigns it to the InternalHost field. +func (o *ProxyProviderRequest) SetInternalHost(v string) { + o.InternalHost = &v +} + +// GetExternalHost returns the ExternalHost field value +func (o *ProxyProviderRequest) GetExternalHost() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalHost +} + +// GetExternalHostOk returns a tuple with the ExternalHost field value +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetExternalHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalHost, true +} + +// SetExternalHost sets field value +func (o *ProxyProviderRequest) SetExternalHost(v string) { + o.ExternalHost = v +} + +// GetInternalHostSslValidation returns the InternalHostSslValidation field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetInternalHostSslValidation() bool { + if o == nil || IsNil(o.InternalHostSslValidation) { + var ret bool + return ret + } + return *o.InternalHostSslValidation +} + +// GetInternalHostSslValidationOk returns a tuple with the InternalHostSslValidation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetInternalHostSslValidationOk() (*bool, bool) { + if o == nil || IsNil(o.InternalHostSslValidation) { + return nil, false + } + return o.InternalHostSslValidation, true +} + +// HasInternalHostSslValidation returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasInternalHostSslValidation() bool { + if o != nil && !IsNil(o.InternalHostSslValidation) { + return true + } + + return false +} + +// SetInternalHostSslValidation gets a reference to the given bool and assigns it to the InternalHostSslValidation field. +func (o *ProxyProviderRequest) SetInternalHostSslValidation(v bool) { + o.InternalHostSslValidation = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ProxyProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ProxyProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *ProxyProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *ProxyProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *ProxyProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +// GetSkipPathRegex returns the SkipPathRegex field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetSkipPathRegex() string { + if o == nil || IsNil(o.SkipPathRegex) { + var ret string + return ret + } + return *o.SkipPathRegex +} + +// GetSkipPathRegexOk returns a tuple with the SkipPathRegex field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetSkipPathRegexOk() (*string, bool) { + if o == nil || IsNil(o.SkipPathRegex) { + return nil, false + } + return o.SkipPathRegex, true +} + +// HasSkipPathRegex returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasSkipPathRegex() bool { + if o != nil && !IsNil(o.SkipPathRegex) { + return true + } + + return false +} + +// SetSkipPathRegex gets a reference to the given string and assigns it to the SkipPathRegex field. +func (o *ProxyProviderRequest) SetSkipPathRegex(v string) { + o.SkipPathRegex = &v +} + +// GetBasicAuthEnabled returns the BasicAuthEnabled field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetBasicAuthEnabled() bool { + if o == nil || IsNil(o.BasicAuthEnabled) { + var ret bool + return ret + } + return *o.BasicAuthEnabled +} + +// GetBasicAuthEnabledOk returns a tuple with the BasicAuthEnabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetBasicAuthEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.BasicAuthEnabled) { + return nil, false + } + return o.BasicAuthEnabled, true +} + +// HasBasicAuthEnabled returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasBasicAuthEnabled() bool { + if o != nil && !IsNil(o.BasicAuthEnabled) { + return true + } + + return false +} + +// SetBasicAuthEnabled gets a reference to the given bool and assigns it to the BasicAuthEnabled field. +func (o *ProxyProviderRequest) SetBasicAuthEnabled(v bool) { + o.BasicAuthEnabled = &v +} + +// GetBasicAuthPasswordAttribute returns the BasicAuthPasswordAttribute field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetBasicAuthPasswordAttribute() string { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + var ret string + return ret + } + return *o.BasicAuthPasswordAttribute +} + +// GetBasicAuthPasswordAttributeOk returns a tuple with the BasicAuthPasswordAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetBasicAuthPasswordAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthPasswordAttribute) { + return nil, false + } + return o.BasicAuthPasswordAttribute, true +} + +// HasBasicAuthPasswordAttribute returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasBasicAuthPasswordAttribute() bool { + if o != nil && !IsNil(o.BasicAuthPasswordAttribute) { + return true + } + + return false +} + +// SetBasicAuthPasswordAttribute gets a reference to the given string and assigns it to the BasicAuthPasswordAttribute field. +func (o *ProxyProviderRequest) SetBasicAuthPasswordAttribute(v string) { + o.BasicAuthPasswordAttribute = &v +} + +// GetBasicAuthUserAttribute returns the BasicAuthUserAttribute field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetBasicAuthUserAttribute() string { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + var ret string + return ret + } + return *o.BasicAuthUserAttribute +} + +// GetBasicAuthUserAttributeOk returns a tuple with the BasicAuthUserAttribute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetBasicAuthUserAttributeOk() (*string, bool) { + if o == nil || IsNil(o.BasicAuthUserAttribute) { + return nil, false + } + return o.BasicAuthUserAttribute, true +} + +// HasBasicAuthUserAttribute returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasBasicAuthUserAttribute() bool { + if o != nil && !IsNil(o.BasicAuthUserAttribute) { + return true + } + + return false +} + +// SetBasicAuthUserAttribute gets a reference to the given string and assigns it to the BasicAuthUserAttribute field. +func (o *ProxyProviderRequest) SetBasicAuthUserAttribute(v string) { + o.BasicAuthUserAttribute = &v +} + +// GetMode returns the Mode field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetMode() ProxyMode { + if o == nil || IsNil(o.Mode) { + var ret ProxyMode + return ret + } + return *o.Mode +} + +// GetModeOk returns a tuple with the Mode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetModeOk() (*ProxyMode, bool) { + if o == nil || IsNil(o.Mode) { + return nil, false + } + return o.Mode, true +} + +// HasMode returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasMode() bool { + if o != nil && !IsNil(o.Mode) { + return true + } + + return false +} + +// SetMode gets a reference to the given ProxyMode and assigns it to the Mode field. +func (o *ProxyProviderRequest) SetMode(v ProxyMode) { + o.Mode = &v +} + +// GetInterceptHeaderAuth returns the InterceptHeaderAuth field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetInterceptHeaderAuth() bool { + if o == nil || IsNil(o.InterceptHeaderAuth) { + var ret bool + return ret + } + return *o.InterceptHeaderAuth +} + +// GetInterceptHeaderAuthOk returns a tuple with the InterceptHeaderAuth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetInterceptHeaderAuthOk() (*bool, bool) { + if o == nil || IsNil(o.InterceptHeaderAuth) { + return nil, false + } + return o.InterceptHeaderAuth, true +} + +// HasInterceptHeaderAuth returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasInterceptHeaderAuth() bool { + if o != nil && !IsNil(o.InterceptHeaderAuth) { + return true + } + + return false +} + +// SetInterceptHeaderAuth gets a reference to the given bool and assigns it to the InterceptHeaderAuth field. +func (o *ProxyProviderRequest) SetInterceptHeaderAuth(v bool) { + o.InterceptHeaderAuth = &v +} + +// GetCookieDomain returns the CookieDomain field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetCookieDomain() string { + if o == nil || IsNil(o.CookieDomain) { + var ret string + return ret + } + return *o.CookieDomain +} + +// GetCookieDomainOk returns a tuple with the CookieDomain field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetCookieDomainOk() (*string, bool) { + if o == nil || IsNil(o.CookieDomain) { + return nil, false + } + return o.CookieDomain, true +} + +// HasCookieDomain returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasCookieDomain() bool { + if o != nil && !IsNil(o.CookieDomain) { + return true + } + + return false +} + +// SetCookieDomain gets a reference to the given string and assigns it to the CookieDomain field. +func (o *ProxyProviderRequest) SetCookieDomain(v string) { + o.CookieDomain = &v +} + +// GetJwtFederationSources returns the JwtFederationSources field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetJwtFederationSources() []string { + if o == nil || IsNil(o.JwtFederationSources) { + var ret []string + return ret + } + return o.JwtFederationSources +} + +// GetJwtFederationSourcesOk returns a tuple with the JwtFederationSources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetJwtFederationSourcesOk() ([]string, bool) { + if o == nil || IsNil(o.JwtFederationSources) { + return nil, false + } + return o.JwtFederationSources, true +} + +// HasJwtFederationSources returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasJwtFederationSources() bool { + if o != nil && !IsNil(o.JwtFederationSources) { + return true + } + + return false +} + +// SetJwtFederationSources gets a reference to the given []string and assigns it to the JwtFederationSources field. +func (o *ProxyProviderRequest) SetJwtFederationSources(v []string) { + o.JwtFederationSources = v +} + +// GetJwtFederationProviders returns the JwtFederationProviders field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetJwtFederationProviders() []int32 { + if o == nil || IsNil(o.JwtFederationProviders) { + var ret []int32 + return ret + } + return o.JwtFederationProviders +} + +// GetJwtFederationProvidersOk returns a tuple with the JwtFederationProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetJwtFederationProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.JwtFederationProviders) { + return nil, false + } + return o.JwtFederationProviders, true +} + +// HasJwtFederationProviders returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasJwtFederationProviders() bool { + if o != nil && !IsNil(o.JwtFederationProviders) { + return true + } + + return false +} + +// SetJwtFederationProviders gets a reference to the given []int32 and assigns it to the JwtFederationProviders field. +func (o *ProxyProviderRequest) SetJwtFederationProviders(v []int32) { + o.JwtFederationProviders = v +} + +// GetAccessTokenValidity returns the AccessTokenValidity field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetAccessTokenValidity() string { + if o == nil || IsNil(o.AccessTokenValidity) { + var ret string + return ret + } + return *o.AccessTokenValidity +} + +// GetAccessTokenValidityOk returns a tuple with the AccessTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetAccessTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.AccessTokenValidity) { + return nil, false + } + return o.AccessTokenValidity, true +} + +// HasAccessTokenValidity returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasAccessTokenValidity() bool { + if o != nil && !IsNil(o.AccessTokenValidity) { + return true + } + + return false +} + +// SetAccessTokenValidity gets a reference to the given string and assigns it to the AccessTokenValidity field. +func (o *ProxyProviderRequest) SetAccessTokenValidity(v string) { + o.AccessTokenValidity = &v +} + +// GetRefreshTokenValidity returns the RefreshTokenValidity field value if set, zero value otherwise. +func (o *ProxyProviderRequest) GetRefreshTokenValidity() string { + if o == nil || IsNil(o.RefreshTokenValidity) { + var ret string + return ret + } + return *o.RefreshTokenValidity +} + +// GetRefreshTokenValidityOk returns a tuple with the RefreshTokenValidity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ProxyProviderRequest) GetRefreshTokenValidityOk() (*string, bool) { + if o == nil || IsNil(o.RefreshTokenValidity) { + return nil, false + } + return o.RefreshTokenValidity, true +} + +// HasRefreshTokenValidity returns a boolean if a field has been set. +func (o *ProxyProviderRequest) HasRefreshTokenValidity() bool { + if o != nil && !IsNil(o.RefreshTokenValidity) { + return true + } + + return false +} + +// SetRefreshTokenValidity gets a reference to the given string and assigns it to the RefreshTokenValidity field. +func (o *ProxyProviderRequest) SetRefreshTokenValidity(v string) { + o.RefreshTokenValidity = &v +} + +func (o ProxyProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProxyProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.InternalHost) { + toSerialize["internal_host"] = o.InternalHost + } + toSerialize["external_host"] = o.ExternalHost + if !IsNil(o.InternalHostSslValidation) { + toSerialize["internal_host_ssl_validation"] = o.InternalHostSslValidation + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + if !IsNil(o.SkipPathRegex) { + toSerialize["skip_path_regex"] = o.SkipPathRegex + } + if !IsNil(o.BasicAuthEnabled) { + toSerialize["basic_auth_enabled"] = o.BasicAuthEnabled + } + if !IsNil(o.BasicAuthPasswordAttribute) { + toSerialize["basic_auth_password_attribute"] = o.BasicAuthPasswordAttribute + } + if !IsNil(o.BasicAuthUserAttribute) { + toSerialize["basic_auth_user_attribute"] = o.BasicAuthUserAttribute + } + if !IsNil(o.Mode) { + toSerialize["mode"] = o.Mode + } + if !IsNil(o.InterceptHeaderAuth) { + toSerialize["intercept_header_auth"] = o.InterceptHeaderAuth + } + if !IsNil(o.CookieDomain) { + toSerialize["cookie_domain"] = o.CookieDomain + } + if !IsNil(o.JwtFederationSources) { + toSerialize["jwt_federation_sources"] = o.JwtFederationSources + } + if !IsNil(o.JwtFederationProviders) { + toSerialize["jwt_federation_providers"] = o.JwtFederationProviders + } + if !IsNil(o.AccessTokenValidity) { + toSerialize["access_token_validity"] = o.AccessTokenValidity + } + if !IsNil(o.RefreshTokenValidity) { + toSerialize["refresh_token_validity"] = o.RefreshTokenValidity + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ProxyProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + "external_host", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProxyProviderRequest := _ProxyProviderRequest{} + + err = json.Unmarshal(data, &varProxyProviderRequest) + + if err != nil { + return err + } + + *o = ProxyProviderRequest(varProxyProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "internal_host") + delete(additionalProperties, "external_host") + delete(additionalProperties, "internal_host_ssl_validation") + delete(additionalProperties, "certificate") + delete(additionalProperties, "skip_path_regex") + delete(additionalProperties, "basic_auth_enabled") + delete(additionalProperties, "basic_auth_password_attribute") + delete(additionalProperties, "basic_auth_user_attribute") + delete(additionalProperties, "mode") + delete(additionalProperties, "intercept_header_auth") + delete(additionalProperties, "cookie_domain") + delete(additionalProperties, "jwt_federation_sources") + delete(additionalProperties, "jwt_federation_providers") + delete(additionalProperties, "access_token_validity") + delete(additionalProperties, "refresh_token_validity") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableProxyProviderRequest struct { + value *ProxyProviderRequest + isSet bool +} + +func (v NullableProxyProviderRequest) Get() *ProxyProviderRequest { + return v.value +} + +func (v *NullableProxyProviderRequest) Set(val *ProxyProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableProxyProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableProxyProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProxyProviderRequest(val *ProxyProviderRequest) *NullableProxyProviderRequest { + return &NullableProxyProviderRequest{value: val, isSet: true} +} + +func (v NullableProxyProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProxyProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_rac_property_mapping.go b/packages/client-go/model_rac_property_mapping.go new file mode 100644 index 0000000000..9a165ce3de --- /dev/null +++ b/packages/client-go/model_rac_property_mapping.go @@ -0,0 +1,431 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RACPropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RACPropertyMapping{} + +// RACPropertyMapping RACPropertyMapping Serializer +type RACPropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression *string `json:"expression,omitempty"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + StaticSettings map[string]interface{} `json:"static_settings"` + AdditionalProperties map[string]interface{} +} + +type _RACPropertyMapping RACPropertyMapping + +// NewRACPropertyMapping instantiates a new RACPropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRACPropertyMapping(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, staticSettings map[string]interface{}) *RACPropertyMapping { + this := RACPropertyMapping{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.StaticSettings = staticSettings + return &this +} + +// NewRACPropertyMappingWithDefaults instantiates a new RACPropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRACPropertyMappingWithDefaults() *RACPropertyMapping { + this := RACPropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *RACPropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RACPropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RACPropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACPropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *RACPropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *RACPropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *RACPropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *RACPropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *RACPropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RACPropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *RACPropertyMapping) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *RACPropertyMapping) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *RACPropertyMapping) SetExpression(v string) { + o.Expression = &v +} + +// GetComponent returns the Component field value +func (o *RACPropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *RACPropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *RACPropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *RACPropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *RACPropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *RACPropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *RACPropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *RACPropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetStaticSettings returns the StaticSettings field value +func (o *RACPropertyMapping) GetStaticSettings() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.StaticSettings +} + +// GetStaticSettingsOk returns a tuple with the StaticSettings field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMapping) GetStaticSettingsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.StaticSettings, true +} + +// SetStaticSettings sets field value +func (o *RACPropertyMapping) SetStaticSettings(v map[string]interface{}) { + o.StaticSettings = v +} + +func (o RACPropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RACPropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["static_settings"] = o.StaticSettings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RACPropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "static_settings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRACPropertyMapping := _RACPropertyMapping{} + + err = json.Unmarshal(data, &varRACPropertyMapping) + + if err != nil { + return err + } + + *o = RACPropertyMapping(varRACPropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "static_settings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRACPropertyMapping struct { + value *RACPropertyMapping + isSet bool +} + +func (v NullableRACPropertyMapping) Get() *RACPropertyMapping { + return v.value +} + +func (v *NullableRACPropertyMapping) Set(val *RACPropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableRACPropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableRACPropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRACPropertyMapping(val *RACPropertyMapping) *NullableRACPropertyMapping { + return &NullableRACPropertyMapping{value: val, isSet: true} +} + +func (v NullableRACPropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRACPropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_rac_property_mapping_request.go b/packages/client-go/model_rac_property_mapping_request.go new file mode 100644 index 0000000000..0fc2dadcc1 --- /dev/null +++ b/packages/client-go/model_rac_property_mapping_request.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RACPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RACPropertyMappingRequest{} + +// RACPropertyMappingRequest RACPropertyMapping Serializer +type RACPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression *string `json:"expression,omitempty"` + StaticSettings map[string]interface{} `json:"static_settings"` + AdditionalProperties map[string]interface{} +} + +type _RACPropertyMappingRequest RACPropertyMappingRequest + +// NewRACPropertyMappingRequest instantiates a new RACPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRACPropertyMappingRequest(name string, staticSettings map[string]interface{}) *RACPropertyMappingRequest { + this := RACPropertyMappingRequest{} + this.Name = name + this.StaticSettings = staticSettings + return &this +} + +// NewRACPropertyMappingRequestWithDefaults instantiates a new RACPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRACPropertyMappingRequestWithDefaults() *RACPropertyMappingRequest { + this := RACPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RACPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *RACPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *RACPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *RACPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *RACPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *RACPropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RACPropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value if set, zero value otherwise. +func (o *RACPropertyMappingRequest) GetExpression() string { + if o == nil || IsNil(o.Expression) { + var ret string + return ret + } + return *o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil || IsNil(o.Expression) { + return nil, false + } + return o.Expression, true +} + +// HasExpression returns a boolean if a field has been set. +func (o *RACPropertyMappingRequest) HasExpression() bool { + if o != nil && !IsNil(o.Expression) { + return true + } + + return false +} + +// SetExpression gets a reference to the given string and assigns it to the Expression field. +func (o *RACPropertyMappingRequest) SetExpression(v string) { + o.Expression = &v +} + +// GetStaticSettings returns the StaticSettings field value +func (o *RACPropertyMappingRequest) GetStaticSettings() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.StaticSettings +} + +// GetStaticSettingsOk returns a tuple with the StaticSettings field value +// and a boolean to check if the value has been set. +func (o *RACPropertyMappingRequest) GetStaticSettingsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.StaticSettings, true +} + +// SetStaticSettings sets field value +func (o *RACPropertyMappingRequest) SetStaticSettings(v map[string]interface{}) { + o.StaticSettings = v +} + +func (o RACPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RACPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + if !IsNil(o.Expression) { + toSerialize["expression"] = o.Expression + } + toSerialize["static_settings"] = o.StaticSettings + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RACPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "static_settings", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRACPropertyMappingRequest := _RACPropertyMappingRequest{} + + err = json.Unmarshal(data, &varRACPropertyMappingRequest) + + if err != nil { + return err + } + + *o = RACPropertyMappingRequest(varRACPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "static_settings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRACPropertyMappingRequest struct { + value *RACPropertyMappingRequest + isSet bool +} + +func (v NullableRACPropertyMappingRequest) Get() *RACPropertyMappingRequest { + return v.value +} + +func (v *NullableRACPropertyMappingRequest) Set(val *RACPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRACPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRACPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRACPropertyMappingRequest(val *RACPropertyMappingRequest) *NullableRACPropertyMappingRequest { + return &NullableRACPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableRACPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRACPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_rac_provider.go b/packages/client-go/model_rac_provider.go new file mode 100644 index 0000000000..6e5f2ff3a1 --- /dev/null +++ b/packages/client-go/model_rac_provider.go @@ -0,0 +1,702 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RACProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RACProvider{} + +// RACProvider RACProvider Serializer +type RACProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + Settings map[string]interface{} `json:"settings,omitempty"` + OutpostSet []string `json:"outpost_set"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + ConnectionExpiry *string `json:"connection_expiry,omitempty"` + // When set to true, connection tokens will be deleted upon disconnect. + DeleteTokenOnDisconnect *bool `json:"delete_token_on_disconnect,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RACProvider RACProvider + +// NewRACProvider instantiates a new RACProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRACProvider(pk int32, name string, authorizationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, outpostSet []string) *RACProvider { + this := RACProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.OutpostSet = outpostSet + return &this +} + +// NewRACProviderWithDefaults instantiates a new RACProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRACProviderWithDefaults() *RACProvider { + this := RACProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *RACProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RACProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *RACProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RACProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RACProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *RACProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *RACProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *RACProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *RACProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *RACProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *RACProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *RACProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *RACProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *RACProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *RACProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *RACProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RACProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *RACProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RACProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *RACProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RACProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *RACProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RACProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *RACProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *RACProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *RACProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *RACProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *RACProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *RACProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *RACProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *RACProvider) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProvider) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *RACProvider) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *RACProvider) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetOutpostSet returns the OutpostSet field value +func (o *RACProvider) GetOutpostSet() []string { + if o == nil { + var ret []string + return ret + } + + return o.OutpostSet +} + +// GetOutpostSetOk returns a tuple with the OutpostSet field value +// and a boolean to check if the value has been set. +func (o *RACProvider) GetOutpostSetOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.OutpostSet, true +} + +// SetOutpostSet sets field value +func (o *RACProvider) SetOutpostSet(v []string) { + o.OutpostSet = v +} + +// GetConnectionExpiry returns the ConnectionExpiry field value if set, zero value otherwise. +func (o *RACProvider) GetConnectionExpiry() string { + if o == nil || IsNil(o.ConnectionExpiry) { + var ret string + return ret + } + return *o.ConnectionExpiry +} + +// GetConnectionExpiryOk returns a tuple with the ConnectionExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProvider) GetConnectionExpiryOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionExpiry) { + return nil, false + } + return o.ConnectionExpiry, true +} + +// HasConnectionExpiry returns a boolean if a field has been set. +func (o *RACProvider) HasConnectionExpiry() bool { + if o != nil && !IsNil(o.ConnectionExpiry) { + return true + } + + return false +} + +// SetConnectionExpiry gets a reference to the given string and assigns it to the ConnectionExpiry field. +func (o *RACProvider) SetConnectionExpiry(v string) { + o.ConnectionExpiry = &v +} + +// GetDeleteTokenOnDisconnect returns the DeleteTokenOnDisconnect field value if set, zero value otherwise. +func (o *RACProvider) GetDeleteTokenOnDisconnect() bool { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + var ret bool + return ret + } + return *o.DeleteTokenOnDisconnect +} + +// GetDeleteTokenOnDisconnectOk returns a tuple with the DeleteTokenOnDisconnect field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProvider) GetDeleteTokenOnDisconnectOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + return nil, false + } + return o.DeleteTokenOnDisconnect, true +} + +// HasDeleteTokenOnDisconnect returns a boolean if a field has been set. +func (o *RACProvider) HasDeleteTokenOnDisconnect() bool { + if o != nil && !IsNil(o.DeleteTokenOnDisconnect) { + return true + } + + return false +} + +// SetDeleteTokenOnDisconnect gets a reference to the given bool and assigns it to the DeleteTokenOnDisconnect field. +func (o *RACProvider) SetDeleteTokenOnDisconnect(v bool) { + o.DeleteTokenOnDisconnect = &v +} + +func (o RACProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RACProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + toSerialize["outpost_set"] = o.OutpostSet + if !IsNil(o.ConnectionExpiry) { + toSerialize["connection_expiry"] = o.ConnectionExpiry + } + if !IsNil(o.DeleteTokenOnDisconnect) { + toSerialize["delete_token_on_disconnect"] = o.DeleteTokenOnDisconnect + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RACProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "outpost_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRACProvider := _RACProvider{} + + err = json.Unmarshal(data, &varRACProvider) + + if err != nil { + return err + } + + *o = RACProvider(varRACProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "settings") + delete(additionalProperties, "outpost_set") + delete(additionalProperties, "connection_expiry") + delete(additionalProperties, "delete_token_on_disconnect") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRACProvider struct { + value *RACProvider + isSet bool +} + +func (v NullableRACProvider) Get() *RACProvider { + return v.value +} + +func (v *NullableRACProvider) Set(val *RACProvider) { + v.value = val + v.isSet = true +} + +func (v NullableRACProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableRACProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRACProvider(val *RACProvider) *NullableRACProvider { + return &NullableRACProvider{value: val, isSet: true} +} + +func (v NullableRACProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRACProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_rac_provider_request.go b/packages/client-go/model_rac_provider_request.go new file mode 100644 index 0000000000..1afec53c39 --- /dev/null +++ b/packages/client-go/model_rac_provider_request.go @@ -0,0 +1,396 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RACProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RACProviderRequest{} + +// RACProviderRequest RACProvider Serializer +type RACProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + Settings map[string]interface{} `json:"settings,omitempty"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + ConnectionExpiry *string `json:"connection_expiry,omitempty"` + // When set to true, connection tokens will be deleted upon disconnect. + DeleteTokenOnDisconnect *bool `json:"delete_token_on_disconnect,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RACProviderRequest RACProviderRequest + +// NewRACProviderRequest instantiates a new RACProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRACProviderRequest(name string, authorizationFlow string) *RACProviderRequest { + this := RACProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + return &this +} + +// NewRACProviderRequestWithDefaults instantiates a new RACProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRACProviderRequestWithDefaults() *RACProviderRequest { + this := RACProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RACProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RACProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RACProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RACProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *RACProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *RACProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *RACProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *RACProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *RACProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *RACProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *RACProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *RACProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *RACProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetSettings returns the Settings field value if set, zero value otherwise. +func (o *RACProviderRequest) GetSettings() map[string]interface{} { + if o == nil || IsNil(o.Settings) { + var ret map[string]interface{} + return ret + } + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Settings) { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// HasSettings returns a boolean if a field has been set. +func (o *RACProviderRequest) HasSettings() bool { + if o != nil && !IsNil(o.Settings) { + return true + } + + return false +} + +// SetSettings gets a reference to the given map[string]interface{} and assigns it to the Settings field. +func (o *RACProviderRequest) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetConnectionExpiry returns the ConnectionExpiry field value if set, zero value otherwise. +func (o *RACProviderRequest) GetConnectionExpiry() string { + if o == nil || IsNil(o.ConnectionExpiry) { + var ret string + return ret + } + return *o.ConnectionExpiry +} + +// GetConnectionExpiryOk returns a tuple with the ConnectionExpiry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetConnectionExpiryOk() (*string, bool) { + if o == nil || IsNil(o.ConnectionExpiry) { + return nil, false + } + return o.ConnectionExpiry, true +} + +// HasConnectionExpiry returns a boolean if a field has been set. +func (o *RACProviderRequest) HasConnectionExpiry() bool { + if o != nil && !IsNil(o.ConnectionExpiry) { + return true + } + + return false +} + +// SetConnectionExpiry gets a reference to the given string and assigns it to the ConnectionExpiry field. +func (o *RACProviderRequest) SetConnectionExpiry(v string) { + o.ConnectionExpiry = &v +} + +// GetDeleteTokenOnDisconnect returns the DeleteTokenOnDisconnect field value if set, zero value otherwise. +func (o *RACProviderRequest) GetDeleteTokenOnDisconnect() bool { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + var ret bool + return ret + } + return *o.DeleteTokenOnDisconnect +} + +// GetDeleteTokenOnDisconnectOk returns a tuple with the DeleteTokenOnDisconnect field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RACProviderRequest) GetDeleteTokenOnDisconnectOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteTokenOnDisconnect) { + return nil, false + } + return o.DeleteTokenOnDisconnect, true +} + +// HasDeleteTokenOnDisconnect returns a boolean if a field has been set. +func (o *RACProviderRequest) HasDeleteTokenOnDisconnect() bool { + if o != nil && !IsNil(o.DeleteTokenOnDisconnect) { + return true + } + + return false +} + +// SetDeleteTokenOnDisconnect gets a reference to the given bool and assigns it to the DeleteTokenOnDisconnect field. +func (o *RACProviderRequest) SetDeleteTokenOnDisconnect(v bool) { + o.DeleteTokenOnDisconnect = &v +} + +func (o RACProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RACProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.Settings) { + toSerialize["settings"] = o.Settings + } + if !IsNil(o.ConnectionExpiry) { + toSerialize["connection_expiry"] = o.ConnectionExpiry + } + if !IsNil(o.DeleteTokenOnDisconnect) { + toSerialize["delete_token_on_disconnect"] = o.DeleteTokenOnDisconnect + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RACProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRACProviderRequest := _RACProviderRequest{} + + err = json.Unmarshal(data, &varRACProviderRequest) + + if err != nil { + return err + } + + *o = RACProviderRequest(varRACProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "settings") + delete(additionalProperties, "connection_expiry") + delete(additionalProperties, "delete_token_on_disconnect") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRACProviderRequest struct { + value *RACProviderRequest + isSet bool +} + +func (v NullableRACProviderRequest) Get() *RACProviderRequest { + return v.value +} + +func (v *NullableRACProviderRequest) Set(val *RACProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRACProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRACProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRACProviderRequest(val *RACProviderRequest) *NullableRACProviderRequest { + return &NullableRACProviderRequest{value: val, isSet: true} +} + +func (v NullableRACProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRACProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_check_access.go b/packages/client-go/model_radius_check_access.go new file mode 100644 index 0000000000..ecedadebd1 --- /dev/null +++ b/packages/client-go/model_radius_check_access.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusCheckAccess type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusCheckAccess{} + +// RadiusCheckAccess Base serializer class which doesn't implement create/update methods +type RadiusCheckAccess struct { + Attributes *string `json:"attributes,omitempty"` + Access PolicyTestResult `json:"access"` + AdditionalProperties map[string]interface{} +} + +type _RadiusCheckAccess RadiusCheckAccess + +// NewRadiusCheckAccess instantiates a new RadiusCheckAccess object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusCheckAccess(access PolicyTestResult) *RadiusCheckAccess { + this := RadiusCheckAccess{} + this.Access = access + return &this +} + +// NewRadiusCheckAccessWithDefaults instantiates a new RadiusCheckAccess object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusCheckAccessWithDefaults() *RadiusCheckAccess { + this := RadiusCheckAccess{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *RadiusCheckAccess) GetAttributes() string { + if o == nil || IsNil(o.Attributes) { + var ret string + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusCheckAccess) GetAttributesOk() (*string, bool) { + if o == nil || IsNil(o.Attributes) { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *RadiusCheckAccess) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given string and assigns it to the Attributes field. +func (o *RadiusCheckAccess) SetAttributes(v string) { + o.Attributes = &v +} + +// GetAccess returns the Access field value +func (o *RadiusCheckAccess) GetAccess() PolicyTestResult { + if o == nil { + var ret PolicyTestResult + return ret + } + + return o.Access +} + +// GetAccessOk returns a tuple with the Access field value +// and a boolean to check if the value has been set. +func (o *RadiusCheckAccess) GetAccessOk() (*PolicyTestResult, bool) { + if o == nil { + return nil, false + } + return &o.Access, true +} + +// SetAccess sets field value +func (o *RadiusCheckAccess) SetAccess(v PolicyTestResult) { + o.Access = v +} + +func (o RadiusCheckAccess) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusCheckAccess) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + toSerialize["access"] = o.Access + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusCheckAccess) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "access", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusCheckAccess := _RadiusCheckAccess{} + + err = json.Unmarshal(data, &varRadiusCheckAccess) + + if err != nil { + return err + } + + *o = RadiusCheckAccess(varRadiusCheckAccess) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "attributes") + delete(additionalProperties, "access") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusCheckAccess struct { + value *RadiusCheckAccess + isSet bool +} + +func (v NullableRadiusCheckAccess) Get() *RadiusCheckAccess { + return v.value +} + +func (v *NullableRadiusCheckAccess) Set(val *RadiusCheckAccess) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusCheckAccess) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusCheckAccess) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusCheckAccess(val *RadiusCheckAccess) *NullableRadiusCheckAccess { + return &NullableRadiusCheckAccess{value: val, isSet: true} +} + +func (v NullableRadiusCheckAccess) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusCheckAccess) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_outpost_config.go b/packages/client-go/model_radius_outpost_config.go new file mode 100644 index 0000000000..0c02552b72 --- /dev/null +++ b/packages/client-go/model_radius_outpost_config.go @@ -0,0 +1,416 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusOutpostConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusOutpostConfig{} + +// RadiusOutpostConfig RadiusProvider Serializer +type RadiusOutpostConfig struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + ApplicationSlug string `json:"application_slug"` + AuthFlowSlug string `json:"auth_flow_slug"` + // List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + ClientNetworks *string `json:"client_networks,omitempty"` + // Shared secret between clients and server to hash packets. + SharedSecret *string `json:"shared_secret,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RadiusOutpostConfig RadiusOutpostConfig + +// NewRadiusOutpostConfig instantiates a new RadiusOutpostConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusOutpostConfig(pk int32, name string, applicationSlug string, authFlowSlug string) *RadiusOutpostConfig { + this := RadiusOutpostConfig{} + this.Pk = pk + this.Name = name + this.ApplicationSlug = applicationSlug + this.AuthFlowSlug = authFlowSlug + return &this +} + +// NewRadiusOutpostConfigWithDefaults instantiates a new RadiusOutpostConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusOutpostConfigWithDefaults() *RadiusOutpostConfig { + this := RadiusOutpostConfig{} + return &this +} + +// GetPk returns the Pk field value +func (o *RadiusOutpostConfig) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RadiusOutpostConfig) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *RadiusOutpostConfig) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RadiusOutpostConfig) SetName(v string) { + o.Name = v +} + +// GetApplicationSlug returns the ApplicationSlug field value +func (o *RadiusOutpostConfig) GetApplicationSlug() string { + if o == nil { + var ret string + return ret + } + + return o.ApplicationSlug +} + +// GetApplicationSlugOk returns a tuple with the ApplicationSlug field value +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ApplicationSlug, true +} + +// SetApplicationSlug sets field value +func (o *RadiusOutpostConfig) SetApplicationSlug(v string) { + o.ApplicationSlug = v +} + +// GetAuthFlowSlug returns the AuthFlowSlug field value +func (o *RadiusOutpostConfig) GetAuthFlowSlug() string { + if o == nil { + var ret string + return ret + } + + return o.AuthFlowSlug +} + +// GetAuthFlowSlugOk returns a tuple with the AuthFlowSlug field value +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetAuthFlowSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthFlowSlug, true +} + +// SetAuthFlowSlug sets field value +func (o *RadiusOutpostConfig) SetAuthFlowSlug(v string) { + o.AuthFlowSlug = v +} + +// GetClientNetworks returns the ClientNetworks field value if set, zero value otherwise. +func (o *RadiusOutpostConfig) GetClientNetworks() string { + if o == nil || IsNil(o.ClientNetworks) { + var ret string + return ret + } + return *o.ClientNetworks +} + +// GetClientNetworksOk returns a tuple with the ClientNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetClientNetworksOk() (*string, bool) { + if o == nil || IsNil(o.ClientNetworks) { + return nil, false + } + return o.ClientNetworks, true +} + +// HasClientNetworks returns a boolean if a field has been set. +func (o *RadiusOutpostConfig) HasClientNetworks() bool { + if o != nil && !IsNil(o.ClientNetworks) { + return true + } + + return false +} + +// SetClientNetworks gets a reference to the given string and assigns it to the ClientNetworks field. +func (o *RadiusOutpostConfig) SetClientNetworks(v string) { + o.ClientNetworks = &v +} + +// GetSharedSecret returns the SharedSecret field value if set, zero value otherwise. +func (o *RadiusOutpostConfig) GetSharedSecret() string { + if o == nil || IsNil(o.SharedSecret) { + var ret string + return ret + } + return *o.SharedSecret +} + +// GetSharedSecretOk returns a tuple with the SharedSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetSharedSecretOk() (*string, bool) { + if o == nil || IsNil(o.SharedSecret) { + return nil, false + } + return o.SharedSecret, true +} + +// HasSharedSecret returns a boolean if a field has been set. +func (o *RadiusOutpostConfig) HasSharedSecret() bool { + if o != nil && !IsNil(o.SharedSecret) { + return true + } + + return false +} + +// SetSharedSecret gets a reference to the given string and assigns it to the SharedSecret field. +func (o *RadiusOutpostConfig) SetSharedSecret(v string) { + o.SharedSecret = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *RadiusOutpostConfig) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusOutpostConfig) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *RadiusOutpostConfig) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *RadiusOutpostConfig) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusOutpostConfig) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusOutpostConfig) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *RadiusOutpostConfig) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *RadiusOutpostConfig) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *RadiusOutpostConfig) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *RadiusOutpostConfig) UnsetCertificate() { + o.Certificate.Unset() +} + +func (o RadiusOutpostConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusOutpostConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["application_slug"] = o.ApplicationSlug + toSerialize["auth_flow_slug"] = o.AuthFlowSlug + if !IsNil(o.ClientNetworks) { + toSerialize["client_networks"] = o.ClientNetworks + } + if !IsNil(o.SharedSecret) { + toSerialize["shared_secret"] = o.SharedSecret + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusOutpostConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "application_slug", + "auth_flow_slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusOutpostConfig := _RadiusOutpostConfig{} + + err = json.Unmarshal(data, &varRadiusOutpostConfig) + + if err != nil { + return err + } + + *o = RadiusOutpostConfig(varRadiusOutpostConfig) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "application_slug") + delete(additionalProperties, "auth_flow_slug") + delete(additionalProperties, "client_networks") + delete(additionalProperties, "shared_secret") + delete(additionalProperties, "mfa_support") + delete(additionalProperties, "certificate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusOutpostConfig struct { + value *RadiusOutpostConfig + isSet bool +} + +func (v NullableRadiusOutpostConfig) Get() *RadiusOutpostConfig { + return v.value +} + +func (v *NullableRadiusOutpostConfig) Set(val *RadiusOutpostConfig) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusOutpostConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusOutpostConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusOutpostConfig(val *RadiusOutpostConfig) *NullableRadiusOutpostConfig { + return &NullableRadiusOutpostConfig{value: val, isSet: true} +} + +func (v NullableRadiusOutpostConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusOutpostConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_provider.go b/packages/client-go/model_radius_provider.go new file mode 100644 index 0000000000..82adc80e62 --- /dev/null +++ b/packages/client-go/model_radius_provider.go @@ -0,0 +1,781 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusProvider{} + +// RadiusProvider RadiusProvider Serializer +type RadiusProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + ClientNetworks *string `json:"client_networks,omitempty"` + // Shared secret between clients and server to hash packets. + SharedSecret *string `json:"shared_secret,omitempty"` + OutpostSet []string `json:"outpost_set"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RadiusProvider RadiusProvider + +// NewRadiusProvider instantiates a new RadiusProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, outpostSet []string) *RadiusProvider { + this := RadiusProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.OutpostSet = outpostSet + return &this +} + +// NewRadiusProviderWithDefaults instantiates a new RadiusProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusProviderWithDefaults() *RadiusProvider { + this := RadiusProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *RadiusProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RadiusProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *RadiusProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RadiusProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *RadiusProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *RadiusProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *RadiusProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *RadiusProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *RadiusProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *RadiusProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *RadiusProvider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *RadiusProvider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *RadiusProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *RadiusProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *RadiusProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *RadiusProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *RadiusProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RadiusProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *RadiusProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RadiusProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *RadiusProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RadiusProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *RadiusProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *RadiusProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *RadiusProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *RadiusProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *RadiusProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *RadiusProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *RadiusProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *RadiusProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *RadiusProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetClientNetworks returns the ClientNetworks field value if set, zero value otherwise. +func (o *RadiusProvider) GetClientNetworks() string { + if o == nil || IsNil(o.ClientNetworks) { + var ret string + return ret + } + return *o.ClientNetworks +} + +// GetClientNetworksOk returns a tuple with the ClientNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetClientNetworksOk() (*string, bool) { + if o == nil || IsNil(o.ClientNetworks) { + return nil, false + } + return o.ClientNetworks, true +} + +// HasClientNetworks returns a boolean if a field has been set. +func (o *RadiusProvider) HasClientNetworks() bool { + if o != nil && !IsNil(o.ClientNetworks) { + return true + } + + return false +} + +// SetClientNetworks gets a reference to the given string and assigns it to the ClientNetworks field. +func (o *RadiusProvider) SetClientNetworks(v string) { + o.ClientNetworks = &v +} + +// GetSharedSecret returns the SharedSecret field value if set, zero value otherwise. +func (o *RadiusProvider) GetSharedSecret() string { + if o == nil || IsNil(o.SharedSecret) { + var ret string + return ret + } + return *o.SharedSecret +} + +// GetSharedSecretOk returns a tuple with the SharedSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetSharedSecretOk() (*string, bool) { + if o == nil || IsNil(o.SharedSecret) { + return nil, false + } + return o.SharedSecret, true +} + +// HasSharedSecret returns a boolean if a field has been set. +func (o *RadiusProvider) HasSharedSecret() bool { + if o != nil && !IsNil(o.SharedSecret) { + return true + } + + return false +} + +// SetSharedSecret gets a reference to the given string and assigns it to the SharedSecret field. +func (o *RadiusProvider) SetSharedSecret(v string) { + o.SharedSecret = &v +} + +// GetOutpostSet returns the OutpostSet field value +func (o *RadiusProvider) GetOutpostSet() []string { + if o == nil { + var ret []string + return ret + } + + return o.OutpostSet +} + +// GetOutpostSetOk returns a tuple with the OutpostSet field value +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetOutpostSetOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.OutpostSet, true +} + +// SetOutpostSet sets field value +func (o *RadiusProvider) SetOutpostSet(v []string) { + o.OutpostSet = v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *RadiusProvider) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProvider) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *RadiusProvider) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *RadiusProvider) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProvider) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProvider) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *RadiusProvider) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *RadiusProvider) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *RadiusProvider) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *RadiusProvider) UnsetCertificate() { + o.Certificate.Unset() +} + +func (o RadiusProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.ClientNetworks) { + toSerialize["client_networks"] = o.ClientNetworks + } + if !IsNil(o.SharedSecret) { + toSerialize["shared_secret"] = o.SharedSecret + } + toSerialize["outpost_set"] = o.OutpostSet + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "outpost_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusProvider := _RadiusProvider{} + + err = json.Unmarshal(data, &varRadiusProvider) + + if err != nil { + return err + } + + *o = RadiusProvider(varRadiusProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "client_networks") + delete(additionalProperties, "shared_secret") + delete(additionalProperties, "outpost_set") + delete(additionalProperties, "mfa_support") + delete(additionalProperties, "certificate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusProvider struct { + value *RadiusProvider + isSet bool +} + +func (v NullableRadiusProvider) Get() *RadiusProvider { + return v.value +} + +func (v *NullableRadiusProvider) Set(val *RadiusProvider) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusProvider(val *RadiusProvider) *NullableRadiusProvider { + return &NullableRadiusProvider{value: val, isSet: true} +} + +func (v NullableRadiusProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_provider_property_mapping.go b/packages/client-go/model_radius_provider_property_mapping.go new file mode 100644 index 0000000000..29e18882cf --- /dev/null +++ b/packages/client-go/model_radius_provider_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusProviderPropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusProviderPropertyMapping{} + +// RadiusProviderPropertyMapping RadiusProviderPropertyMapping Serializer +type RadiusProviderPropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _RadiusProviderPropertyMapping RadiusProviderPropertyMapping + +// NewRadiusProviderPropertyMapping instantiates a new RadiusProviderPropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusProviderPropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *RadiusProviderPropertyMapping { + this := RadiusProviderPropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewRadiusProviderPropertyMappingWithDefaults instantiates a new RadiusProviderPropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusProviderPropertyMappingWithDefaults() *RadiusProviderPropertyMapping { + this := RadiusProviderPropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *RadiusProviderPropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RadiusProviderPropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProviderPropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProviderPropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *RadiusProviderPropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *RadiusProviderPropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *RadiusProviderPropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *RadiusProviderPropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *RadiusProviderPropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RadiusProviderPropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *RadiusProviderPropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *RadiusProviderPropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *RadiusProviderPropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *RadiusProviderPropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *RadiusProviderPropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *RadiusProviderPropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *RadiusProviderPropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *RadiusProviderPropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *RadiusProviderPropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *RadiusProviderPropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o RadiusProviderPropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusProviderPropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusProviderPropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusProviderPropertyMapping := _RadiusProviderPropertyMapping{} + + err = json.Unmarshal(data, &varRadiusProviderPropertyMapping) + + if err != nil { + return err + } + + *o = RadiusProviderPropertyMapping(varRadiusProviderPropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusProviderPropertyMapping struct { + value *RadiusProviderPropertyMapping + isSet bool +} + +func (v NullableRadiusProviderPropertyMapping) Get() *RadiusProviderPropertyMapping { + return v.value +} + +func (v *NullableRadiusProviderPropertyMapping) Set(val *RadiusProviderPropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusProviderPropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusProviderPropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusProviderPropertyMapping(val *RadiusProviderPropertyMapping) *NullableRadiusProviderPropertyMapping { + return &NullableRadiusProviderPropertyMapping{value: val, isSet: true} +} + +func (v NullableRadiusProviderPropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusProviderPropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_provider_property_mapping_request.go b/packages/client-go/model_radius_provider_property_mapping_request.go new file mode 100644 index 0000000000..e2e127efb8 --- /dev/null +++ b/packages/client-go/model_radius_provider_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusProviderPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusProviderPropertyMappingRequest{} + +// RadiusProviderPropertyMappingRequest RadiusProviderPropertyMapping Serializer +type RadiusProviderPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _RadiusProviderPropertyMappingRequest RadiusProviderPropertyMappingRequest + +// NewRadiusProviderPropertyMappingRequest instantiates a new RadiusProviderPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusProviderPropertyMappingRequest(name string, expression string) *RadiusProviderPropertyMappingRequest { + this := RadiusProviderPropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewRadiusProviderPropertyMappingRequestWithDefaults instantiates a new RadiusProviderPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusProviderPropertyMappingRequestWithDefaults() *RadiusProviderPropertyMappingRequest { + this := RadiusProviderPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProviderPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProviderPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *RadiusProviderPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *RadiusProviderPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *RadiusProviderPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *RadiusProviderPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *RadiusProviderPropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RadiusProviderPropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *RadiusProviderPropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *RadiusProviderPropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o RadiusProviderPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusProviderPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusProviderPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusProviderPropertyMappingRequest := _RadiusProviderPropertyMappingRequest{} + + err = json.Unmarshal(data, &varRadiusProviderPropertyMappingRequest) + + if err != nil { + return err + } + + *o = RadiusProviderPropertyMappingRequest(varRadiusProviderPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusProviderPropertyMappingRequest struct { + value *RadiusProviderPropertyMappingRequest + isSet bool +} + +func (v NullableRadiusProviderPropertyMappingRequest) Get() *RadiusProviderPropertyMappingRequest { + return v.value +} + +func (v *NullableRadiusProviderPropertyMappingRequest) Set(val *RadiusProviderPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusProviderPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusProviderPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusProviderPropertyMappingRequest(val *RadiusProviderPropertyMappingRequest) *NullableRadiusProviderPropertyMappingRequest { + return &NullableRadiusProviderPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableRadiusProviderPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusProviderPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_radius_provider_request.go b/packages/client-go/model_radius_provider_request.go new file mode 100644 index 0000000000..be2710af3b --- /dev/null +++ b/packages/client-go/model_radius_provider_request.go @@ -0,0 +1,475 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RadiusProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RadiusProviderRequest{} + +// RadiusProviderRequest RadiusProvider Serializer +type RadiusProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // List of CIDRs (comma-separated) that clients can connect from. A more specific CIDR will match before a looser one. Clients connecting from a non-specified CIDR will be dropped. + ClientNetworks *string `json:"client_networks,omitempty"` + // Shared secret between clients and server to hash packets. + SharedSecret *string `json:"shared_secret,omitempty"` + // When enabled, code-based multi-factor authentication can be used by appending a semicolon and the TOTP code to the password. This should only be enabled if all users that will bind to this provider have a TOTP device configured, as otherwise a password may incorrectly be rejected if it contains a semicolon. + MfaSupport *bool `json:"mfa_support,omitempty"` + Certificate NullableString `json:"certificate,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RadiusProviderRequest RadiusProviderRequest + +// NewRadiusProviderRequest instantiates a new RadiusProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRadiusProviderRequest(name string, authorizationFlow string, invalidationFlow string) *RadiusProviderRequest { + this := RadiusProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + return &this +} + +// NewRadiusProviderRequestWithDefaults instantiates a new RadiusProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRadiusProviderRequestWithDefaults() *RadiusProviderRequest { + this := RadiusProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RadiusProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RadiusProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *RadiusProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *RadiusProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *RadiusProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *RadiusProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *RadiusProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *RadiusProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *RadiusProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *RadiusProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *RadiusProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetClientNetworks returns the ClientNetworks field value if set, zero value otherwise. +func (o *RadiusProviderRequest) GetClientNetworks() string { + if o == nil || IsNil(o.ClientNetworks) { + var ret string + return ret + } + return *o.ClientNetworks +} + +// GetClientNetworksOk returns a tuple with the ClientNetworks field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetClientNetworksOk() (*string, bool) { + if o == nil || IsNil(o.ClientNetworks) { + return nil, false + } + return o.ClientNetworks, true +} + +// HasClientNetworks returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasClientNetworks() bool { + if o != nil && !IsNil(o.ClientNetworks) { + return true + } + + return false +} + +// SetClientNetworks gets a reference to the given string and assigns it to the ClientNetworks field. +func (o *RadiusProviderRequest) SetClientNetworks(v string) { + o.ClientNetworks = &v +} + +// GetSharedSecret returns the SharedSecret field value if set, zero value otherwise. +func (o *RadiusProviderRequest) GetSharedSecret() string { + if o == nil || IsNil(o.SharedSecret) { + var ret string + return ret + } + return *o.SharedSecret +} + +// GetSharedSecretOk returns a tuple with the SharedSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetSharedSecretOk() (*string, bool) { + if o == nil || IsNil(o.SharedSecret) { + return nil, false + } + return o.SharedSecret, true +} + +// HasSharedSecret returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasSharedSecret() bool { + if o != nil && !IsNil(o.SharedSecret) { + return true + } + + return false +} + +// SetSharedSecret gets a reference to the given string and assigns it to the SharedSecret field. +func (o *RadiusProviderRequest) SetSharedSecret(v string) { + o.SharedSecret = &v +} + +// GetMfaSupport returns the MfaSupport field value if set, zero value otherwise. +func (o *RadiusProviderRequest) GetMfaSupport() bool { + if o == nil || IsNil(o.MfaSupport) { + var ret bool + return ret + } + return *o.MfaSupport +} + +// GetMfaSupportOk returns a tuple with the MfaSupport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RadiusProviderRequest) GetMfaSupportOk() (*bool, bool) { + if o == nil || IsNil(o.MfaSupport) { + return nil, false + } + return o.MfaSupport, true +} + +// HasMfaSupport returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasMfaSupport() bool { + if o != nil && !IsNil(o.MfaSupport) { + return true + } + + return false +} + +// SetMfaSupport gets a reference to the given bool and assigns it to the MfaSupport field. +func (o *RadiusProviderRequest) SetMfaSupport(v bool) { + o.MfaSupport = &v +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RadiusProviderRequest) GetCertificate() string { + if o == nil || IsNil(o.Certificate.Get()) { + var ret string + return ret + } + return *o.Certificate.Get() +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RadiusProviderRequest) GetCertificateOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Certificate.Get(), o.Certificate.IsSet() +} + +// HasCertificate returns a boolean if a field has been set. +func (o *RadiusProviderRequest) HasCertificate() bool { + if o != nil && o.Certificate.IsSet() { + return true + } + + return false +} + +// SetCertificate gets a reference to the given NullableString and assigns it to the Certificate field. +func (o *RadiusProviderRequest) SetCertificate(v string) { + o.Certificate.Set(&v) +} + +// SetCertificateNil sets the value for Certificate to be an explicit nil +func (o *RadiusProviderRequest) SetCertificateNil() { + o.Certificate.Set(nil) +} + +// UnsetCertificate ensures that no value is present for Certificate, not even an explicit nil +func (o *RadiusProviderRequest) UnsetCertificate() { + o.Certificate.Unset() +} + +func (o RadiusProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RadiusProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.ClientNetworks) { + toSerialize["client_networks"] = o.ClientNetworks + } + if !IsNil(o.SharedSecret) { + toSerialize["shared_secret"] = o.SharedSecret + } + if !IsNil(o.MfaSupport) { + toSerialize["mfa_support"] = o.MfaSupport + } + if o.Certificate.IsSet() { + toSerialize["certificate"] = o.Certificate.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RadiusProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRadiusProviderRequest := _RadiusProviderRequest{} + + err = json.Unmarshal(data, &varRadiusProviderRequest) + + if err != nil { + return err + } + + *o = RadiusProviderRequest(varRadiusProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "client_networks") + delete(additionalProperties, "shared_secret") + delete(additionalProperties, "mfa_support") + delete(additionalProperties, "certificate") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRadiusProviderRequest struct { + value *RadiusProviderRequest + isSet bool +} + +func (v NullableRadiusProviderRequest) Get() *RadiusProviderRequest { + return v.value +} + +func (v *NullableRadiusProviderRequest) Set(val *RadiusProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRadiusProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRadiusProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRadiusProviderRequest(val *RadiusProviderRequest) *NullableRadiusProviderRequest { + return &NullableRadiusProviderRequest{value: val, isSet: true} +} + +func (v NullableRadiusProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRadiusProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_challenge.go b/packages/client-go/model_redirect_challenge.go new file mode 100644 index 0000000000..fcf47d769f --- /dev/null +++ b/packages/client-go/model_redirect_challenge.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectChallenge{} + +// RedirectChallenge Challenge type to redirect the client +type RedirectChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _RedirectChallenge RedirectChallenge + +// NewRedirectChallenge instantiates a new RedirectChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectChallenge(to string) *RedirectChallenge { + this := RedirectChallenge{} + var component string = "xak-flow-redirect" + this.Component = &component + this.To = to + return &this +} + +// NewRedirectChallengeWithDefaults instantiates a new RedirectChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectChallengeWithDefaults() *RedirectChallenge { + this := RedirectChallenge{} + var component string = "xak-flow-redirect" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *RedirectChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *RedirectChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *RedirectChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *RedirectChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *RedirectChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *RedirectChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *RedirectChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *RedirectChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *RedirectChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetTo returns the To field value +func (o *RedirectChallenge) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *RedirectChallenge) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *RedirectChallenge) SetTo(v string) { + o.To = v +} + +func (o RedirectChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectChallenge := _RedirectChallenge{} + + err = json.Unmarshal(data, &varRedirectChallenge) + + if err != nil { + return err + } + + *o = RedirectChallenge(varRedirectChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectChallenge struct { + value *RedirectChallenge + isSet bool +} + +func (v NullableRedirectChallenge) Get() *RedirectChallenge { + return v.value +} + +func (v *NullableRedirectChallenge) Set(val *RedirectChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectChallenge(val *RedirectChallenge) *NullableRedirectChallenge { + return &NullableRedirectChallenge{value: val, isSet: true} +} + +func (v NullableRedirectChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_challenge_response_request.go b/packages/client-go/model_redirect_challenge_response_request.go new file mode 100644 index 0000000000..06346ab76a --- /dev/null +++ b/packages/client-go/model_redirect_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectChallengeResponseRequest{} + +// RedirectChallengeResponseRequest Redirect challenge response +type RedirectChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + To string `json:"to"` + AdditionalProperties map[string]interface{} +} + +type _RedirectChallengeResponseRequest RedirectChallengeResponseRequest + +// NewRedirectChallengeResponseRequest instantiates a new RedirectChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectChallengeResponseRequest(to string) *RedirectChallengeResponseRequest { + this := RedirectChallengeResponseRequest{} + var component string = "xak-flow-redirect" + this.Component = &component + this.To = to + return &this +} + +// NewRedirectChallengeResponseRequestWithDefaults instantiates a new RedirectChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectChallengeResponseRequestWithDefaults() *RedirectChallengeResponseRequest { + this := RedirectChallengeResponseRequest{} + var component string = "xak-flow-redirect" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *RedirectChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *RedirectChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *RedirectChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetTo returns the To field value +func (o *RedirectChallengeResponseRequest) GetTo() string { + if o == nil { + var ret string + return ret + } + + return o.To +} + +// GetToOk returns a tuple with the To field value +// and a boolean to check if the value has been set. +func (o *RedirectChallengeResponseRequest) GetToOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.To, true +} + +// SetTo sets field value +func (o *RedirectChallengeResponseRequest) SetTo(v string) { + o.To = v +} + +func (o RedirectChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["to"] = o.To + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectChallengeResponseRequest := _RedirectChallengeResponseRequest{} + + err = json.Unmarshal(data, &varRedirectChallengeResponseRequest) + + if err != nil { + return err + } + + *o = RedirectChallengeResponseRequest(varRedirectChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "to") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectChallengeResponseRequest struct { + value *RedirectChallengeResponseRequest + isSet bool +} + +func (v NullableRedirectChallengeResponseRequest) Get() *RedirectChallengeResponseRequest { + return v.value +} + +func (v *NullableRedirectChallengeResponseRequest) Set(val *RedirectChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectChallengeResponseRequest(val *RedirectChallengeResponseRequest) *NullableRedirectChallengeResponseRequest { + return &NullableRedirectChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableRedirectChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_stage.go b/packages/client-go/model_redirect_stage.go new file mode 100644 index 0000000000..077ca1db60 --- /dev/null +++ b/packages/client-go/model_redirect_stage.go @@ -0,0 +1,496 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectStage{} + +// RedirectStage RedirectStage Serializer +type RedirectStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + KeepContext *bool `json:"keep_context,omitempty"` + Mode RedirectStageModeEnum `json:"mode"` + TargetStatic *string `json:"target_static,omitempty"` + TargetFlow NullableString `json:"target_flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RedirectStage RedirectStage + +// NewRedirectStage instantiates a new RedirectStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, mode RedirectStageModeEnum) *RedirectStage { + this := RedirectStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Mode = mode + return &this +} + +// NewRedirectStageWithDefaults instantiates a new RedirectStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectStageWithDefaults() *RedirectStage { + this := RedirectStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *RedirectStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RedirectStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *RedirectStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RedirectStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *RedirectStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *RedirectStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *RedirectStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *RedirectStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *RedirectStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *RedirectStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *RedirectStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *RedirectStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *RedirectStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *RedirectStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetKeepContext returns the KeepContext field value if set, zero value otherwise. +func (o *RedirectStage) GetKeepContext() bool { + if o == nil || IsNil(o.KeepContext) { + var ret bool + return ret + } + return *o.KeepContext +} + +// GetKeepContextOk returns a tuple with the KeepContext field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetKeepContextOk() (*bool, bool) { + if o == nil || IsNil(o.KeepContext) { + return nil, false + } + return o.KeepContext, true +} + +// HasKeepContext returns a boolean if a field has been set. +func (o *RedirectStage) HasKeepContext() bool { + if o != nil && !IsNil(o.KeepContext) { + return true + } + + return false +} + +// SetKeepContext gets a reference to the given bool and assigns it to the KeepContext field. +func (o *RedirectStage) SetKeepContext(v bool) { + o.KeepContext = &v +} + +// GetMode returns the Mode field value +func (o *RedirectStage) GetMode() RedirectStageModeEnum { + if o == nil { + var ret RedirectStageModeEnum + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetModeOk() (*RedirectStageModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *RedirectStage) SetMode(v RedirectStageModeEnum) { + o.Mode = v +} + +// GetTargetStatic returns the TargetStatic field value if set, zero value otherwise. +func (o *RedirectStage) GetTargetStatic() string { + if o == nil || IsNil(o.TargetStatic) { + var ret string + return ret + } + return *o.TargetStatic +} + +// GetTargetStaticOk returns a tuple with the TargetStatic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectStage) GetTargetStaticOk() (*string, bool) { + if o == nil || IsNil(o.TargetStatic) { + return nil, false + } + return o.TargetStatic, true +} + +// HasTargetStatic returns a boolean if a field has been set. +func (o *RedirectStage) HasTargetStatic() bool { + if o != nil && !IsNil(o.TargetStatic) { + return true + } + + return false +} + +// SetTargetStatic gets a reference to the given string and assigns it to the TargetStatic field. +func (o *RedirectStage) SetTargetStatic(v string) { + o.TargetStatic = &v +} + +// GetTargetFlow returns the TargetFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RedirectStage) GetTargetFlow() string { + if o == nil || IsNil(o.TargetFlow.Get()) { + var ret string + return ret + } + return *o.TargetFlow.Get() +} + +// GetTargetFlowOk returns a tuple with the TargetFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RedirectStage) GetTargetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TargetFlow.Get(), o.TargetFlow.IsSet() +} + +// HasTargetFlow returns a boolean if a field has been set. +func (o *RedirectStage) HasTargetFlow() bool { + if o != nil && o.TargetFlow.IsSet() { + return true + } + + return false +} + +// SetTargetFlow gets a reference to the given NullableString and assigns it to the TargetFlow field. +func (o *RedirectStage) SetTargetFlow(v string) { + o.TargetFlow.Set(&v) +} + +// SetTargetFlowNil sets the value for TargetFlow to be an explicit nil +func (o *RedirectStage) SetTargetFlowNil() { + o.TargetFlow.Set(nil) +} + +// UnsetTargetFlow ensures that no value is present for TargetFlow, not even an explicit nil +func (o *RedirectStage) UnsetTargetFlow() { + o.TargetFlow.Unset() +} + +func (o RedirectStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.KeepContext) { + toSerialize["keep_context"] = o.KeepContext + } + toSerialize["mode"] = o.Mode + if !IsNil(o.TargetStatic) { + toSerialize["target_static"] = o.TargetStatic + } + if o.TargetFlow.IsSet() { + toSerialize["target_flow"] = o.TargetFlow.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "mode", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectStage := _RedirectStage{} + + err = json.Unmarshal(data, &varRedirectStage) + + if err != nil { + return err + } + + *o = RedirectStage(varRedirectStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "keep_context") + delete(additionalProperties, "mode") + delete(additionalProperties, "target_static") + delete(additionalProperties, "target_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectStage struct { + value *RedirectStage + isSet bool +} + +func (v NullableRedirectStage) Get() *RedirectStage { + return v.value +} + +func (v *NullableRedirectStage) Set(val *RedirectStage) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectStage) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectStage(val *RedirectStage) *NullableRedirectStage { + return &NullableRedirectStage{value: val, isSet: true} +} + +func (v NullableRedirectStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_stage_mode_enum.go b/packages/client-go/model_redirect_stage_mode_enum.go new file mode 100644 index 0000000000..25e631a1df --- /dev/null +++ b/packages/client-go/model_redirect_stage_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// RedirectStageModeEnum the model 'RedirectStageModeEnum' +type RedirectStageModeEnum string + +// List of RedirectStageModeEnum +const ( + REDIRECTSTAGEMODEENUM_STATIC RedirectStageModeEnum = "static" + REDIRECTSTAGEMODEENUM_FLOW RedirectStageModeEnum = "flow" +) + +// All allowed values of RedirectStageModeEnum enum +var AllowedRedirectStageModeEnumEnumValues = []RedirectStageModeEnum{ + "static", + "flow", +} + +func (v *RedirectStageModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := RedirectStageModeEnum(value) + for _, existing := range AllowedRedirectStageModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid RedirectStageModeEnum", value) +} + +// NewRedirectStageModeEnumFromValue returns a pointer to a valid RedirectStageModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewRedirectStageModeEnumFromValue(v string) (*RedirectStageModeEnum, error) { + ev := RedirectStageModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for RedirectStageModeEnum: valid values are %v", v, AllowedRedirectStageModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v RedirectStageModeEnum) IsValid() bool { + for _, existing := range AllowedRedirectStageModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RedirectStageModeEnum value +func (v RedirectStageModeEnum) Ptr() *RedirectStageModeEnum { + return &v +} + +type NullableRedirectStageModeEnum struct { + value *RedirectStageModeEnum + isSet bool +} + +func (v NullableRedirectStageModeEnum) Get() *RedirectStageModeEnum { + return v.value +} + +func (v *NullableRedirectStageModeEnum) Set(val *RedirectStageModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectStageModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectStageModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectStageModeEnum(val *RedirectStageModeEnum) *NullableRedirectStageModeEnum { + return &NullableRedirectStageModeEnum{value: val, isSet: true} +} + +func (v NullableRedirectStageModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectStageModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_stage_request.go b/packages/client-go/model_redirect_stage_request.go new file mode 100644 index 0000000000..b65a2018b5 --- /dev/null +++ b/packages/client-go/model_redirect_stage_request.go @@ -0,0 +1,318 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectStageRequest{} + +// RedirectStageRequest RedirectStage Serializer +type RedirectStageRequest struct { + Name string `json:"name"` + KeepContext *bool `json:"keep_context,omitempty"` + Mode RedirectStageModeEnum `json:"mode"` + TargetStatic *string `json:"target_static,omitempty"` + TargetFlow NullableString `json:"target_flow,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _RedirectStageRequest RedirectStageRequest + +// NewRedirectStageRequest instantiates a new RedirectStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectStageRequest(name string, mode RedirectStageModeEnum) *RedirectStageRequest { + this := RedirectStageRequest{} + this.Name = name + this.Mode = mode + return &this +} + +// NewRedirectStageRequestWithDefaults instantiates a new RedirectStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectStageRequestWithDefaults() *RedirectStageRequest { + this := RedirectStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RedirectStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RedirectStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RedirectStageRequest) SetName(v string) { + o.Name = v +} + +// GetKeepContext returns the KeepContext field value if set, zero value otherwise. +func (o *RedirectStageRequest) GetKeepContext() bool { + if o == nil || IsNil(o.KeepContext) { + var ret bool + return ret + } + return *o.KeepContext +} + +// GetKeepContextOk returns a tuple with the KeepContext field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectStageRequest) GetKeepContextOk() (*bool, bool) { + if o == nil || IsNil(o.KeepContext) { + return nil, false + } + return o.KeepContext, true +} + +// HasKeepContext returns a boolean if a field has been set. +func (o *RedirectStageRequest) HasKeepContext() bool { + if o != nil && !IsNil(o.KeepContext) { + return true + } + + return false +} + +// SetKeepContext gets a reference to the given bool and assigns it to the KeepContext field. +func (o *RedirectStageRequest) SetKeepContext(v bool) { + o.KeepContext = &v +} + +// GetMode returns the Mode field value +func (o *RedirectStageRequest) GetMode() RedirectStageModeEnum { + if o == nil { + var ret RedirectStageModeEnum + return ret + } + + return o.Mode +} + +// GetModeOk returns a tuple with the Mode field value +// and a boolean to check if the value has been set. +func (o *RedirectStageRequest) GetModeOk() (*RedirectStageModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Mode, true +} + +// SetMode sets field value +func (o *RedirectStageRequest) SetMode(v RedirectStageModeEnum) { + o.Mode = v +} + +// GetTargetStatic returns the TargetStatic field value if set, zero value otherwise. +func (o *RedirectStageRequest) GetTargetStatic() string { + if o == nil || IsNil(o.TargetStatic) { + var ret string + return ret + } + return *o.TargetStatic +} + +// GetTargetStaticOk returns a tuple with the TargetStatic field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RedirectStageRequest) GetTargetStaticOk() (*string, bool) { + if o == nil || IsNil(o.TargetStatic) { + return nil, false + } + return o.TargetStatic, true +} + +// HasTargetStatic returns a boolean if a field has been set. +func (o *RedirectStageRequest) HasTargetStatic() bool { + if o != nil && !IsNil(o.TargetStatic) { + return true + } + + return false +} + +// SetTargetStatic gets a reference to the given string and assigns it to the TargetStatic field. +func (o *RedirectStageRequest) SetTargetStatic(v string) { + o.TargetStatic = &v +} + +// GetTargetFlow returns the TargetFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *RedirectStageRequest) GetTargetFlow() string { + if o == nil || IsNil(o.TargetFlow.Get()) { + var ret string + return ret + } + return *o.TargetFlow.Get() +} + +// GetTargetFlowOk returns a tuple with the TargetFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *RedirectStageRequest) GetTargetFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.TargetFlow.Get(), o.TargetFlow.IsSet() +} + +// HasTargetFlow returns a boolean if a field has been set. +func (o *RedirectStageRequest) HasTargetFlow() bool { + if o != nil && o.TargetFlow.IsSet() { + return true + } + + return false +} + +// SetTargetFlow gets a reference to the given NullableString and assigns it to the TargetFlow field. +func (o *RedirectStageRequest) SetTargetFlow(v string) { + o.TargetFlow.Set(&v) +} + +// SetTargetFlowNil sets the value for TargetFlow to be an explicit nil +func (o *RedirectStageRequest) SetTargetFlowNil() { + o.TargetFlow.Set(nil) +} + +// UnsetTargetFlow ensures that no value is present for TargetFlow, not even an explicit nil +func (o *RedirectStageRequest) UnsetTargetFlow() { + o.TargetFlow.Unset() +} + +func (o RedirectStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.KeepContext) { + toSerialize["keep_context"] = o.KeepContext + } + toSerialize["mode"] = o.Mode + if !IsNil(o.TargetStatic) { + toSerialize["target_static"] = o.TargetStatic + } + if o.TargetFlow.IsSet() { + toSerialize["target_flow"] = o.TargetFlow.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "mode", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectStageRequest := _RedirectStageRequest{} + + err = json.Unmarshal(data, &varRedirectStageRequest) + + if err != nil { + return err + } + + *o = RedirectStageRequest(varRedirectStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "keep_context") + delete(additionalProperties, "mode") + delete(additionalProperties, "target_static") + delete(additionalProperties, "target_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectStageRequest struct { + value *RedirectStageRequest + isSet bool +} + +func (v NullableRedirectStageRequest) Get() *RedirectStageRequest { + return v.value +} + +func (v *NullableRedirectStageRequest) Set(val *RedirectStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectStageRequest(val *RedirectStageRequest) *NullableRedirectStageRequest { + return &NullableRedirectStageRequest{value: val, isSet: true} +} + +func (v NullableRedirectStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_uri.go b/packages/client-go/model_redirect_uri.go new file mode 100644 index 0000000000..fa475d8864 --- /dev/null +++ b/packages/client-go/model_redirect_uri.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectURI type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectURI{} + +// RedirectURI A single allowed redirect URI entry +type RedirectURI struct { + MatchingMode MatchingModeEnum `json:"matching_mode"` + Url string `json:"url"` + AdditionalProperties map[string]interface{} +} + +type _RedirectURI RedirectURI + +// NewRedirectURI instantiates a new RedirectURI object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectURI(matchingMode MatchingModeEnum, url string) *RedirectURI { + this := RedirectURI{} + this.MatchingMode = matchingMode + this.Url = url + return &this +} + +// NewRedirectURIWithDefaults instantiates a new RedirectURI object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectURIWithDefaults() *RedirectURI { + this := RedirectURI{} + return &this +} + +// GetMatchingMode returns the MatchingMode field value +func (o *RedirectURI) GetMatchingMode() MatchingModeEnum { + if o == nil { + var ret MatchingModeEnum + return ret + } + + return o.MatchingMode +} + +// GetMatchingModeOk returns a tuple with the MatchingMode field value +// and a boolean to check if the value has been set. +func (o *RedirectURI) GetMatchingModeOk() (*MatchingModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.MatchingMode, true +} + +// SetMatchingMode sets field value +func (o *RedirectURI) SetMatchingMode(v MatchingModeEnum) { + o.MatchingMode = v +} + +// GetUrl returns the Url field value +func (o *RedirectURI) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RedirectURI) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RedirectURI) SetUrl(v string) { + o.Url = v +} + +func (o RedirectURI) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectURI) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["matching_mode"] = o.MatchingMode + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectURI) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "matching_mode", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectURI := _RedirectURI{} + + err = json.Unmarshal(data, &varRedirectURI) + + if err != nil { + return err + } + + *o = RedirectURI(varRedirectURI) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "matching_mode") + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectURI struct { + value *RedirectURI + isSet bool +} + +func (v NullableRedirectURI) Get() *RedirectURI { + return v.value +} + +func (v *NullableRedirectURI) Set(val *RedirectURI) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectURI) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectURI) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectURI(val *RedirectURI) *NullableRedirectURI { + return &NullableRedirectURI{value: val, isSet: true} +} + +func (v NullableRedirectURI) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectURI) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_redirect_uri_request.go b/packages/client-go/model_redirect_uri_request.go new file mode 100644 index 0000000000..b67b5b8ae0 --- /dev/null +++ b/packages/client-go/model_redirect_uri_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RedirectURIRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RedirectURIRequest{} + +// RedirectURIRequest A single allowed redirect URI entry +type RedirectURIRequest struct { + MatchingMode MatchingModeEnum `json:"matching_mode"` + Url string `json:"url"` + AdditionalProperties map[string]interface{} +} + +type _RedirectURIRequest RedirectURIRequest + +// NewRedirectURIRequest instantiates a new RedirectURIRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRedirectURIRequest(matchingMode MatchingModeEnum, url string) *RedirectURIRequest { + this := RedirectURIRequest{} + this.MatchingMode = matchingMode + this.Url = url + return &this +} + +// NewRedirectURIRequestWithDefaults instantiates a new RedirectURIRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRedirectURIRequestWithDefaults() *RedirectURIRequest { + this := RedirectURIRequest{} + return &this +} + +// GetMatchingMode returns the MatchingMode field value +func (o *RedirectURIRequest) GetMatchingMode() MatchingModeEnum { + if o == nil { + var ret MatchingModeEnum + return ret + } + + return o.MatchingMode +} + +// GetMatchingModeOk returns a tuple with the MatchingMode field value +// and a boolean to check if the value has been set. +func (o *RedirectURIRequest) GetMatchingModeOk() (*MatchingModeEnum, bool) { + if o == nil { + return nil, false + } + return &o.MatchingMode, true +} + +// SetMatchingMode sets field value +func (o *RedirectURIRequest) SetMatchingMode(v MatchingModeEnum) { + o.MatchingMode = v +} + +// GetUrl returns the Url field value +func (o *RedirectURIRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *RedirectURIRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *RedirectURIRequest) SetUrl(v string) { + o.Url = v +} + +func (o RedirectURIRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RedirectURIRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["matching_mode"] = o.MatchingMode + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RedirectURIRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "matching_mode", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRedirectURIRequest := _RedirectURIRequest{} + + err = json.Unmarshal(data, &varRedirectURIRequest) + + if err != nil { + return err + } + + *o = RedirectURIRequest(varRedirectURIRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "matching_mode") + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRedirectURIRequest struct { + value *RedirectURIRequest + isSet bool +} + +func (v NullableRedirectURIRequest) Get() *RedirectURIRequest { + return v.value +} + +func (v *NullableRedirectURIRequest) Set(val *RedirectURIRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRedirectURIRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRedirectURIRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRedirectURIRequest(val *RedirectURIRequest) *NullableRedirectURIRequest { + return &NullableRedirectURIRequest{value: val, isSet: true} +} + +func (v NullableRedirectURIRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRedirectURIRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_related_group.go b/packages/client-go/model_related_group.go new file mode 100644 index 0000000000..70e9e081c5 --- /dev/null +++ b/packages/client-go/model_related_group.go @@ -0,0 +1,300 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RelatedGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RelatedGroup{} + +// RelatedGroup Stripped down group serializer to show relevant children/parents for groups +type RelatedGroup struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Users added to this group will be superusers. + IsSuperuser *bool `json:"is_superuser,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + GroupUuid string `json:"group_uuid"` + AdditionalProperties map[string]interface{} +} + +type _RelatedGroup RelatedGroup + +// NewRelatedGroup instantiates a new RelatedGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRelatedGroup(pk string, name string, groupUuid string) *RelatedGroup { + this := RelatedGroup{} + this.Pk = pk + this.Name = name + this.GroupUuid = groupUuid + return &this +} + +// NewRelatedGroupWithDefaults instantiates a new RelatedGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRelatedGroupWithDefaults() *RelatedGroup { + this := RelatedGroup{} + return &this +} + +// GetPk returns the Pk field value +func (o *RelatedGroup) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *RelatedGroup) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *RelatedGroup) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *RelatedGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RelatedGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RelatedGroup) SetName(v string) { + o.Name = v +} + +// GetIsSuperuser returns the IsSuperuser field value if set, zero value otherwise. +func (o *RelatedGroup) GetIsSuperuser() bool { + if o == nil || IsNil(o.IsSuperuser) { + var ret bool + return ret + } + return *o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelatedGroup) GetIsSuperuserOk() (*bool, bool) { + if o == nil || IsNil(o.IsSuperuser) { + return nil, false + } + return o.IsSuperuser, true +} + +// HasIsSuperuser returns a boolean if a field has been set. +func (o *RelatedGroup) HasIsSuperuser() bool { + if o != nil && !IsNil(o.IsSuperuser) { + return true + } + + return false +} + +// SetIsSuperuser gets a reference to the given bool and assigns it to the IsSuperuser field. +func (o *RelatedGroup) SetIsSuperuser(v bool) { + o.IsSuperuser = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *RelatedGroup) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelatedGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *RelatedGroup) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *RelatedGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetGroupUuid returns the GroupUuid field value +func (o *RelatedGroup) GetGroupUuid() string { + if o == nil { + var ret string + return ret + } + + return o.GroupUuid +} + +// GetGroupUuidOk returns a tuple with the GroupUuid field value +// and a boolean to check if the value has been set. +func (o *RelatedGroup) GetGroupUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.GroupUuid, true +} + +// SetGroupUuid sets field value +func (o *RelatedGroup) SetGroupUuid(v string) { + o.GroupUuid = v +} + +func (o RelatedGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RelatedGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.IsSuperuser) { + toSerialize["is_superuser"] = o.IsSuperuser + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + toSerialize["group_uuid"] = o.GroupUuid + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RelatedGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "group_uuid", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRelatedGroup := _RelatedGroup{} + + err = json.Unmarshal(data, &varRelatedGroup) + + if err != nil { + return err + } + + *o = RelatedGroup(varRelatedGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "attributes") + delete(additionalProperties, "group_uuid") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRelatedGroup struct { + value *RelatedGroup + isSet bool +} + +func (v NullableRelatedGroup) Get() *RelatedGroup { + return v.value +} + +func (v *NullableRelatedGroup) Set(val *RelatedGroup) { + v.value = val + v.isSet = true +} + +func (v NullableRelatedGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableRelatedGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRelatedGroup(val *RelatedGroup) *NullableRelatedGroup { + return &NullableRelatedGroup{value: val, isSet: true} +} + +func (v NullableRelatedGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRelatedGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_reputation.go b/packages/client-go/model_reputation.go new file mode 100644 index 0000000000..d35a88ba05 --- /dev/null +++ b/packages/client-go/model_reputation.go @@ -0,0 +1,374 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Reputation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Reputation{} + +// Reputation Reputation Serializer +type Reputation struct { + Pk *string `json:"pk,omitempty"` + Identifier string `json:"identifier"` + Ip string `json:"ip"` + IpGeoData map[string]interface{} `json:"ip_geo_data,omitempty"` + IpAsnData map[string]interface{} `json:"ip_asn_data,omitempty"` + Score *int64 `json:"score,omitempty"` + Updated time.Time `json:"updated"` + AdditionalProperties map[string]interface{} +} + +type _Reputation Reputation + +// NewReputation instantiates a new Reputation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReputation(identifier string, ip string, updated time.Time) *Reputation { + this := Reputation{} + this.Identifier = identifier + this.Ip = ip + this.Updated = updated + return &this +} + +// NewReputationWithDefaults instantiates a new Reputation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReputationWithDefaults() *Reputation { + this := Reputation{} + return &this +} + +// GetPk returns the Pk field value if set, zero value otherwise. +func (o *Reputation) GetPk() string { + if o == nil || IsNil(o.Pk) { + var ret string + return ret + } + return *o.Pk +} + +// GetPkOk returns a tuple with the Pk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Reputation) GetPkOk() (*string, bool) { + if o == nil || IsNil(o.Pk) { + return nil, false + } + return o.Pk, true +} + +// HasPk returns a boolean if a field has been set. +func (o *Reputation) HasPk() bool { + if o != nil && !IsNil(o.Pk) { + return true + } + + return false +} + +// SetPk gets a reference to the given string and assigns it to the Pk field. +func (o *Reputation) SetPk(v string) { + o.Pk = &v +} + +// GetIdentifier returns the Identifier field value +func (o *Reputation) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *Reputation) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *Reputation) SetIdentifier(v string) { + o.Identifier = v +} + +// GetIp returns the Ip field value +func (o *Reputation) GetIp() string { + if o == nil { + var ret string + return ret + } + + return o.Ip +} + +// GetIpOk returns a tuple with the Ip field value +// and a boolean to check if the value has been set. +func (o *Reputation) GetIpOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Ip, true +} + +// SetIp sets field value +func (o *Reputation) SetIp(v string) { + o.Ip = v +} + +// GetIpGeoData returns the IpGeoData field value if set, zero value otherwise. +func (o *Reputation) GetIpGeoData() map[string]interface{} { + if o == nil || IsNil(o.IpGeoData) { + var ret map[string]interface{} + return ret + } + return o.IpGeoData +} + +// GetIpGeoDataOk returns a tuple with the IpGeoData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Reputation) GetIpGeoDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.IpGeoData) { + return map[string]interface{}{}, false + } + return o.IpGeoData, true +} + +// HasIpGeoData returns a boolean if a field has been set. +func (o *Reputation) HasIpGeoData() bool { + if o != nil && !IsNil(o.IpGeoData) { + return true + } + + return false +} + +// SetIpGeoData gets a reference to the given map[string]interface{} and assigns it to the IpGeoData field. +func (o *Reputation) SetIpGeoData(v map[string]interface{}) { + o.IpGeoData = v +} + +// GetIpAsnData returns the IpAsnData field value if set, zero value otherwise. +func (o *Reputation) GetIpAsnData() map[string]interface{} { + if o == nil || IsNil(o.IpAsnData) { + var ret map[string]interface{} + return ret + } + return o.IpAsnData +} + +// GetIpAsnDataOk returns a tuple with the IpAsnData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Reputation) GetIpAsnDataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.IpAsnData) { + return map[string]interface{}{}, false + } + return o.IpAsnData, true +} + +// HasIpAsnData returns a boolean if a field has been set. +func (o *Reputation) HasIpAsnData() bool { + if o != nil && !IsNil(o.IpAsnData) { + return true + } + + return false +} + +// SetIpAsnData gets a reference to the given map[string]interface{} and assigns it to the IpAsnData field. +func (o *Reputation) SetIpAsnData(v map[string]interface{}) { + o.IpAsnData = v +} + +// GetScore returns the Score field value if set, zero value otherwise. +func (o *Reputation) GetScore() int64 { + if o == nil || IsNil(o.Score) { + var ret int64 + return ret + } + return *o.Score +} + +// GetScoreOk returns a tuple with the Score field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Reputation) GetScoreOk() (*int64, bool) { + if o == nil || IsNil(o.Score) { + return nil, false + } + return o.Score, true +} + +// HasScore returns a boolean if a field has been set. +func (o *Reputation) HasScore() bool { + if o != nil && !IsNil(o.Score) { + return true + } + + return false +} + +// SetScore gets a reference to the given int64 and assigns it to the Score field. +func (o *Reputation) SetScore(v int64) { + o.Score = &v +} + +// GetUpdated returns the Updated field value +func (o *Reputation) GetUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Updated +} + +// GetUpdatedOk returns a tuple with the Updated field value +// and a boolean to check if the value has been set. +func (o *Reputation) GetUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Updated, true +} + +// SetUpdated sets field value +func (o *Reputation) SetUpdated(v time.Time) { + o.Updated = v +} + +func (o Reputation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Reputation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Pk) { + toSerialize["pk"] = o.Pk + } + toSerialize["identifier"] = o.Identifier + toSerialize["ip"] = o.Ip + if !IsNil(o.IpGeoData) { + toSerialize["ip_geo_data"] = o.IpGeoData + } + if !IsNil(o.IpAsnData) { + toSerialize["ip_asn_data"] = o.IpAsnData + } + if !IsNil(o.Score) { + toSerialize["score"] = o.Score + } + toSerialize["updated"] = o.Updated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Reputation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "identifier", + "ip", + "updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReputation := _Reputation{} + + err = json.Unmarshal(data, &varReputation) + + if err != nil { + return err + } + + *o = Reputation(varReputation) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "identifier") + delete(additionalProperties, "ip") + delete(additionalProperties, "ip_geo_data") + delete(additionalProperties, "ip_asn_data") + delete(additionalProperties, "score") + delete(additionalProperties, "updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReputation struct { + value *Reputation + isSet bool +} + +func (v NullableReputation) Get() *Reputation { + return v.value +} + +func (v *NullableReputation) Set(val *Reputation) { + v.value = val + v.isSet = true +} + +func (v NullableReputation) IsSet() bool { + return v.isSet +} + +func (v *NullableReputation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReputation(val *Reputation) *NullableReputation { + return &NullableReputation{value: val, isSet: true} +} + +func (v NullableReputation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReputation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_reputation_policy.go b/packages/client-go/model_reputation_policy.go new file mode 100644 index 0000000000..a4a0e1f855 --- /dev/null +++ b/packages/client-go/model_reputation_policy.go @@ -0,0 +1,495 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ReputationPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReputationPolicy{} + +// ReputationPolicy Reputation Policy Serializer +type ReputationPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + CheckIp *bool `json:"check_ip,omitempty"` + CheckUsername *bool `json:"check_username,omitempty"` + Threshold *int32 `json:"threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ReputationPolicy ReputationPolicy + +// NewReputationPolicy instantiates a new ReputationPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReputationPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *ReputationPolicy { + this := ReputationPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewReputationPolicyWithDefaults instantiates a new ReputationPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReputationPolicyWithDefaults() *ReputationPolicy { + this := ReputationPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *ReputationPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ReputationPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ReputationPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ReputationPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *ReputationPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *ReputationPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *ReputationPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *ReputationPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ReputationPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *ReputationPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ReputationPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ReputationPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ReputationPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ReputationPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ReputationPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *ReputationPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *ReputationPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetCheckIp returns the CheckIp field value if set, zero value otherwise. +func (o *ReputationPolicy) GetCheckIp() bool { + if o == nil || IsNil(o.CheckIp) { + var ret bool + return ret + } + return *o.CheckIp +} + +// GetCheckIpOk returns a tuple with the CheckIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetCheckIpOk() (*bool, bool) { + if o == nil || IsNil(o.CheckIp) { + return nil, false + } + return o.CheckIp, true +} + +// HasCheckIp returns a boolean if a field has been set. +func (o *ReputationPolicy) HasCheckIp() bool { + if o != nil && !IsNil(o.CheckIp) { + return true + } + + return false +} + +// SetCheckIp gets a reference to the given bool and assigns it to the CheckIp field. +func (o *ReputationPolicy) SetCheckIp(v bool) { + o.CheckIp = &v +} + +// GetCheckUsername returns the CheckUsername field value if set, zero value otherwise. +func (o *ReputationPolicy) GetCheckUsername() bool { + if o == nil || IsNil(o.CheckUsername) { + var ret bool + return ret + } + return *o.CheckUsername +} + +// GetCheckUsernameOk returns a tuple with the CheckUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetCheckUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.CheckUsername) { + return nil, false + } + return o.CheckUsername, true +} + +// HasCheckUsername returns a boolean if a field has been set. +func (o *ReputationPolicy) HasCheckUsername() bool { + if o != nil && !IsNil(o.CheckUsername) { + return true + } + + return false +} + +// SetCheckUsername gets a reference to the given bool and assigns it to the CheckUsername field. +func (o *ReputationPolicy) SetCheckUsername(v bool) { + o.CheckUsername = &v +} + +// GetThreshold returns the Threshold field value if set, zero value otherwise. +func (o *ReputationPolicy) GetThreshold() int32 { + if o == nil || IsNil(o.Threshold) { + var ret int32 + return ret + } + return *o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicy) GetThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.Threshold) { + return nil, false + } + return o.Threshold, true +} + +// HasThreshold returns a boolean if a field has been set. +func (o *ReputationPolicy) HasThreshold() bool { + if o != nil && !IsNil(o.Threshold) { + return true + } + + return false +} + +// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. +func (o *ReputationPolicy) SetThreshold(v int32) { + o.Threshold = &v +} + +func (o ReputationPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReputationPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if !IsNil(o.CheckIp) { + toSerialize["check_ip"] = o.CheckIp + } + if !IsNil(o.CheckUsername) { + toSerialize["check_username"] = o.CheckUsername + } + if !IsNil(o.Threshold) { + toSerialize["threshold"] = o.Threshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ReputationPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReputationPolicy := _ReputationPolicy{} + + err = json.Unmarshal(data, &varReputationPolicy) + + if err != nil { + return err + } + + *o = ReputationPolicy(varReputationPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "check_ip") + delete(additionalProperties, "check_username") + delete(additionalProperties, "threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReputationPolicy struct { + value *ReputationPolicy + isSet bool +} + +func (v NullableReputationPolicy) Get() *ReputationPolicy { + return v.value +} + +func (v *NullableReputationPolicy) Set(val *ReputationPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableReputationPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableReputationPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReputationPolicy(val *ReputationPolicy) *NullableReputationPolicy { + return &NullableReputationPolicy{value: val, isSet: true} +} + +func (v NullableReputationPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReputationPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_reputation_policy_request.go b/packages/client-go/model_reputation_policy_request.go new file mode 100644 index 0000000000..521dade30f --- /dev/null +++ b/packages/client-go/model_reputation_policy_request.go @@ -0,0 +1,316 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ReputationPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReputationPolicyRequest{} + +// ReputationPolicyRequest Reputation Policy Serializer +type ReputationPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + CheckIp *bool `json:"check_ip,omitempty"` + CheckUsername *bool `json:"check_username,omitempty"` + Threshold *int32 `json:"threshold,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ReputationPolicyRequest ReputationPolicyRequest + +// NewReputationPolicyRequest instantiates a new ReputationPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReputationPolicyRequest(name string) *ReputationPolicyRequest { + this := ReputationPolicyRequest{} + this.Name = name + return &this +} + +// NewReputationPolicyRequestWithDefaults instantiates a new ReputationPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReputationPolicyRequestWithDefaults() *ReputationPolicyRequest { + this := ReputationPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *ReputationPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ReputationPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ReputationPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *ReputationPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *ReputationPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *ReputationPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetCheckIp returns the CheckIp field value if set, zero value otherwise. +func (o *ReputationPolicyRequest) GetCheckIp() bool { + if o == nil || IsNil(o.CheckIp) { + var ret bool + return ret + } + return *o.CheckIp +} + +// GetCheckIpOk returns a tuple with the CheckIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicyRequest) GetCheckIpOk() (*bool, bool) { + if o == nil || IsNil(o.CheckIp) { + return nil, false + } + return o.CheckIp, true +} + +// HasCheckIp returns a boolean if a field has been set. +func (o *ReputationPolicyRequest) HasCheckIp() bool { + if o != nil && !IsNil(o.CheckIp) { + return true + } + + return false +} + +// SetCheckIp gets a reference to the given bool and assigns it to the CheckIp field. +func (o *ReputationPolicyRequest) SetCheckIp(v bool) { + o.CheckIp = &v +} + +// GetCheckUsername returns the CheckUsername field value if set, zero value otherwise. +func (o *ReputationPolicyRequest) GetCheckUsername() bool { + if o == nil || IsNil(o.CheckUsername) { + var ret bool + return ret + } + return *o.CheckUsername +} + +// GetCheckUsernameOk returns a tuple with the CheckUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicyRequest) GetCheckUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.CheckUsername) { + return nil, false + } + return o.CheckUsername, true +} + +// HasCheckUsername returns a boolean if a field has been set. +func (o *ReputationPolicyRequest) HasCheckUsername() bool { + if o != nil && !IsNil(o.CheckUsername) { + return true + } + + return false +} + +// SetCheckUsername gets a reference to the given bool and assigns it to the CheckUsername field. +func (o *ReputationPolicyRequest) SetCheckUsername(v bool) { + o.CheckUsername = &v +} + +// GetThreshold returns the Threshold field value if set, zero value otherwise. +func (o *ReputationPolicyRequest) GetThreshold() int32 { + if o == nil || IsNil(o.Threshold) { + var ret int32 + return ret + } + return *o.Threshold +} + +// GetThresholdOk returns a tuple with the Threshold field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ReputationPolicyRequest) GetThresholdOk() (*int32, bool) { + if o == nil || IsNil(o.Threshold) { + return nil, false + } + return o.Threshold, true +} + +// HasThreshold returns a boolean if a field has been set. +func (o *ReputationPolicyRequest) HasThreshold() bool { + if o != nil && !IsNil(o.Threshold) { + return true + } + + return false +} + +// SetThreshold gets a reference to the given int32 and assigns it to the Threshold field. +func (o *ReputationPolicyRequest) SetThreshold(v int32) { + o.Threshold = &v +} + +func (o ReputationPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReputationPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.CheckIp) { + toSerialize["check_ip"] = o.CheckIp + } + if !IsNil(o.CheckUsername) { + toSerialize["check_username"] = o.CheckUsername + } + if !IsNil(o.Threshold) { + toSerialize["threshold"] = o.Threshold + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ReputationPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReputationPolicyRequest := _ReputationPolicyRequest{} + + err = json.Unmarshal(data, &varReputationPolicyRequest) + + if err != nil { + return err + } + + *o = ReputationPolicyRequest(varReputationPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "check_ip") + delete(additionalProperties, "check_username") + delete(additionalProperties, "threshold") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReputationPolicyRequest struct { + value *ReputationPolicyRequest + isSet bool +} + +func (v NullableReputationPolicyRequest) Get() *ReputationPolicyRequest { + return v.value +} + +func (v *NullableReputationPolicyRequest) Set(val *ReputationPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableReputationPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableReputationPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReputationPolicyRequest(val *ReputationPolicyRequest) *NullableReputationPolicyRequest { + return &NullableReputationPolicyRequest{value: val, isSet: true} +} + +func (v NullableReputationPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReputationPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_resident_key_requirement_enum.go b/packages/client-go/model_resident_key_requirement_enum.go new file mode 100644 index 0000000000..d54db703b5 --- /dev/null +++ b/packages/client-go/model_resident_key_requirement_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// ResidentKeyRequirementEnum the model 'ResidentKeyRequirementEnum' +type ResidentKeyRequirementEnum string + +// List of ResidentKeyRequirementEnum +const ( + RESIDENTKEYREQUIREMENTENUM_DISCOURAGED ResidentKeyRequirementEnum = "discouraged" + RESIDENTKEYREQUIREMENTENUM_PREFERRED ResidentKeyRequirementEnum = "preferred" + RESIDENTKEYREQUIREMENTENUM_REQUIRED ResidentKeyRequirementEnum = "required" +) + +// All allowed values of ResidentKeyRequirementEnum enum +var AllowedResidentKeyRequirementEnumEnumValues = []ResidentKeyRequirementEnum{ + "discouraged", + "preferred", + "required", +} + +func (v *ResidentKeyRequirementEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := ResidentKeyRequirementEnum(value) + for _, existing := range AllowedResidentKeyRequirementEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid ResidentKeyRequirementEnum", value) +} + +// NewResidentKeyRequirementEnumFromValue returns a pointer to a valid ResidentKeyRequirementEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewResidentKeyRequirementEnumFromValue(v string) (*ResidentKeyRequirementEnum, error) { + ev := ResidentKeyRequirementEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for ResidentKeyRequirementEnum: valid values are %v", v, AllowedResidentKeyRequirementEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v ResidentKeyRequirementEnum) IsValid() bool { + for _, existing := range AllowedResidentKeyRequirementEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to ResidentKeyRequirementEnum value +func (v ResidentKeyRequirementEnum) Ptr() *ResidentKeyRequirementEnum { + return &v +} + +type NullableResidentKeyRequirementEnum struct { + value *ResidentKeyRequirementEnum + isSet bool +} + +func (v NullableResidentKeyRequirementEnum) Get() *ResidentKeyRequirementEnum { + return v.value +} + +func (v *NullableResidentKeyRequirementEnum) Set(val *ResidentKeyRequirementEnum) { + v.value = val + v.isSet = true +} + +func (v NullableResidentKeyRequirementEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableResidentKeyRequirementEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResidentKeyRequirementEnum(val *ResidentKeyRequirementEnum) *NullableResidentKeyRequirementEnum { + return &NullableResidentKeyRequirementEnum{value: val, isSet: true} +} + +func (v NullableResidentKeyRequirementEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResidentKeyRequirementEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_review.go b/packages/client-go/model_review.go new file mode 100644 index 0000000000..62e64aa655 --- /dev/null +++ b/packages/client-go/model_review.go @@ -0,0 +1,303 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Review type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Review{} + +// Review Mixin to validate that a valid enterprise license exists before allowing to save the object +type Review struct { + Id string `json:"id"` + Iteration string `json:"iteration"` + Reviewer ReviewerUser `json:"reviewer"` + Timestamp time.Time `json:"timestamp"` + Note NullableString `json:"note,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Review Review + +// NewReview instantiates a new Review object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReview(id string, iteration string, reviewer ReviewerUser, timestamp time.Time) *Review { + this := Review{} + this.Id = id + this.Iteration = iteration + this.Reviewer = reviewer + this.Timestamp = timestamp + return &this +} + +// NewReviewWithDefaults instantiates a new Review object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReviewWithDefaults() *Review { + this := Review{} + return &this +} + +// GetId returns the Id field value +func (o *Review) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Review) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Review) SetId(v string) { + o.Id = v +} + +// GetIteration returns the Iteration field value +func (o *Review) GetIteration() string { + if o == nil { + var ret string + return ret + } + + return o.Iteration +} + +// GetIterationOk returns a tuple with the Iteration field value +// and a boolean to check if the value has been set. +func (o *Review) GetIterationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iteration, true +} + +// SetIteration sets field value +func (o *Review) SetIteration(v string) { + o.Iteration = v +} + +// GetReviewer returns the Reviewer field value +func (o *Review) GetReviewer() ReviewerUser { + if o == nil { + var ret ReviewerUser + return ret + } + + return o.Reviewer +} + +// GetReviewerOk returns a tuple with the Reviewer field value +// and a boolean to check if the value has been set. +func (o *Review) GetReviewerOk() (*ReviewerUser, bool) { + if o == nil { + return nil, false + } + return &o.Reviewer, true +} + +// SetReviewer sets field value +func (o *Review) SetReviewer(v ReviewerUser) { + o.Reviewer = v +} + +// GetTimestamp returns the Timestamp field value +func (o *Review) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *Review) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *Review) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Review) GetNote() string { + if o == nil || IsNil(o.Note.Get()) { + var ret string + return ret + } + return *o.Note.Get() +} + +// GetNoteOk returns a tuple with the Note field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Review) GetNoteOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Note.Get(), o.Note.IsSet() +} + +// HasNote returns a boolean if a field has been set. +func (o *Review) HasNote() bool { + if o != nil && o.Note.IsSet() { + return true + } + + return false +} + +// SetNote gets a reference to the given NullableString and assigns it to the Note field. +func (o *Review) SetNote(v string) { + o.Note.Set(&v) +} + +// SetNoteNil sets the value for Note to be an explicit nil +func (o *Review) SetNoteNil() { + o.Note.Set(nil) +} + +// UnsetNote ensures that no value is present for Note, not even an explicit nil +func (o *Review) UnsetNote() { + o.Note.Unset() +} + +func (o Review) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Review) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["iteration"] = o.Iteration + toSerialize["reviewer"] = o.Reviewer + toSerialize["timestamp"] = o.Timestamp + if o.Note.IsSet() { + toSerialize["note"] = o.Note.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Review) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "iteration", + "reviewer", + "timestamp", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReview := _Review{} + + err = json.Unmarshal(data, &varReview) + + if err != nil { + return err + } + + *o = Review(varReview) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "iteration") + delete(additionalProperties, "reviewer") + delete(additionalProperties, "timestamp") + delete(additionalProperties, "note") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReview struct { + value *Review + isSet bool +} + +func (v NullableReview) Get() *Review { + return v.value +} + +func (v *NullableReview) Set(val *Review) { + v.value = val + v.isSet = true +} + +func (v NullableReview) IsSet() bool { + return v.isSet +} + +func (v *NullableReview) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReview(val *Review) *NullableReview { + return &NullableReview{value: val, isSet: true} +} + +func (v NullableReview) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReview) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_review_request.go b/packages/client-go/model_review_request.go new file mode 100644 index 0000000000..c7edfd99d6 --- /dev/null +++ b/packages/client-go/model_review_request.go @@ -0,0 +1,215 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ReviewRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReviewRequest{} + +// ReviewRequest Mixin to validate that a valid enterprise license exists before allowing to save the object +type ReviewRequest struct { + Iteration string `json:"iteration"` + Note NullableString `json:"note,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ReviewRequest ReviewRequest + +// NewReviewRequest instantiates a new ReviewRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReviewRequest(iteration string) *ReviewRequest { + this := ReviewRequest{} + this.Iteration = iteration + return &this +} + +// NewReviewRequestWithDefaults instantiates a new ReviewRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReviewRequestWithDefaults() *ReviewRequest { + this := ReviewRequest{} + return &this +} + +// GetIteration returns the Iteration field value +func (o *ReviewRequest) GetIteration() string { + if o == nil { + var ret string + return ret + } + + return o.Iteration +} + +// GetIterationOk returns a tuple with the Iteration field value +// and a boolean to check if the value has been set. +func (o *ReviewRequest) GetIterationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iteration, true +} + +// SetIteration sets field value +func (o *ReviewRequest) SetIteration(v string) { + o.Iteration = v +} + +// GetNote returns the Note field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ReviewRequest) GetNote() string { + if o == nil || IsNil(o.Note.Get()) { + var ret string + return ret + } + return *o.Note.Get() +} + +// GetNoteOk returns a tuple with the Note field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ReviewRequest) GetNoteOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Note.Get(), o.Note.IsSet() +} + +// HasNote returns a boolean if a field has been set. +func (o *ReviewRequest) HasNote() bool { + if o != nil && o.Note.IsSet() { + return true + } + + return false +} + +// SetNote gets a reference to the given NullableString and assigns it to the Note field. +func (o *ReviewRequest) SetNote(v string) { + o.Note.Set(&v) +} + +// SetNoteNil sets the value for Note to be an explicit nil +func (o *ReviewRequest) SetNoteNil() { + o.Note.Set(nil) +} + +// UnsetNote ensures that no value is present for Note, not even an explicit nil +func (o *ReviewRequest) UnsetNote() { + o.Note.Unset() +} + +func (o ReviewRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReviewRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["iteration"] = o.Iteration + if o.Note.IsSet() { + toSerialize["note"] = o.Note.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ReviewRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "iteration", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReviewRequest := _ReviewRequest{} + + err = json.Unmarshal(data, &varReviewRequest) + + if err != nil { + return err + } + + *o = ReviewRequest(varReviewRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "iteration") + delete(additionalProperties, "note") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReviewRequest struct { + value *ReviewRequest + isSet bool +} + +func (v NullableReviewRequest) Get() *ReviewRequest { + return v.value +} + +func (v *NullableReviewRequest) Set(val *ReviewRequest) { + v.value = val + v.isSet = true +} + +func (v NullableReviewRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableReviewRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReviewRequest(val *ReviewRequest) *NullableReviewRequest { + return &NullableReviewRequest{value: val, isSet: true} +} + +func (v NullableReviewRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReviewRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_reviewer_group.go b/packages/client-go/model_reviewer_group.go new file mode 100644 index 0000000000..9ba749267f --- /dev/null +++ b/packages/client-go/model_reviewer_group.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ReviewerGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReviewerGroup{} + +// ReviewerGroup struct for ReviewerGroup +type ReviewerGroup struct { + Pk string `json:"pk"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _ReviewerGroup ReviewerGroup + +// NewReviewerGroup instantiates a new ReviewerGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReviewerGroup(pk string, name string) *ReviewerGroup { + this := ReviewerGroup{} + this.Pk = pk + this.Name = name + return &this +} + +// NewReviewerGroupWithDefaults instantiates a new ReviewerGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReviewerGroupWithDefaults() *ReviewerGroup { + this := ReviewerGroup{} + return &this +} + +// GetPk returns the Pk field value +func (o *ReviewerGroup) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ReviewerGroup) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ReviewerGroup) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ReviewerGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ReviewerGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ReviewerGroup) SetName(v string) { + o.Name = v +} + +func (o ReviewerGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReviewerGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ReviewerGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReviewerGroup := _ReviewerGroup{} + + err = json.Unmarshal(data, &varReviewerGroup) + + if err != nil { + return err + } + + *o = ReviewerGroup(varReviewerGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReviewerGroup struct { + value *ReviewerGroup + isSet bool +} + +func (v NullableReviewerGroup) Get() *ReviewerGroup { + return v.value +} + +func (v *NullableReviewerGroup) Set(val *ReviewerGroup) { + v.value = val + v.isSet = true +} + +func (v NullableReviewerGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableReviewerGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReviewerGroup(val *ReviewerGroup) *NullableReviewerGroup { + return &NullableReviewerGroup{value: val, isSet: true} +} + +func (v NullableReviewerGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReviewerGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_reviewer_user.go b/packages/client-go/model_reviewer_user.go new file mode 100644 index 0000000000..bcc6453c55 --- /dev/null +++ b/packages/client-go/model_reviewer_user.go @@ -0,0 +1,256 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ReviewerUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ReviewerUser{} + +// ReviewerUser struct for ReviewerUser +type ReviewerUser struct { + Pk int32 `json:"pk"` + Uuid string `json:"uuid"` + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username" validate:"regexp=^[\\\\w.@+-]+$"` + // User's display name. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _ReviewerUser ReviewerUser + +// NewReviewerUser instantiates a new ReviewerUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewReviewerUser(pk int32, uuid string, username string, name string) *ReviewerUser { + this := ReviewerUser{} + this.Pk = pk + this.Uuid = uuid + this.Username = username + this.Name = name + return &this +} + +// NewReviewerUserWithDefaults instantiates a new ReviewerUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewReviewerUserWithDefaults() *ReviewerUser { + this := ReviewerUser{} + return &this +} + +// GetPk returns the Pk field value +func (o *ReviewerUser) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ReviewerUser) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ReviewerUser) SetPk(v int32) { + o.Pk = v +} + +// GetUuid returns the Uuid field value +func (o *ReviewerUser) GetUuid() string { + if o == nil { + var ret string + return ret + } + + return o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value +// and a boolean to check if the value has been set. +func (o *ReviewerUser) GetUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uuid, true +} + +// SetUuid sets field value +func (o *ReviewerUser) SetUuid(v string) { + o.Uuid = v +} + +// GetUsername returns the Username field value +func (o *ReviewerUser) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *ReviewerUser) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *ReviewerUser) SetUsername(v string) { + o.Username = v +} + +// GetName returns the Name field value +func (o *ReviewerUser) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ReviewerUser) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ReviewerUser) SetName(v string) { + o.Name = v +} + +func (o ReviewerUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ReviewerUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["uuid"] = o.Uuid + toSerialize["username"] = o.Username + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ReviewerUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "uuid", + "username", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varReviewerUser := _ReviewerUser{} + + err = json.Unmarshal(data, &varReviewerUser) + + if err != nil { + return err + } + + *o = ReviewerUser(varReviewerUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "uuid") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableReviewerUser struct { + value *ReviewerUser + isSet bool +} + +func (v NullableReviewerUser) Get() *ReviewerUser { + return v.value +} + +func (v *NullableReviewerUser) Set(val *ReviewerUser) { + v.value = val + v.isSet = true +} + +func (v NullableReviewerUser) IsSet() bool { + return v.isSet +} + +func (v *NullableReviewerUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableReviewerUser(val *ReviewerUser) *NullableReviewerUser { + return &NullableReviewerUser{value: val, isSet: true} +} + +func (v NullableReviewerUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableReviewerUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_role.go b/packages/client-go/model_role.go new file mode 100644 index 0000000000..84dadeac96 --- /dev/null +++ b/packages/client-go/model_role.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Role type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Role{} + +// Role Role serializer +type Role struct { + Pk string `json:"pk"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _Role Role + +// NewRole instantiates a new Role object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRole(pk string, name string) *Role { + this := Role{} + this.Pk = pk + this.Name = name + return &this +} + +// NewRoleWithDefaults instantiates a new Role object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleWithDefaults() *Role { + this := Role{} + return &this +} + +// GetPk returns the Pk field value +func (o *Role) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Role) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Role) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Role) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Role) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Role) SetName(v string) { + o.Name = v +} + +func (o Role) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Role) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Role) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRole := _Role{} + + err = json.Unmarshal(data, &varRole) + + if err != nil { + return err + } + + *o = Role(varRole) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRole struct { + value *Role + isSet bool +} + +func (v NullableRole) Get() *Role { + return v.value +} + +func (v *NullableRole) Set(val *Role) { + v.value = val + v.isSet = true +} + +func (v NullableRole) IsSet() bool { + return v.isSet +} + +func (v *NullableRole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRole(val *Role) *NullableRole { + return &NullableRole{value: val, isSet: true} +} + +func (v NullableRole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_role_assigned_object_permission.go b/packages/client-go/model_role_assigned_object_permission.go new file mode 100644 index 0000000000..2e6bd7b175 --- /dev/null +++ b/packages/client-go/model_role_assigned_object_permission.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RoleAssignedObjectPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleAssignedObjectPermission{} + +// RoleAssignedObjectPermission Roles assigned object permission serializer +type RoleAssignedObjectPermission struct { + RolePk string `json:"role_pk"` + Name string `json:"name"` + ObjectPermissions []RoleObjectPermission `json:"object_permissions"` + ModelPermissions []RoleModelPermission `json:"model_permissions"` + AdditionalProperties map[string]interface{} +} + +type _RoleAssignedObjectPermission RoleAssignedObjectPermission + +// NewRoleAssignedObjectPermission instantiates a new RoleAssignedObjectPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleAssignedObjectPermission(rolePk string, name string, objectPermissions []RoleObjectPermission, modelPermissions []RoleModelPermission) *RoleAssignedObjectPermission { + this := RoleAssignedObjectPermission{} + this.RolePk = rolePk + this.Name = name + this.ObjectPermissions = objectPermissions + this.ModelPermissions = modelPermissions + return &this +} + +// NewRoleAssignedObjectPermissionWithDefaults instantiates a new RoleAssignedObjectPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleAssignedObjectPermissionWithDefaults() *RoleAssignedObjectPermission { + this := RoleAssignedObjectPermission{} + return &this +} + +// GetRolePk returns the RolePk field value +func (o *RoleAssignedObjectPermission) GetRolePk() string { + if o == nil { + var ret string + return ret + } + + return o.RolePk +} + +// GetRolePkOk returns a tuple with the RolePk field value +// and a boolean to check if the value has been set. +func (o *RoleAssignedObjectPermission) GetRolePkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RolePk, true +} + +// SetRolePk sets field value +func (o *RoleAssignedObjectPermission) SetRolePk(v string) { + o.RolePk = v +} + +// GetName returns the Name field value +func (o *RoleAssignedObjectPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoleAssignedObjectPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoleAssignedObjectPermission) SetName(v string) { + o.Name = v +} + +// GetObjectPermissions returns the ObjectPermissions field value +func (o *RoleAssignedObjectPermission) GetObjectPermissions() []RoleObjectPermission { + if o == nil { + var ret []RoleObjectPermission + return ret + } + + return o.ObjectPermissions +} + +// GetObjectPermissionsOk returns a tuple with the ObjectPermissions field value +// and a boolean to check if the value has been set. +func (o *RoleAssignedObjectPermission) GetObjectPermissionsOk() ([]RoleObjectPermission, bool) { + if o == nil { + return nil, false + } + return o.ObjectPermissions, true +} + +// SetObjectPermissions sets field value +func (o *RoleAssignedObjectPermission) SetObjectPermissions(v []RoleObjectPermission) { + o.ObjectPermissions = v +} + +// GetModelPermissions returns the ModelPermissions field value +func (o *RoleAssignedObjectPermission) GetModelPermissions() []RoleModelPermission { + if o == nil { + var ret []RoleModelPermission + return ret + } + + return o.ModelPermissions +} + +// GetModelPermissionsOk returns a tuple with the ModelPermissions field value +// and a boolean to check if the value has been set. +func (o *RoleAssignedObjectPermission) GetModelPermissionsOk() ([]RoleModelPermission, bool) { + if o == nil { + return nil, false + } + return o.ModelPermissions, true +} + +// SetModelPermissions sets field value +func (o *RoleAssignedObjectPermission) SetModelPermissions(v []RoleModelPermission) { + o.ModelPermissions = v +} + +func (o RoleAssignedObjectPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleAssignedObjectPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["role_pk"] = o.RolePk + toSerialize["name"] = o.Name + toSerialize["object_permissions"] = o.ObjectPermissions + toSerialize["model_permissions"] = o.ModelPermissions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RoleAssignedObjectPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "role_pk", + "name", + "object_permissions", + "model_permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleAssignedObjectPermission := _RoleAssignedObjectPermission{} + + err = json.Unmarshal(data, &varRoleAssignedObjectPermission) + + if err != nil { + return err + } + + *o = RoleAssignedObjectPermission(varRoleAssignedObjectPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "role_pk") + delete(additionalProperties, "name") + delete(additionalProperties, "object_permissions") + delete(additionalProperties, "model_permissions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRoleAssignedObjectPermission struct { + value *RoleAssignedObjectPermission + isSet bool +} + +func (v NullableRoleAssignedObjectPermission) Get() *RoleAssignedObjectPermission { + return v.value +} + +func (v *NullableRoleAssignedObjectPermission) Set(val *RoleAssignedObjectPermission) { + v.value = val + v.isSet = true +} + +func (v NullableRoleAssignedObjectPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleAssignedObjectPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleAssignedObjectPermission(val *RoleAssignedObjectPermission) *NullableRoleAssignedObjectPermission { + return &NullableRoleAssignedObjectPermission{value: val, isSet: true} +} + +func (v NullableRoleAssignedObjectPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleAssignedObjectPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_role_model_permission.go b/packages/client-go/model_role_model_permission.go new file mode 100644 index 0000000000..7c27eff3d1 --- /dev/null +++ b/packages/client-go/model_role_model_permission.go @@ -0,0 +1,283 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RoleModelPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleModelPermission{} + +// RoleModelPermission Role-bound object level permission +type RoleModelPermission struct { + Id int32 `json:"id"` + Codename string `json:"codename"` + Model string `json:"model"` + AppLabel string `json:"app_label"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _RoleModelPermission RoleModelPermission + +// NewRoleModelPermission instantiates a new RoleModelPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleModelPermission(id int32, codename string, model string, appLabel string, name string) *RoleModelPermission { + this := RoleModelPermission{} + this.Id = id + this.Codename = codename + this.Model = model + this.AppLabel = appLabel + this.Name = name + return &this +} + +// NewRoleModelPermissionWithDefaults instantiates a new RoleModelPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleModelPermissionWithDefaults() *RoleModelPermission { + this := RoleModelPermission{} + return &this +} + +// GetId returns the Id field value +func (o *RoleModelPermission) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RoleModelPermission) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RoleModelPermission) SetId(v int32) { + o.Id = v +} + +// GetCodename returns the Codename field value +func (o *RoleModelPermission) GetCodename() string { + if o == nil { + var ret string + return ret + } + + return o.Codename +} + +// GetCodenameOk returns a tuple with the Codename field value +// and a boolean to check if the value has been set. +func (o *RoleModelPermission) GetCodenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Codename, true +} + +// SetCodename sets field value +func (o *RoleModelPermission) SetCodename(v string) { + o.Codename = v +} + +// GetModel returns the Model field value +func (o *RoleModelPermission) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *RoleModelPermission) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *RoleModelPermission) SetModel(v string) { + o.Model = v +} + +// GetAppLabel returns the AppLabel field value +func (o *RoleModelPermission) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *RoleModelPermission) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *RoleModelPermission) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetName returns the Name field value +func (o *RoleModelPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoleModelPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoleModelPermission) SetName(v string) { + o.Name = v +} + +func (o RoleModelPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleModelPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["codename"] = o.Codename + toSerialize["model"] = o.Model + toSerialize["app_label"] = o.AppLabel + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RoleModelPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "codename", + "model", + "app_label", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleModelPermission := _RoleModelPermission{} + + err = json.Unmarshal(data, &varRoleModelPermission) + + if err != nil { + return err + } + + *o = RoleModelPermission(varRoleModelPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "codename") + delete(additionalProperties, "model") + delete(additionalProperties, "app_label") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRoleModelPermission struct { + value *RoleModelPermission + isSet bool +} + +func (v NullableRoleModelPermission) Get() *RoleModelPermission { + return v.value +} + +func (v *NullableRoleModelPermission) Set(val *RoleModelPermission) { + v.value = val + v.isSet = true +} + +func (v NullableRoleModelPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleModelPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleModelPermission(val *RoleModelPermission) *NullableRoleModelPermission { + return &NullableRoleModelPermission{value: val, isSet: true} +} + +func (v NullableRoleModelPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleModelPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_role_object_permission.go b/packages/client-go/model_role_object_permission.go new file mode 100644 index 0000000000..958a357e04 --- /dev/null +++ b/packages/client-go/model_role_object_permission.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RoleObjectPermission type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleObjectPermission{} + +// RoleObjectPermission Role-bound object level permission +type RoleObjectPermission struct { + Id int32 `json:"id"` + Codename string `json:"codename"` + Model string `json:"model"` + AppLabel string `json:"app_label"` + ObjectPk string `json:"object_pk"` + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _RoleObjectPermission RoleObjectPermission + +// NewRoleObjectPermission instantiates a new RoleObjectPermission object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleObjectPermission(id int32, codename string, model string, appLabel string, objectPk string, name string) *RoleObjectPermission { + this := RoleObjectPermission{} + this.Id = id + this.Codename = codename + this.Model = model + this.AppLabel = appLabel + this.ObjectPk = objectPk + this.Name = name + return &this +} + +// NewRoleObjectPermissionWithDefaults instantiates a new RoleObjectPermission object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleObjectPermissionWithDefaults() *RoleObjectPermission { + this := RoleObjectPermission{} + return &this +} + +// GetId returns the Id field value +func (o *RoleObjectPermission) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RoleObjectPermission) SetId(v int32) { + o.Id = v +} + +// GetCodename returns the Codename field value +func (o *RoleObjectPermission) GetCodename() string { + if o == nil { + var ret string + return ret + } + + return o.Codename +} + +// GetCodenameOk returns a tuple with the Codename field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetCodenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Codename, true +} + +// SetCodename sets field value +func (o *RoleObjectPermission) SetCodename(v string) { + o.Codename = v +} + +// GetModel returns the Model field value +func (o *RoleObjectPermission) GetModel() string { + if o == nil { + var ret string + return ret + } + + return o.Model +} + +// GetModelOk returns a tuple with the Model field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Model, true +} + +// SetModel sets field value +func (o *RoleObjectPermission) SetModel(v string) { + o.Model = v +} + +// GetAppLabel returns the AppLabel field value +func (o *RoleObjectPermission) GetAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.AppLabel +} + +// GetAppLabelOk returns a tuple with the AppLabel field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AppLabel, true +} + +// SetAppLabel sets field value +func (o *RoleObjectPermission) SetAppLabel(v string) { + o.AppLabel = v +} + +// GetObjectPk returns the ObjectPk field value +func (o *RoleObjectPermission) GetObjectPk() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectPk +} + +// GetObjectPkOk returns a tuple with the ObjectPk field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetObjectPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectPk, true +} + +// SetObjectPk sets field value +func (o *RoleObjectPermission) SetObjectPk(v string) { + o.ObjectPk = v +} + +// GetName returns the Name field value +func (o *RoleObjectPermission) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoleObjectPermission) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoleObjectPermission) SetName(v string) { + o.Name = v +} + +func (o RoleObjectPermission) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleObjectPermission) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["codename"] = o.Codename + toSerialize["model"] = o.Model + toSerialize["app_label"] = o.AppLabel + toSerialize["object_pk"] = o.ObjectPk + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RoleObjectPermission) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "codename", + "model", + "app_label", + "object_pk", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleObjectPermission := _RoleObjectPermission{} + + err = json.Unmarshal(data, &varRoleObjectPermission) + + if err != nil { + return err + } + + *o = RoleObjectPermission(varRoleObjectPermission) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "codename") + delete(additionalProperties, "model") + delete(additionalProperties, "app_label") + delete(additionalProperties, "object_pk") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRoleObjectPermission struct { + value *RoleObjectPermission + isSet bool +} + +func (v NullableRoleObjectPermission) Get() *RoleObjectPermission { + return v.value +} + +func (v *NullableRoleObjectPermission) Set(val *RoleObjectPermission) { + v.value = val + v.isSet = true +} + +func (v NullableRoleObjectPermission) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleObjectPermission) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleObjectPermission(val *RoleObjectPermission) *NullableRoleObjectPermission { + return &NullableRoleObjectPermission{value: val, isSet: true} +} + +func (v NullableRoleObjectPermission) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleObjectPermission) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_role_request.go b/packages/client-go/model_role_request.go new file mode 100644 index 0000000000..ffbbea97dd --- /dev/null +++ b/packages/client-go/model_role_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the RoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoleRequest{} + +// RoleRequest Role serializer +type RoleRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _RoleRequest RoleRequest + +// NewRoleRequest instantiates a new RoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoleRequest(name string) *RoleRequest { + this := RoleRequest{} + this.Name = name + return &this +} + +// NewRoleRequestWithDefaults instantiates a new RoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoleRequestWithDefaults() *RoleRequest { + this := RoleRequest{} + return &this +} + +// GetName returns the Name field value +func (o *RoleRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoleRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoleRequest) SetName(v string) { + o.Name = v +} + +func (o RoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *RoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoleRequest := _RoleRequest{} + + err = json.Unmarshal(data, &varRoleRequest) + + if err != nil { + return err + } + + *o = RoleRequest(varRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableRoleRequest struct { + value *RoleRequest + isSet bool +} + +func (v NullableRoleRequest) Get() *RoleRequest { + return v.value +} + +func (v *NullableRoleRequest) Set(val *RoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoleRequest(val *RoleRequest) *NullableRoleRequest { + return &NullableRoleRequest{value: val, isSet: true} +} + +func (v NullableRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_bindings_enum.go b/packages/client-go/model_saml_bindings_enum.go new file mode 100644 index 0000000000..199658f148 --- /dev/null +++ b/packages/client-go/model_saml_bindings_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SAMLBindingsEnum the model 'SAMLBindingsEnum' +type SAMLBindingsEnum string + +// List of SAMLBindingsEnum +const ( + SAMLBINDINGSENUM_REDIRECT SAMLBindingsEnum = "redirect" + SAMLBINDINGSENUM_POST SAMLBindingsEnum = "post" +) + +// All allowed values of SAMLBindingsEnum enum +var AllowedSAMLBindingsEnumEnumValues = []SAMLBindingsEnum{ + "redirect", + "post", +} + +func (v *SAMLBindingsEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SAMLBindingsEnum(value) + for _, existing := range AllowedSAMLBindingsEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SAMLBindingsEnum", value) +} + +// NewSAMLBindingsEnumFromValue returns a pointer to a valid SAMLBindingsEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSAMLBindingsEnumFromValue(v string) (*SAMLBindingsEnum, error) { + ev := SAMLBindingsEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SAMLBindingsEnum: valid values are %v", v, AllowedSAMLBindingsEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SAMLBindingsEnum) IsValid() bool { + for _, existing := range AllowedSAMLBindingsEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SAMLBindingsEnum value +func (v SAMLBindingsEnum) Ptr() *SAMLBindingsEnum { + return &v +} + +type NullableSAMLBindingsEnum struct { + value *SAMLBindingsEnum + isSet bool +} + +func (v NullableSAMLBindingsEnum) Get() *SAMLBindingsEnum { + return v.value +} + +func (v *NullableSAMLBindingsEnum) Set(val *SAMLBindingsEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLBindingsEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLBindingsEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLBindingsEnum(val *SAMLBindingsEnum) *NullableSAMLBindingsEnum { + return &NullableSAMLBindingsEnum{value: val, isSet: true} +} + +func (v NullableSAMLBindingsEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLBindingsEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_logout_methods.go b/packages/client-go/model_saml_logout_methods.go new file mode 100644 index 0000000000..8b07d1f3fd --- /dev/null +++ b/packages/client-go/model_saml_logout_methods.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SAMLLogoutMethods the model 'SAMLLogoutMethods' +type SAMLLogoutMethods string + +// List of SAMLLogoutMethods +const ( + SAMLLOGOUTMETHODS_FRONTCHANNEL_IFRAME SAMLLogoutMethods = "frontchannel_iframe" + SAMLLOGOUTMETHODS_FRONTCHANNEL_NATIVE SAMLLogoutMethods = "frontchannel_native" + SAMLLOGOUTMETHODS_BACKCHANNEL SAMLLogoutMethods = "backchannel" +) + +// All allowed values of SAMLLogoutMethods enum +var AllowedSAMLLogoutMethodsEnumValues = []SAMLLogoutMethods{ + "frontchannel_iframe", + "frontchannel_native", + "backchannel", +} + +func (v *SAMLLogoutMethods) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SAMLLogoutMethods(value) + for _, existing := range AllowedSAMLLogoutMethodsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SAMLLogoutMethods", value) +} + +// NewSAMLLogoutMethodsFromValue returns a pointer to a valid SAMLLogoutMethods +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSAMLLogoutMethodsFromValue(v string) (*SAMLLogoutMethods, error) { + ev := SAMLLogoutMethods(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SAMLLogoutMethods: valid values are %v", v, AllowedSAMLLogoutMethodsEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SAMLLogoutMethods) IsValid() bool { + for _, existing := range AllowedSAMLLogoutMethodsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SAMLLogoutMethods value +func (v SAMLLogoutMethods) Ptr() *SAMLLogoutMethods { + return &v +} + +type NullableSAMLLogoutMethods struct { + value *SAMLLogoutMethods + isSet bool +} + +func (v NullableSAMLLogoutMethods) Get() *SAMLLogoutMethods { + return v.value +} + +func (v *NullableSAMLLogoutMethods) Set(val *SAMLLogoutMethods) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLLogoutMethods) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLLogoutMethods) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLLogoutMethods(val *SAMLLogoutMethods) *NullableSAMLLogoutMethods { + return &NullableSAMLLogoutMethods{value: val, isSet: true} +} + +func (v NullableSAMLLogoutMethods) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLLogoutMethods) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_metadata.go b/packages/client-go/model_saml_metadata.go new file mode 100644 index 0000000000..bb20b471dd --- /dev/null +++ b/packages/client-go/model_saml_metadata.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLMetadata type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLMetadata{} + +// SAMLMetadata SAML Provider Metadata serializer +type SAMLMetadata struct { + Metadata string `json:"metadata"` + DownloadUrl string `json:"download_url"` + AdditionalProperties map[string]interface{} +} + +type _SAMLMetadata SAMLMetadata + +// NewSAMLMetadata instantiates a new SAMLMetadata object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLMetadata(metadata string, downloadUrl string) *SAMLMetadata { + this := SAMLMetadata{} + this.Metadata = metadata + this.DownloadUrl = downloadUrl + return &this +} + +// NewSAMLMetadataWithDefaults instantiates a new SAMLMetadata object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLMetadataWithDefaults() *SAMLMetadata { + this := SAMLMetadata{} + return &this +} + +// GetMetadata returns the Metadata field value +func (o *SAMLMetadata) GetMetadata() string { + if o == nil { + var ret string + return ret + } + + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value +// and a boolean to check if the value has been set. +func (o *SAMLMetadata) GetMetadataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Metadata, true +} + +// SetMetadata sets field value +func (o *SAMLMetadata) SetMetadata(v string) { + o.Metadata = v +} + +// GetDownloadUrl returns the DownloadUrl field value +func (o *SAMLMetadata) GetDownloadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.DownloadUrl +} + +// GetDownloadUrlOk returns a tuple with the DownloadUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLMetadata) GetDownloadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DownloadUrl, true +} + +// SetDownloadUrl sets field value +func (o *SAMLMetadata) SetDownloadUrl(v string) { + o.DownloadUrl = v +} + +func (o SAMLMetadata) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLMetadata) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["metadata"] = o.Metadata + toSerialize["download_url"] = o.DownloadUrl + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLMetadata) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "metadata", + "download_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLMetadata := _SAMLMetadata{} + + err = json.Unmarshal(data, &varSAMLMetadata) + + if err != nil { + return err + } + + *o = SAMLMetadata(varSAMLMetadata) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "metadata") + delete(additionalProperties, "download_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLMetadata struct { + value *SAMLMetadata + isSet bool +} + +func (v NullableSAMLMetadata) Get() *SAMLMetadata { + return v.value +} + +func (v *NullableSAMLMetadata) Set(val *SAMLMetadata) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLMetadata) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLMetadata) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLMetadata(val *SAMLMetadata) *NullableSAMLMetadata { + return &NullableSAMLMetadata{value: val, isSet: true} +} + +func (v NullableSAMLMetadata) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLMetadata) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_name_id_policy_enum.go b/packages/client-go/model_saml_name_id_policy_enum.go new file mode 100644 index 0000000000..4ae9b2ca46 --- /dev/null +++ b/packages/client-go/model_saml_name_id_policy_enum.go @@ -0,0 +1,119 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SAMLNameIDPolicyEnum the model 'SAMLNameIDPolicyEnum' +type SAMLNameIDPolicyEnum string + +// List of SAMLNameIDPolicyEnum +const ( + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_1_1_NAMEID_FORMAT_EMAIL_ADDRESS SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_2_0_NAMEID_FORMAT_PERSISTENT SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_1_1_NAMEID_FORMAT_X509_SUBJECT_NAME SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_2_0_NAMEID_FORMAT_WINDOWS_DOMAIN_QUALIFIED_NAME SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName" + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_2_0_NAMEID_FORMAT_TRANSIENT SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient" + SAMLNAMEIDPOLICYENUM_URN_OASIS_NAMES_TC_SAML_1_1_NAMEID_FORMAT_UNSPECIFIED SAMLNameIDPolicyEnum = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" +) + +// All allowed values of SAMLNameIDPolicyEnum enum +var AllowedSAMLNameIDPolicyEnumEnumValues = []SAMLNameIDPolicyEnum{ + "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", + "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", + "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName", + "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName", + "urn:oasis:names:tc:SAML:2.0:nameid-format:transient", + "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified", +} + +func (v *SAMLNameIDPolicyEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SAMLNameIDPolicyEnum(value) + for _, existing := range AllowedSAMLNameIDPolicyEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SAMLNameIDPolicyEnum", value) +} + +// NewSAMLNameIDPolicyEnumFromValue returns a pointer to a valid SAMLNameIDPolicyEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSAMLNameIDPolicyEnumFromValue(v string) (*SAMLNameIDPolicyEnum, error) { + ev := SAMLNameIDPolicyEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SAMLNameIDPolicyEnum: valid values are %v", v, AllowedSAMLNameIDPolicyEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SAMLNameIDPolicyEnum) IsValid() bool { + for _, existing := range AllowedSAMLNameIDPolicyEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SAMLNameIDPolicyEnum value +func (v SAMLNameIDPolicyEnum) Ptr() *SAMLNameIDPolicyEnum { + return &v +} + +type NullableSAMLNameIDPolicyEnum struct { + value *SAMLNameIDPolicyEnum + isSet bool +} + +func (v NullableSAMLNameIDPolicyEnum) Get() *SAMLNameIDPolicyEnum { + return v.value +} + +func (v *NullableSAMLNameIDPolicyEnum) Set(val *SAMLNameIDPolicyEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLNameIDPolicyEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLNameIDPolicyEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLNameIDPolicyEnum(val *SAMLNameIDPolicyEnum) *NullableSAMLNameIDPolicyEnum { + return &NullableSAMLNameIDPolicyEnum{value: val, isSet: true} +} + +func (v NullableSAMLNameIDPolicyEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLNameIDPolicyEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_property_mapping.go b/packages/client-go/model_saml_property_mapping.go new file mode 100644 index 0000000000..a7f9328aed --- /dev/null +++ b/packages/client-go/model_saml_property_mapping.go @@ -0,0 +1,471 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLPropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLPropertyMapping{} + +// SAMLPropertyMapping SAMLPropertyMapping Serializer +type SAMLPropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + SamlName string `json:"saml_name"` + FriendlyName NullableString `json:"friendly_name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SAMLPropertyMapping SAMLPropertyMapping + +// NewSAMLPropertyMapping instantiates a new SAMLPropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLPropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string, samlName string) *SAMLPropertyMapping { + this := SAMLPropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.SamlName = samlName + return &this +} + +// NewSAMLPropertyMappingWithDefaults instantiates a new SAMLPropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLPropertyMappingWithDefaults() *SAMLPropertyMapping { + this := SAMLPropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *SAMLPropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SAMLPropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLPropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLPropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SAMLPropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SAMLPropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SAMLPropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SAMLPropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SAMLPropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLPropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SAMLPropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SAMLPropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *SAMLPropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SAMLPropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SAMLPropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SAMLPropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SAMLPropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SAMLPropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SAMLPropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SAMLPropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetSamlName returns the SamlName field value +func (o *SAMLPropertyMapping) GetSamlName() string { + if o == nil { + var ret string + return ret + } + + return o.SamlName +} + +// GetSamlNameOk returns a tuple with the SamlName field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMapping) GetSamlNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SamlName, true +} + +// SetSamlName sets field value +func (o *SAMLPropertyMapping) SetSamlName(v string) { + o.SamlName = v +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLPropertyMapping) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName.Get()) { + var ret string + return ret + } + return *o.FriendlyName.Get() +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLPropertyMapping) GetFriendlyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FriendlyName.Get(), o.FriendlyName.IsSet() +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *SAMLPropertyMapping) HasFriendlyName() bool { + if o != nil && o.FriendlyName.IsSet() { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given NullableString and assigns it to the FriendlyName field. +func (o *SAMLPropertyMapping) SetFriendlyName(v string) { + o.FriendlyName.Set(&v) +} + +// SetFriendlyNameNil sets the value for FriendlyName to be an explicit nil +func (o *SAMLPropertyMapping) SetFriendlyNameNil() { + o.FriendlyName.Set(nil) +} + +// UnsetFriendlyName ensures that no value is present for FriendlyName, not even an explicit nil +func (o *SAMLPropertyMapping) UnsetFriendlyName() { + o.FriendlyName.Unset() +} + +func (o SAMLPropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLPropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["saml_name"] = o.SamlName + if o.FriendlyName.IsSet() { + toSerialize["friendly_name"] = o.FriendlyName.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLPropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "saml_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLPropertyMapping := _SAMLPropertyMapping{} + + err = json.Unmarshal(data, &varSAMLPropertyMapping) + + if err != nil { + return err + } + + *o = SAMLPropertyMapping(varSAMLPropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "saml_name") + delete(additionalProperties, "friendly_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLPropertyMapping struct { + value *SAMLPropertyMapping + isSet bool +} + +func (v NullableSAMLPropertyMapping) Get() *SAMLPropertyMapping { + return v.value +} + +func (v *NullableSAMLPropertyMapping) Set(val *SAMLPropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLPropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLPropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLPropertyMapping(val *SAMLPropertyMapping) *NullableSAMLPropertyMapping { + return &NullableSAMLPropertyMapping{value: val, isSet: true} +} + +func (v NullableSAMLPropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLPropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_property_mapping_request.go b/packages/client-go/model_saml_property_mapping_request.go new file mode 100644 index 0000000000..fb368e0fb6 --- /dev/null +++ b/packages/client-go/model_saml_property_mapping_request.go @@ -0,0 +1,322 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLPropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLPropertyMappingRequest{} + +// SAMLPropertyMappingRequest SAMLPropertyMapping Serializer +type SAMLPropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + SamlName string `json:"saml_name"` + FriendlyName NullableString `json:"friendly_name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SAMLPropertyMappingRequest SAMLPropertyMappingRequest + +// NewSAMLPropertyMappingRequest instantiates a new SAMLPropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLPropertyMappingRequest(name string, expression string, samlName string) *SAMLPropertyMappingRequest { + this := SAMLPropertyMappingRequest{} + this.Name = name + this.Expression = expression + this.SamlName = samlName + return &this +} + +// NewSAMLPropertyMappingRequestWithDefaults instantiates a new SAMLPropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLPropertyMappingRequestWithDefaults() *SAMLPropertyMappingRequest { + this := SAMLPropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLPropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLPropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SAMLPropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SAMLPropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SAMLPropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SAMLPropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SAMLPropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLPropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SAMLPropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SAMLPropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +// GetSamlName returns the SamlName field value +func (o *SAMLPropertyMappingRequest) GetSamlName() string { + if o == nil { + var ret string + return ret + } + + return o.SamlName +} + +// GetSamlNameOk returns a tuple with the SamlName field value +// and a boolean to check if the value has been set. +func (o *SAMLPropertyMappingRequest) GetSamlNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SamlName, true +} + +// SetSamlName sets field value +func (o *SAMLPropertyMappingRequest) SetSamlName(v string) { + o.SamlName = v +} + +// GetFriendlyName returns the FriendlyName field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLPropertyMappingRequest) GetFriendlyName() string { + if o == nil || IsNil(o.FriendlyName.Get()) { + var ret string + return ret + } + return *o.FriendlyName.Get() +} + +// GetFriendlyNameOk returns a tuple with the FriendlyName field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLPropertyMappingRequest) GetFriendlyNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.FriendlyName.Get(), o.FriendlyName.IsSet() +} + +// HasFriendlyName returns a boolean if a field has been set. +func (o *SAMLPropertyMappingRequest) HasFriendlyName() bool { + if o != nil && o.FriendlyName.IsSet() { + return true + } + + return false +} + +// SetFriendlyName gets a reference to the given NullableString and assigns it to the FriendlyName field. +func (o *SAMLPropertyMappingRequest) SetFriendlyName(v string) { + o.FriendlyName.Set(&v) +} + +// SetFriendlyNameNil sets the value for FriendlyName to be an explicit nil +func (o *SAMLPropertyMappingRequest) SetFriendlyNameNil() { + o.FriendlyName.Set(nil) +} + +// UnsetFriendlyName ensures that no value is present for FriendlyName, not even an explicit nil +func (o *SAMLPropertyMappingRequest) UnsetFriendlyName() { + o.FriendlyName.Unset() +} + +func (o SAMLPropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLPropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["saml_name"] = o.SamlName + if o.FriendlyName.IsSet() { + toSerialize["friendly_name"] = o.FriendlyName.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLPropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + "saml_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLPropertyMappingRequest := _SAMLPropertyMappingRequest{} + + err = json.Unmarshal(data, &varSAMLPropertyMappingRequest) + + if err != nil { + return err + } + + *o = SAMLPropertyMappingRequest(varSAMLPropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "saml_name") + delete(additionalProperties, "friendly_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLPropertyMappingRequest struct { + value *SAMLPropertyMappingRequest + isSet bool +} + +func (v NullableSAMLPropertyMappingRequest) Get() *SAMLPropertyMappingRequest { + return v.value +} + +func (v *NullableSAMLPropertyMappingRequest) Set(val *SAMLPropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLPropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLPropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLPropertyMappingRequest(val *SAMLPropertyMappingRequest) *NullableSAMLPropertyMappingRequest { + return &NullableSAMLPropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableSAMLPropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLPropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_provider.go b/packages/client-go/model_saml_provider.go new file mode 100644 index 0000000000..e0cd278bec --- /dev/null +++ b/packages/client-go/model_saml_provider.go @@ -0,0 +1,1683 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLProvider{} + +// SAMLProvider SAMLProvider Serializer +type SAMLProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AcsUrl string `json:"acs_url"` + // Single Logout Service URL where the logout response should be sent. + SlsUrl *string `json:"sls_url,omitempty"` + // Value of the audience restriction field of the assertion. When left empty, no audience restriction will be added. + Audience *string `json:"audience,omitempty"` + // Also known as EntityID + Issuer *string `json:"issuer,omitempty"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignResponse *bool `json:"sign_response,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + SignLogoutResponse *bool `json:"sign_logout_response,omitempty"` + // This determines how authentik sends the response back to the Service Provider. + SpBinding *SAMLBindingsEnum `json:"sp_binding,omitempty"` + // This determines how authentik sends the logout response back to the Service Provider. + SlsBinding *SAMLBindingsEnum `json:"sls_binding,omitempty"` + // Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in hidden iframes. Front-channel native uses your active browser tab to send post requests and redirect to providers. Back-channel sends logout requests directly from the server without user interaction (requires POST SLS binding). + LogoutMethod *SAMLLogoutMethods `json:"logout_method,omitempty"` + // Default relay_state value for IDP-initiated logins + DefaultRelayState *string `json:"default_relay_state,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + // Get metadata download URL + UrlDownloadMetadata string `json:"url_download_metadata"` + // Get SSO Post URL + UrlSsoPost string `json:"url_sso_post"` + // Get SSO Redirect URL + UrlSsoRedirect string `json:"url_sso_redirect"` + // Get SSO IDP-Initiated URL + UrlSsoInit string `json:"url_sso_init"` + // Get SLO POST URL + UrlSloPost string `json:"url_slo_post"` + // Get SLO redirect URL + UrlSloRedirect string `json:"url_slo_redirect"` + AdditionalProperties map[string]interface{} +} + +type _SAMLProvider SAMLProvider + +// NewSAMLProvider instantiates a new SAMLProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, acsUrl string, urlDownloadMetadata string, urlSsoPost string, urlSsoRedirect string, urlSsoInit string, urlSloPost string, urlSloRedirect string) *SAMLProvider { + this := SAMLProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.AcsUrl = acsUrl + this.UrlDownloadMetadata = urlDownloadMetadata + this.UrlSsoPost = urlSsoPost + this.UrlSsoRedirect = urlSsoRedirect + this.UrlSsoInit = urlSsoInit + this.UrlSloPost = urlSloPost + this.UrlSloRedirect = urlSloRedirect + return &this +} + +// NewSAMLProviderWithDefaults instantiates a new SAMLProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLProviderWithDefaults() *SAMLProvider { + this := SAMLProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *SAMLProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SAMLProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SAMLProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *SAMLProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *SAMLProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *SAMLProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *SAMLProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *SAMLProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *SAMLProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *SAMLProvider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *SAMLProvider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *SAMLProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *SAMLProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *SAMLProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *SAMLProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SAMLProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SAMLProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *SAMLProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SAMLProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *SAMLProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SAMLProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *SAMLProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SAMLProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *SAMLProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *SAMLProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SAMLProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SAMLProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SAMLProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SAMLProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SAMLProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetAcsUrl returns the AcsUrl field value +func (o *SAMLProvider) GetAcsUrl() string { + if o == nil { + var ret string + return ret + } + + return o.AcsUrl +} + +// GetAcsUrlOk returns a tuple with the AcsUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetAcsUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AcsUrl, true +} + +// SetAcsUrl sets field value +func (o *SAMLProvider) SetAcsUrl(v string) { + o.AcsUrl = v +} + +// GetSlsUrl returns the SlsUrl field value if set, zero value otherwise. +func (o *SAMLProvider) GetSlsUrl() string { + if o == nil || IsNil(o.SlsUrl) { + var ret string + return ret + } + return *o.SlsUrl +} + +// GetSlsUrlOk returns a tuple with the SlsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSlsUrlOk() (*string, bool) { + if o == nil || IsNil(o.SlsUrl) { + return nil, false + } + return o.SlsUrl, true +} + +// HasSlsUrl returns a boolean if a field has been set. +func (o *SAMLProvider) HasSlsUrl() bool { + if o != nil && !IsNil(o.SlsUrl) { + return true + } + + return false +} + +// SetSlsUrl gets a reference to the given string and assigns it to the SlsUrl field. +func (o *SAMLProvider) SetSlsUrl(v string) { + o.SlsUrl = &v +} + +// GetAudience returns the Audience field value if set, zero value otherwise. +func (o *SAMLProvider) GetAudience() string { + if o == nil || IsNil(o.Audience) { + var ret string + return ret + } + return *o.Audience +} + +// GetAudienceOk returns a tuple with the Audience field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetAudienceOk() (*string, bool) { + if o == nil || IsNil(o.Audience) { + return nil, false + } + return o.Audience, true +} + +// HasAudience returns a boolean if a field has been set. +func (o *SAMLProvider) HasAudience() bool { + if o != nil && !IsNil(o.Audience) { + return true + } + + return false +} + +// SetAudience gets a reference to the given string and assigns it to the Audience field. +func (o *SAMLProvider) SetAudience(v string) { + o.Audience = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *SAMLProvider) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *SAMLProvider) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *SAMLProvider) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *SAMLProvider) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *SAMLProvider) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *SAMLProvider) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *SAMLProvider) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *SAMLProvider) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *SAMLProvider) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *SAMLProvider) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *SAMLProvider) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *SAMLProvider) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *SAMLProvider) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *SAMLProvider) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *SAMLProvider) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *SAMLProvider) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *SAMLProvider) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *SAMLProvider) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *SAMLProvider) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *SAMLProvider) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *SAMLProvider) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *SAMLProvider) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *SAMLProvider) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *SAMLProvider) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *SAMLProvider) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *SAMLProvider) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *SAMLProvider) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *SAMLProvider) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *SAMLProvider) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *SAMLProvider) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *SAMLProvider) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *SAMLProvider) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *SAMLProvider) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *SAMLProvider) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProvider) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProvider) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *SAMLProvider) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *SAMLProvider) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *SAMLProvider) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *SAMLProvider) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *SAMLProvider) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *SAMLProvider) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *SAMLProvider) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignResponse returns the SignResponse field value if set, zero value otherwise. +func (o *SAMLProvider) GetSignResponse() bool { + if o == nil || IsNil(o.SignResponse) { + var ret bool + return ret + } + return *o.SignResponse +} + +// GetSignResponseOk returns a tuple with the SignResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSignResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignResponse) { + return nil, false + } + return o.SignResponse, true +} + +// HasSignResponse returns a boolean if a field has been set. +func (o *SAMLProvider) HasSignResponse() bool { + if o != nil && !IsNil(o.SignResponse) { + return true + } + + return false +} + +// SetSignResponse gets a reference to the given bool and assigns it to the SignResponse field. +func (o *SAMLProvider) SetSignResponse(v bool) { + o.SignResponse = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *SAMLProvider) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *SAMLProvider) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *SAMLProvider) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetSignLogoutResponse returns the SignLogoutResponse field value if set, zero value otherwise. +func (o *SAMLProvider) GetSignLogoutResponse() bool { + if o == nil || IsNil(o.SignLogoutResponse) { + var ret bool + return ret + } + return *o.SignLogoutResponse +} + +// GetSignLogoutResponseOk returns a tuple with the SignLogoutResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSignLogoutResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutResponse) { + return nil, false + } + return o.SignLogoutResponse, true +} + +// HasSignLogoutResponse returns a boolean if a field has been set. +func (o *SAMLProvider) HasSignLogoutResponse() bool { + if o != nil && !IsNil(o.SignLogoutResponse) { + return true + } + + return false +} + +// SetSignLogoutResponse gets a reference to the given bool and assigns it to the SignLogoutResponse field. +func (o *SAMLProvider) SetSignLogoutResponse(v bool) { + o.SignLogoutResponse = &v +} + +// GetSpBinding returns the SpBinding field value if set, zero value otherwise. +func (o *SAMLProvider) GetSpBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SpBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SpBinding +} + +// GetSpBindingOk returns a tuple with the SpBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSpBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SpBinding) { + return nil, false + } + return o.SpBinding, true +} + +// HasSpBinding returns a boolean if a field has been set. +func (o *SAMLProvider) HasSpBinding() bool { + if o != nil && !IsNil(o.SpBinding) { + return true + } + + return false +} + +// SetSpBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SpBinding field. +func (o *SAMLProvider) SetSpBinding(v SAMLBindingsEnum) { + o.SpBinding = &v +} + +// GetSlsBinding returns the SlsBinding field value if set, zero value otherwise. +func (o *SAMLProvider) GetSlsBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SlsBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SlsBinding +} + +// GetSlsBindingOk returns a tuple with the SlsBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetSlsBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SlsBinding) { + return nil, false + } + return o.SlsBinding, true +} + +// HasSlsBinding returns a boolean if a field has been set. +func (o *SAMLProvider) HasSlsBinding() bool { + if o != nil && !IsNil(o.SlsBinding) { + return true + } + + return false +} + +// SetSlsBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SlsBinding field. +func (o *SAMLProvider) SetSlsBinding(v SAMLBindingsEnum) { + o.SlsBinding = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *SAMLProvider) GetLogoutMethod() SAMLLogoutMethods { + if o == nil || IsNil(o.LogoutMethod) { + var ret SAMLLogoutMethods + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetLogoutMethodOk() (*SAMLLogoutMethods, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *SAMLProvider) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given SAMLLogoutMethods and assigns it to the LogoutMethod field. +func (o *SAMLProvider) SetLogoutMethod(v SAMLLogoutMethods) { + o.LogoutMethod = &v +} + +// GetDefaultRelayState returns the DefaultRelayState field value if set, zero value otherwise. +func (o *SAMLProvider) GetDefaultRelayState() string { + if o == nil || IsNil(o.DefaultRelayState) { + var ret string + return ret + } + return *o.DefaultRelayState +} + +// GetDefaultRelayStateOk returns a tuple with the DefaultRelayState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetDefaultRelayStateOk() (*string, bool) { + if o == nil || IsNil(o.DefaultRelayState) { + return nil, false + } + return o.DefaultRelayState, true +} + +// HasDefaultRelayState returns a boolean if a field has been set. +func (o *SAMLProvider) HasDefaultRelayState() bool { + if o != nil && !IsNil(o.DefaultRelayState) { + return true + } + + return false +} + +// SetDefaultRelayState gets a reference to the given string and assigns it to the DefaultRelayState field. +func (o *SAMLProvider) SetDefaultRelayState(v string) { + o.DefaultRelayState = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *SAMLProvider) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *SAMLProvider) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *SAMLProvider) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +// GetUrlDownloadMetadata returns the UrlDownloadMetadata field value +func (o *SAMLProvider) GetUrlDownloadMetadata() string { + if o == nil { + var ret string + return ret + } + + return o.UrlDownloadMetadata +} + +// GetUrlDownloadMetadataOk returns a tuple with the UrlDownloadMetadata field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlDownloadMetadataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlDownloadMetadata, true +} + +// SetUrlDownloadMetadata sets field value +func (o *SAMLProvider) SetUrlDownloadMetadata(v string) { + o.UrlDownloadMetadata = v +} + +// GetUrlSsoPost returns the UrlSsoPost field value +func (o *SAMLProvider) GetUrlSsoPost() string { + if o == nil { + var ret string + return ret + } + + return o.UrlSsoPost +} + +// GetUrlSsoPostOk returns a tuple with the UrlSsoPost field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlSsoPostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlSsoPost, true +} + +// SetUrlSsoPost sets field value +func (o *SAMLProvider) SetUrlSsoPost(v string) { + o.UrlSsoPost = v +} + +// GetUrlSsoRedirect returns the UrlSsoRedirect field value +func (o *SAMLProvider) GetUrlSsoRedirect() string { + if o == nil { + var ret string + return ret + } + + return o.UrlSsoRedirect +} + +// GetUrlSsoRedirectOk returns a tuple with the UrlSsoRedirect field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlSsoRedirectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlSsoRedirect, true +} + +// SetUrlSsoRedirect sets field value +func (o *SAMLProvider) SetUrlSsoRedirect(v string) { + o.UrlSsoRedirect = v +} + +// GetUrlSsoInit returns the UrlSsoInit field value +func (o *SAMLProvider) GetUrlSsoInit() string { + if o == nil { + var ret string + return ret + } + + return o.UrlSsoInit +} + +// GetUrlSsoInitOk returns a tuple with the UrlSsoInit field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlSsoInitOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlSsoInit, true +} + +// SetUrlSsoInit sets field value +func (o *SAMLProvider) SetUrlSsoInit(v string) { + o.UrlSsoInit = v +} + +// GetUrlSloPost returns the UrlSloPost field value +func (o *SAMLProvider) GetUrlSloPost() string { + if o == nil { + var ret string + return ret + } + + return o.UrlSloPost +} + +// GetUrlSloPostOk returns a tuple with the UrlSloPost field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlSloPostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlSloPost, true +} + +// SetUrlSloPost sets field value +func (o *SAMLProvider) SetUrlSloPost(v string) { + o.UrlSloPost = v +} + +// GetUrlSloRedirect returns the UrlSloRedirect field value +func (o *SAMLProvider) GetUrlSloRedirect() string { + if o == nil { + var ret string + return ret + } + + return o.UrlSloRedirect +} + +// GetUrlSloRedirectOk returns a tuple with the UrlSloRedirect field value +// and a boolean to check if the value has been set. +func (o *SAMLProvider) GetUrlSloRedirectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlSloRedirect, true +} + +// SetUrlSloRedirect sets field value +func (o *SAMLProvider) SetUrlSloRedirect(v string) { + o.UrlSloRedirect = v +} + +func (o SAMLProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["acs_url"] = o.AcsUrl + if !IsNil(o.SlsUrl) { + toSerialize["sls_url"] = o.SlsUrl + } + if !IsNil(o.Audience) { + toSerialize["audience"] = o.Audience + } + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignResponse) { + toSerialize["sign_response"] = o.SignResponse + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.SignLogoutResponse) { + toSerialize["sign_logout_response"] = o.SignLogoutResponse + } + if !IsNil(o.SpBinding) { + toSerialize["sp_binding"] = o.SpBinding + } + if !IsNil(o.SlsBinding) { + toSerialize["sls_binding"] = o.SlsBinding + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.DefaultRelayState) { + toSerialize["default_relay_state"] = o.DefaultRelayState + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + toSerialize["url_download_metadata"] = o.UrlDownloadMetadata + toSerialize["url_sso_post"] = o.UrlSsoPost + toSerialize["url_sso_redirect"] = o.UrlSsoRedirect + toSerialize["url_sso_init"] = o.UrlSsoInit + toSerialize["url_slo_post"] = o.UrlSloPost + toSerialize["url_slo_redirect"] = o.UrlSloRedirect + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "acs_url", + "url_download_metadata", + "url_sso_post", + "url_sso_redirect", + "url_sso_init", + "url_slo_post", + "url_slo_redirect", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLProvider := _SAMLProvider{} + + err = json.Unmarshal(data, &varSAMLProvider) + + if err != nil { + return err + } + + *o = SAMLProvider(varSAMLProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "acs_url") + delete(additionalProperties, "sls_url") + delete(additionalProperties, "audience") + delete(additionalProperties, "issuer") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_response") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "sign_logout_response") + delete(additionalProperties, "sp_binding") + delete(additionalProperties, "sls_binding") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "default_relay_state") + delete(additionalProperties, "default_name_id_policy") + delete(additionalProperties, "url_download_metadata") + delete(additionalProperties, "url_sso_post") + delete(additionalProperties, "url_sso_redirect") + delete(additionalProperties, "url_sso_init") + delete(additionalProperties, "url_slo_post") + delete(additionalProperties, "url_slo_redirect") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLProvider struct { + value *SAMLProvider + isSet bool +} + +func (v NullableSAMLProvider) Get() *SAMLProvider { + return v.value +} + +func (v *NullableSAMLProvider) Set(val *SAMLProvider) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLProvider(val *SAMLProvider) *NullableSAMLProvider { + return &NullableSAMLProvider{value: val, isSet: true} +} + +func (v NullableSAMLProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_provider_request.go b/packages/client-go/model_saml_provider_request.go new file mode 100644 index 0000000000..0e3bf65397 --- /dev/null +++ b/packages/client-go/model_saml_provider_request.go @@ -0,0 +1,1226 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLProviderRequest{} + +// SAMLProviderRequest SAMLProvider Serializer +type SAMLProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + AcsUrl string `json:"acs_url"` + // Single Logout Service URL where the logout response should be sent. + SlsUrl *string `json:"sls_url,omitempty"` + // Value of the audience restriction field of the assertion. When left empty, no audience restriction will be added. + Audience *string `json:"audience,omitempty"` + // Also known as EntityID + Issuer *string `json:"issuer,omitempty"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignResponse *bool `json:"sign_response,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + SignLogoutResponse *bool `json:"sign_logout_response,omitempty"` + // This determines how authentik sends the response back to the Service Provider. + SpBinding *SAMLBindingsEnum `json:"sp_binding,omitempty"` + // This determines how authentik sends the logout response back to the Service Provider. + SlsBinding *SAMLBindingsEnum `json:"sls_binding,omitempty"` + // Method to use for logout. Front-channel iframe loads all logout URLs simultaneously in hidden iframes. Front-channel native uses your active browser tab to send post requests and redirect to providers. Back-channel sends logout requests directly from the server without user interaction (requires POST SLS binding). + LogoutMethod *SAMLLogoutMethods `json:"logout_method,omitempty"` + // Default relay_state value for IDP-initiated logins + DefaultRelayState *string `json:"default_relay_state,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SAMLProviderRequest SAMLProviderRequest + +// NewSAMLProviderRequest instantiates a new SAMLProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLProviderRequest(name string, authorizationFlow string, invalidationFlow string, acsUrl string) *SAMLProviderRequest { + this := SAMLProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.AcsUrl = acsUrl + return &this +} + +// NewSAMLProviderRequestWithDefaults instantiates a new SAMLProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLProviderRequestWithDefaults() *SAMLProviderRequest { + this := SAMLProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SAMLProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *SAMLProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *SAMLProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *SAMLProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *SAMLProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *SAMLProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *SAMLProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *SAMLProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *SAMLProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetAcsUrl returns the AcsUrl field value +func (o *SAMLProviderRequest) GetAcsUrl() string { + if o == nil { + var ret string + return ret + } + + return o.AcsUrl +} + +// GetAcsUrlOk returns a tuple with the AcsUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetAcsUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AcsUrl, true +} + +// SetAcsUrl sets field value +func (o *SAMLProviderRequest) SetAcsUrl(v string) { + o.AcsUrl = v +} + +// GetSlsUrl returns the SlsUrl field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSlsUrl() string { + if o == nil || IsNil(o.SlsUrl) { + var ret string + return ret + } + return *o.SlsUrl +} + +// GetSlsUrlOk returns a tuple with the SlsUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSlsUrlOk() (*string, bool) { + if o == nil || IsNil(o.SlsUrl) { + return nil, false + } + return o.SlsUrl, true +} + +// HasSlsUrl returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSlsUrl() bool { + if o != nil && !IsNil(o.SlsUrl) { + return true + } + + return false +} + +// SetSlsUrl gets a reference to the given string and assigns it to the SlsUrl field. +func (o *SAMLProviderRequest) SetSlsUrl(v string) { + o.SlsUrl = &v +} + +// GetAudience returns the Audience field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetAudience() string { + if o == nil || IsNil(o.Audience) { + var ret string + return ret + } + return *o.Audience +} + +// GetAudienceOk returns a tuple with the Audience field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetAudienceOk() (*string, bool) { + if o == nil || IsNil(o.Audience) { + return nil, false + } + return o.Audience, true +} + +// HasAudience returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasAudience() bool { + if o != nil && !IsNil(o.Audience) { + return true + } + + return false +} + +// SetAudience gets a reference to the given string and assigns it to the Audience field. +func (o *SAMLProviderRequest) SetAudience(v string) { + o.Audience = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *SAMLProviderRequest) SetIssuer(v string) { + o.Issuer = &v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *SAMLProviderRequest) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *SAMLProviderRequest) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *SAMLProviderRequest) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *SAMLProviderRequest) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *SAMLProviderRequest) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *SAMLProviderRequest) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *SAMLProviderRequest) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *SAMLProviderRequest) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *SAMLProviderRequest) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *SAMLProviderRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *SAMLProviderRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *SAMLProviderRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *SAMLProviderRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *SAMLProviderRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *SAMLProviderRequest) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *SAMLProviderRequest) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *SAMLProviderRequest) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLProviderRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLProviderRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *SAMLProviderRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *SAMLProviderRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *SAMLProviderRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *SAMLProviderRequest) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignResponse returns the SignResponse field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSignResponse() bool { + if o == nil || IsNil(o.SignResponse) { + var ret bool + return ret + } + return *o.SignResponse +} + +// GetSignResponseOk returns a tuple with the SignResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSignResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignResponse) { + return nil, false + } + return o.SignResponse, true +} + +// HasSignResponse returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSignResponse() bool { + if o != nil && !IsNil(o.SignResponse) { + return true + } + + return false +} + +// SetSignResponse gets a reference to the given bool and assigns it to the SignResponse field. +func (o *SAMLProviderRequest) SetSignResponse(v bool) { + o.SignResponse = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *SAMLProviderRequest) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetSignLogoutResponse returns the SignLogoutResponse field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSignLogoutResponse() bool { + if o == nil || IsNil(o.SignLogoutResponse) { + var ret bool + return ret + } + return *o.SignLogoutResponse +} + +// GetSignLogoutResponseOk returns a tuple with the SignLogoutResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSignLogoutResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutResponse) { + return nil, false + } + return o.SignLogoutResponse, true +} + +// HasSignLogoutResponse returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSignLogoutResponse() bool { + if o != nil && !IsNil(o.SignLogoutResponse) { + return true + } + + return false +} + +// SetSignLogoutResponse gets a reference to the given bool and assigns it to the SignLogoutResponse field. +func (o *SAMLProviderRequest) SetSignLogoutResponse(v bool) { + o.SignLogoutResponse = &v +} + +// GetSpBinding returns the SpBinding field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSpBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SpBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SpBinding +} + +// GetSpBindingOk returns a tuple with the SpBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSpBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SpBinding) { + return nil, false + } + return o.SpBinding, true +} + +// HasSpBinding returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSpBinding() bool { + if o != nil && !IsNil(o.SpBinding) { + return true + } + + return false +} + +// SetSpBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SpBinding field. +func (o *SAMLProviderRequest) SetSpBinding(v SAMLBindingsEnum) { + o.SpBinding = &v +} + +// GetSlsBinding returns the SlsBinding field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetSlsBinding() SAMLBindingsEnum { + if o == nil || IsNil(o.SlsBinding) { + var ret SAMLBindingsEnum + return ret + } + return *o.SlsBinding +} + +// GetSlsBindingOk returns a tuple with the SlsBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetSlsBindingOk() (*SAMLBindingsEnum, bool) { + if o == nil || IsNil(o.SlsBinding) { + return nil, false + } + return o.SlsBinding, true +} + +// HasSlsBinding returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasSlsBinding() bool { + if o != nil && !IsNil(o.SlsBinding) { + return true + } + + return false +} + +// SetSlsBinding gets a reference to the given SAMLBindingsEnum and assigns it to the SlsBinding field. +func (o *SAMLProviderRequest) SetSlsBinding(v SAMLBindingsEnum) { + o.SlsBinding = &v +} + +// GetLogoutMethod returns the LogoutMethod field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetLogoutMethod() SAMLLogoutMethods { + if o == nil || IsNil(o.LogoutMethod) { + var ret SAMLLogoutMethods + return ret + } + return *o.LogoutMethod +} + +// GetLogoutMethodOk returns a tuple with the LogoutMethod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetLogoutMethodOk() (*SAMLLogoutMethods, bool) { + if o == nil || IsNil(o.LogoutMethod) { + return nil, false + } + return o.LogoutMethod, true +} + +// HasLogoutMethod returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasLogoutMethod() bool { + if o != nil && !IsNil(o.LogoutMethod) { + return true + } + + return false +} + +// SetLogoutMethod gets a reference to the given SAMLLogoutMethods and assigns it to the LogoutMethod field. +func (o *SAMLProviderRequest) SetLogoutMethod(v SAMLLogoutMethods) { + o.LogoutMethod = &v +} + +// GetDefaultRelayState returns the DefaultRelayState field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetDefaultRelayState() string { + if o == nil || IsNil(o.DefaultRelayState) { + var ret string + return ret + } + return *o.DefaultRelayState +} + +// GetDefaultRelayStateOk returns a tuple with the DefaultRelayState field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetDefaultRelayStateOk() (*string, bool) { + if o == nil || IsNil(o.DefaultRelayState) { + return nil, false + } + return o.DefaultRelayState, true +} + +// HasDefaultRelayState returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasDefaultRelayState() bool { + if o != nil && !IsNil(o.DefaultRelayState) { + return true + } + + return false +} + +// SetDefaultRelayState gets a reference to the given string and assigns it to the DefaultRelayState field. +func (o *SAMLProviderRequest) SetDefaultRelayState(v string) { + o.DefaultRelayState = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *SAMLProviderRequest) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLProviderRequest) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *SAMLProviderRequest) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *SAMLProviderRequest) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +func (o SAMLProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["acs_url"] = o.AcsUrl + if !IsNil(o.SlsUrl) { + toSerialize["sls_url"] = o.SlsUrl + } + if !IsNil(o.Audience) { + toSerialize["audience"] = o.Audience + } + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignResponse) { + toSerialize["sign_response"] = o.SignResponse + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.SignLogoutResponse) { + toSerialize["sign_logout_response"] = o.SignLogoutResponse + } + if !IsNil(o.SpBinding) { + toSerialize["sp_binding"] = o.SpBinding + } + if !IsNil(o.SlsBinding) { + toSerialize["sls_binding"] = o.SlsBinding + } + if !IsNil(o.LogoutMethod) { + toSerialize["logout_method"] = o.LogoutMethod + } + if !IsNil(o.DefaultRelayState) { + toSerialize["default_relay_state"] = o.DefaultRelayState + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + "acs_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLProviderRequest := _SAMLProviderRequest{} + + err = json.Unmarshal(data, &varSAMLProviderRequest) + + if err != nil { + return err + } + + *o = SAMLProviderRequest(varSAMLProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "acs_url") + delete(additionalProperties, "sls_url") + delete(additionalProperties, "audience") + delete(additionalProperties, "issuer") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_response") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "sign_logout_response") + delete(additionalProperties, "sp_binding") + delete(additionalProperties, "sls_binding") + delete(additionalProperties, "logout_method") + delete(additionalProperties, "default_relay_state") + delete(additionalProperties, "default_name_id_policy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLProviderRequest struct { + value *SAMLProviderRequest + isSet bool +} + +func (v NullableSAMLProviderRequest) Get() *SAMLProviderRequest { + return v.value +} + +func (v *NullableSAMLProviderRequest) Set(val *SAMLProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLProviderRequest(val *SAMLProviderRequest) *NullableSAMLProviderRequest { + return &NullableSAMLProviderRequest{value: val, isSet: true} +} + +func (v NullableSAMLProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_source.go b/packages/client-go/model_saml_source.go new file mode 100644 index 0000000000..d3c4d1ffc1 --- /dev/null +++ b/packages/client-go/model_saml_source.go @@ -0,0 +1,1466 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLSource{} + +// SAMLSource SAMLSource Serializer +type SAMLSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl string `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow string `json:"pre_authentication_flow"` + // Also known as Entity ID. Defaults the Metadata URL. + Issuer *string `json:"issuer,omitempty"` + // URL that the initial Login request is sent to. + SsoUrl string `json:"sso_url"` + // Optional URL if your IDP supports Single-Logout. + SloUrl NullableString `json:"slo_url,omitempty"` + // Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done. + AllowIdpInitiated *bool `json:"allow_idp_initiated,omitempty"` + // NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + NameIdPolicy *SAMLNameIDPolicyEnum `json:"name_id_policy,omitempty"` + BindingType *BindingTypeEnum `json:"binding_type,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // Keypair used to sign outgoing Responses going to the Identity Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3). + TemporaryUserDeleteAfter *string `json:"temporary_user_delete_after,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignedAssertion *bool `json:"signed_assertion,omitempty"` + SignedResponse *bool `json:"signed_response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SAMLSource SAMLSource + +// NewSAMLSource instantiates a new SAMLSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl string, iconThemedUrls NullableThemedUrls, preAuthenticationFlow string, ssoUrl string) *SAMLSource { + this := SAMLSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.PreAuthenticationFlow = preAuthenticationFlow + this.SsoUrl = ssoUrl + return &this +} + +// NewSAMLSourceWithDefaults instantiates a new SAMLSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLSourceWithDefaults() *SAMLSource { + this := SAMLSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *SAMLSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SAMLSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SAMLSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SAMLSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SAMLSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SAMLSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SAMLSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SAMLSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *SAMLSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *SAMLSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *SAMLSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *SAMLSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *SAMLSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *SAMLSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *SAMLSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *SAMLSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *SAMLSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *SAMLSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *SAMLSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *SAMLSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *SAMLSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *SAMLSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *SAMLSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *SAMLSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *SAMLSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *SAMLSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SAMLSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SAMLSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SAMLSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SAMLSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SAMLSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SAMLSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SAMLSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *SAMLSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *SAMLSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *SAMLSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *SAMLSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *SAMLSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *SAMLSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SAMLSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *SAMLSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *SAMLSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *SAMLSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *SAMLSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *SAMLSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *SAMLSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *SAMLSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +func (o *SAMLSource) GetIconUrl() string { + if o == nil { + var ret string + return ret + } + + return o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IconUrl, true +} + +// SetIconUrl sets field value +func (o *SAMLSource) SetIconUrl(v string) { + o.IconUrl = v +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *SAMLSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *SAMLSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *SAMLSource) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *SAMLSource) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *SAMLSource) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value +func (o *SAMLSource) GetPreAuthenticationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreAuthenticationFlow, true +} + +// SetPreAuthenticationFlow sets field value +func (o *SAMLSource) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *SAMLSource) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *SAMLSource) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *SAMLSource) SetIssuer(v string) { + o.Issuer = &v +} + +// GetSsoUrl returns the SsoUrl field value +func (o *SAMLSource) GetSsoUrl() string { + if o == nil { + var ret string + return ret + } + + return o.SsoUrl +} + +// GetSsoUrlOk returns a tuple with the SsoUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetSsoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SsoUrl, true +} + +// SetSsoUrl sets field value +func (o *SAMLSource) SetSsoUrl(v string) { + o.SsoUrl = v +} + +// GetSloUrl returns the SloUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetSloUrl() string { + if o == nil || IsNil(o.SloUrl.Get()) { + var ret string + return ret + } + return *o.SloUrl.Get() +} + +// GetSloUrlOk returns a tuple with the SloUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetSloUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SloUrl.Get(), o.SloUrl.IsSet() +} + +// HasSloUrl returns a boolean if a field has been set. +func (o *SAMLSource) HasSloUrl() bool { + if o != nil && o.SloUrl.IsSet() { + return true + } + + return false +} + +// SetSloUrl gets a reference to the given NullableString and assigns it to the SloUrl field. +func (o *SAMLSource) SetSloUrl(v string) { + o.SloUrl.Set(&v) +} + +// SetSloUrlNil sets the value for SloUrl to be an explicit nil +func (o *SAMLSource) SetSloUrlNil() { + o.SloUrl.Set(nil) +} + +// UnsetSloUrl ensures that no value is present for SloUrl, not even an explicit nil +func (o *SAMLSource) UnsetSloUrl() { + o.SloUrl.Unset() +} + +// GetAllowIdpInitiated returns the AllowIdpInitiated field value if set, zero value otherwise. +func (o *SAMLSource) GetAllowIdpInitiated() bool { + if o == nil || IsNil(o.AllowIdpInitiated) { + var ret bool + return ret + } + return *o.AllowIdpInitiated +} + +// GetAllowIdpInitiatedOk returns a tuple with the AllowIdpInitiated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetAllowIdpInitiatedOk() (*bool, bool) { + if o == nil || IsNil(o.AllowIdpInitiated) { + return nil, false + } + return o.AllowIdpInitiated, true +} + +// HasAllowIdpInitiated returns a boolean if a field has been set. +func (o *SAMLSource) HasAllowIdpInitiated() bool { + if o != nil && !IsNil(o.AllowIdpInitiated) { + return true + } + + return false +} + +// SetAllowIdpInitiated gets a reference to the given bool and assigns it to the AllowIdpInitiated field. +func (o *SAMLSource) SetAllowIdpInitiated(v bool) { + o.AllowIdpInitiated = &v +} + +// GetNameIdPolicy returns the NameIdPolicy field value if set, zero value otherwise. +func (o *SAMLSource) GetNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.NameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.NameIdPolicy +} + +// GetNameIdPolicyOk returns a tuple with the NameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.NameIdPolicy) { + return nil, false + } + return o.NameIdPolicy, true +} + +// HasNameIdPolicy returns a boolean if a field has been set. +func (o *SAMLSource) HasNameIdPolicy() bool { + if o != nil && !IsNil(o.NameIdPolicy) { + return true + } + + return false +} + +// SetNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the NameIdPolicy field. +func (o *SAMLSource) SetNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.NameIdPolicy = &v +} + +// GetBindingType returns the BindingType field value if set, zero value otherwise. +func (o *SAMLSource) GetBindingType() BindingTypeEnum { + if o == nil || IsNil(o.BindingType) { + var ret BindingTypeEnum + return ret + } + return *o.BindingType +} + +// GetBindingTypeOk returns a tuple with the BindingType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetBindingTypeOk() (*BindingTypeEnum, bool) { + if o == nil || IsNil(o.BindingType) { + return nil, false + } + return o.BindingType, true +} + +// HasBindingType returns a boolean if a field has been set. +func (o *SAMLSource) HasBindingType() bool { + if o != nil && !IsNil(o.BindingType) { + return true + } + + return false +} + +// SetBindingType gets a reference to the given BindingTypeEnum and assigns it to the BindingType field. +func (o *SAMLSource) SetBindingType(v BindingTypeEnum) { + o.BindingType = &v +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *SAMLSource) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *SAMLSource) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *SAMLSource) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *SAMLSource) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *SAMLSource) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *SAMLSource) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *SAMLSource) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *SAMLSource) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *SAMLSource) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *SAMLSource) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *SAMLSource) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *SAMLSource) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *SAMLSource) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *SAMLSource) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetTemporaryUserDeleteAfter returns the TemporaryUserDeleteAfter field value if set, zero value otherwise. +func (o *SAMLSource) GetTemporaryUserDeleteAfter() string { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + var ret string + return ret + } + return *o.TemporaryUserDeleteAfter +} + +// GetTemporaryUserDeleteAfterOk returns a tuple with the TemporaryUserDeleteAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetTemporaryUserDeleteAfterOk() (*string, bool) { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + return nil, false + } + return o.TemporaryUserDeleteAfter, true +} + +// HasTemporaryUserDeleteAfter returns a boolean if a field has been set. +func (o *SAMLSource) HasTemporaryUserDeleteAfter() bool { + if o != nil && !IsNil(o.TemporaryUserDeleteAfter) { + return true + } + + return false +} + +// SetTemporaryUserDeleteAfter gets a reference to the given string and assigns it to the TemporaryUserDeleteAfter field. +func (o *SAMLSource) SetTemporaryUserDeleteAfter(v string) { + o.TemporaryUserDeleteAfter = &v +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSource) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSource) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *SAMLSource) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *SAMLSource) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *SAMLSource) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *SAMLSource) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignedAssertion returns the SignedAssertion field value if set, zero value otherwise. +func (o *SAMLSource) GetSignedAssertion() bool { + if o == nil || IsNil(o.SignedAssertion) { + var ret bool + return ret + } + return *o.SignedAssertion +} + +// GetSignedAssertionOk returns a tuple with the SignedAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetSignedAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignedAssertion) { + return nil, false + } + return o.SignedAssertion, true +} + +// HasSignedAssertion returns a boolean if a field has been set. +func (o *SAMLSource) HasSignedAssertion() bool { + if o != nil && !IsNil(o.SignedAssertion) { + return true + } + + return false +} + +// SetSignedAssertion gets a reference to the given bool and assigns it to the SignedAssertion field. +func (o *SAMLSource) SetSignedAssertion(v bool) { + o.SignedAssertion = &v +} + +// GetSignedResponse returns the SignedResponse field value if set, zero value otherwise. +func (o *SAMLSource) GetSignedResponse() bool { + if o == nil || IsNil(o.SignedResponse) { + var ret bool + return ret + } + return *o.SignedResponse +} + +// GetSignedResponseOk returns a tuple with the SignedResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSource) GetSignedResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignedResponse) { + return nil, false + } + return o.SignedResponse, true +} + +// HasSignedResponse returns a boolean if a field has been set. +func (o *SAMLSource) HasSignedResponse() bool { + if o != nil && !IsNil(o.SignedResponse) { + return true + } + + return false +} + +// SetSignedResponse gets a reference to the given bool and assigns it to the SignedResponse field. +func (o *SAMLSource) SetSignedResponse(v bool) { + o.SignedResponse = &v +} + +func (o SAMLSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + toSerialize["sso_url"] = o.SsoUrl + if o.SloUrl.IsSet() { + toSerialize["slo_url"] = o.SloUrl.Get() + } + if !IsNil(o.AllowIdpInitiated) { + toSerialize["allow_idp_initiated"] = o.AllowIdpInitiated + } + if !IsNil(o.NameIdPolicy) { + toSerialize["name_id_policy"] = o.NameIdPolicy + } + if !IsNil(o.BindingType) { + toSerialize["binding_type"] = o.BindingType + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if !IsNil(o.TemporaryUserDeleteAfter) { + toSerialize["temporary_user_delete_after"] = o.TemporaryUserDeleteAfter + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignedAssertion) { + toSerialize["signed_assertion"] = o.SignedAssertion + } + if !IsNil(o.SignedResponse) { + toSerialize["signed_response"] = o.SignedResponse + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "pre_authentication_flow", + "sso_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLSource := _SAMLSource{} + + err = json.Unmarshal(data, &varSAMLSource) + + if err != nil { + return err + } + + *o = SAMLSource(varSAMLSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "pre_authentication_flow") + delete(additionalProperties, "issuer") + delete(additionalProperties, "sso_url") + delete(additionalProperties, "slo_url") + delete(additionalProperties, "allow_idp_initiated") + delete(additionalProperties, "name_id_policy") + delete(additionalProperties, "binding_type") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "temporary_user_delete_after") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "signed_assertion") + delete(additionalProperties, "signed_response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLSource struct { + value *SAMLSource + isSet bool +} + +func (v NullableSAMLSource) Get() *SAMLSource { + return v.value +} + +func (v *NullableSAMLSource) Set(val *SAMLSource) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLSource) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLSource(val *SAMLSource) *NullableSAMLSource { + return &NullableSAMLSource{value: val, isSet: true} +} + +func (v NullableSAMLSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_source_property_mapping.go b/packages/client-go/model_saml_source_property_mapping.go new file mode 100644 index 0000000000..02791b8a16 --- /dev/null +++ b/packages/client-go/model_saml_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLSourcePropertyMapping{} + +// SAMLSourcePropertyMapping SAMLSourcePropertyMapping Serializer +type SAMLSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _SAMLSourcePropertyMapping SAMLSourcePropertyMapping + +// NewSAMLSourcePropertyMapping instantiates a new SAMLSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *SAMLSourcePropertyMapping { + this := SAMLSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewSAMLSourcePropertyMappingWithDefaults instantiates a new SAMLSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLSourcePropertyMappingWithDefaults() *SAMLSourcePropertyMapping { + this := SAMLSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *SAMLSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SAMLSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SAMLSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SAMLSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SAMLSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SAMLSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SAMLSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SAMLSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SAMLSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *SAMLSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SAMLSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SAMLSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SAMLSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SAMLSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SAMLSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SAMLSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SAMLSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o SAMLSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLSourcePropertyMapping := _SAMLSourcePropertyMapping{} + + err = json.Unmarshal(data, &varSAMLSourcePropertyMapping) + + if err != nil { + return err + } + + *o = SAMLSourcePropertyMapping(varSAMLSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLSourcePropertyMapping struct { + value *SAMLSourcePropertyMapping + isSet bool +} + +func (v NullableSAMLSourcePropertyMapping) Get() *SAMLSourcePropertyMapping { + return v.value +} + +func (v *NullableSAMLSourcePropertyMapping) Set(val *SAMLSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLSourcePropertyMapping(val *SAMLSourcePropertyMapping) *NullableSAMLSourcePropertyMapping { + return &NullableSAMLSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableSAMLSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_source_property_mapping_request.go b/packages/client-go/model_saml_source_property_mapping_request.go new file mode 100644 index 0000000000..835eb488b2 --- /dev/null +++ b/packages/client-go/model_saml_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLSourcePropertyMappingRequest{} + +// SAMLSourcePropertyMappingRequest SAMLSourcePropertyMapping Serializer +type SAMLSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _SAMLSourcePropertyMappingRequest SAMLSourcePropertyMappingRequest + +// NewSAMLSourcePropertyMappingRequest instantiates a new SAMLSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLSourcePropertyMappingRequest(name string, expression string) *SAMLSourcePropertyMappingRequest { + this := SAMLSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewSAMLSourcePropertyMappingRequestWithDefaults instantiates a new SAMLSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLSourcePropertyMappingRequestWithDefaults() *SAMLSourcePropertyMappingRequest { + this := SAMLSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SAMLSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SAMLSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SAMLSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SAMLSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SAMLSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SAMLSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SAMLSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SAMLSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o SAMLSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLSourcePropertyMappingRequest := _SAMLSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varSAMLSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = SAMLSourcePropertyMappingRequest(varSAMLSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLSourcePropertyMappingRequest struct { + value *SAMLSourcePropertyMappingRequest + isSet bool +} + +func (v NullableSAMLSourcePropertyMappingRequest) Get() *SAMLSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableSAMLSourcePropertyMappingRequest) Set(val *SAMLSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLSourcePropertyMappingRequest(val *SAMLSourcePropertyMappingRequest) *NullableSAMLSourcePropertyMappingRequest { + return &NullableSAMLSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableSAMLSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_saml_source_request.go b/packages/client-go/model_saml_source_request.go new file mode 100644 index 0000000000..123106aa1e --- /dev/null +++ b/packages/client-go/model_saml_source_request.go @@ -0,0 +1,1225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SAMLSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SAMLSourceRequest{} + +// SAMLSourceRequest SAMLSource Serializer +type SAMLSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // How the source determines if an existing group should be used or a new group created. + GroupMatchingMode *GroupMatchingModeEnum `json:"group_matching_mode,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow string `json:"pre_authentication_flow"` + // Also known as Entity ID. Defaults the Metadata URL. + Issuer *string `json:"issuer,omitempty"` + // URL that the initial Login request is sent to. + SsoUrl string `json:"sso_url"` + // Optional URL if your IDP supports Single-Logout. + SloUrl NullableString `json:"slo_url,omitempty"` + // Allows authentication flows initiated by the IdP. This can be a security risk, as no validation of the request ID is done. + AllowIdpInitiated *bool `json:"allow_idp_initiated,omitempty"` + // NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. + NameIdPolicy *SAMLNameIDPolicyEnum `json:"name_id_policy,omitempty"` + BindingType *BindingTypeEnum `json:"binding_type,omitempty"` + // When selected, incoming assertion's Signatures will be validated against this certificate. To allow unsigned Requests, leave on default. + VerificationKp NullableString `json:"verification_kp,omitempty"` + // Keypair used to sign outgoing Responses going to the Identity Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Time offset when temporary users should be deleted. This only applies if your IDP uses the NameID Format 'transient', and the user doesn't log out manually. (Format: hours=1;minutes=2;seconds=3). + TemporaryUserDeleteAfter *string `json:"temporary_user_delete_after,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignedAssertion *bool `json:"signed_assertion,omitempty"` + SignedResponse *bool `json:"signed_response,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SAMLSourceRequest SAMLSourceRequest + +// NewSAMLSourceRequest instantiates a new SAMLSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSAMLSourceRequest(name string, slug string, preAuthenticationFlow string, ssoUrl string) *SAMLSourceRequest { + this := SAMLSourceRequest{} + this.Name = name + this.Slug = slug + this.PreAuthenticationFlow = preAuthenticationFlow + this.SsoUrl = ssoUrl + return &this +} + +// NewSAMLSourceRequestWithDefaults instantiates a new SAMLSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSAMLSourceRequestWithDefaults() *SAMLSourceRequest { + this := SAMLSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SAMLSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SAMLSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SAMLSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SAMLSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SAMLSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *SAMLSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *SAMLSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *SAMLSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *SAMLSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *SAMLSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *SAMLSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *SAMLSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *SAMLSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *SAMLSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *SAMLSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *SAMLSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *SAMLSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *SAMLSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetGroupMatchingMode returns the GroupMatchingMode field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetGroupMatchingMode() GroupMatchingModeEnum { + if o == nil || IsNil(o.GroupMatchingMode) { + var ret GroupMatchingModeEnum + return ret + } + return *o.GroupMatchingMode +} + +// GetGroupMatchingModeOk returns a tuple with the GroupMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetGroupMatchingModeOk() (*GroupMatchingModeEnum, bool) { + if o == nil || IsNil(o.GroupMatchingMode) { + return nil, false + } + return o.GroupMatchingMode, true +} + +// HasGroupMatchingMode returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasGroupMatchingMode() bool { + if o != nil && !IsNil(o.GroupMatchingMode) { + return true + } + + return false +} + +// SetGroupMatchingMode gets a reference to the given GroupMatchingModeEnum and assigns it to the GroupMatchingMode field. +func (o *SAMLSourceRequest) SetGroupMatchingMode(v GroupMatchingModeEnum) { + o.GroupMatchingMode = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value +func (o *SAMLSourceRequest) GetPreAuthenticationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreAuthenticationFlow, true +} + +// SetPreAuthenticationFlow sets field value +func (o *SAMLSourceRequest) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetIssuer() string { + if o == nil || IsNil(o.Issuer) { + var ret string + return ret + } + return *o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetIssuerOk() (*string, bool) { + if o == nil || IsNil(o.Issuer) { + return nil, false + } + return o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasIssuer() bool { + if o != nil && !IsNil(o.Issuer) { + return true + } + + return false +} + +// SetIssuer gets a reference to the given string and assigns it to the Issuer field. +func (o *SAMLSourceRequest) SetIssuer(v string) { + o.Issuer = &v +} + +// GetSsoUrl returns the SsoUrl field value +func (o *SAMLSourceRequest) GetSsoUrl() string { + if o == nil { + var ret string + return ret + } + + return o.SsoUrl +} + +// GetSsoUrlOk returns a tuple with the SsoUrl field value +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetSsoUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SsoUrl, true +} + +// SetSsoUrl sets field value +func (o *SAMLSourceRequest) SetSsoUrl(v string) { + o.SsoUrl = v +} + +// GetSloUrl returns the SloUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetSloUrl() string { + if o == nil || IsNil(o.SloUrl.Get()) { + var ret string + return ret + } + return *o.SloUrl.Get() +} + +// GetSloUrlOk returns a tuple with the SloUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetSloUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SloUrl.Get(), o.SloUrl.IsSet() +} + +// HasSloUrl returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasSloUrl() bool { + if o != nil && o.SloUrl.IsSet() { + return true + } + + return false +} + +// SetSloUrl gets a reference to the given NullableString and assigns it to the SloUrl field. +func (o *SAMLSourceRequest) SetSloUrl(v string) { + o.SloUrl.Set(&v) +} + +// SetSloUrlNil sets the value for SloUrl to be an explicit nil +func (o *SAMLSourceRequest) SetSloUrlNil() { + o.SloUrl.Set(nil) +} + +// UnsetSloUrl ensures that no value is present for SloUrl, not even an explicit nil +func (o *SAMLSourceRequest) UnsetSloUrl() { + o.SloUrl.Unset() +} + +// GetAllowIdpInitiated returns the AllowIdpInitiated field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetAllowIdpInitiated() bool { + if o == nil || IsNil(o.AllowIdpInitiated) { + var ret bool + return ret + } + return *o.AllowIdpInitiated +} + +// GetAllowIdpInitiatedOk returns a tuple with the AllowIdpInitiated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetAllowIdpInitiatedOk() (*bool, bool) { + if o == nil || IsNil(o.AllowIdpInitiated) { + return nil, false + } + return o.AllowIdpInitiated, true +} + +// HasAllowIdpInitiated returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasAllowIdpInitiated() bool { + if o != nil && !IsNil(o.AllowIdpInitiated) { + return true + } + + return false +} + +// SetAllowIdpInitiated gets a reference to the given bool and assigns it to the AllowIdpInitiated field. +func (o *SAMLSourceRequest) SetAllowIdpInitiated(v bool) { + o.AllowIdpInitiated = &v +} + +// GetNameIdPolicy returns the NameIdPolicy field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.NameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.NameIdPolicy +} + +// GetNameIdPolicyOk returns a tuple with the NameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.NameIdPolicy) { + return nil, false + } + return o.NameIdPolicy, true +} + +// HasNameIdPolicy returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasNameIdPolicy() bool { + if o != nil && !IsNil(o.NameIdPolicy) { + return true + } + + return false +} + +// SetNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the NameIdPolicy field. +func (o *SAMLSourceRequest) SetNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.NameIdPolicy = &v +} + +// GetBindingType returns the BindingType field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetBindingType() BindingTypeEnum { + if o == nil || IsNil(o.BindingType) { + var ret BindingTypeEnum + return ret + } + return *o.BindingType +} + +// GetBindingTypeOk returns a tuple with the BindingType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetBindingTypeOk() (*BindingTypeEnum, bool) { + if o == nil || IsNil(o.BindingType) { + return nil, false + } + return o.BindingType, true +} + +// HasBindingType returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasBindingType() bool { + if o != nil && !IsNil(o.BindingType) { + return true + } + + return false +} + +// SetBindingType gets a reference to the given BindingTypeEnum and assigns it to the BindingType field. +func (o *SAMLSourceRequest) SetBindingType(v BindingTypeEnum) { + o.BindingType = &v +} + +// GetVerificationKp returns the VerificationKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetVerificationKp() string { + if o == nil || IsNil(o.VerificationKp.Get()) { + var ret string + return ret + } + return *o.VerificationKp.Get() +} + +// GetVerificationKpOk returns a tuple with the VerificationKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetVerificationKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VerificationKp.Get(), o.VerificationKp.IsSet() +} + +// HasVerificationKp returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasVerificationKp() bool { + if o != nil && o.VerificationKp.IsSet() { + return true + } + + return false +} + +// SetVerificationKp gets a reference to the given NullableString and assigns it to the VerificationKp field. +func (o *SAMLSourceRequest) SetVerificationKp(v string) { + o.VerificationKp.Set(&v) +} + +// SetVerificationKpNil sets the value for VerificationKp to be an explicit nil +func (o *SAMLSourceRequest) SetVerificationKpNil() { + o.VerificationKp.Set(nil) +} + +// UnsetVerificationKp ensures that no value is present for VerificationKp, not even an explicit nil +func (o *SAMLSourceRequest) UnsetVerificationKp() { + o.VerificationKp.Unset() +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *SAMLSourceRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *SAMLSourceRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *SAMLSourceRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *SAMLSourceRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *SAMLSourceRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetTemporaryUserDeleteAfter returns the TemporaryUserDeleteAfter field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetTemporaryUserDeleteAfter() string { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + var ret string + return ret + } + return *o.TemporaryUserDeleteAfter +} + +// GetTemporaryUserDeleteAfterOk returns a tuple with the TemporaryUserDeleteAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetTemporaryUserDeleteAfterOk() (*string, bool) { + if o == nil || IsNil(o.TemporaryUserDeleteAfter) { + return nil, false + } + return o.TemporaryUserDeleteAfter, true +} + +// HasTemporaryUserDeleteAfter returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasTemporaryUserDeleteAfter() bool { + if o != nil && !IsNil(o.TemporaryUserDeleteAfter) { + return true + } + + return false +} + +// SetTemporaryUserDeleteAfter gets a reference to the given string and assigns it to the TemporaryUserDeleteAfter field. +func (o *SAMLSourceRequest) SetTemporaryUserDeleteAfter(v string) { + o.TemporaryUserDeleteAfter = &v +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SAMLSourceRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SAMLSourceRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *SAMLSourceRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *SAMLSourceRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *SAMLSourceRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignedAssertion returns the SignedAssertion field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetSignedAssertion() bool { + if o == nil || IsNil(o.SignedAssertion) { + var ret bool + return ret + } + return *o.SignedAssertion +} + +// GetSignedAssertionOk returns a tuple with the SignedAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetSignedAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignedAssertion) { + return nil, false + } + return o.SignedAssertion, true +} + +// HasSignedAssertion returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasSignedAssertion() bool { + if o != nil && !IsNil(o.SignedAssertion) { + return true + } + + return false +} + +// SetSignedAssertion gets a reference to the given bool and assigns it to the SignedAssertion field. +func (o *SAMLSourceRequest) SetSignedAssertion(v bool) { + o.SignedAssertion = &v +} + +// GetSignedResponse returns the SignedResponse field value if set, zero value otherwise. +func (o *SAMLSourceRequest) GetSignedResponse() bool { + if o == nil || IsNil(o.SignedResponse) { + var ret bool + return ret + } + return *o.SignedResponse +} + +// GetSignedResponseOk returns a tuple with the SignedResponse field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SAMLSourceRequest) GetSignedResponseOk() (*bool, bool) { + if o == nil || IsNil(o.SignedResponse) { + return nil, false + } + return o.SignedResponse, true +} + +// HasSignedResponse returns a boolean if a field has been set. +func (o *SAMLSourceRequest) HasSignedResponse() bool { + if o != nil && !IsNil(o.SignedResponse) { + return true + } + + return false +} + +// SetSignedResponse gets a reference to the given bool and assigns it to the SignedResponse field. +func (o *SAMLSourceRequest) SetSignedResponse(v bool) { + o.SignedResponse = &v +} + +func (o SAMLSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SAMLSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + if !IsNil(o.GroupMatchingMode) { + toSerialize["group_matching_mode"] = o.GroupMatchingMode + } + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + if !IsNil(o.Issuer) { + toSerialize["issuer"] = o.Issuer + } + toSerialize["sso_url"] = o.SsoUrl + if o.SloUrl.IsSet() { + toSerialize["slo_url"] = o.SloUrl.Get() + } + if !IsNil(o.AllowIdpInitiated) { + toSerialize["allow_idp_initiated"] = o.AllowIdpInitiated + } + if !IsNil(o.NameIdPolicy) { + toSerialize["name_id_policy"] = o.NameIdPolicy + } + if !IsNil(o.BindingType) { + toSerialize["binding_type"] = o.BindingType + } + if o.VerificationKp.IsSet() { + toSerialize["verification_kp"] = o.VerificationKp.Get() + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if !IsNil(o.TemporaryUserDeleteAfter) { + toSerialize["temporary_user_delete_after"] = o.TemporaryUserDeleteAfter + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignedAssertion) { + toSerialize["signed_assertion"] = o.SignedAssertion + } + if !IsNil(o.SignedResponse) { + toSerialize["signed_response"] = o.SignedResponse + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SAMLSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "pre_authentication_flow", + "sso_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSAMLSourceRequest := _SAMLSourceRequest{} + + err = json.Unmarshal(data, &varSAMLSourceRequest) + + if err != nil { + return err + } + + *o = SAMLSourceRequest(varSAMLSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "group_matching_mode") + delete(additionalProperties, "pre_authentication_flow") + delete(additionalProperties, "issuer") + delete(additionalProperties, "sso_url") + delete(additionalProperties, "slo_url") + delete(additionalProperties, "allow_idp_initiated") + delete(additionalProperties, "name_id_policy") + delete(additionalProperties, "binding_type") + delete(additionalProperties, "verification_kp") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "temporary_user_delete_after") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "signed_assertion") + delete(additionalProperties, "signed_response") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSAMLSourceRequest struct { + value *SAMLSourceRequest + isSet bool +} + +func (v NullableSAMLSourceRequest) Get() *SAMLSourceRequest { + return v.value +} + +func (v *NullableSAMLSourceRequest) Set(val *SAMLSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSAMLSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSAMLSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSAMLSourceRequest(val *SAMLSourceRequest) *NullableSAMLSourceRequest { + return &NullableSAMLSourceRequest{value: val, isSet: true} +} + +func (v NullableSAMLSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSAMLSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_schedule.go b/packages/client-go/model_schedule.go new file mode 100644 index 0000000000..19915d66ef --- /dev/null +++ b/packages/client-go/model_schedule.go @@ -0,0 +1,524 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Schedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schedule{} + +// Schedule struct for Schedule +type Schedule struct { + Id string `json:"id"` + // Unique schedule identifier + Identifier NullableString `json:"identifier"` + Uid string `json:"uid"` + // Dramatiq actor to call + ActorName string `json:"actor_name"` + RelObjAppLabel string `json:"rel_obj_app_label"` + RelObjModel string `json:"rel_obj_model"` + RelObjId NullableString `json:"rel_obj_id,omitempty"` + // When to schedule tasks + Crontab string `json:"crontab"` + // Pause this schedule + Paused *bool `json:"paused,omitempty"` + NextRun time.Time `json:"next_run"` + Description NullableString `json:"description"` + LastTaskStatus NullableLastTaskStatusEnum `json:"last_task_status"` + AdditionalProperties map[string]interface{} +} + +type _Schedule Schedule + +// NewSchedule instantiates a new Schedule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSchedule(id string, identifier NullableString, uid string, actorName string, relObjAppLabel string, relObjModel string, crontab string, nextRun time.Time, description NullableString, lastTaskStatus NullableLastTaskStatusEnum) *Schedule { + this := Schedule{} + this.Id = id + this.Identifier = identifier + this.Uid = uid + this.ActorName = actorName + this.RelObjAppLabel = relObjAppLabel + this.RelObjModel = relObjModel + this.Crontab = crontab + this.NextRun = nextRun + this.Description = description + this.LastTaskStatus = lastTaskStatus + return &this +} + +// NewScheduleWithDefaults instantiates a new Schedule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleWithDefaults() *Schedule { + this := Schedule{} + return &this +} + +// GetId returns the Id field value +func (o *Schedule) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Schedule) SetId(v string) { + o.Id = v +} + +// GetIdentifier returns the Identifier field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Schedule) GetIdentifier() string { + if o == nil || o.Identifier.Get() == nil { + var ret string + return ret + } + + return *o.Identifier.Get() +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Identifier.Get(), o.Identifier.IsSet() +} + +// SetIdentifier sets field value +func (o *Schedule) SetIdentifier(v string) { + o.Identifier.Set(&v) +} + +// GetUid returns the Uid field value +func (o *Schedule) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *Schedule) SetUid(v string) { + o.Uid = v +} + +// GetActorName returns the ActorName field value +func (o *Schedule) GetActorName() string { + if o == nil { + var ret string + return ret + } + + return o.ActorName +} + +// GetActorNameOk returns a tuple with the ActorName field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetActorNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorName, true +} + +// SetActorName sets field value +func (o *Schedule) SetActorName(v string) { + o.ActorName = v +} + +// GetRelObjAppLabel returns the RelObjAppLabel field value +func (o *Schedule) GetRelObjAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.RelObjAppLabel +} + +// GetRelObjAppLabelOk returns a tuple with the RelObjAppLabel field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetRelObjAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RelObjAppLabel, true +} + +// SetRelObjAppLabel sets field value +func (o *Schedule) SetRelObjAppLabel(v string) { + o.RelObjAppLabel = v +} + +// GetRelObjModel returns the RelObjModel field value +func (o *Schedule) GetRelObjModel() string { + if o == nil { + var ret string + return ret + } + + return o.RelObjModel +} + +// GetRelObjModelOk returns a tuple with the RelObjModel field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetRelObjModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RelObjModel, true +} + +// SetRelObjModel sets field value +func (o *Schedule) SetRelObjModel(v string) { + o.RelObjModel = v +} + +// GetRelObjId returns the RelObjId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Schedule) GetRelObjId() string { + if o == nil || IsNil(o.RelObjId.Get()) { + var ret string + return ret + } + return *o.RelObjId.Get() +} + +// GetRelObjIdOk returns a tuple with the RelObjId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetRelObjIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RelObjId.Get(), o.RelObjId.IsSet() +} + +// HasRelObjId returns a boolean if a field has been set. +func (o *Schedule) HasRelObjId() bool { + if o != nil && o.RelObjId.IsSet() { + return true + } + + return false +} + +// SetRelObjId gets a reference to the given NullableString and assigns it to the RelObjId field. +func (o *Schedule) SetRelObjId(v string) { + o.RelObjId.Set(&v) +} + +// SetRelObjIdNil sets the value for RelObjId to be an explicit nil +func (o *Schedule) SetRelObjIdNil() { + o.RelObjId.Set(nil) +} + +// UnsetRelObjId ensures that no value is present for RelObjId, not even an explicit nil +func (o *Schedule) UnsetRelObjId() { + o.RelObjId.Unset() +} + +// GetCrontab returns the Crontab field value +func (o *Schedule) GetCrontab() string { + if o == nil { + var ret string + return ret + } + + return o.Crontab +} + +// GetCrontabOk returns a tuple with the Crontab field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetCrontabOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Crontab, true +} + +// SetCrontab sets field value +func (o *Schedule) SetCrontab(v string) { + o.Crontab = v +} + +// GetPaused returns the Paused field value if set, zero value otherwise. +func (o *Schedule) GetPaused() bool { + if o == nil || IsNil(o.Paused) { + var ret bool + return ret + } + return *o.Paused +} + +// GetPausedOk returns a tuple with the Paused field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetPausedOk() (*bool, bool) { + if o == nil || IsNil(o.Paused) { + return nil, false + } + return o.Paused, true +} + +// HasPaused returns a boolean if a field has been set. +func (o *Schedule) HasPaused() bool { + if o != nil && !IsNil(o.Paused) { + return true + } + + return false +} + +// SetPaused gets a reference to the given bool and assigns it to the Paused field. +func (o *Schedule) SetPaused(v bool) { + o.Paused = &v +} + +// GetNextRun returns the NextRun field value +func (o *Schedule) GetNextRun() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.NextRun +} + +// GetNextRunOk returns a tuple with the NextRun field value +// and a boolean to check if the value has been set. +func (o *Schedule) GetNextRunOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.NextRun, true +} + +// SetNextRun sets field value +func (o *Schedule) SetNextRun(v time.Time) { + o.NextRun = v +} + +// GetDescription returns the Description field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Schedule) GetDescription() string { + if o == nil || o.Description.Get() == nil { + var ret string + return ret + } + + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// SetDescription sets field value +func (o *Schedule) SetDescription(v string) { + o.Description.Set(&v) +} + +// GetLastTaskStatus returns the LastTaskStatus field value +// If the value is explicit nil, the zero value for LastTaskStatusEnum will be returned +func (o *Schedule) GetLastTaskStatus() LastTaskStatusEnum { + if o == nil || o.LastTaskStatus.Get() == nil { + var ret LastTaskStatusEnum + return ret + } + + return *o.LastTaskStatus.Get() +} + +// GetLastTaskStatusOk returns a tuple with the LastTaskStatus field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Schedule) GetLastTaskStatusOk() (*LastTaskStatusEnum, bool) { + if o == nil { + return nil, false + } + return o.LastTaskStatus.Get(), o.LastTaskStatus.IsSet() +} + +// SetLastTaskStatus sets field value +func (o *Schedule) SetLastTaskStatus(v LastTaskStatusEnum) { + o.LastTaskStatus.Set(&v) +} + +func (o Schedule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["identifier"] = o.Identifier.Get() + toSerialize["uid"] = o.Uid + toSerialize["actor_name"] = o.ActorName + toSerialize["rel_obj_app_label"] = o.RelObjAppLabel + toSerialize["rel_obj_model"] = o.RelObjModel + if o.RelObjId.IsSet() { + toSerialize["rel_obj_id"] = o.RelObjId.Get() + } + toSerialize["crontab"] = o.Crontab + if !IsNil(o.Paused) { + toSerialize["paused"] = o.Paused + } + toSerialize["next_run"] = o.NextRun + toSerialize["description"] = o.Description.Get() + toSerialize["last_task_status"] = o.LastTaskStatus.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schedule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "identifier", + "uid", + "actor_name", + "rel_obj_app_label", + "rel_obj_model", + "crontab", + "next_run", + "description", + "last_task_status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSchedule := _Schedule{} + + err = json.Unmarshal(data, &varSchedule) + + if err != nil { + return err + } + + *o = Schedule(varSchedule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "identifier") + delete(additionalProperties, "uid") + delete(additionalProperties, "actor_name") + delete(additionalProperties, "rel_obj_app_label") + delete(additionalProperties, "rel_obj_model") + delete(additionalProperties, "rel_obj_id") + delete(additionalProperties, "crontab") + delete(additionalProperties, "paused") + delete(additionalProperties, "next_run") + delete(additionalProperties, "description") + delete(additionalProperties, "last_task_status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchedule struct { + value *Schedule + isSet bool +} + +func (v NullableSchedule) Get() *Schedule { + return v.value +} + +func (v *NullableSchedule) Set(val *Schedule) { + v.value = val + v.isSet = true +} + +func (v NullableSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchedule(val *Schedule) *NullableSchedule { + return &NullableSchedule{value: val, isSet: true} +} + +func (v NullableSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_schedule_request.go b/packages/client-go/model_schedule_request.go new file mode 100644 index 0000000000..4107416c68 --- /dev/null +++ b/packages/client-go/model_schedule_request.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ScheduleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScheduleRequest{} + +// ScheduleRequest struct for ScheduleRequest +type ScheduleRequest struct { + RelObjId NullableString `json:"rel_obj_id,omitempty"` + // When to schedule tasks + Crontab string `json:"crontab"` + // Pause this schedule + Paused *bool `json:"paused,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ScheduleRequest ScheduleRequest + +// NewScheduleRequest instantiates a new ScheduleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScheduleRequest(crontab string) *ScheduleRequest { + this := ScheduleRequest{} + this.Crontab = crontab + return &this +} + +// NewScheduleRequestWithDefaults instantiates a new ScheduleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScheduleRequestWithDefaults() *ScheduleRequest { + this := ScheduleRequest{} + return &this +} + +// GetRelObjId returns the RelObjId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScheduleRequest) GetRelObjId() string { + if o == nil || IsNil(o.RelObjId.Get()) { + var ret string + return ret + } + return *o.RelObjId.Get() +} + +// GetRelObjIdOk returns a tuple with the RelObjId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScheduleRequest) GetRelObjIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RelObjId.Get(), o.RelObjId.IsSet() +} + +// HasRelObjId returns a boolean if a field has been set. +func (o *ScheduleRequest) HasRelObjId() bool { + if o != nil && o.RelObjId.IsSet() { + return true + } + + return false +} + +// SetRelObjId gets a reference to the given NullableString and assigns it to the RelObjId field. +func (o *ScheduleRequest) SetRelObjId(v string) { + o.RelObjId.Set(&v) +} + +// SetRelObjIdNil sets the value for RelObjId to be an explicit nil +func (o *ScheduleRequest) SetRelObjIdNil() { + o.RelObjId.Set(nil) +} + +// UnsetRelObjId ensures that no value is present for RelObjId, not even an explicit nil +func (o *ScheduleRequest) UnsetRelObjId() { + o.RelObjId.Unset() +} + +// GetCrontab returns the Crontab field value +func (o *ScheduleRequest) GetCrontab() string { + if o == nil { + var ret string + return ret + } + + return o.Crontab +} + +// GetCrontabOk returns a tuple with the Crontab field value +// and a boolean to check if the value has been set. +func (o *ScheduleRequest) GetCrontabOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Crontab, true +} + +// SetCrontab sets field value +func (o *ScheduleRequest) SetCrontab(v string) { + o.Crontab = v +} + +// GetPaused returns the Paused field value if set, zero value otherwise. +func (o *ScheduleRequest) GetPaused() bool { + if o == nil || IsNil(o.Paused) { + var ret bool + return ret + } + return *o.Paused +} + +// GetPausedOk returns a tuple with the Paused field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScheduleRequest) GetPausedOk() (*bool, bool) { + if o == nil || IsNil(o.Paused) { + return nil, false + } + return o.Paused, true +} + +// HasPaused returns a boolean if a field has been set. +func (o *ScheduleRequest) HasPaused() bool { + if o != nil && !IsNil(o.Paused) { + return true + } + + return false +} + +// SetPaused gets a reference to the given bool and assigns it to the Paused field. +func (o *ScheduleRequest) SetPaused(v bool) { + o.Paused = &v +} + +func (o ScheduleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScheduleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.RelObjId.IsSet() { + toSerialize["rel_obj_id"] = o.RelObjId.Get() + } + toSerialize["crontab"] = o.Crontab + if !IsNil(o.Paused) { + toSerialize["paused"] = o.Paused + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ScheduleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "crontab", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScheduleRequest := _ScheduleRequest{} + + err = json.Unmarshal(data, &varScheduleRequest) + + if err != nil { + return err + } + + *o = ScheduleRequest(varScheduleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "rel_obj_id") + delete(additionalProperties, "crontab") + delete(additionalProperties, "paused") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableScheduleRequest struct { + value *ScheduleRequest + isSet bool +} + +func (v NullableScheduleRequest) Get() *ScheduleRequest { + return v.value +} + +func (v *NullableScheduleRequest) Set(val *ScheduleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableScheduleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableScheduleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScheduleRequest(val *ScheduleRequest) *NullableScheduleRequest { + return &NullableScheduleRequest{value: val, isSet: true} +} + +func (v NullableScheduleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScheduleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_authentication_mode_enum.go b/packages/client-go/model_scim_authentication_mode_enum.go new file mode 100644 index 0000000000..6357b27420 --- /dev/null +++ b/packages/client-go/model_scim_authentication_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SCIMAuthenticationModeEnum the model 'SCIMAuthenticationModeEnum' +type SCIMAuthenticationModeEnum string + +// List of SCIMAuthenticationModeEnum +const ( + SCIMAUTHENTICATIONMODEENUM_TOKEN SCIMAuthenticationModeEnum = "token" + SCIMAUTHENTICATIONMODEENUM_OAUTH SCIMAuthenticationModeEnum = "oauth" +) + +// All allowed values of SCIMAuthenticationModeEnum enum +var AllowedSCIMAuthenticationModeEnumEnumValues = []SCIMAuthenticationModeEnum{ + "token", + "oauth", +} + +func (v *SCIMAuthenticationModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SCIMAuthenticationModeEnum(value) + for _, existing := range AllowedSCIMAuthenticationModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SCIMAuthenticationModeEnum", value) +} + +// NewSCIMAuthenticationModeEnumFromValue returns a pointer to a valid SCIMAuthenticationModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSCIMAuthenticationModeEnumFromValue(v string) (*SCIMAuthenticationModeEnum, error) { + ev := SCIMAuthenticationModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SCIMAuthenticationModeEnum: valid values are %v", v, AllowedSCIMAuthenticationModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SCIMAuthenticationModeEnum) IsValid() bool { + for _, existing := range AllowedSCIMAuthenticationModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SCIMAuthenticationModeEnum value +func (v SCIMAuthenticationModeEnum) Ptr() *SCIMAuthenticationModeEnum { + return &v +} + +type NullableSCIMAuthenticationModeEnum struct { + value *SCIMAuthenticationModeEnum + isSet bool +} + +func (v NullableSCIMAuthenticationModeEnum) Get() *SCIMAuthenticationModeEnum { + return v.value +} + +func (v *NullableSCIMAuthenticationModeEnum) Set(val *SCIMAuthenticationModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMAuthenticationModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMAuthenticationModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMAuthenticationModeEnum(val *SCIMAuthenticationModeEnum) *NullableSCIMAuthenticationModeEnum { + return &NullableSCIMAuthenticationModeEnum{value: val, isSet: true} +} + +func (v NullableSCIMAuthenticationModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMAuthenticationModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_mapping.go b/packages/client-go/model_scim_mapping.go new file mode 100644 index 0000000000..1d65078bac --- /dev/null +++ b/packages/client-go/model_scim_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMMapping{} + +// SCIMMapping SCIMMapping Serializer +type SCIMMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _SCIMMapping SCIMMapping + +// NewSCIMMapping instantiates a new SCIMMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *SCIMMapping { + this := SCIMMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewSCIMMappingWithDefaults instantiates a new SCIMMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMMappingWithDefaults() *SCIMMapping { + this := SCIMMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *SCIMMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SCIMMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SCIMMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SCIMMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SCIMMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SCIMMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SCIMMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SCIMMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SCIMMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *SCIMMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SCIMMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SCIMMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SCIMMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SCIMMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SCIMMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SCIMMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SCIMMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SCIMMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o SCIMMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMMapping := _SCIMMapping{} + + err = json.Unmarshal(data, &varSCIMMapping) + + if err != nil { + return err + } + + *o = SCIMMapping(varSCIMMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMMapping struct { + value *SCIMMapping + isSet bool +} + +func (v NullableSCIMMapping) Get() *SCIMMapping { + return v.value +} + +func (v *NullableSCIMMapping) Set(val *SCIMMapping) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMMapping(val *SCIMMapping) *NullableSCIMMapping { + return &NullableSCIMMapping{value: val, isSet: true} +} + +func (v NullableSCIMMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_mapping_request.go b/packages/client-go/model_scim_mapping_request.go new file mode 100644 index 0000000000..4eaf538505 --- /dev/null +++ b/packages/client-go/model_scim_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMMappingRequest{} + +// SCIMMappingRequest SCIMMapping Serializer +type SCIMMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _SCIMMappingRequest SCIMMappingRequest + +// NewSCIMMappingRequest instantiates a new SCIMMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMMappingRequest(name string, expression string) *SCIMMappingRequest { + this := SCIMMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewSCIMMappingRequestWithDefaults instantiates a new SCIMMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMMappingRequestWithDefaults() *SCIMMappingRequest { + this := SCIMMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SCIMMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SCIMMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SCIMMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SCIMMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SCIMMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SCIMMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SCIMMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SCIMMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o SCIMMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMMappingRequest := _SCIMMappingRequest{} + + err = json.Unmarshal(data, &varSCIMMappingRequest) + + if err != nil { + return err + } + + *o = SCIMMappingRequest(varSCIMMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMMappingRequest struct { + value *SCIMMappingRequest + isSet bool +} + +func (v NullableSCIMMappingRequest) Get() *SCIMMappingRequest { + return v.value +} + +func (v *NullableSCIMMappingRequest) Set(val *SCIMMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMMappingRequest(val *SCIMMappingRequest) *NullableSCIMMappingRequest { + return &NullableSCIMMappingRequest{value: val, isSet: true} +} + +func (v NullableSCIMMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider.go b/packages/client-go/model_scim_provider.go new file mode 100644 index 0000000000..c41b1620a5 --- /dev/null +++ b/packages/client-go/model_scim_provider.go @@ -0,0 +1,949 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProvider{} + +// SCIMProvider SCIMProvider Serializer +type SCIMProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Base URL to SCIM requests, usually ends in /v2 + Url string `json:"url"` + VerifyCertificates *bool `json:"verify_certificates,omitempty"` + // Authentication token + Token *string `json:"token,omitempty"` + AuthMode *SCIMAuthenticationModeEnum `json:"auth_mode,omitempty"` + // OAuth Source used for authentication + AuthOauth NullableString `json:"auth_oauth,omitempty"` + // Additional OAuth parameters, such as grant_type + AuthOauthParams map[string]interface{} `json:"auth_oauth_params,omitempty"` + // Alter authentik behavior for vendor-specific SCIM implementations. + CompatibilityMode *CompatibilityModeEnum `json:"compatibility_mode,omitempty"` + // Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + ServiceProviderConfigCacheTimeout *string `json:"service_provider_config_cache_timeout,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // Group filters used to define sync-scope for groups. + GroupFilters []string `json:"group_filters,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProvider SCIMProvider + +// NewSCIMProvider instantiates a new SCIMProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProvider(pk int32, name string, component string, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, url string) *SCIMProvider { + this := SCIMProvider{} + this.Pk = pk + this.Name = name + this.Component = component + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Url = url + return &this +} + +// NewSCIMProviderWithDefaults instantiates a new SCIMProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderWithDefaults() *SCIMProvider { + this := SCIMProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *SCIMProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SCIMProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SCIMProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMProvider) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *SCIMProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *SCIMProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *SCIMProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *SCIMProvider) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *SCIMProvider) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *SCIMProvider) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetComponent returns the Component field value +func (o *SCIMProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SCIMProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SCIMProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *SCIMProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SCIMProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *SCIMProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *SCIMProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SCIMProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SCIMProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SCIMProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SCIMProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SCIMProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetUrl returns the Url field value +func (o *SCIMProvider) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *SCIMProvider) SetUrl(v string) { + o.Url = v +} + +// GetVerifyCertificates returns the VerifyCertificates field value if set, zero value otherwise. +func (o *SCIMProvider) GetVerifyCertificates() bool { + if o == nil || IsNil(o.VerifyCertificates) { + var ret bool + return ret + } + return *o.VerifyCertificates +} + +// GetVerifyCertificatesOk returns a tuple with the VerifyCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetVerifyCertificatesOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyCertificates) { + return nil, false + } + return o.VerifyCertificates, true +} + +// HasVerifyCertificates returns a boolean if a field has been set. +func (o *SCIMProvider) HasVerifyCertificates() bool { + if o != nil && !IsNil(o.VerifyCertificates) { + return true + } + + return false +} + +// SetVerifyCertificates gets a reference to the given bool and assigns it to the VerifyCertificates field. +func (o *SCIMProvider) SetVerifyCertificates(v bool) { + o.VerifyCertificates = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *SCIMProvider) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *SCIMProvider) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *SCIMProvider) SetToken(v string) { + o.Token = &v +} + +// GetAuthMode returns the AuthMode field value if set, zero value otherwise. +func (o *SCIMProvider) GetAuthMode() SCIMAuthenticationModeEnum { + if o == nil || IsNil(o.AuthMode) { + var ret SCIMAuthenticationModeEnum + return ret + } + return *o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetAuthModeOk() (*SCIMAuthenticationModeEnum, bool) { + if o == nil || IsNil(o.AuthMode) { + return nil, false + } + return o.AuthMode, true +} + +// HasAuthMode returns a boolean if a field has been set. +func (o *SCIMProvider) HasAuthMode() bool { + if o != nil && !IsNil(o.AuthMode) { + return true + } + + return false +} + +// SetAuthMode gets a reference to the given SCIMAuthenticationModeEnum and assigns it to the AuthMode field. +func (o *SCIMProvider) SetAuthMode(v SCIMAuthenticationModeEnum) { + o.AuthMode = &v +} + +// GetAuthOauth returns the AuthOauth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMProvider) GetAuthOauth() string { + if o == nil || IsNil(o.AuthOauth.Get()) { + var ret string + return ret + } + return *o.AuthOauth.Get() +} + +// GetAuthOauthOk returns a tuple with the AuthOauth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMProvider) GetAuthOauthOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthOauth.Get(), o.AuthOauth.IsSet() +} + +// HasAuthOauth returns a boolean if a field has been set. +func (o *SCIMProvider) HasAuthOauth() bool { + if o != nil && o.AuthOauth.IsSet() { + return true + } + + return false +} + +// SetAuthOauth gets a reference to the given NullableString and assigns it to the AuthOauth field. +func (o *SCIMProvider) SetAuthOauth(v string) { + o.AuthOauth.Set(&v) +} + +// SetAuthOauthNil sets the value for AuthOauth to be an explicit nil +func (o *SCIMProvider) SetAuthOauthNil() { + o.AuthOauth.Set(nil) +} + +// UnsetAuthOauth ensures that no value is present for AuthOauth, not even an explicit nil +func (o *SCIMProvider) UnsetAuthOauth() { + o.AuthOauth.Unset() +} + +// GetAuthOauthParams returns the AuthOauthParams field value if set, zero value otherwise. +func (o *SCIMProvider) GetAuthOauthParams() map[string]interface{} { + if o == nil || IsNil(o.AuthOauthParams) { + var ret map[string]interface{} + return ret + } + return o.AuthOauthParams +} + +// GetAuthOauthParamsOk returns a tuple with the AuthOauthParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetAuthOauthParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.AuthOauthParams) { + return map[string]interface{}{}, false + } + return o.AuthOauthParams, true +} + +// HasAuthOauthParams returns a boolean if a field has been set. +func (o *SCIMProvider) HasAuthOauthParams() bool { + if o != nil && !IsNil(o.AuthOauthParams) { + return true + } + + return false +} + +// SetAuthOauthParams gets a reference to the given map[string]interface{} and assigns it to the AuthOauthParams field. +func (o *SCIMProvider) SetAuthOauthParams(v map[string]interface{}) { + o.AuthOauthParams = v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *SCIMProvider) GetCompatibilityMode() CompatibilityModeEnum { + if o == nil || IsNil(o.CompatibilityMode) { + var ret CompatibilityModeEnum + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetCompatibilityModeOk() (*CompatibilityModeEnum, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *SCIMProvider) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given CompatibilityModeEnum and assigns it to the CompatibilityMode field. +func (o *SCIMProvider) SetCompatibilityMode(v CompatibilityModeEnum) { + o.CompatibilityMode = &v +} + +// GetServiceProviderConfigCacheTimeout returns the ServiceProviderConfigCacheTimeout field value if set, zero value otherwise. +func (o *SCIMProvider) GetServiceProviderConfigCacheTimeout() string { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + var ret string + return ret + } + return *o.ServiceProviderConfigCacheTimeout +} + +// GetServiceProviderConfigCacheTimeoutOk returns a tuple with the ServiceProviderConfigCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetServiceProviderConfigCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + return nil, false + } + return o.ServiceProviderConfigCacheTimeout, true +} + +// HasServiceProviderConfigCacheTimeout returns a boolean if a field has been set. +func (o *SCIMProvider) HasServiceProviderConfigCacheTimeout() bool { + if o != nil && !IsNil(o.ServiceProviderConfigCacheTimeout) { + return true + } + + return false +} + +// SetServiceProviderConfigCacheTimeout gets a reference to the given string and assigns it to the ServiceProviderConfigCacheTimeout field. +func (o *SCIMProvider) SetServiceProviderConfigCacheTimeout(v string) { + o.ServiceProviderConfigCacheTimeout = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *SCIMProvider) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *SCIMProvider) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *SCIMProvider) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *SCIMProvider) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *SCIMProvider) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *SCIMProvider) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *SCIMProvider) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *SCIMProvider) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *SCIMProvider) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetGroupFilters returns the GroupFilters field value if set, zero value otherwise. +func (o *SCIMProvider) GetGroupFilters() []string { + if o == nil || IsNil(o.GroupFilters) { + var ret []string + return ret + } + return o.GroupFilters +} + +// GetGroupFiltersOk returns a tuple with the GroupFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetGroupFiltersOk() ([]string, bool) { + if o == nil || IsNil(o.GroupFilters) { + return nil, false + } + return o.GroupFilters, true +} + +// HasGroupFilters returns a boolean if a field has been set. +func (o *SCIMProvider) HasGroupFilters() bool { + if o != nil && !IsNil(o.GroupFilters) { + return true + } + + return false +} + +// SetGroupFilters gets a reference to the given []string and assigns it to the GroupFilters field. +func (o *SCIMProvider) SetGroupFilters(v []string) { + o.GroupFilters = v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *SCIMProvider) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProvider) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *SCIMProvider) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *SCIMProvider) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o SCIMProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["component"] = o.Component + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["url"] = o.Url + if !IsNil(o.VerifyCertificates) { + toSerialize["verify_certificates"] = o.VerifyCertificates + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if !IsNil(o.AuthMode) { + toSerialize["auth_mode"] = o.AuthMode + } + if o.AuthOauth.IsSet() { + toSerialize["auth_oauth"] = o.AuthOauth.Get() + } + if !IsNil(o.AuthOauthParams) { + toSerialize["auth_oauth_params"] = o.AuthOauthParams + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + if !IsNil(o.ServiceProviderConfigCacheTimeout) { + toSerialize["service_provider_config_cache_timeout"] = o.ServiceProviderConfigCacheTimeout + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.GroupFilters) { + toSerialize["group_filters"] = o.GroupFilters + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProvider := _SCIMProvider{} + + err = json.Unmarshal(data, &varSCIMProvider) + + if err != nil { + return err + } + + *o = SCIMProvider(varSCIMProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "url") + delete(additionalProperties, "verify_certificates") + delete(additionalProperties, "token") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "auth_oauth") + delete(additionalProperties, "auth_oauth_params") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "service_provider_config_cache_timeout") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "group_filters") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProvider struct { + value *SCIMProvider + isSet bool +} + +func (v NullableSCIMProvider) Get() *SCIMProvider { + return v.value +} + +func (v *NullableSCIMProvider) Set(val *SCIMProvider) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProvider(val *SCIMProvider) *NullableSCIMProvider { + return &NullableSCIMProvider{value: val, isSet: true} +} + +func (v NullableSCIMProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider_group.go b/packages/client-go/model_scim_provider_group.go new file mode 100644 index 0000000000..843ef008fa --- /dev/null +++ b/packages/client-go/model_scim_provider_group.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProviderGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProviderGroup{} + +// SCIMProviderGroup SCIMProviderGroup Serializer +type SCIMProviderGroup struct { + Id string `json:"id"` + ScimId string `json:"scim_id"` + Group string `json:"group"` + GroupObj PartialGroup `json:"group_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProviderGroup SCIMProviderGroup + +// NewSCIMProviderGroup instantiates a new SCIMProviderGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProviderGroup(id string, scimId string, group string, groupObj PartialGroup, provider int32, attributes map[string]interface{}) *SCIMProviderGroup { + this := SCIMProviderGroup{} + this.Id = id + this.ScimId = scimId + this.Group = group + this.GroupObj = groupObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewSCIMProviderGroupWithDefaults instantiates a new SCIMProviderGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderGroupWithDefaults() *SCIMProviderGroup { + this := SCIMProviderGroup{} + return &this +} + +// GetId returns the Id field value +func (o *SCIMProviderGroup) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SCIMProviderGroup) SetId(v string) { + o.Id = v +} + +// GetScimId returns the ScimId field value +func (o *SCIMProviderGroup) GetScimId() string { + if o == nil { + var ret string + return ret + } + + return o.ScimId +} + +// GetScimIdOk returns a tuple with the ScimId field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetScimIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScimId, true +} + +// SetScimId sets field value +func (o *SCIMProviderGroup) SetScimId(v string) { + o.ScimId = v +} + +// GetGroup returns the Group field value +func (o *SCIMProviderGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *SCIMProviderGroup) SetGroup(v string) { + o.Group = v +} + +// GetGroupObj returns the GroupObj field value +func (o *SCIMProviderGroup) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *SCIMProviderGroup) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetProvider returns the Provider field value +func (o *SCIMProviderGroup) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *SCIMProviderGroup) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *SCIMProviderGroup) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *SCIMProviderGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMProviderGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProviderGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["scim_id"] = o.ScimId + toSerialize["group"] = o.Group + toSerialize["group_obj"] = o.GroupObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProviderGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "scim_id", + "group", + "group_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProviderGroup := _SCIMProviderGroup{} + + err = json.Unmarshal(data, &varSCIMProviderGroup) + + if err != nil { + return err + } + + *o = SCIMProviderGroup(varSCIMProviderGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "scim_id") + delete(additionalProperties, "group") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProviderGroup struct { + value *SCIMProviderGroup + isSet bool +} + +func (v NullableSCIMProviderGroup) Get() *SCIMProviderGroup { + return v.value +} + +func (v *NullableSCIMProviderGroup) Set(val *SCIMProviderGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProviderGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProviderGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProviderGroup(val *SCIMProviderGroup) *NullableSCIMProviderGroup { + return &NullableSCIMProviderGroup{value: val, isSet: true} +} + +func (v NullableSCIMProviderGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProviderGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider_group_request.go b/packages/client-go/model_scim_provider_group_request.go new file mode 100644 index 0000000000..8855f5f4dd --- /dev/null +++ b/packages/client-go/model_scim_provider_group_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProviderGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProviderGroupRequest{} + +// SCIMProviderGroupRequest SCIMProviderGroup Serializer +type SCIMProviderGroupRequest struct { + ScimId string `json:"scim_id"` + Group string `json:"group"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProviderGroupRequest SCIMProviderGroupRequest + +// NewSCIMProviderGroupRequest instantiates a new SCIMProviderGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProviderGroupRequest(scimId string, group string, provider int32) *SCIMProviderGroupRequest { + this := SCIMProviderGroupRequest{} + this.ScimId = scimId + this.Group = group + this.Provider = provider + return &this +} + +// NewSCIMProviderGroupRequestWithDefaults instantiates a new SCIMProviderGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderGroupRequestWithDefaults() *SCIMProviderGroupRequest { + this := SCIMProviderGroupRequest{} + return &this +} + +// GetScimId returns the ScimId field value +func (o *SCIMProviderGroupRequest) GetScimId() string { + if o == nil { + var ret string + return ret + } + + return o.ScimId +} + +// GetScimIdOk returns a tuple with the ScimId field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroupRequest) GetScimIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScimId, true +} + +// SetScimId sets field value +func (o *SCIMProviderGroupRequest) SetScimId(v string) { + o.ScimId = v +} + +// GetGroup returns the Group field value +func (o *SCIMProviderGroupRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroupRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *SCIMProviderGroupRequest) SetGroup(v string) { + o.Group = v +} + +// GetProvider returns the Provider field value +func (o *SCIMProviderGroupRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderGroupRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *SCIMProviderGroupRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o SCIMProviderGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProviderGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["scim_id"] = o.ScimId + toSerialize["group"] = o.Group + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProviderGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "scim_id", + "group", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProviderGroupRequest := _SCIMProviderGroupRequest{} + + err = json.Unmarshal(data, &varSCIMProviderGroupRequest) + + if err != nil { + return err + } + + *o = SCIMProviderGroupRequest(varSCIMProviderGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "scim_id") + delete(additionalProperties, "group") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProviderGroupRequest struct { + value *SCIMProviderGroupRequest + isSet bool +} + +func (v NullableSCIMProviderGroupRequest) Get() *SCIMProviderGroupRequest { + return v.value +} + +func (v *NullableSCIMProviderGroupRequest) Set(val *SCIMProviderGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProviderGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProviderGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProviderGroupRequest(val *SCIMProviderGroupRequest) *NullableSCIMProviderGroupRequest { + return &NullableSCIMProviderGroupRequest{value: val, isSet: true} +} + +func (v NullableSCIMProviderGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProviderGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider_request.go b/packages/client-go/model_scim_provider_request.go new file mode 100644 index 0000000000..582a950bc4 --- /dev/null +++ b/packages/client-go/model_scim_provider_request.go @@ -0,0 +1,736 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProviderRequest{} + +// SCIMProviderRequest SCIMProvider Serializer +type SCIMProviderRequest struct { + Name string `json:"name"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Property mappings used for group creation/updating. + PropertyMappingsGroup []string `json:"property_mappings_group,omitempty"` + // Base URL to SCIM requests, usually ends in /v2 + Url string `json:"url"` + VerifyCertificates *bool `json:"verify_certificates,omitempty"` + // Authentication token + Token *string `json:"token,omitempty"` + AuthMode *SCIMAuthenticationModeEnum `json:"auth_mode,omitempty"` + // OAuth Source used for authentication + AuthOauth NullableString `json:"auth_oauth,omitempty"` + // Additional OAuth parameters, such as grant_type + AuthOauthParams map[string]interface{} `json:"auth_oauth_params,omitempty"` + // Alter authentik behavior for vendor-specific SCIM implementations. + CompatibilityMode *CompatibilityModeEnum `json:"compatibility_mode,omitempty"` + // Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. + ServiceProviderConfigCacheTimeout *string `json:"service_provider_config_cache_timeout,omitempty"` + ExcludeUsersServiceAccount *bool `json:"exclude_users_service_account,omitempty"` + // Controls the number of objects synced in a single task + SyncPageSize *int32 `json:"sync_page_size,omitempty"` + // Timeout for synchronization of a single page + SyncPageTimeout *string `json:"sync_page_timeout,omitempty"` + // Group filters used to define sync-scope for groups. + GroupFilters []string `json:"group_filters,omitempty"` + // When enabled, provider will not modify or create objects in the remote system. + DryRun *bool `json:"dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProviderRequest SCIMProviderRequest + +// NewSCIMProviderRequest instantiates a new SCIMProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProviderRequest(name string, url string) *SCIMProviderRequest { + this := SCIMProviderRequest{} + this.Name = name + this.Url = url + return &this +} + +// NewSCIMProviderRequestWithDefaults instantiates a new SCIMProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderRequestWithDefaults() *SCIMProviderRequest { + this := SCIMProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SCIMProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMProviderRequest) SetName(v string) { + o.Name = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *SCIMProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetPropertyMappingsGroup returns the PropertyMappingsGroup field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetPropertyMappingsGroup() []string { + if o == nil || IsNil(o.PropertyMappingsGroup) { + var ret []string + return ret + } + return o.PropertyMappingsGroup +} + +// GetPropertyMappingsGroupOk returns a tuple with the PropertyMappingsGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetPropertyMappingsGroupOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappingsGroup) { + return nil, false + } + return o.PropertyMappingsGroup, true +} + +// HasPropertyMappingsGroup returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasPropertyMappingsGroup() bool { + if o != nil && !IsNil(o.PropertyMappingsGroup) { + return true + } + + return false +} + +// SetPropertyMappingsGroup gets a reference to the given []string and assigns it to the PropertyMappingsGroup field. +func (o *SCIMProviderRequest) SetPropertyMappingsGroup(v []string) { + o.PropertyMappingsGroup = v +} + +// GetUrl returns the Url field value +func (o *SCIMProviderRequest) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *SCIMProviderRequest) SetUrl(v string) { + o.Url = v +} + +// GetVerifyCertificates returns the VerifyCertificates field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetVerifyCertificates() bool { + if o == nil || IsNil(o.VerifyCertificates) { + var ret bool + return ret + } + return *o.VerifyCertificates +} + +// GetVerifyCertificatesOk returns a tuple with the VerifyCertificates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetVerifyCertificatesOk() (*bool, bool) { + if o == nil || IsNil(o.VerifyCertificates) { + return nil, false + } + return o.VerifyCertificates, true +} + +// HasVerifyCertificates returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasVerifyCertificates() bool { + if o != nil && !IsNil(o.VerifyCertificates) { + return true + } + + return false +} + +// SetVerifyCertificates gets a reference to the given bool and assigns it to the VerifyCertificates field. +func (o *SCIMProviderRequest) SetVerifyCertificates(v bool) { + o.VerifyCertificates = &v +} + +// GetToken returns the Token field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetToken() string { + if o == nil || IsNil(o.Token) { + var ret string + return ret + } + return *o.Token +} + +// GetTokenOk returns a tuple with the Token field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetTokenOk() (*string, bool) { + if o == nil || IsNil(o.Token) { + return nil, false + } + return o.Token, true +} + +// HasToken returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasToken() bool { + if o != nil && !IsNil(o.Token) { + return true + } + + return false +} + +// SetToken gets a reference to the given string and assigns it to the Token field. +func (o *SCIMProviderRequest) SetToken(v string) { + o.Token = &v +} + +// GetAuthMode returns the AuthMode field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetAuthMode() SCIMAuthenticationModeEnum { + if o == nil || IsNil(o.AuthMode) { + var ret SCIMAuthenticationModeEnum + return ret + } + return *o.AuthMode +} + +// GetAuthModeOk returns a tuple with the AuthMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetAuthModeOk() (*SCIMAuthenticationModeEnum, bool) { + if o == nil || IsNil(o.AuthMode) { + return nil, false + } + return o.AuthMode, true +} + +// HasAuthMode returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasAuthMode() bool { + if o != nil && !IsNil(o.AuthMode) { + return true + } + + return false +} + +// SetAuthMode gets a reference to the given SCIMAuthenticationModeEnum and assigns it to the AuthMode field. +func (o *SCIMProviderRequest) SetAuthMode(v SCIMAuthenticationModeEnum) { + o.AuthMode = &v +} + +// GetAuthOauth returns the AuthOauth field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMProviderRequest) GetAuthOauth() string { + if o == nil || IsNil(o.AuthOauth.Get()) { + var ret string + return ret + } + return *o.AuthOauth.Get() +} + +// GetAuthOauthOk returns a tuple with the AuthOauth field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMProviderRequest) GetAuthOauthOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthOauth.Get(), o.AuthOauth.IsSet() +} + +// HasAuthOauth returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasAuthOauth() bool { + if o != nil && o.AuthOauth.IsSet() { + return true + } + + return false +} + +// SetAuthOauth gets a reference to the given NullableString and assigns it to the AuthOauth field. +func (o *SCIMProviderRequest) SetAuthOauth(v string) { + o.AuthOauth.Set(&v) +} + +// SetAuthOauthNil sets the value for AuthOauth to be an explicit nil +func (o *SCIMProviderRequest) SetAuthOauthNil() { + o.AuthOauth.Set(nil) +} + +// UnsetAuthOauth ensures that no value is present for AuthOauth, not even an explicit nil +func (o *SCIMProviderRequest) UnsetAuthOauth() { + o.AuthOauth.Unset() +} + +// GetAuthOauthParams returns the AuthOauthParams field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetAuthOauthParams() map[string]interface{} { + if o == nil || IsNil(o.AuthOauthParams) { + var ret map[string]interface{} + return ret + } + return o.AuthOauthParams +} + +// GetAuthOauthParamsOk returns a tuple with the AuthOauthParams field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetAuthOauthParamsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.AuthOauthParams) { + return map[string]interface{}{}, false + } + return o.AuthOauthParams, true +} + +// HasAuthOauthParams returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasAuthOauthParams() bool { + if o != nil && !IsNil(o.AuthOauthParams) { + return true + } + + return false +} + +// SetAuthOauthParams gets a reference to the given map[string]interface{} and assigns it to the AuthOauthParams field. +func (o *SCIMProviderRequest) SetAuthOauthParams(v map[string]interface{}) { + o.AuthOauthParams = v +} + +// GetCompatibilityMode returns the CompatibilityMode field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetCompatibilityMode() CompatibilityModeEnum { + if o == nil || IsNil(o.CompatibilityMode) { + var ret CompatibilityModeEnum + return ret + } + return *o.CompatibilityMode +} + +// GetCompatibilityModeOk returns a tuple with the CompatibilityMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetCompatibilityModeOk() (*CompatibilityModeEnum, bool) { + if o == nil || IsNil(o.CompatibilityMode) { + return nil, false + } + return o.CompatibilityMode, true +} + +// HasCompatibilityMode returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasCompatibilityMode() bool { + if o != nil && !IsNil(o.CompatibilityMode) { + return true + } + + return false +} + +// SetCompatibilityMode gets a reference to the given CompatibilityModeEnum and assigns it to the CompatibilityMode field. +func (o *SCIMProviderRequest) SetCompatibilityMode(v CompatibilityModeEnum) { + o.CompatibilityMode = &v +} + +// GetServiceProviderConfigCacheTimeout returns the ServiceProviderConfigCacheTimeout field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetServiceProviderConfigCacheTimeout() string { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + var ret string + return ret + } + return *o.ServiceProviderConfigCacheTimeout +} + +// GetServiceProviderConfigCacheTimeoutOk returns a tuple with the ServiceProviderConfigCacheTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetServiceProviderConfigCacheTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ServiceProviderConfigCacheTimeout) { + return nil, false + } + return o.ServiceProviderConfigCacheTimeout, true +} + +// HasServiceProviderConfigCacheTimeout returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasServiceProviderConfigCacheTimeout() bool { + if o != nil && !IsNil(o.ServiceProviderConfigCacheTimeout) { + return true + } + + return false +} + +// SetServiceProviderConfigCacheTimeout gets a reference to the given string and assigns it to the ServiceProviderConfigCacheTimeout field. +func (o *SCIMProviderRequest) SetServiceProviderConfigCacheTimeout(v string) { + o.ServiceProviderConfigCacheTimeout = &v +} + +// GetExcludeUsersServiceAccount returns the ExcludeUsersServiceAccount field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetExcludeUsersServiceAccount() bool { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + var ret bool + return ret + } + return *o.ExcludeUsersServiceAccount +} + +// GetExcludeUsersServiceAccountOk returns a tuple with the ExcludeUsersServiceAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetExcludeUsersServiceAccountOk() (*bool, bool) { + if o == nil || IsNil(o.ExcludeUsersServiceAccount) { + return nil, false + } + return o.ExcludeUsersServiceAccount, true +} + +// HasExcludeUsersServiceAccount returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasExcludeUsersServiceAccount() bool { + if o != nil && !IsNil(o.ExcludeUsersServiceAccount) { + return true + } + + return false +} + +// SetExcludeUsersServiceAccount gets a reference to the given bool and assigns it to the ExcludeUsersServiceAccount field. +func (o *SCIMProviderRequest) SetExcludeUsersServiceAccount(v bool) { + o.ExcludeUsersServiceAccount = &v +} + +// GetSyncPageSize returns the SyncPageSize field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetSyncPageSize() int32 { + if o == nil || IsNil(o.SyncPageSize) { + var ret int32 + return ret + } + return *o.SyncPageSize +} + +// GetSyncPageSizeOk returns a tuple with the SyncPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetSyncPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.SyncPageSize) { + return nil, false + } + return o.SyncPageSize, true +} + +// HasSyncPageSize returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasSyncPageSize() bool { + if o != nil && !IsNil(o.SyncPageSize) { + return true + } + + return false +} + +// SetSyncPageSize gets a reference to the given int32 and assigns it to the SyncPageSize field. +func (o *SCIMProviderRequest) SetSyncPageSize(v int32) { + o.SyncPageSize = &v +} + +// GetSyncPageTimeout returns the SyncPageTimeout field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetSyncPageTimeout() string { + if o == nil || IsNil(o.SyncPageTimeout) { + var ret string + return ret + } + return *o.SyncPageTimeout +} + +// GetSyncPageTimeoutOk returns a tuple with the SyncPageTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetSyncPageTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.SyncPageTimeout) { + return nil, false + } + return o.SyncPageTimeout, true +} + +// HasSyncPageTimeout returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasSyncPageTimeout() bool { + if o != nil && !IsNil(o.SyncPageTimeout) { + return true + } + + return false +} + +// SetSyncPageTimeout gets a reference to the given string and assigns it to the SyncPageTimeout field. +func (o *SCIMProviderRequest) SetSyncPageTimeout(v string) { + o.SyncPageTimeout = &v +} + +// GetGroupFilters returns the GroupFilters field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetGroupFilters() []string { + if o == nil || IsNil(o.GroupFilters) { + var ret []string + return ret + } + return o.GroupFilters +} + +// GetGroupFiltersOk returns a tuple with the GroupFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetGroupFiltersOk() ([]string, bool) { + if o == nil || IsNil(o.GroupFilters) { + return nil, false + } + return o.GroupFilters, true +} + +// HasGroupFilters returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasGroupFilters() bool { + if o != nil && !IsNil(o.GroupFilters) { + return true + } + + return false +} + +// SetGroupFilters gets a reference to the given []string and assigns it to the GroupFilters field. +func (o *SCIMProviderRequest) SetGroupFilters(v []string) { + o.GroupFilters = v +} + +// GetDryRun returns the DryRun field value if set, zero value otherwise. +func (o *SCIMProviderRequest) GetDryRun() bool { + if o == nil || IsNil(o.DryRun) { + var ret bool + return ret + } + return *o.DryRun +} + +// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMProviderRequest) GetDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.DryRun) { + return nil, false + } + return o.DryRun, true +} + +// HasDryRun returns a boolean if a field has been set. +func (o *SCIMProviderRequest) HasDryRun() bool { + if o != nil && !IsNil(o.DryRun) { + return true + } + + return false +} + +// SetDryRun gets a reference to the given bool and assigns it to the DryRun field. +func (o *SCIMProviderRequest) SetDryRun(v bool) { + o.DryRun = &v +} + +func (o SCIMProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + if !IsNil(o.PropertyMappingsGroup) { + toSerialize["property_mappings_group"] = o.PropertyMappingsGroup + } + toSerialize["url"] = o.Url + if !IsNil(o.VerifyCertificates) { + toSerialize["verify_certificates"] = o.VerifyCertificates + } + if !IsNil(o.Token) { + toSerialize["token"] = o.Token + } + if !IsNil(o.AuthMode) { + toSerialize["auth_mode"] = o.AuthMode + } + if o.AuthOauth.IsSet() { + toSerialize["auth_oauth"] = o.AuthOauth.Get() + } + if !IsNil(o.AuthOauthParams) { + toSerialize["auth_oauth_params"] = o.AuthOauthParams + } + if !IsNil(o.CompatibilityMode) { + toSerialize["compatibility_mode"] = o.CompatibilityMode + } + if !IsNil(o.ServiceProviderConfigCacheTimeout) { + toSerialize["service_provider_config_cache_timeout"] = o.ServiceProviderConfigCacheTimeout + } + if !IsNil(o.ExcludeUsersServiceAccount) { + toSerialize["exclude_users_service_account"] = o.ExcludeUsersServiceAccount + } + if !IsNil(o.SyncPageSize) { + toSerialize["sync_page_size"] = o.SyncPageSize + } + if !IsNil(o.SyncPageTimeout) { + toSerialize["sync_page_timeout"] = o.SyncPageTimeout + } + if !IsNil(o.GroupFilters) { + toSerialize["group_filters"] = o.GroupFilters + } + if !IsNil(o.DryRun) { + toSerialize["dry_run"] = o.DryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProviderRequest := _SCIMProviderRequest{} + + err = json.Unmarshal(data, &varSCIMProviderRequest) + + if err != nil { + return err + } + + *o = SCIMProviderRequest(varSCIMProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "property_mappings_group") + delete(additionalProperties, "url") + delete(additionalProperties, "verify_certificates") + delete(additionalProperties, "token") + delete(additionalProperties, "auth_mode") + delete(additionalProperties, "auth_oauth") + delete(additionalProperties, "auth_oauth_params") + delete(additionalProperties, "compatibility_mode") + delete(additionalProperties, "service_provider_config_cache_timeout") + delete(additionalProperties, "exclude_users_service_account") + delete(additionalProperties, "sync_page_size") + delete(additionalProperties, "sync_page_timeout") + delete(additionalProperties, "group_filters") + delete(additionalProperties, "dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProviderRequest struct { + value *SCIMProviderRequest + isSet bool +} + +func (v NullableSCIMProviderRequest) Get() *SCIMProviderRequest { + return v.value +} + +func (v *NullableSCIMProviderRequest) Set(val *SCIMProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProviderRequest(val *SCIMProviderRequest) *NullableSCIMProviderRequest { + return &NullableSCIMProviderRequest{value: val, isSet: true} +} + +func (v NullableSCIMProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider_user.go b/packages/client-go/model_scim_provider_user.go new file mode 100644 index 0000000000..d7068655e9 --- /dev/null +++ b/packages/client-go/model_scim_provider_user.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProviderUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProviderUser{} + +// SCIMProviderUser SCIMProviderUser Serializer +type SCIMProviderUser struct { + Id string `json:"id"` + ScimId string `json:"scim_id"` + User int32 `json:"user"` + UserObj PartialUser `json:"user_obj"` + Provider int32 `json:"provider"` + Attributes map[string]interface{} `json:"attributes"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProviderUser SCIMProviderUser + +// NewSCIMProviderUser instantiates a new SCIMProviderUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProviderUser(id string, scimId string, user int32, userObj PartialUser, provider int32, attributes map[string]interface{}) *SCIMProviderUser { + this := SCIMProviderUser{} + this.Id = id + this.ScimId = scimId + this.User = user + this.UserObj = userObj + this.Provider = provider + this.Attributes = attributes + return &this +} + +// NewSCIMProviderUserWithDefaults instantiates a new SCIMProviderUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderUserWithDefaults() *SCIMProviderUser { + this := SCIMProviderUser{} + return &this +} + +// GetId returns the Id field value +func (o *SCIMProviderUser) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *SCIMProviderUser) SetId(v string) { + o.Id = v +} + +// GetScimId returns the ScimId field value +func (o *SCIMProviderUser) GetScimId() string { + if o == nil { + var ret string + return ret + } + + return o.ScimId +} + +// GetScimIdOk returns a tuple with the ScimId field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetScimIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScimId, true +} + +// SetScimId sets field value +func (o *SCIMProviderUser) SetScimId(v string) { + o.ScimId = v +} + +// GetUser returns the User field value +func (o *SCIMProviderUser) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SCIMProviderUser) SetUser(v int32) { + o.User = v +} + +// GetUserObj returns the UserObj field value +func (o *SCIMProviderUser) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *SCIMProviderUser) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetProvider returns the Provider field value +func (o *SCIMProviderUser) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *SCIMProviderUser) SetProvider(v int32) { + o.Provider = v +} + +// GetAttributes returns the Attributes field value +func (o *SCIMProviderUser) GetAttributes() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUser) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// SetAttributes sets field value +func (o *SCIMProviderUser) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMProviderUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProviderUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["scim_id"] = o.ScimId + toSerialize["user"] = o.User + toSerialize["user_obj"] = o.UserObj + toSerialize["provider"] = o.Provider + toSerialize["attributes"] = o.Attributes + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProviderUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "scim_id", + "user", + "user_obj", + "provider", + "attributes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProviderUser := _SCIMProviderUser{} + + err = json.Unmarshal(data, &varSCIMProviderUser) + + if err != nil { + return err + } + + *o = SCIMProviderUser(varSCIMProviderUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "scim_id") + delete(additionalProperties, "user") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "provider") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProviderUser struct { + value *SCIMProviderUser + isSet bool +} + +func (v NullableSCIMProviderUser) Get() *SCIMProviderUser { + return v.value +} + +func (v *NullableSCIMProviderUser) Set(val *SCIMProviderUser) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProviderUser) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProviderUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProviderUser(val *SCIMProviderUser) *NullableSCIMProviderUser { + return &NullableSCIMProviderUser{value: val, isSet: true} +} + +func (v NullableSCIMProviderUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProviderUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_provider_user_request.go b/packages/client-go/model_scim_provider_user_request.go new file mode 100644 index 0000000000..22f8a02888 --- /dev/null +++ b/packages/client-go/model_scim_provider_user_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMProviderUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMProviderUserRequest{} + +// SCIMProviderUserRequest SCIMProviderUser Serializer +type SCIMProviderUserRequest struct { + ScimId string `json:"scim_id"` + User int32 `json:"user"` + Provider int32 `json:"provider"` + AdditionalProperties map[string]interface{} +} + +type _SCIMProviderUserRequest SCIMProviderUserRequest + +// NewSCIMProviderUserRequest instantiates a new SCIMProviderUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMProviderUserRequest(scimId string, user int32, provider int32) *SCIMProviderUserRequest { + this := SCIMProviderUserRequest{} + this.ScimId = scimId + this.User = user + this.Provider = provider + return &this +} + +// NewSCIMProviderUserRequestWithDefaults instantiates a new SCIMProviderUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMProviderUserRequestWithDefaults() *SCIMProviderUserRequest { + this := SCIMProviderUserRequest{} + return &this +} + +// GetScimId returns the ScimId field value +func (o *SCIMProviderUserRequest) GetScimId() string { + if o == nil { + var ret string + return ret + } + + return o.ScimId +} + +// GetScimIdOk returns a tuple with the ScimId field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUserRequest) GetScimIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScimId, true +} + +// SetScimId sets field value +func (o *SCIMProviderUserRequest) SetScimId(v string) { + o.ScimId = v +} + +// GetUser returns the User field value +func (o *SCIMProviderUserRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUserRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SCIMProviderUserRequest) SetUser(v int32) { + o.User = v +} + +// GetProvider returns the Provider field value +func (o *SCIMProviderUserRequest) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *SCIMProviderUserRequest) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *SCIMProviderUserRequest) SetProvider(v int32) { + o.Provider = v +} + +func (o SCIMProviderUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMProviderUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["scim_id"] = o.ScimId + toSerialize["user"] = o.User + toSerialize["provider"] = o.Provider + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMProviderUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "scim_id", + "user", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMProviderUserRequest := _SCIMProviderUserRequest{} + + err = json.Unmarshal(data, &varSCIMProviderUserRequest) + + if err != nil { + return err + } + + *o = SCIMProviderUserRequest(varSCIMProviderUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "scim_id") + delete(additionalProperties, "user") + delete(additionalProperties, "provider") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMProviderUserRequest struct { + value *SCIMProviderUserRequest + isSet bool +} + +func (v NullableSCIMProviderUserRequest) Get() *SCIMProviderUserRequest { + return v.value +} + +func (v *NullableSCIMProviderUserRequest) Set(val *SCIMProviderUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMProviderUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMProviderUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMProviderUserRequest(val *SCIMProviderUserRequest) *NullableSCIMProviderUserRequest { + return &NullableSCIMProviderUserRequest{value: val, isSet: true} +} + +func (v NullableSCIMProviderUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMProviderUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source.go b/packages/client-go/model_scim_source.go new file mode 100644 index 0000000000..030ff1ef4d --- /dev/null +++ b/packages/client-go/model_scim_source.go @@ -0,0 +1,586 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSource{} + +// SCIMSource SCIMSource Serializer +type SCIMSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + // Get Root URL + RootUrl string `json:"root_url"` + TokenObj Token `json:"token_obj"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSource SCIMSource + +// NewSCIMSource instantiates a new SCIMSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, rootUrl string, tokenObj Token) *SCIMSource { + this := SCIMSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.RootUrl = rootUrl + this.TokenObj = tokenObj + return &this +} + +// NewSCIMSourceWithDefaults instantiates a new SCIMSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceWithDefaults() *SCIMSource { + this := SCIMSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *SCIMSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SCIMSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SCIMSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SCIMSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SCIMSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SCIMSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SCIMSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SCIMSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *SCIMSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *SCIMSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *SCIMSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *SCIMSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *SCIMSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *SCIMSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *SCIMSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SCIMSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SCIMSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SCIMSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SCIMSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SCIMSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SCIMSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SCIMSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SCIMSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *SCIMSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *SCIMSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *SCIMSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *SCIMSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetRootUrl returns the RootUrl field value +func (o *SCIMSource) GetRootUrl() string { + if o == nil { + var ret string + return ret + } + + return o.RootUrl +} + +// GetRootUrlOk returns a tuple with the RootUrl field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetRootUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RootUrl, true +} + +// SetRootUrl sets field value +func (o *SCIMSource) SetRootUrl(v string) { + o.RootUrl = v +} + +// GetTokenObj returns the TokenObj field value +func (o *SCIMSource) GetTokenObj() Token { + if o == nil { + var ret Token + return ret + } + + return o.TokenObj +} + +// GetTokenObjOk returns a tuple with the TokenObj field value +// and a boolean to check if the value has been set. +func (o *SCIMSource) GetTokenObjOk() (*Token, bool) { + if o == nil { + return nil, false + } + return &o.TokenObj, true +} + +// SetTokenObj sets field value +func (o *SCIMSource) SetTokenObj(v Token) { + o.TokenObj = v +} + +func (o SCIMSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + toSerialize["root_url"] = o.RootUrl + toSerialize["token_obj"] = o.TokenObj + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "root_url", + "token_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSource := _SCIMSource{} + + err = json.Unmarshal(data, &varSCIMSource) + + if err != nil { + return err + } + + *o = SCIMSource(varSCIMSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "root_url") + delete(additionalProperties, "token_obj") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSource struct { + value *SCIMSource + isSet bool +} + +func (v NullableSCIMSource) Get() *SCIMSource { + return v.value +} + +func (v *NullableSCIMSource) Set(val *SCIMSource) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSource) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSource(val *SCIMSource) *NullableSCIMSource { + return &NullableSCIMSource{value: val, isSet: true} +} + +func (v NullableSCIMSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_group.go b/packages/client-go/model_scim_source_group.go new file mode 100644 index 0000000000..e8793c7806 --- /dev/null +++ b/packages/client-go/model_scim_source_group.go @@ -0,0 +1,328 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourceGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourceGroup{} + +// SCIMSourceGroup SCIMSourceGroup Serializer +type SCIMSourceGroup struct { + Id *string `json:"id,omitempty"` + ExternalId string `json:"external_id"` + Group string `json:"group"` + GroupObj PartialGroup `json:"group_obj"` + Source string `json:"source"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourceGroup SCIMSourceGroup + +// NewSCIMSourceGroup instantiates a new SCIMSourceGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourceGroup(externalId string, group string, groupObj PartialGroup, source string) *SCIMSourceGroup { + this := SCIMSourceGroup{} + this.ExternalId = externalId + this.Group = group + this.GroupObj = groupObj + this.Source = source + return &this +} + +// NewSCIMSourceGroupWithDefaults instantiates a new SCIMSourceGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceGroupWithDefaults() *SCIMSourceGroup { + this := SCIMSourceGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SCIMSourceGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SCIMSourceGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SCIMSourceGroup) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value +func (o *SCIMSourceGroup) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *SCIMSourceGroup) SetExternalId(v string) { + o.ExternalId = v +} + +// GetGroup returns the Group field value +func (o *SCIMSourceGroup) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *SCIMSourceGroup) SetGroup(v string) { + o.Group = v +} + +// GetGroupObj returns the GroupObj field value +func (o *SCIMSourceGroup) GetGroupObj() PartialGroup { + if o == nil { + var ret PartialGroup + return ret + } + + return o.GroupObj +} + +// GetGroupObjOk returns a tuple with the GroupObj field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetGroupObjOk() (*PartialGroup, bool) { + if o == nil { + return nil, false + } + return &o.GroupObj, true +} + +// SetGroupObj sets field value +func (o *SCIMSourceGroup) SetGroupObj(v PartialGroup) { + o.GroupObj = v +} + +// GetSource returns the Source field value +func (o *SCIMSourceGroup) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SCIMSourceGroup) SetSource(v string) { + o.Source = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SCIMSourceGroup) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroup) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SCIMSourceGroup) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *SCIMSourceGroup) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMSourceGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourceGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["external_id"] = o.ExternalId + toSerialize["group"] = o.Group + toSerialize["group_obj"] = o.GroupObj + toSerialize["source"] = o.Source + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourceGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "external_id", + "group", + "group_obj", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourceGroup := _SCIMSourceGroup{} + + err = json.Unmarshal(data, &varSCIMSourceGroup) + + if err != nil { + return err + } + + *o = SCIMSourceGroup(varSCIMSourceGroup) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "group") + delete(additionalProperties, "group_obj") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourceGroup struct { + value *SCIMSourceGroup + isSet bool +} + +func (v NullableSCIMSourceGroup) Get() *SCIMSourceGroup { + return v.value +} + +func (v *NullableSCIMSourceGroup) Set(val *SCIMSourceGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourceGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourceGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourceGroup(val *SCIMSourceGroup) *NullableSCIMSourceGroup { + return &NullableSCIMSourceGroup{value: val, isSet: true} +} + +func (v NullableSCIMSourceGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourceGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_group_request.go b/packages/client-go/model_scim_source_group_request.go new file mode 100644 index 0000000000..19811297eb --- /dev/null +++ b/packages/client-go/model_scim_source_group_request.go @@ -0,0 +1,299 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourceGroupRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourceGroupRequest{} + +// SCIMSourceGroupRequest SCIMSourceGroup Serializer +type SCIMSourceGroupRequest struct { + Id *string `json:"id,omitempty"` + ExternalId string `json:"external_id"` + Group string `json:"group"` + Source string `json:"source"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourceGroupRequest SCIMSourceGroupRequest + +// NewSCIMSourceGroupRequest instantiates a new SCIMSourceGroupRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourceGroupRequest(externalId string, group string, source string) *SCIMSourceGroupRequest { + this := SCIMSourceGroupRequest{} + this.ExternalId = externalId + this.Group = group + this.Source = source + return &this +} + +// NewSCIMSourceGroupRequestWithDefaults instantiates a new SCIMSourceGroupRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceGroupRequestWithDefaults() *SCIMSourceGroupRequest { + this := SCIMSourceGroupRequest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SCIMSourceGroupRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroupRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SCIMSourceGroupRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SCIMSourceGroupRequest) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value +func (o *SCIMSourceGroupRequest) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroupRequest) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *SCIMSourceGroupRequest) SetExternalId(v string) { + o.ExternalId = v +} + +// GetGroup returns the Group field value +func (o *SCIMSourceGroupRequest) GetGroup() string { + if o == nil { + var ret string + return ret + } + + return o.Group +} + +// GetGroupOk returns a tuple with the Group field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroupRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Group, true +} + +// SetGroup sets field value +func (o *SCIMSourceGroupRequest) SetGroup(v string) { + o.Group = v +} + +// GetSource returns the Source field value +func (o *SCIMSourceGroupRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroupRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SCIMSourceGroupRequest) SetSource(v string) { + o.Source = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SCIMSourceGroupRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceGroupRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SCIMSourceGroupRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *SCIMSourceGroupRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMSourceGroupRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourceGroupRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["external_id"] = o.ExternalId + toSerialize["group"] = o.Group + toSerialize["source"] = o.Source + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourceGroupRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "external_id", + "group", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourceGroupRequest := _SCIMSourceGroupRequest{} + + err = json.Unmarshal(data, &varSCIMSourceGroupRequest) + + if err != nil { + return err + } + + *o = SCIMSourceGroupRequest(varSCIMSourceGroupRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "group") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourceGroupRequest struct { + value *SCIMSourceGroupRequest + isSet bool +} + +func (v NullableSCIMSourceGroupRequest) Get() *SCIMSourceGroupRequest { + return v.value +} + +func (v *NullableSCIMSourceGroupRequest) Set(val *SCIMSourceGroupRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourceGroupRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourceGroupRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourceGroupRequest(val *SCIMSourceGroupRequest) *NullableSCIMSourceGroupRequest { + return &NullableSCIMSourceGroupRequest{value: val, isSet: true} +} + +func (v NullableSCIMSourceGroupRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourceGroupRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_property_mapping.go b/packages/client-go/model_scim_source_property_mapping.go new file mode 100644 index 0000000000..9d611ae2f5 --- /dev/null +++ b/packages/client-go/model_scim_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourcePropertyMapping{} + +// SCIMSourcePropertyMapping SCIMSourcePropertyMapping Serializer +type SCIMSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourcePropertyMapping SCIMSourcePropertyMapping + +// NewSCIMSourcePropertyMapping instantiates a new SCIMSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *SCIMSourcePropertyMapping { + this := SCIMSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewSCIMSourcePropertyMappingWithDefaults instantiates a new SCIMSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourcePropertyMappingWithDefaults() *SCIMSourcePropertyMapping { + this := SCIMSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *SCIMSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SCIMSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SCIMSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SCIMSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SCIMSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SCIMSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SCIMSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SCIMSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SCIMSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *SCIMSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SCIMSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SCIMSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SCIMSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SCIMSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SCIMSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SCIMSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SCIMSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o SCIMSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourcePropertyMapping := _SCIMSourcePropertyMapping{} + + err = json.Unmarshal(data, &varSCIMSourcePropertyMapping) + + if err != nil { + return err + } + + *o = SCIMSourcePropertyMapping(varSCIMSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourcePropertyMapping struct { + value *SCIMSourcePropertyMapping + isSet bool +} + +func (v NullableSCIMSourcePropertyMapping) Get() *SCIMSourcePropertyMapping { + return v.value +} + +func (v *NullableSCIMSourcePropertyMapping) Set(val *SCIMSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourcePropertyMapping(val *SCIMSourcePropertyMapping) *NullableSCIMSourcePropertyMapping { + return &NullableSCIMSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableSCIMSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_property_mapping_request.go b/packages/client-go/model_scim_source_property_mapping_request.go new file mode 100644 index 0000000000..5493018d75 --- /dev/null +++ b/packages/client-go/model_scim_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourcePropertyMappingRequest{} + +// SCIMSourcePropertyMappingRequest SCIMSourcePropertyMapping Serializer +type SCIMSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourcePropertyMappingRequest SCIMSourcePropertyMappingRequest + +// NewSCIMSourcePropertyMappingRequest instantiates a new SCIMSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourcePropertyMappingRequest(name string, expression string) *SCIMSourcePropertyMappingRequest { + this := SCIMSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewSCIMSourcePropertyMappingRequestWithDefaults instantiates a new SCIMSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourcePropertyMappingRequestWithDefaults() *SCIMSourcePropertyMappingRequest { + this := SCIMSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SCIMSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SCIMSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *SCIMSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *SCIMSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *SCIMSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *SCIMSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *SCIMSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *SCIMSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *SCIMSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *SCIMSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o SCIMSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourcePropertyMappingRequest := _SCIMSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varSCIMSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = SCIMSourcePropertyMappingRequest(varSCIMSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourcePropertyMappingRequest struct { + value *SCIMSourcePropertyMappingRequest + isSet bool +} + +func (v NullableSCIMSourcePropertyMappingRequest) Get() *SCIMSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableSCIMSourcePropertyMappingRequest) Set(val *SCIMSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourcePropertyMappingRequest(val *SCIMSourcePropertyMappingRequest) *NullableSCIMSourcePropertyMappingRequest { + return &NullableSCIMSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableSCIMSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_request.go b/packages/client-go/model_scim_source_request.go new file mode 100644 index 0000000000..b7192be613 --- /dev/null +++ b/packages/client-go/model_scim_source_request.go @@ -0,0 +1,346 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourceRequest{} + +// SCIMSourceRequest SCIMSource Serializer +type SCIMSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourceRequest SCIMSourceRequest + +// NewSCIMSourceRequest instantiates a new SCIMSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourceRequest(name string, slug string) *SCIMSourceRequest { + this := SCIMSourceRequest{} + this.Name = name + this.Slug = slug + return &this +} + +// NewSCIMSourceRequestWithDefaults instantiates a new SCIMSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceRequestWithDefaults() *SCIMSourceRequest { + this := SCIMSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SCIMSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SCIMSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *SCIMSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *SCIMSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SCIMSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *SCIMSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *SCIMSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *SCIMSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *SCIMSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *SCIMSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *SCIMSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *SCIMSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *SCIMSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *SCIMSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *SCIMSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *SCIMSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +func (o SCIMSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourceRequest := _SCIMSourceRequest{} + + err = json.Unmarshal(data, &varSCIMSourceRequest) + + if err != nil { + return err + } + + *o = SCIMSourceRequest(varSCIMSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "user_path_template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourceRequest struct { + value *SCIMSourceRequest + isSet bool +} + +func (v NullableSCIMSourceRequest) Get() *SCIMSourceRequest { + return v.value +} + +func (v *NullableSCIMSourceRequest) Set(val *SCIMSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourceRequest(val *SCIMSourceRequest) *NullableSCIMSourceRequest { + return &NullableSCIMSourceRequest{value: val, isSet: true} +} + +func (v NullableSCIMSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_user.go b/packages/client-go/model_scim_source_user.go new file mode 100644 index 0000000000..04d3dc0a6b --- /dev/null +++ b/packages/client-go/model_scim_source_user.go @@ -0,0 +1,328 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourceUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourceUser{} + +// SCIMSourceUser SCIMSourceUser Serializer +type SCIMSourceUser struct { + Id *string `json:"id,omitempty"` + ExternalId string `json:"external_id"` + User int32 `json:"user"` + UserObj PartialUser `json:"user_obj"` + Source string `json:"source"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourceUser SCIMSourceUser + +// NewSCIMSourceUser instantiates a new SCIMSourceUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourceUser(externalId string, user int32, userObj PartialUser, source string) *SCIMSourceUser { + this := SCIMSourceUser{} + this.ExternalId = externalId + this.User = user + this.UserObj = userObj + this.Source = source + return &this +} + +// NewSCIMSourceUserWithDefaults instantiates a new SCIMSourceUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceUserWithDefaults() *SCIMSourceUser { + this := SCIMSourceUser{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SCIMSourceUser) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SCIMSourceUser) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SCIMSourceUser) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value +func (o *SCIMSourceUser) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *SCIMSourceUser) SetExternalId(v string) { + o.ExternalId = v +} + +// GetUser returns the User field value +func (o *SCIMSourceUser) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SCIMSourceUser) SetUser(v int32) { + o.User = v +} + +// GetUserObj returns the UserObj field value +func (o *SCIMSourceUser) GetUserObj() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetUserObjOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *SCIMSourceUser) SetUserObj(v PartialUser) { + o.UserObj = v +} + +// GetSource returns the Source field value +func (o *SCIMSourceUser) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SCIMSourceUser) SetSource(v string) { + o.Source = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SCIMSourceUser) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceUser) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SCIMSourceUser) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *SCIMSourceUser) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMSourceUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourceUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["external_id"] = o.ExternalId + toSerialize["user"] = o.User + toSerialize["user_obj"] = o.UserObj + toSerialize["source"] = o.Source + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourceUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "external_id", + "user", + "user_obj", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourceUser := _SCIMSourceUser{} + + err = json.Unmarshal(data, &varSCIMSourceUser) + + if err != nil { + return err + } + + *o = SCIMSourceUser(varSCIMSourceUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "user") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourceUser struct { + value *SCIMSourceUser + isSet bool +} + +func (v NullableSCIMSourceUser) Get() *SCIMSourceUser { + return v.value +} + +func (v *NullableSCIMSourceUser) Set(val *SCIMSourceUser) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourceUser) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourceUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourceUser(val *SCIMSourceUser) *NullableSCIMSourceUser { + return &NullableSCIMSourceUser{value: val, isSet: true} +} + +func (v NullableSCIMSourceUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourceUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scim_source_user_request.go b/packages/client-go/model_scim_source_user_request.go new file mode 100644 index 0000000000..28f02c3e07 --- /dev/null +++ b/packages/client-go/model_scim_source_user_request.go @@ -0,0 +1,299 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SCIMSourceUserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SCIMSourceUserRequest{} + +// SCIMSourceUserRequest SCIMSourceUser Serializer +type SCIMSourceUserRequest struct { + Id *string `json:"id,omitempty"` + ExternalId string `json:"external_id"` + User int32 `json:"user"` + Source string `json:"source"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SCIMSourceUserRequest SCIMSourceUserRequest + +// NewSCIMSourceUserRequest instantiates a new SCIMSourceUserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSCIMSourceUserRequest(externalId string, user int32, source string) *SCIMSourceUserRequest { + this := SCIMSourceUserRequest{} + this.ExternalId = externalId + this.User = user + this.Source = source + return &this +} + +// NewSCIMSourceUserRequestWithDefaults instantiates a new SCIMSourceUserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSCIMSourceUserRequestWithDefaults() *SCIMSourceUserRequest { + this := SCIMSourceUserRequest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SCIMSourceUserRequest) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceUserRequest) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SCIMSourceUserRequest) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SCIMSourceUserRequest) SetId(v string) { + o.Id = &v +} + +// GetExternalId returns the ExternalId field value +func (o *SCIMSourceUserRequest) GetExternalId() string { + if o == nil { + var ret string + return ret + } + + return o.ExternalId +} + +// GetExternalIdOk returns a tuple with the ExternalId field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUserRequest) GetExternalIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ExternalId, true +} + +// SetExternalId sets field value +func (o *SCIMSourceUserRequest) SetExternalId(v string) { + o.ExternalId = v +} + +// GetUser returns the User field value +func (o *SCIMSourceUserRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUserRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SCIMSourceUserRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *SCIMSourceUserRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SCIMSourceUserRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SCIMSourceUserRequest) SetSource(v string) { + o.Source = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SCIMSourceUserRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SCIMSourceUserRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SCIMSourceUserRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *SCIMSourceUserRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +func (o SCIMSourceUserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SCIMSourceUserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["external_id"] = o.ExternalId + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SCIMSourceUserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "external_id", + "user", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSCIMSourceUserRequest := _SCIMSourceUserRequest{} + + err = json.Unmarshal(data, &varSCIMSourceUserRequest) + + if err != nil { + return err + } + + *o = SCIMSourceUserRequest(varSCIMSourceUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "external_id") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "attributes") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSCIMSourceUserRequest struct { + value *SCIMSourceUserRequest + isSet bool +} + +func (v NullableSCIMSourceUserRequest) Get() *SCIMSourceUserRequest { + return v.value +} + +func (v *NullableSCIMSourceUserRequest) Set(val *SCIMSourceUserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSCIMSourceUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSCIMSourceUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSCIMSourceUserRequest(val *SCIMSourceUserRequest) *NullableSCIMSourceUserRequest { + return &NullableSCIMSourceUserRequest{value: val, isSet: true} +} + +func (v NullableSCIMSourceUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSCIMSourceUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scope_mapping.go b/packages/client-go/model_scope_mapping.go new file mode 100644 index 0000000000..dd7526af2b --- /dev/null +++ b/packages/client-go/model_scope_mapping.go @@ -0,0 +1,462 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ScopeMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScopeMapping{} + +// ScopeMapping ScopeMapping Serializer +type ScopeMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Scope name requested by the client + ScopeName string `json:"scope_name"` + // Description shown to the user when consenting. If left empty, the user won't be informed. + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ScopeMapping ScopeMapping + +// NewScopeMapping instantiates a new ScopeMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScopeMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string, scopeName string) *ScopeMapping { + this := ScopeMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.ScopeName = scopeName + return &this +} + +// NewScopeMappingWithDefaults instantiates a new ScopeMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScopeMappingWithDefaults() *ScopeMapping { + this := ScopeMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *ScopeMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ScopeMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScopeMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScopeMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *ScopeMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *ScopeMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *ScopeMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *ScopeMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *ScopeMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ScopeMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *ScopeMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *ScopeMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *ScopeMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ScopeMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *ScopeMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ScopeMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ScopeMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ScopeMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ScopeMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ScopeMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetScopeName returns the ScopeName field value +func (o *ScopeMapping) GetScopeName() string { + if o == nil { + var ret string + return ret + } + + return o.ScopeName +} + +// GetScopeNameOk returns a tuple with the ScopeName field value +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetScopeNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScopeName, true +} + +// SetScopeName sets field value +func (o *ScopeMapping) SetScopeName(v string) { + o.ScopeName = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ScopeMapping) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScopeMapping) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ScopeMapping) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ScopeMapping) SetDescription(v string) { + o.Description = &v +} + +func (o ScopeMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScopeMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["scope_name"] = o.ScopeName + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ScopeMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "scope_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScopeMapping := _ScopeMapping{} + + err = json.Unmarshal(data, &varScopeMapping) + + if err != nil { + return err + } + + *o = ScopeMapping(varScopeMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "scope_name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableScopeMapping struct { + value *ScopeMapping + isSet bool +} + +func (v NullableScopeMapping) Get() *ScopeMapping { + return v.value +} + +func (v *NullableScopeMapping) Set(val *ScopeMapping) { + v.value = val + v.isSet = true +} + +func (v NullableScopeMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableScopeMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScopeMapping(val *ScopeMapping) *NullableScopeMapping { + return &NullableScopeMapping{value: val, isSet: true} +} + +func (v NullableScopeMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScopeMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_scope_mapping_request.go b/packages/client-go/model_scope_mapping_request.go new file mode 100644 index 0000000000..9f21c95a22 --- /dev/null +++ b/packages/client-go/model_scope_mapping_request.go @@ -0,0 +1,313 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ScopeMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ScopeMappingRequest{} + +// ScopeMappingRequest ScopeMapping Serializer +type ScopeMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Scope name requested by the client + ScopeName string `json:"scope_name"` + // Description shown to the user when consenting. If left empty, the user won't be informed. + Description *string `json:"description,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ScopeMappingRequest ScopeMappingRequest + +// NewScopeMappingRequest instantiates a new ScopeMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewScopeMappingRequest(name string, expression string, scopeName string) *ScopeMappingRequest { + this := ScopeMappingRequest{} + this.Name = name + this.Expression = expression + this.ScopeName = scopeName + return &this +} + +// NewScopeMappingRequestWithDefaults instantiates a new ScopeMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewScopeMappingRequestWithDefaults() *ScopeMappingRequest { + this := ScopeMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScopeMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScopeMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *ScopeMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *ScopeMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *ScopeMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *ScopeMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *ScopeMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ScopeMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ScopeMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *ScopeMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *ScopeMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *ScopeMappingRequest) SetExpression(v string) { + o.Expression = v +} + +// GetScopeName returns the ScopeName field value +func (o *ScopeMappingRequest) GetScopeName() string { + if o == nil { + var ret string + return ret + } + + return o.ScopeName +} + +// GetScopeNameOk returns a tuple with the ScopeName field value +// and a boolean to check if the value has been set. +func (o *ScopeMappingRequest) GetScopeNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ScopeName, true +} + +// SetScopeName sets field value +func (o *ScopeMappingRequest) SetScopeName(v string) { + o.ScopeName = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *ScopeMappingRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ScopeMappingRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *ScopeMappingRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *ScopeMappingRequest) SetDescription(v string) { + o.Description = &v +} + +func (o ScopeMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ScopeMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["scope_name"] = o.ScopeName + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ScopeMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + "scope_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varScopeMappingRequest := _ScopeMappingRequest{} + + err = json.Unmarshal(data, &varScopeMappingRequest) + + if err != nil { + return err + } + + *o = ScopeMappingRequest(varScopeMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "scope_name") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableScopeMappingRequest struct { + value *ScopeMappingRequest + isSet bool +} + +func (v NullableScopeMappingRequest) Get() *ScopeMappingRequest { + return v.value +} + +func (v *NullableScopeMappingRequest) Set(val *ScopeMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableScopeMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableScopeMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableScopeMappingRequest(val *ScopeMappingRequest) *NullableScopeMappingRequest { + return &NullableScopeMappingRequest{value: val, isSet: true} +} + +func (v NullableScopeMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableScopeMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_selectable_stage.go b/packages/client-go/model_selectable_stage.go new file mode 100644 index 0000000000..d00f8b9e1f --- /dev/null +++ b/packages/client-go/model_selectable_stage.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SelectableStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SelectableStage{} + +// SelectableStage Serializer for stages which can be selected by users +type SelectableStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + VerboseName string `json:"verbose_name"` + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _SelectableStage SelectableStage + +// NewSelectableStage instantiates a new SelectableStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSelectableStage(pk string, name string, verboseName string, metaModelName string) *SelectableStage { + this := SelectableStage{} + this.Pk = pk + this.Name = name + this.VerboseName = verboseName + this.MetaModelName = metaModelName + return &this +} + +// NewSelectableStageWithDefaults instantiates a new SelectableStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSelectableStageWithDefaults() *SelectableStage { + this := SelectableStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *SelectableStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SelectableStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SelectableStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SelectableStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SelectableStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SelectableStage) SetName(v string) { + o.Name = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SelectableStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SelectableStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SelectableStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SelectableStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SelectableStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SelectableStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o SelectableStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SelectableStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["verbose_name"] = o.VerboseName + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SelectableStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "verbose_name", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSelectableStage := _SelectableStage{} + + err = json.Unmarshal(data, &varSelectableStage) + + if err != nil { + return err + } + + *o = SelectableStage(varSelectableStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSelectableStage struct { + value *SelectableStage + isSet bool +} + +func (v NullableSelectableStage) Get() *SelectableStage { + return v.value +} + +func (v *NullableSelectableStage) Set(val *SelectableStage) { + v.value = val + v.isSet = true +} + +func (v NullableSelectableStage) IsSet() bool { + return v.isSet +} + +func (v *NullableSelectableStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSelectableStage(val *SelectableStage) *NullableSelectableStage { + return &NullableSelectableStage{value: val, isSet: true} +} + +func (v NullableSelectableStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSelectableStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_service_connection.go b/packages/client-go/model_service_connection.go new file mode 100644 index 0000000000..68e2f1c1f6 --- /dev/null +++ b/packages/client-go/model_service_connection.go @@ -0,0 +1,354 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceConnection{} + +// ServiceConnection ServiceConnection Serializer +type ServiceConnection struct { + Pk string `json:"pk"` + Name string `json:"name"` + // If enabled, use the local connection. Required Docker socket/Kubernetes Integration + Local *bool `json:"local,omitempty"` + // Return component used to edit this object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _ServiceConnection ServiceConnection + +// NewServiceConnection instantiates a new ServiceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceConnection(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string) *ServiceConnection { + this := ServiceConnection{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewServiceConnectionWithDefaults instantiates a new ServiceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceConnectionWithDefaults() *ServiceConnection { + this := ServiceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *ServiceConnection) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *ServiceConnection) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *ServiceConnection) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ServiceConnection) SetName(v string) { + o.Name = v +} + +// GetLocal returns the Local field value if set, zero value otherwise. +func (o *ServiceConnection) GetLocal() bool { + if o == nil || IsNil(o.Local) { + var ret bool + return ret + } + return *o.Local +} + +// GetLocalOk returns a tuple with the Local field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetLocalOk() (*bool, bool) { + if o == nil || IsNil(o.Local) { + return nil, false + } + return o.Local, true +} + +// HasLocal returns a boolean if a field has been set. +func (o *ServiceConnection) HasLocal() bool { + if o != nil && !IsNil(o.Local) { + return true + } + + return false +} + +// SetLocal gets a reference to the given bool and assigns it to the Local field. +func (o *ServiceConnection) SetLocal(v bool) { + o.Local = &v +} + +// GetComponent returns the Component field value +func (o *ServiceConnection) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *ServiceConnection) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *ServiceConnection) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *ServiceConnection) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *ServiceConnection) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *ServiceConnection) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *ServiceConnection) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *ServiceConnection) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *ServiceConnection) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o ServiceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.Local) { + toSerialize["local"] = o.Local + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceConnection := _ServiceConnection{} + + err = json.Unmarshal(data, &varServiceConnection) + + if err != nil { + return err + } + + *o = ServiceConnection(varServiceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "local") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceConnection struct { + value *ServiceConnection + isSet bool +} + +func (v NullableServiceConnection) Get() *ServiceConnection { + return v.value +} + +func (v *NullableServiceConnection) Set(val *ServiceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableServiceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceConnection(val *ServiceConnection) *NullableServiceConnection { + return &NullableServiceConnection{value: val, isSet: true} +} + +func (v NullableServiceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_service_connection_state.go b/packages/client-go/model_service_connection_state.go new file mode 100644 index 0000000000..4e3b042ed9 --- /dev/null +++ b/packages/client-go/model_service_connection_state.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ServiceConnectionState type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceConnectionState{} + +// ServiceConnectionState Serializer for Service connection state +type ServiceConnectionState struct { + Healthy bool `json:"healthy"` + Version string `json:"version"` + AdditionalProperties map[string]interface{} +} + +type _ServiceConnectionState ServiceConnectionState + +// NewServiceConnectionState instantiates a new ServiceConnectionState object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceConnectionState(healthy bool, version string) *ServiceConnectionState { + this := ServiceConnectionState{} + this.Healthy = healthy + this.Version = version + return &this +} + +// NewServiceConnectionStateWithDefaults instantiates a new ServiceConnectionState object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceConnectionStateWithDefaults() *ServiceConnectionState { + this := ServiceConnectionState{} + return &this +} + +// GetHealthy returns the Healthy field value +func (o *ServiceConnectionState) GetHealthy() bool { + if o == nil { + var ret bool + return ret + } + + return o.Healthy +} + +// GetHealthyOk returns a tuple with the Healthy field value +// and a boolean to check if the value has been set. +func (o *ServiceConnectionState) GetHealthyOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Healthy, true +} + +// SetHealthy sets field value +func (o *ServiceConnectionState) SetHealthy(v bool) { + o.Healthy = v +} + +// GetVersion returns the Version field value +func (o *ServiceConnectionState) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *ServiceConnectionState) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *ServiceConnectionState) SetVersion(v string) { + o.Version = v +} + +func (o ServiceConnectionState) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceConnectionState) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["healthy"] = o.Healthy + toSerialize["version"] = o.Version + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ServiceConnectionState) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "healthy", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceConnectionState := _ServiceConnectionState{} + + err = json.Unmarshal(data, &varServiceConnectionState) + + if err != nil { + return err + } + + *o = ServiceConnectionState(varServiceConnectionState) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "healthy") + delete(additionalProperties, "version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableServiceConnectionState struct { + value *ServiceConnectionState + isSet bool +} + +func (v NullableServiceConnectionState) Get() *ServiceConnectionState { + return v.value +} + +func (v *NullableServiceConnectionState) Set(val *ServiceConnectionState) { + v.value = val + v.isSet = true +} + +func (v NullableServiceConnectionState) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceConnectionState) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceConnectionState(val *ServiceConnectionState) *NullableServiceConnectionState { + return &NullableServiceConnectionState{value: val, isSet: true} +} + +func (v NullableServiceConnectionState) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceConnectionState) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_session_end_challenge.go b/packages/client-go/model_session_end_challenge.go new file mode 100644 index 0000000000..d65fef8416 --- /dev/null +++ b/packages/client-go/model_session_end_challenge.go @@ -0,0 +1,451 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SessionEndChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SessionEndChallenge{} + +// SessionEndChallenge Challenge for ending a session +type SessionEndChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + ApplicationName *string `json:"application_name,omitempty"` + ApplicationLaunchUrl *string `json:"application_launch_url,omitempty"` + InvalidationFlowUrl *string `json:"invalidation_flow_url,omitempty"` + BrandName string `json:"brand_name"` + AdditionalProperties map[string]interface{} +} + +type _SessionEndChallenge SessionEndChallenge + +// NewSessionEndChallenge instantiates a new SessionEndChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSessionEndChallenge(pendingUser string, pendingUserAvatar string, brandName string) *SessionEndChallenge { + this := SessionEndChallenge{} + var component string = "ak-stage-session-end" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + this.BrandName = brandName + return &this +} + +// NewSessionEndChallengeWithDefaults instantiates a new SessionEndChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSessionEndChallengeWithDefaults() *SessionEndChallenge { + this := SessionEndChallenge{} + var component string = "ak-stage-session-end" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *SessionEndChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *SessionEndChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *SessionEndChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *SessionEndChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *SessionEndChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *SessionEndChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *SessionEndChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +// GetApplicationName returns the ApplicationName field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetApplicationName() string { + if o == nil || IsNil(o.ApplicationName) { + var ret string + return ret + } + return *o.ApplicationName +} + +// GetApplicationNameOk returns a tuple with the ApplicationName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetApplicationNameOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationName) { + return nil, false + } + return o.ApplicationName, true +} + +// HasApplicationName returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasApplicationName() bool { + if o != nil && !IsNil(o.ApplicationName) { + return true + } + + return false +} + +// SetApplicationName gets a reference to the given string and assigns it to the ApplicationName field. +func (o *SessionEndChallenge) SetApplicationName(v string) { + o.ApplicationName = &v +} + +// GetApplicationLaunchUrl returns the ApplicationLaunchUrl field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetApplicationLaunchUrl() string { + if o == nil || IsNil(o.ApplicationLaunchUrl) { + var ret string + return ret + } + return *o.ApplicationLaunchUrl +} + +// GetApplicationLaunchUrlOk returns a tuple with the ApplicationLaunchUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetApplicationLaunchUrlOk() (*string, bool) { + if o == nil || IsNil(o.ApplicationLaunchUrl) { + return nil, false + } + return o.ApplicationLaunchUrl, true +} + +// HasApplicationLaunchUrl returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasApplicationLaunchUrl() bool { + if o != nil && !IsNil(o.ApplicationLaunchUrl) { + return true + } + + return false +} + +// SetApplicationLaunchUrl gets a reference to the given string and assigns it to the ApplicationLaunchUrl field. +func (o *SessionEndChallenge) SetApplicationLaunchUrl(v string) { + o.ApplicationLaunchUrl = &v +} + +// GetInvalidationFlowUrl returns the InvalidationFlowUrl field value if set, zero value otherwise. +func (o *SessionEndChallenge) GetInvalidationFlowUrl() string { + if o == nil || IsNil(o.InvalidationFlowUrl) { + var ret string + return ret + } + return *o.InvalidationFlowUrl +} + +// GetInvalidationFlowUrlOk returns a tuple with the InvalidationFlowUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetInvalidationFlowUrlOk() (*string, bool) { + if o == nil || IsNil(o.InvalidationFlowUrl) { + return nil, false + } + return o.InvalidationFlowUrl, true +} + +// HasInvalidationFlowUrl returns a boolean if a field has been set. +func (o *SessionEndChallenge) HasInvalidationFlowUrl() bool { + if o != nil && !IsNil(o.InvalidationFlowUrl) { + return true + } + + return false +} + +// SetInvalidationFlowUrl gets a reference to the given string and assigns it to the InvalidationFlowUrl field. +func (o *SessionEndChallenge) SetInvalidationFlowUrl(v string) { + o.InvalidationFlowUrl = &v +} + +// GetBrandName returns the BrandName field value +func (o *SessionEndChallenge) GetBrandName() string { + if o == nil { + var ret string + return ret + } + + return o.BrandName +} + +// GetBrandNameOk returns a tuple with the BrandName field value +// and a boolean to check if the value has been set. +func (o *SessionEndChallenge) GetBrandNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BrandName, true +} + +// SetBrandName sets field value +func (o *SessionEndChallenge) SetBrandName(v string) { + o.BrandName = v +} + +func (o SessionEndChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SessionEndChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + if !IsNil(o.ApplicationName) { + toSerialize["application_name"] = o.ApplicationName + } + if !IsNil(o.ApplicationLaunchUrl) { + toSerialize["application_launch_url"] = o.ApplicationLaunchUrl + } + if !IsNil(o.InvalidationFlowUrl) { + toSerialize["invalidation_flow_url"] = o.InvalidationFlowUrl + } + toSerialize["brand_name"] = o.BrandName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SessionEndChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + "brand_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSessionEndChallenge := _SessionEndChallenge{} + + err = json.Unmarshal(data, &varSessionEndChallenge) + + if err != nil { + return err + } + + *o = SessionEndChallenge(varSessionEndChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + delete(additionalProperties, "application_name") + delete(additionalProperties, "application_launch_url") + delete(additionalProperties, "invalidation_flow_url") + delete(additionalProperties, "brand_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSessionEndChallenge struct { + value *SessionEndChallenge + isSet bool +} + +func (v NullableSessionEndChallenge) Get() *SessionEndChallenge { + return v.value +} + +func (v *NullableSessionEndChallenge) Set(val *SessionEndChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableSessionEndChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableSessionEndChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSessionEndChallenge(val *SessionEndChallenge) *NullableSessionEndChallenge { + return &NullableSessionEndChallenge{value: val, isSet: true} +} + +func (v NullableSessionEndChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSessionEndChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_session_user.go b/packages/client-go/model_session_user.go new file mode 100644 index 0000000000..b58aca3493 --- /dev/null +++ b/packages/client-go/model_session_user.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SessionUser type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SessionUser{} + +// SessionUser Response for the /user/me endpoint, returns the currently active user (as `user` property) and, if this user is being impersonated, the original user in the `original` property. +type SessionUser struct { + User UserSelf `json:"user"` + Original *UserSelf `json:"original,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SessionUser SessionUser + +// NewSessionUser instantiates a new SessionUser object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSessionUser(user UserSelf) *SessionUser { + this := SessionUser{} + this.User = user + return &this +} + +// NewSessionUserWithDefaults instantiates a new SessionUser object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSessionUserWithDefaults() *SessionUser { + this := SessionUser{} + return &this +} + +// GetUser returns the User field value +func (o *SessionUser) GetUser() UserSelf { + if o == nil { + var ret UserSelf + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SessionUser) GetUserOk() (*UserSelf, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SessionUser) SetUser(v UserSelf) { + o.User = v +} + +// GetOriginal returns the Original field value if set, zero value otherwise. +func (o *SessionUser) GetOriginal() UserSelf { + if o == nil || IsNil(o.Original) { + var ret UserSelf + return ret + } + return *o.Original +} + +// GetOriginalOk returns a tuple with the Original field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SessionUser) GetOriginalOk() (*UserSelf, bool) { + if o == nil || IsNil(o.Original) { + return nil, false + } + return o.Original, true +} + +// HasOriginal returns a boolean if a field has been set. +func (o *SessionUser) HasOriginal() bool { + if o != nil && !IsNil(o.Original) { + return true + } + + return false +} + +// SetOriginal gets a reference to the given UserSelf and assigns it to the Original field. +func (o *SessionUser) SetOriginal(v UserSelf) { + o.Original = &v +} + +func (o SessionUser) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SessionUser) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + if !IsNil(o.Original) { + toSerialize["original"] = o.Original + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SessionUser) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSessionUser := _SessionUser{} + + err = json.Unmarshal(data, &varSessionUser) + + if err != nil { + return err + } + + *o = SessionUser(varSessionUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "original") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSessionUser struct { + value *SessionUser + isSet bool +} + +func (v NullableSessionUser) Get() *SessionUser { + return v.value +} + +func (v *NullableSessionUser) Set(val *SessionUser) { + v.value = val + v.isSet = true +} + +func (v NullableSessionUser) IsSet() bool { + return v.isSet +} + +func (v *NullableSessionUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSessionUser(val *SessionUser) *NullableSessionUser { + return &NullableSessionUser{value: val, isSet: true} +} + +func (v NullableSessionUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSessionUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_settings.go b/packages/client-go/model_settings.go new file mode 100644 index 0000000000..28a86e7400 --- /dev/null +++ b/packages/client-go/model_settings.go @@ -0,0 +1,737 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Settings type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Settings{} + +// Settings Settings Serializer +type Settings struct { + // Configure how authentik should show avatars for users. + Avatars *string `json:"avatars,omitempty"` + // Enable the ability for users to change their name. + DefaultUserChangeName *bool `json:"default_user_change_name,omitempty"` + // Enable the ability for users to change their email address. + DefaultUserChangeEmail *bool `json:"default_user_change_email,omitempty"` + // Enable the ability for users to change their username. + DefaultUserChangeUsername *bool `json:"default_user_change_username,omitempty"` + // Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + EventRetention *string `json:"event_retention,omitempty"` + // Reputation cannot decrease lower than this value. Zero or negative. + ReputationLowerLimit *int32 `json:"reputation_lower_limit,omitempty"` + // Reputation cannot increase higher than this value. Zero or positive. + ReputationUpperLimit *int32 `json:"reputation_upper_limit,omitempty"` + FooterLinks interface{} `json:"footer_links,omitempty"` + // When enabled, all the events caused by a user will be deleted upon the user's deletion. + GdprCompliance *bool `json:"gdpr_compliance,omitempty"` + // Globally enable/disable impersonation. + Impersonation *bool `json:"impersonation,omitempty"` + // Require administrators to provide a reason for impersonating a user. + ImpersonationRequireReason *bool `json:"impersonation_require_reason,omitempty"` + // Default token duration + DefaultTokenDuration *string `json:"default_token_duration,omitempty"` + // Default token length + DefaultTokenLength *int32 `json:"default_token_length,omitempty"` + // Default page size for API responses, if no size was requested. + PaginationDefaultPageSize *int32 `json:"pagination_default_page_size,omitempty"` + // Maximum page size + PaginationMaxPageSize *int32 `json:"pagination_max_page_size,omitempty"` + Flags PatchedSettingsRequestFlags `json:"flags"` + AdditionalProperties map[string]interface{} +} + +type _Settings Settings + +// NewSettings instantiates a new Settings object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSettings(flags PatchedSettingsRequestFlags) *Settings { + this := Settings{} + this.Flags = flags + return &this +} + +// NewSettingsWithDefaults instantiates a new Settings object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSettingsWithDefaults() *Settings { + this := Settings{} + return &this +} + +// GetAvatars returns the Avatars field value if set, zero value otherwise. +func (o *Settings) GetAvatars() string { + if o == nil || IsNil(o.Avatars) { + var ret string + return ret + } + return *o.Avatars +} + +// GetAvatarsOk returns a tuple with the Avatars field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetAvatarsOk() (*string, bool) { + if o == nil || IsNil(o.Avatars) { + return nil, false + } + return o.Avatars, true +} + +// HasAvatars returns a boolean if a field has been set. +func (o *Settings) HasAvatars() bool { + if o != nil && !IsNil(o.Avatars) { + return true + } + + return false +} + +// SetAvatars gets a reference to the given string and assigns it to the Avatars field. +func (o *Settings) SetAvatars(v string) { + o.Avatars = &v +} + +// GetDefaultUserChangeName returns the DefaultUserChangeName field value if set, zero value otherwise. +func (o *Settings) GetDefaultUserChangeName() bool { + if o == nil || IsNil(o.DefaultUserChangeName) { + var ret bool + return ret + } + return *o.DefaultUserChangeName +} + +// GetDefaultUserChangeNameOk returns a tuple with the DefaultUserChangeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetDefaultUserChangeNameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeName) { + return nil, false + } + return o.DefaultUserChangeName, true +} + +// HasDefaultUserChangeName returns a boolean if a field has been set. +func (o *Settings) HasDefaultUserChangeName() bool { + if o != nil && !IsNil(o.DefaultUserChangeName) { + return true + } + + return false +} + +// SetDefaultUserChangeName gets a reference to the given bool and assigns it to the DefaultUserChangeName field. +func (o *Settings) SetDefaultUserChangeName(v bool) { + o.DefaultUserChangeName = &v +} + +// GetDefaultUserChangeEmail returns the DefaultUserChangeEmail field value if set, zero value otherwise. +func (o *Settings) GetDefaultUserChangeEmail() bool { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + var ret bool + return ret + } + return *o.DefaultUserChangeEmail +} + +// GetDefaultUserChangeEmailOk returns a tuple with the DefaultUserChangeEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetDefaultUserChangeEmailOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + return nil, false + } + return o.DefaultUserChangeEmail, true +} + +// HasDefaultUserChangeEmail returns a boolean if a field has been set. +func (o *Settings) HasDefaultUserChangeEmail() bool { + if o != nil && !IsNil(o.DefaultUserChangeEmail) { + return true + } + + return false +} + +// SetDefaultUserChangeEmail gets a reference to the given bool and assigns it to the DefaultUserChangeEmail field. +func (o *Settings) SetDefaultUserChangeEmail(v bool) { + o.DefaultUserChangeEmail = &v +} + +// GetDefaultUserChangeUsername returns the DefaultUserChangeUsername field value if set, zero value otherwise. +func (o *Settings) GetDefaultUserChangeUsername() bool { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + var ret bool + return ret + } + return *o.DefaultUserChangeUsername +} + +// GetDefaultUserChangeUsernameOk returns a tuple with the DefaultUserChangeUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetDefaultUserChangeUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + return nil, false + } + return o.DefaultUserChangeUsername, true +} + +// HasDefaultUserChangeUsername returns a boolean if a field has been set. +func (o *Settings) HasDefaultUserChangeUsername() bool { + if o != nil && !IsNil(o.DefaultUserChangeUsername) { + return true + } + + return false +} + +// SetDefaultUserChangeUsername gets a reference to the given bool and assigns it to the DefaultUserChangeUsername field. +func (o *Settings) SetDefaultUserChangeUsername(v bool) { + o.DefaultUserChangeUsername = &v +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *Settings) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *Settings) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *Settings) SetEventRetention(v string) { + o.EventRetention = &v +} + +// GetReputationLowerLimit returns the ReputationLowerLimit field value if set, zero value otherwise. +func (o *Settings) GetReputationLowerLimit() int32 { + if o == nil || IsNil(o.ReputationLowerLimit) { + var ret int32 + return ret + } + return *o.ReputationLowerLimit +} + +// GetReputationLowerLimitOk returns a tuple with the ReputationLowerLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetReputationLowerLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationLowerLimit) { + return nil, false + } + return o.ReputationLowerLimit, true +} + +// HasReputationLowerLimit returns a boolean if a field has been set. +func (o *Settings) HasReputationLowerLimit() bool { + if o != nil && !IsNil(o.ReputationLowerLimit) { + return true + } + + return false +} + +// SetReputationLowerLimit gets a reference to the given int32 and assigns it to the ReputationLowerLimit field. +func (o *Settings) SetReputationLowerLimit(v int32) { + o.ReputationLowerLimit = &v +} + +// GetReputationUpperLimit returns the ReputationUpperLimit field value if set, zero value otherwise. +func (o *Settings) GetReputationUpperLimit() int32 { + if o == nil || IsNil(o.ReputationUpperLimit) { + var ret int32 + return ret + } + return *o.ReputationUpperLimit +} + +// GetReputationUpperLimitOk returns a tuple with the ReputationUpperLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetReputationUpperLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationUpperLimit) { + return nil, false + } + return o.ReputationUpperLimit, true +} + +// HasReputationUpperLimit returns a boolean if a field has been set. +func (o *Settings) HasReputationUpperLimit() bool { + if o != nil && !IsNil(o.ReputationUpperLimit) { + return true + } + + return false +} + +// SetReputationUpperLimit gets a reference to the given int32 and assigns it to the ReputationUpperLimit field. +func (o *Settings) SetReputationUpperLimit(v int32) { + o.ReputationUpperLimit = &v +} + +// GetFooterLinks returns the FooterLinks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Settings) GetFooterLinks() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.FooterLinks +} + +// GetFooterLinksOk returns a tuple with the FooterLinks field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Settings) GetFooterLinksOk() (*interface{}, bool) { + if o == nil || IsNil(o.FooterLinks) { + return nil, false + } + return &o.FooterLinks, true +} + +// HasFooterLinks returns a boolean if a field has been set. +func (o *Settings) HasFooterLinks() bool { + if o != nil && !IsNil(o.FooterLinks) { + return true + } + + return false +} + +// SetFooterLinks gets a reference to the given interface{} and assigns it to the FooterLinks field. +func (o *Settings) SetFooterLinks(v interface{}) { + o.FooterLinks = v +} + +// GetGdprCompliance returns the GdprCompliance field value if set, zero value otherwise. +func (o *Settings) GetGdprCompliance() bool { + if o == nil || IsNil(o.GdprCompliance) { + var ret bool + return ret + } + return *o.GdprCompliance +} + +// GetGdprComplianceOk returns a tuple with the GdprCompliance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetGdprComplianceOk() (*bool, bool) { + if o == nil || IsNil(o.GdprCompliance) { + return nil, false + } + return o.GdprCompliance, true +} + +// HasGdprCompliance returns a boolean if a field has been set. +func (o *Settings) HasGdprCompliance() bool { + if o != nil && !IsNil(o.GdprCompliance) { + return true + } + + return false +} + +// SetGdprCompliance gets a reference to the given bool and assigns it to the GdprCompliance field. +func (o *Settings) SetGdprCompliance(v bool) { + o.GdprCompliance = &v +} + +// GetImpersonation returns the Impersonation field value if set, zero value otherwise. +func (o *Settings) GetImpersonation() bool { + if o == nil || IsNil(o.Impersonation) { + var ret bool + return ret + } + return *o.Impersonation +} + +// GetImpersonationOk returns a tuple with the Impersonation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetImpersonationOk() (*bool, bool) { + if o == nil || IsNil(o.Impersonation) { + return nil, false + } + return o.Impersonation, true +} + +// HasImpersonation returns a boolean if a field has been set. +func (o *Settings) HasImpersonation() bool { + if o != nil && !IsNil(o.Impersonation) { + return true + } + + return false +} + +// SetImpersonation gets a reference to the given bool and assigns it to the Impersonation field. +func (o *Settings) SetImpersonation(v bool) { + o.Impersonation = &v +} + +// GetImpersonationRequireReason returns the ImpersonationRequireReason field value if set, zero value otherwise. +func (o *Settings) GetImpersonationRequireReason() bool { + if o == nil || IsNil(o.ImpersonationRequireReason) { + var ret bool + return ret + } + return *o.ImpersonationRequireReason +} + +// GetImpersonationRequireReasonOk returns a tuple with the ImpersonationRequireReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetImpersonationRequireReasonOk() (*bool, bool) { + if o == nil || IsNil(o.ImpersonationRequireReason) { + return nil, false + } + return o.ImpersonationRequireReason, true +} + +// HasImpersonationRequireReason returns a boolean if a field has been set. +func (o *Settings) HasImpersonationRequireReason() bool { + if o != nil && !IsNil(o.ImpersonationRequireReason) { + return true + } + + return false +} + +// SetImpersonationRequireReason gets a reference to the given bool and assigns it to the ImpersonationRequireReason field. +func (o *Settings) SetImpersonationRequireReason(v bool) { + o.ImpersonationRequireReason = &v +} + +// GetDefaultTokenDuration returns the DefaultTokenDuration field value if set, zero value otherwise. +func (o *Settings) GetDefaultTokenDuration() string { + if o == nil || IsNil(o.DefaultTokenDuration) { + var ret string + return ret + } + return *o.DefaultTokenDuration +} + +// GetDefaultTokenDurationOk returns a tuple with the DefaultTokenDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetDefaultTokenDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultTokenDuration) { + return nil, false + } + return o.DefaultTokenDuration, true +} + +// HasDefaultTokenDuration returns a boolean if a field has been set. +func (o *Settings) HasDefaultTokenDuration() bool { + if o != nil && !IsNil(o.DefaultTokenDuration) { + return true + } + + return false +} + +// SetDefaultTokenDuration gets a reference to the given string and assigns it to the DefaultTokenDuration field. +func (o *Settings) SetDefaultTokenDuration(v string) { + o.DefaultTokenDuration = &v +} + +// GetDefaultTokenLength returns the DefaultTokenLength field value if set, zero value otherwise. +func (o *Settings) GetDefaultTokenLength() int32 { + if o == nil || IsNil(o.DefaultTokenLength) { + var ret int32 + return ret + } + return *o.DefaultTokenLength +} + +// GetDefaultTokenLengthOk returns a tuple with the DefaultTokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetDefaultTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultTokenLength) { + return nil, false + } + return o.DefaultTokenLength, true +} + +// HasDefaultTokenLength returns a boolean if a field has been set. +func (o *Settings) HasDefaultTokenLength() bool { + if o != nil && !IsNil(o.DefaultTokenLength) { + return true + } + + return false +} + +// SetDefaultTokenLength gets a reference to the given int32 and assigns it to the DefaultTokenLength field. +func (o *Settings) SetDefaultTokenLength(v int32) { + o.DefaultTokenLength = &v +} + +// GetPaginationDefaultPageSize returns the PaginationDefaultPageSize field value if set, zero value otherwise. +func (o *Settings) GetPaginationDefaultPageSize() int32 { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + var ret int32 + return ret + } + return *o.PaginationDefaultPageSize +} + +// GetPaginationDefaultPageSizeOk returns a tuple with the PaginationDefaultPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetPaginationDefaultPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + return nil, false + } + return o.PaginationDefaultPageSize, true +} + +// HasPaginationDefaultPageSize returns a boolean if a field has been set. +func (o *Settings) HasPaginationDefaultPageSize() bool { + if o != nil && !IsNil(o.PaginationDefaultPageSize) { + return true + } + + return false +} + +// SetPaginationDefaultPageSize gets a reference to the given int32 and assigns it to the PaginationDefaultPageSize field. +func (o *Settings) SetPaginationDefaultPageSize(v int32) { + o.PaginationDefaultPageSize = &v +} + +// GetPaginationMaxPageSize returns the PaginationMaxPageSize field value if set, zero value otherwise. +func (o *Settings) GetPaginationMaxPageSize() int32 { + if o == nil || IsNil(o.PaginationMaxPageSize) { + var ret int32 + return ret + } + return *o.PaginationMaxPageSize +} + +// GetPaginationMaxPageSizeOk returns a tuple with the PaginationMaxPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Settings) GetPaginationMaxPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationMaxPageSize) { + return nil, false + } + return o.PaginationMaxPageSize, true +} + +// HasPaginationMaxPageSize returns a boolean if a field has been set. +func (o *Settings) HasPaginationMaxPageSize() bool { + if o != nil && !IsNil(o.PaginationMaxPageSize) { + return true + } + + return false +} + +// SetPaginationMaxPageSize gets a reference to the given int32 and assigns it to the PaginationMaxPageSize field. +func (o *Settings) SetPaginationMaxPageSize(v int32) { + o.PaginationMaxPageSize = &v +} + +// GetFlags returns the Flags field value +func (o *Settings) GetFlags() PatchedSettingsRequestFlags { + if o == nil { + var ret PatchedSettingsRequestFlags + return ret + } + + return o.Flags +} + +// GetFlagsOk returns a tuple with the Flags field value +// and a boolean to check if the value has been set. +func (o *Settings) GetFlagsOk() (*PatchedSettingsRequestFlags, bool) { + if o == nil { + return nil, false + } + return &o.Flags, true +} + +// SetFlags sets field value +func (o *Settings) SetFlags(v PatchedSettingsRequestFlags) { + o.Flags = v +} + +func (o Settings) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Settings) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Avatars) { + toSerialize["avatars"] = o.Avatars + } + if !IsNil(o.DefaultUserChangeName) { + toSerialize["default_user_change_name"] = o.DefaultUserChangeName + } + if !IsNil(o.DefaultUserChangeEmail) { + toSerialize["default_user_change_email"] = o.DefaultUserChangeEmail + } + if !IsNil(o.DefaultUserChangeUsername) { + toSerialize["default_user_change_username"] = o.DefaultUserChangeUsername + } + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + if !IsNil(o.ReputationLowerLimit) { + toSerialize["reputation_lower_limit"] = o.ReputationLowerLimit + } + if !IsNil(o.ReputationUpperLimit) { + toSerialize["reputation_upper_limit"] = o.ReputationUpperLimit + } + if o.FooterLinks != nil { + toSerialize["footer_links"] = o.FooterLinks + } + if !IsNil(o.GdprCompliance) { + toSerialize["gdpr_compliance"] = o.GdprCompliance + } + if !IsNil(o.Impersonation) { + toSerialize["impersonation"] = o.Impersonation + } + if !IsNil(o.ImpersonationRequireReason) { + toSerialize["impersonation_require_reason"] = o.ImpersonationRequireReason + } + if !IsNil(o.DefaultTokenDuration) { + toSerialize["default_token_duration"] = o.DefaultTokenDuration + } + if !IsNil(o.DefaultTokenLength) { + toSerialize["default_token_length"] = o.DefaultTokenLength + } + if !IsNil(o.PaginationDefaultPageSize) { + toSerialize["pagination_default_page_size"] = o.PaginationDefaultPageSize + } + if !IsNil(o.PaginationMaxPageSize) { + toSerialize["pagination_max_page_size"] = o.PaginationMaxPageSize + } + toSerialize["flags"] = o.Flags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Settings) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "flags", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSettings := _Settings{} + + err = json.Unmarshal(data, &varSettings) + + if err != nil { + return err + } + + *o = Settings(varSettings) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "avatars") + delete(additionalProperties, "default_user_change_name") + delete(additionalProperties, "default_user_change_email") + delete(additionalProperties, "default_user_change_username") + delete(additionalProperties, "event_retention") + delete(additionalProperties, "reputation_lower_limit") + delete(additionalProperties, "reputation_upper_limit") + delete(additionalProperties, "footer_links") + delete(additionalProperties, "gdpr_compliance") + delete(additionalProperties, "impersonation") + delete(additionalProperties, "impersonation_require_reason") + delete(additionalProperties, "default_token_duration") + delete(additionalProperties, "default_token_length") + delete(additionalProperties, "pagination_default_page_size") + delete(additionalProperties, "pagination_max_page_size") + delete(additionalProperties, "flags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSettings struct { + value *Settings + isSet bool +} + +func (v NullableSettings) Get() *Settings { + return v.value +} + +func (v *NullableSettings) Set(val *Settings) { + v.value = val + v.isSet = true +} + +func (v NullableSettings) IsSet() bool { + return v.isSet +} + +func (v *NullableSettings) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSettings(val *Settings) *NullableSettings { + return &NullableSettings{value: val, isSet: true} +} + +func (v NullableSettings) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSettings) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_settings_request.go b/packages/client-go/model_settings_request.go new file mode 100644 index 0000000000..ccdefe1f12 --- /dev/null +++ b/packages/client-go/model_settings_request.go @@ -0,0 +1,737 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SettingsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SettingsRequest{} + +// SettingsRequest Settings Serializer +type SettingsRequest struct { + // Configure how authentik should show avatars for users. + Avatars *string `json:"avatars,omitempty"` + // Enable the ability for users to change their name. + DefaultUserChangeName *bool `json:"default_user_change_name,omitempty"` + // Enable the ability for users to change their email address. + DefaultUserChangeEmail *bool `json:"default_user_change_email,omitempty"` + // Enable the ability for users to change their username. + DefaultUserChangeUsername *bool `json:"default_user_change_username,omitempty"` + // Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). + EventRetention *string `json:"event_retention,omitempty"` + // Reputation cannot decrease lower than this value. Zero or negative. + ReputationLowerLimit *int32 `json:"reputation_lower_limit,omitempty"` + // Reputation cannot increase higher than this value. Zero or positive. + ReputationUpperLimit *int32 `json:"reputation_upper_limit,omitempty"` + FooterLinks interface{} `json:"footer_links,omitempty"` + // When enabled, all the events caused by a user will be deleted upon the user's deletion. + GdprCompliance *bool `json:"gdpr_compliance,omitempty"` + // Globally enable/disable impersonation. + Impersonation *bool `json:"impersonation,omitempty"` + // Require administrators to provide a reason for impersonating a user. + ImpersonationRequireReason *bool `json:"impersonation_require_reason,omitempty"` + // Default token duration + DefaultTokenDuration *string `json:"default_token_duration,omitempty"` + // Default token length + DefaultTokenLength *int32 `json:"default_token_length,omitempty"` + // Default page size for API responses, if no size was requested. + PaginationDefaultPageSize *int32 `json:"pagination_default_page_size,omitempty"` + // Maximum page size + PaginationMaxPageSize *int32 `json:"pagination_max_page_size,omitempty"` + Flags PatchedSettingsRequestFlags `json:"flags"` + AdditionalProperties map[string]interface{} +} + +type _SettingsRequest SettingsRequest + +// NewSettingsRequest instantiates a new SettingsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSettingsRequest(flags PatchedSettingsRequestFlags) *SettingsRequest { + this := SettingsRequest{} + this.Flags = flags + return &this +} + +// NewSettingsRequestWithDefaults instantiates a new SettingsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSettingsRequestWithDefaults() *SettingsRequest { + this := SettingsRequest{} + return &this +} + +// GetAvatars returns the Avatars field value if set, zero value otherwise. +func (o *SettingsRequest) GetAvatars() string { + if o == nil || IsNil(o.Avatars) { + var ret string + return ret + } + return *o.Avatars +} + +// GetAvatarsOk returns a tuple with the Avatars field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetAvatarsOk() (*string, bool) { + if o == nil || IsNil(o.Avatars) { + return nil, false + } + return o.Avatars, true +} + +// HasAvatars returns a boolean if a field has been set. +func (o *SettingsRequest) HasAvatars() bool { + if o != nil && !IsNil(o.Avatars) { + return true + } + + return false +} + +// SetAvatars gets a reference to the given string and assigns it to the Avatars field. +func (o *SettingsRequest) SetAvatars(v string) { + o.Avatars = &v +} + +// GetDefaultUserChangeName returns the DefaultUserChangeName field value if set, zero value otherwise. +func (o *SettingsRequest) GetDefaultUserChangeName() bool { + if o == nil || IsNil(o.DefaultUserChangeName) { + var ret bool + return ret + } + return *o.DefaultUserChangeName +} + +// GetDefaultUserChangeNameOk returns a tuple with the DefaultUserChangeName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetDefaultUserChangeNameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeName) { + return nil, false + } + return o.DefaultUserChangeName, true +} + +// HasDefaultUserChangeName returns a boolean if a field has been set. +func (o *SettingsRequest) HasDefaultUserChangeName() bool { + if o != nil && !IsNil(o.DefaultUserChangeName) { + return true + } + + return false +} + +// SetDefaultUserChangeName gets a reference to the given bool and assigns it to the DefaultUserChangeName field. +func (o *SettingsRequest) SetDefaultUserChangeName(v bool) { + o.DefaultUserChangeName = &v +} + +// GetDefaultUserChangeEmail returns the DefaultUserChangeEmail field value if set, zero value otherwise. +func (o *SettingsRequest) GetDefaultUserChangeEmail() bool { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + var ret bool + return ret + } + return *o.DefaultUserChangeEmail +} + +// GetDefaultUserChangeEmailOk returns a tuple with the DefaultUserChangeEmail field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetDefaultUserChangeEmailOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeEmail) { + return nil, false + } + return o.DefaultUserChangeEmail, true +} + +// HasDefaultUserChangeEmail returns a boolean if a field has been set. +func (o *SettingsRequest) HasDefaultUserChangeEmail() bool { + if o != nil && !IsNil(o.DefaultUserChangeEmail) { + return true + } + + return false +} + +// SetDefaultUserChangeEmail gets a reference to the given bool and assigns it to the DefaultUserChangeEmail field. +func (o *SettingsRequest) SetDefaultUserChangeEmail(v bool) { + o.DefaultUserChangeEmail = &v +} + +// GetDefaultUserChangeUsername returns the DefaultUserChangeUsername field value if set, zero value otherwise. +func (o *SettingsRequest) GetDefaultUserChangeUsername() bool { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + var ret bool + return ret + } + return *o.DefaultUserChangeUsername +} + +// GetDefaultUserChangeUsernameOk returns a tuple with the DefaultUserChangeUsername field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetDefaultUserChangeUsernameOk() (*bool, bool) { + if o == nil || IsNil(o.DefaultUserChangeUsername) { + return nil, false + } + return o.DefaultUserChangeUsername, true +} + +// HasDefaultUserChangeUsername returns a boolean if a field has been set. +func (o *SettingsRequest) HasDefaultUserChangeUsername() bool { + if o != nil && !IsNil(o.DefaultUserChangeUsername) { + return true + } + + return false +} + +// SetDefaultUserChangeUsername gets a reference to the given bool and assigns it to the DefaultUserChangeUsername field. +func (o *SettingsRequest) SetDefaultUserChangeUsername(v bool) { + o.DefaultUserChangeUsername = &v +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *SettingsRequest) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *SettingsRequest) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *SettingsRequest) SetEventRetention(v string) { + o.EventRetention = &v +} + +// GetReputationLowerLimit returns the ReputationLowerLimit field value if set, zero value otherwise. +func (o *SettingsRequest) GetReputationLowerLimit() int32 { + if o == nil || IsNil(o.ReputationLowerLimit) { + var ret int32 + return ret + } + return *o.ReputationLowerLimit +} + +// GetReputationLowerLimitOk returns a tuple with the ReputationLowerLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetReputationLowerLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationLowerLimit) { + return nil, false + } + return o.ReputationLowerLimit, true +} + +// HasReputationLowerLimit returns a boolean if a field has been set. +func (o *SettingsRequest) HasReputationLowerLimit() bool { + if o != nil && !IsNil(o.ReputationLowerLimit) { + return true + } + + return false +} + +// SetReputationLowerLimit gets a reference to the given int32 and assigns it to the ReputationLowerLimit field. +func (o *SettingsRequest) SetReputationLowerLimit(v int32) { + o.ReputationLowerLimit = &v +} + +// GetReputationUpperLimit returns the ReputationUpperLimit field value if set, zero value otherwise. +func (o *SettingsRequest) GetReputationUpperLimit() int32 { + if o == nil || IsNil(o.ReputationUpperLimit) { + var ret int32 + return ret + } + return *o.ReputationUpperLimit +} + +// GetReputationUpperLimitOk returns a tuple with the ReputationUpperLimit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetReputationUpperLimitOk() (*int32, bool) { + if o == nil || IsNil(o.ReputationUpperLimit) { + return nil, false + } + return o.ReputationUpperLimit, true +} + +// HasReputationUpperLimit returns a boolean if a field has been set. +func (o *SettingsRequest) HasReputationUpperLimit() bool { + if o != nil && !IsNil(o.ReputationUpperLimit) { + return true + } + + return false +} + +// SetReputationUpperLimit gets a reference to the given int32 and assigns it to the ReputationUpperLimit field. +func (o *SettingsRequest) SetReputationUpperLimit(v int32) { + o.ReputationUpperLimit = &v +} + +// GetFooterLinks returns the FooterLinks field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SettingsRequest) GetFooterLinks() interface{} { + if o == nil { + var ret interface{} + return ret + } + return o.FooterLinks +} + +// GetFooterLinksOk returns a tuple with the FooterLinks field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SettingsRequest) GetFooterLinksOk() (*interface{}, bool) { + if o == nil || IsNil(o.FooterLinks) { + return nil, false + } + return &o.FooterLinks, true +} + +// HasFooterLinks returns a boolean if a field has been set. +func (o *SettingsRequest) HasFooterLinks() bool { + if o != nil && !IsNil(o.FooterLinks) { + return true + } + + return false +} + +// SetFooterLinks gets a reference to the given interface{} and assigns it to the FooterLinks field. +func (o *SettingsRequest) SetFooterLinks(v interface{}) { + o.FooterLinks = v +} + +// GetGdprCompliance returns the GdprCompliance field value if set, zero value otherwise. +func (o *SettingsRequest) GetGdprCompliance() bool { + if o == nil || IsNil(o.GdprCompliance) { + var ret bool + return ret + } + return *o.GdprCompliance +} + +// GetGdprComplianceOk returns a tuple with the GdprCompliance field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetGdprComplianceOk() (*bool, bool) { + if o == nil || IsNil(o.GdprCompliance) { + return nil, false + } + return o.GdprCompliance, true +} + +// HasGdprCompliance returns a boolean if a field has been set. +func (o *SettingsRequest) HasGdprCompliance() bool { + if o != nil && !IsNil(o.GdprCompliance) { + return true + } + + return false +} + +// SetGdprCompliance gets a reference to the given bool and assigns it to the GdprCompliance field. +func (o *SettingsRequest) SetGdprCompliance(v bool) { + o.GdprCompliance = &v +} + +// GetImpersonation returns the Impersonation field value if set, zero value otherwise. +func (o *SettingsRequest) GetImpersonation() bool { + if o == nil || IsNil(o.Impersonation) { + var ret bool + return ret + } + return *o.Impersonation +} + +// GetImpersonationOk returns a tuple with the Impersonation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetImpersonationOk() (*bool, bool) { + if o == nil || IsNil(o.Impersonation) { + return nil, false + } + return o.Impersonation, true +} + +// HasImpersonation returns a boolean if a field has been set. +func (o *SettingsRequest) HasImpersonation() bool { + if o != nil && !IsNil(o.Impersonation) { + return true + } + + return false +} + +// SetImpersonation gets a reference to the given bool and assigns it to the Impersonation field. +func (o *SettingsRequest) SetImpersonation(v bool) { + o.Impersonation = &v +} + +// GetImpersonationRequireReason returns the ImpersonationRequireReason field value if set, zero value otherwise. +func (o *SettingsRequest) GetImpersonationRequireReason() bool { + if o == nil || IsNil(o.ImpersonationRequireReason) { + var ret bool + return ret + } + return *o.ImpersonationRequireReason +} + +// GetImpersonationRequireReasonOk returns a tuple with the ImpersonationRequireReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetImpersonationRequireReasonOk() (*bool, bool) { + if o == nil || IsNil(o.ImpersonationRequireReason) { + return nil, false + } + return o.ImpersonationRequireReason, true +} + +// HasImpersonationRequireReason returns a boolean if a field has been set. +func (o *SettingsRequest) HasImpersonationRequireReason() bool { + if o != nil && !IsNil(o.ImpersonationRequireReason) { + return true + } + + return false +} + +// SetImpersonationRequireReason gets a reference to the given bool and assigns it to the ImpersonationRequireReason field. +func (o *SettingsRequest) SetImpersonationRequireReason(v bool) { + o.ImpersonationRequireReason = &v +} + +// GetDefaultTokenDuration returns the DefaultTokenDuration field value if set, zero value otherwise. +func (o *SettingsRequest) GetDefaultTokenDuration() string { + if o == nil || IsNil(o.DefaultTokenDuration) { + var ret string + return ret + } + return *o.DefaultTokenDuration +} + +// GetDefaultTokenDurationOk returns a tuple with the DefaultTokenDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetDefaultTokenDurationOk() (*string, bool) { + if o == nil || IsNil(o.DefaultTokenDuration) { + return nil, false + } + return o.DefaultTokenDuration, true +} + +// HasDefaultTokenDuration returns a boolean if a field has been set. +func (o *SettingsRequest) HasDefaultTokenDuration() bool { + if o != nil && !IsNil(o.DefaultTokenDuration) { + return true + } + + return false +} + +// SetDefaultTokenDuration gets a reference to the given string and assigns it to the DefaultTokenDuration field. +func (o *SettingsRequest) SetDefaultTokenDuration(v string) { + o.DefaultTokenDuration = &v +} + +// GetDefaultTokenLength returns the DefaultTokenLength field value if set, zero value otherwise. +func (o *SettingsRequest) GetDefaultTokenLength() int32 { + if o == nil || IsNil(o.DefaultTokenLength) { + var ret int32 + return ret + } + return *o.DefaultTokenLength +} + +// GetDefaultTokenLengthOk returns a tuple with the DefaultTokenLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetDefaultTokenLengthOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultTokenLength) { + return nil, false + } + return o.DefaultTokenLength, true +} + +// HasDefaultTokenLength returns a boolean if a field has been set. +func (o *SettingsRequest) HasDefaultTokenLength() bool { + if o != nil && !IsNil(o.DefaultTokenLength) { + return true + } + + return false +} + +// SetDefaultTokenLength gets a reference to the given int32 and assigns it to the DefaultTokenLength field. +func (o *SettingsRequest) SetDefaultTokenLength(v int32) { + o.DefaultTokenLength = &v +} + +// GetPaginationDefaultPageSize returns the PaginationDefaultPageSize field value if set, zero value otherwise. +func (o *SettingsRequest) GetPaginationDefaultPageSize() int32 { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + var ret int32 + return ret + } + return *o.PaginationDefaultPageSize +} + +// GetPaginationDefaultPageSizeOk returns a tuple with the PaginationDefaultPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetPaginationDefaultPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationDefaultPageSize) { + return nil, false + } + return o.PaginationDefaultPageSize, true +} + +// HasPaginationDefaultPageSize returns a boolean if a field has been set. +func (o *SettingsRequest) HasPaginationDefaultPageSize() bool { + if o != nil && !IsNil(o.PaginationDefaultPageSize) { + return true + } + + return false +} + +// SetPaginationDefaultPageSize gets a reference to the given int32 and assigns it to the PaginationDefaultPageSize field. +func (o *SettingsRequest) SetPaginationDefaultPageSize(v int32) { + o.PaginationDefaultPageSize = &v +} + +// GetPaginationMaxPageSize returns the PaginationMaxPageSize field value if set, zero value otherwise. +func (o *SettingsRequest) GetPaginationMaxPageSize() int32 { + if o == nil || IsNil(o.PaginationMaxPageSize) { + var ret int32 + return ret + } + return *o.PaginationMaxPageSize +} + +// GetPaginationMaxPageSizeOk returns a tuple with the PaginationMaxPageSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetPaginationMaxPageSizeOk() (*int32, bool) { + if o == nil || IsNil(o.PaginationMaxPageSize) { + return nil, false + } + return o.PaginationMaxPageSize, true +} + +// HasPaginationMaxPageSize returns a boolean if a field has been set. +func (o *SettingsRequest) HasPaginationMaxPageSize() bool { + if o != nil && !IsNil(o.PaginationMaxPageSize) { + return true + } + + return false +} + +// SetPaginationMaxPageSize gets a reference to the given int32 and assigns it to the PaginationMaxPageSize field. +func (o *SettingsRequest) SetPaginationMaxPageSize(v int32) { + o.PaginationMaxPageSize = &v +} + +// GetFlags returns the Flags field value +func (o *SettingsRequest) GetFlags() PatchedSettingsRequestFlags { + if o == nil { + var ret PatchedSettingsRequestFlags + return ret + } + + return o.Flags +} + +// GetFlagsOk returns a tuple with the Flags field value +// and a boolean to check if the value has been set. +func (o *SettingsRequest) GetFlagsOk() (*PatchedSettingsRequestFlags, bool) { + if o == nil { + return nil, false + } + return &o.Flags, true +} + +// SetFlags sets field value +func (o *SettingsRequest) SetFlags(v PatchedSettingsRequestFlags) { + o.Flags = v +} + +func (o SettingsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SettingsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Avatars) { + toSerialize["avatars"] = o.Avatars + } + if !IsNil(o.DefaultUserChangeName) { + toSerialize["default_user_change_name"] = o.DefaultUserChangeName + } + if !IsNil(o.DefaultUserChangeEmail) { + toSerialize["default_user_change_email"] = o.DefaultUserChangeEmail + } + if !IsNil(o.DefaultUserChangeUsername) { + toSerialize["default_user_change_username"] = o.DefaultUserChangeUsername + } + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + if !IsNil(o.ReputationLowerLimit) { + toSerialize["reputation_lower_limit"] = o.ReputationLowerLimit + } + if !IsNil(o.ReputationUpperLimit) { + toSerialize["reputation_upper_limit"] = o.ReputationUpperLimit + } + if o.FooterLinks != nil { + toSerialize["footer_links"] = o.FooterLinks + } + if !IsNil(o.GdprCompliance) { + toSerialize["gdpr_compliance"] = o.GdprCompliance + } + if !IsNil(o.Impersonation) { + toSerialize["impersonation"] = o.Impersonation + } + if !IsNil(o.ImpersonationRequireReason) { + toSerialize["impersonation_require_reason"] = o.ImpersonationRequireReason + } + if !IsNil(o.DefaultTokenDuration) { + toSerialize["default_token_duration"] = o.DefaultTokenDuration + } + if !IsNil(o.DefaultTokenLength) { + toSerialize["default_token_length"] = o.DefaultTokenLength + } + if !IsNil(o.PaginationDefaultPageSize) { + toSerialize["pagination_default_page_size"] = o.PaginationDefaultPageSize + } + if !IsNil(o.PaginationMaxPageSize) { + toSerialize["pagination_max_page_size"] = o.PaginationMaxPageSize + } + toSerialize["flags"] = o.Flags + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SettingsRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "flags", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSettingsRequest := _SettingsRequest{} + + err = json.Unmarshal(data, &varSettingsRequest) + + if err != nil { + return err + } + + *o = SettingsRequest(varSettingsRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "avatars") + delete(additionalProperties, "default_user_change_name") + delete(additionalProperties, "default_user_change_email") + delete(additionalProperties, "default_user_change_username") + delete(additionalProperties, "event_retention") + delete(additionalProperties, "reputation_lower_limit") + delete(additionalProperties, "reputation_upper_limit") + delete(additionalProperties, "footer_links") + delete(additionalProperties, "gdpr_compliance") + delete(additionalProperties, "impersonation") + delete(additionalProperties, "impersonation_require_reason") + delete(additionalProperties, "default_token_duration") + delete(additionalProperties, "default_token_length") + delete(additionalProperties, "pagination_default_page_size") + delete(additionalProperties, "pagination_max_page_size") + delete(additionalProperties, "flags") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSettingsRequest struct { + value *SettingsRequest + isSet bool +} + +func (v NullableSettingsRequest) Get() *SettingsRequest { + return v.value +} + +func (v *NullableSettingsRequest) Set(val *SettingsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSettingsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSettingsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSettingsRequest(val *SettingsRequest) *NullableSettingsRequest { + return &NullableSettingsRequest{value: val, isSet: true} +} + +func (v NullableSettingsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSettingsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_severity_enum.go b/packages/client-go/model_severity_enum.go new file mode 100644 index 0000000000..82ae5720b2 --- /dev/null +++ b/packages/client-go/model_severity_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SeverityEnum the model 'SeverityEnum' +type SeverityEnum string + +// List of SeverityEnum +const ( + SEVERITYENUM_NOTICE SeverityEnum = "notice" + SEVERITYENUM_WARNING SeverityEnum = "warning" + SEVERITYENUM_ALERT SeverityEnum = "alert" +) + +// All allowed values of SeverityEnum enum +var AllowedSeverityEnumEnumValues = []SeverityEnum{ + "notice", + "warning", + "alert", +} + +func (v *SeverityEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SeverityEnum(value) + for _, existing := range AllowedSeverityEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SeverityEnum", value) +} + +// NewSeverityEnumFromValue returns a pointer to a valid SeverityEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSeverityEnumFromValue(v string) (*SeverityEnum, error) { + ev := SeverityEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SeverityEnum: valid values are %v", v, AllowedSeverityEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SeverityEnum) IsValid() bool { + for _, existing := range AllowedSeverityEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SeverityEnum value +func (v SeverityEnum) Ptr() *SeverityEnum { + return &v +} + +type NullableSeverityEnum struct { + value *SeverityEnum + isSet bool +} + +func (v NullableSeverityEnum) Get() *SeverityEnum { + return v.value +} + +func (v *NullableSeverityEnum) Set(val *SeverityEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSeverityEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSeverityEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSeverityEnum(val *SeverityEnum) *NullableSeverityEnum { + return &NullableSeverityEnum{value: val, isSet: true} +} + +func (v NullableSeverityEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSeverityEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_shell_challenge.go b/packages/client-go/model_shell_challenge.go new file mode 100644 index 0000000000..2813461a10 --- /dev/null +++ b/packages/client-go/model_shell_challenge.go @@ -0,0 +1,282 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the ShellChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ShellChallenge{} + +// ShellChallenge challenge type to render HTML as-is +type ShellChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + Body string `json:"body"` + AdditionalProperties map[string]interface{} +} + +type _ShellChallenge ShellChallenge + +// NewShellChallenge instantiates a new ShellChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewShellChallenge(body string) *ShellChallenge { + this := ShellChallenge{} + var component string = "xak-flow-shell" + this.Component = &component + this.Body = body + return &this +} + +// NewShellChallengeWithDefaults instantiates a new ShellChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewShellChallengeWithDefaults() *ShellChallenge { + this := ShellChallenge{} + var component string = "xak-flow-shell" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *ShellChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShellChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *ShellChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *ShellChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *ShellChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShellChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *ShellChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *ShellChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *ShellChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ShellChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *ShellChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *ShellChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetBody returns the Body field value +func (o *ShellChallenge) GetBody() string { + if o == nil { + var ret string + return ret + } + + return o.Body +} + +// GetBodyOk returns a tuple with the Body field value +// and a boolean to check if the value has been set. +func (o *ShellChallenge) GetBodyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Body, true +} + +// SetBody sets field value +func (o *ShellChallenge) SetBody(v string) { + o.Body = v +} + +func (o ShellChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ShellChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["body"] = o.Body + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ShellChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "body", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varShellChallenge := _ShellChallenge{} + + err = json.Unmarshal(data, &varShellChallenge) + + if err != nil { + return err + } + + *o = ShellChallenge(varShellChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "body") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableShellChallenge struct { + value *ShellChallenge + isSet bool +} + +func (v NullableShellChallenge) Get() *ShellChallenge { + return v.value +} + +func (v *NullableShellChallenge) Set(val *ShellChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableShellChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableShellChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableShellChallenge(val *ShellChallenge) *NullableShellChallenge { + return &NullableShellChallenge{value: val, isSet: true} +} + +func (v NullableShellChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableShellChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_signature_algorithm_enum.go b/packages/client-go/model_signature_algorithm_enum.go new file mode 100644 index 0000000000..1a615fa048 --- /dev/null +++ b/packages/client-go/model_signature_algorithm_enum.go @@ -0,0 +1,125 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SignatureAlgorithmEnum the model 'SignatureAlgorithmEnum' +type SignatureAlgorithmEnum string + +// List of SignatureAlgorithmEnum +const ( + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2000_09_XMLDSIGRSA_SHA1 SignatureAlgorithmEnum = "http://www.w3.org/2000/09/xmldsig#rsa-sha1" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MORERSA_SHA256 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MORERSA_SHA384 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MORERSA_SHA512 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MOREECDSA_SHA1 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MOREECDSA_SHA256 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MOREECDSA_SHA384 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2001_04_XMLDSIG_MOREECDSA_SHA512 SignatureAlgorithmEnum = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512" + SIGNATUREALGORITHMENUM_HTTP___WWW_W3_ORG_2000_09_XMLDSIGDSA_SHA1 SignatureAlgorithmEnum = "http://www.w3.org/2000/09/xmldsig#dsa-sha1" +) + +// All allowed values of SignatureAlgorithmEnum enum +var AllowedSignatureAlgorithmEnumEnumValues = []SignatureAlgorithmEnum{ + "http://www.w3.org/2000/09/xmldsig#rsa-sha1", + "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256", + "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384", + "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512", + "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1", + "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256", + "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384", + "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512", + "http://www.w3.org/2000/09/xmldsig#dsa-sha1", +} + +func (v *SignatureAlgorithmEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SignatureAlgorithmEnum(value) + for _, existing := range AllowedSignatureAlgorithmEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SignatureAlgorithmEnum", value) +} + +// NewSignatureAlgorithmEnumFromValue returns a pointer to a valid SignatureAlgorithmEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSignatureAlgorithmEnumFromValue(v string) (*SignatureAlgorithmEnum, error) { + ev := SignatureAlgorithmEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SignatureAlgorithmEnum: valid values are %v", v, AllowedSignatureAlgorithmEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SignatureAlgorithmEnum) IsValid() bool { + for _, existing := range AllowedSignatureAlgorithmEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SignatureAlgorithmEnum value +func (v SignatureAlgorithmEnum) Ptr() *SignatureAlgorithmEnum { + return &v +} + +type NullableSignatureAlgorithmEnum struct { + value *SignatureAlgorithmEnum + isSet bool +} + +func (v NullableSignatureAlgorithmEnum) Get() *SignatureAlgorithmEnum { + return v.value +} + +func (v *NullableSignatureAlgorithmEnum) Set(val *SignatureAlgorithmEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSignatureAlgorithmEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSignatureAlgorithmEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSignatureAlgorithmEnum(val *SignatureAlgorithmEnum) *NullableSignatureAlgorithmEnum { + return &NullableSignatureAlgorithmEnum{value: val, isSet: true} +} + +func (v NullableSignatureAlgorithmEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSignatureAlgorithmEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sms_device.go b/packages/client-go/model_sms_device.go new file mode 100644 index 0000000000..6394f0004a --- /dev/null +++ b/packages/client-go/model_sms_device.go @@ -0,0 +1,255 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SMSDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SMSDevice{} + +// SMSDevice Serializer for sms authenticator devices +type SMSDevice struct { + // The human-readable name of this device. + Name string `json:"name"` + Pk int32 `json:"pk"` + PhoneNumber string `json:"phone_number"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _SMSDevice SMSDevice + +// NewSMSDevice instantiates a new SMSDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSMSDevice(name string, pk int32, phoneNumber string, user PartialUser) *SMSDevice { + this := SMSDevice{} + this.Name = name + this.Pk = pk + this.PhoneNumber = phoneNumber + this.User = user + return &this +} + +// NewSMSDeviceWithDefaults instantiates a new SMSDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSMSDeviceWithDefaults() *SMSDevice { + this := SMSDevice{} + return &this +} + +// GetName returns the Name field value +func (o *SMSDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SMSDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SMSDevice) SetName(v string) { + o.Name = v +} + +// GetPk returns the Pk field value +func (o *SMSDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SMSDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SMSDevice) SetPk(v int32) { + o.Pk = v +} + +// GetPhoneNumber returns the PhoneNumber field value +func (o *SMSDevice) GetPhoneNumber() string { + if o == nil { + var ret string + return ret + } + + return o.PhoneNumber +} + +// GetPhoneNumberOk returns a tuple with the PhoneNumber field value +// and a boolean to check if the value has been set. +func (o *SMSDevice) GetPhoneNumberOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PhoneNumber, true +} + +// SetPhoneNumber sets field value +func (o *SMSDevice) SetPhoneNumber(v string) { + o.PhoneNumber = v +} + +// GetUser returns the User field value +func (o *SMSDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *SMSDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *SMSDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o SMSDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SMSDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["pk"] = o.Pk + toSerialize["phone_number"] = o.PhoneNumber + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SMSDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "pk", + "phone_number", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSMSDevice := _SMSDevice{} + + err = json.Unmarshal(data, &varSMSDevice) + + if err != nil { + return err + } + + *o = SMSDevice(varSMSDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "pk") + delete(additionalProperties, "phone_number") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSMSDevice struct { + value *SMSDevice + isSet bool +} + +func (v NullableSMSDevice) Get() *SMSDevice { + return v.value +} + +func (v *NullableSMSDevice) Set(val *SMSDevice) { + v.value = val + v.isSet = true +} + +func (v NullableSMSDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableSMSDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSMSDevice(val *SMSDevice) *NullableSMSDevice { + return &NullableSMSDevice{value: val, isSet: true} +} + +func (v NullableSMSDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSMSDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sms_device_request.go b/packages/client-go/model_sms_device_request.go new file mode 100644 index 0000000000..dab4fba35d --- /dev/null +++ b/packages/client-go/model_sms_device_request.go @@ -0,0 +1,168 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SMSDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SMSDeviceRequest{} + +// SMSDeviceRequest Serializer for sms authenticator devices +type SMSDeviceRequest struct { + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _SMSDeviceRequest SMSDeviceRequest + +// NewSMSDeviceRequest instantiates a new SMSDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSMSDeviceRequest(name string) *SMSDeviceRequest { + this := SMSDeviceRequest{} + this.Name = name + return &this +} + +// NewSMSDeviceRequestWithDefaults instantiates a new SMSDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSMSDeviceRequestWithDefaults() *SMSDeviceRequest { + this := SMSDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SMSDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SMSDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SMSDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o SMSDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SMSDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SMSDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSMSDeviceRequest := _SMSDeviceRequest{} + + err = json.Unmarshal(data, &varSMSDeviceRequest) + + if err != nil { + return err + } + + *o = SMSDeviceRequest(varSMSDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSMSDeviceRequest struct { + value *SMSDeviceRequest + isSet bool +} + +func (v NullableSMSDeviceRequest) Get() *SMSDeviceRequest { + return v.value +} + +func (v *NullableSMSDeviceRequest) Set(val *SMSDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSMSDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSMSDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSMSDeviceRequest(val *SMSDeviceRequest) *NullableSMSDeviceRequest { + return &NullableSMSDeviceRequest{value: val, isSet: true} +} + +func (v NullableSMSDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSMSDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_software.go b/packages/client-go/model_software.go new file mode 100644 index 0000000000..fd6791459e --- /dev/null +++ b/packages/client-go/model_software.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Software type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Software{} + +// Software struct for Software +type Software struct { + Name string `json:"name"` + Version *string `json:"version,omitempty"` + Source string `json:"source"` + Path *string `json:"path,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Software Software + +// NewSoftware instantiates a new Software object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSoftware(name string, source string) *Software { + this := Software{} + this.Name = name + this.Source = source + return &this +} + +// NewSoftwareWithDefaults instantiates a new Software object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSoftwareWithDefaults() *Software { + this := Software{} + return &this +} + +// GetName returns the Name field value +func (o *Software) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Software) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Software) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Software) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Software) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Software) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Software) SetVersion(v string) { + o.Version = &v +} + +// GetSource returns the Source field value +func (o *Software) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *Software) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *Software) SetSource(v string) { + o.Source = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *Software) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Software) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *Software) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *Software) SetPath(v string) { + o.Path = &v +} + +func (o Software) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Software) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + toSerialize["source"] = o.Source + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Software) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSoftware := _Software{} + + err = json.Unmarshal(data, &varSoftware) + + if err != nil { + return err + } + + *o = Software(varSoftware) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + delete(additionalProperties, "source") + delete(additionalProperties, "path") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSoftware struct { + value *Software + isSet bool +} + +func (v NullableSoftware) Get() *Software { + return v.value +} + +func (v *NullableSoftware) Set(val *Software) { + v.value = val + v.isSet = true +} + +func (v NullableSoftware) IsSet() bool { + return v.isSet +} + +func (v *NullableSoftware) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSoftware(val *Software) *NullableSoftware { + return &NullableSoftware{value: val, isSet: true} +} + +func (v NullableSoftware) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSoftware) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_software_request.go b/packages/client-go/model_software_request.go new file mode 100644 index 0000000000..441e726abf --- /dev/null +++ b/packages/client-go/model_software_request.go @@ -0,0 +1,270 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SoftwareRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SoftwareRequest{} + +// SoftwareRequest struct for SoftwareRequest +type SoftwareRequest struct { + Name string `json:"name"` + Version *string `json:"version,omitempty"` + Source string `json:"source"` + Path *string `json:"path,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SoftwareRequest SoftwareRequest + +// NewSoftwareRequest instantiates a new SoftwareRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSoftwareRequest(name string, source string) *SoftwareRequest { + this := SoftwareRequest{} + this.Name = name + this.Source = source + return &this +} + +// NewSoftwareRequestWithDefaults instantiates a new SoftwareRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSoftwareRequestWithDefaults() *SoftwareRequest { + this := SoftwareRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SoftwareRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SoftwareRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SoftwareRequest) SetName(v string) { + o.Name = v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SoftwareRequest) GetVersion() string { + if o == nil || IsNil(o.Version) { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SoftwareRequest) GetVersionOk() (*string, bool) { + if o == nil || IsNil(o.Version) { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SoftwareRequest) HasVersion() bool { + if o != nil && !IsNil(o.Version) { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SoftwareRequest) SetVersion(v string) { + o.Version = &v +} + +// GetSource returns the Source field value +func (o *SoftwareRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SoftwareRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SoftwareRequest) SetSource(v string) { + o.Source = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *SoftwareRequest) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SoftwareRequest) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *SoftwareRequest) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *SoftwareRequest) SetPath(v string) { + o.Path = &v +} + +func (o SoftwareRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SoftwareRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.Version) { + toSerialize["version"] = o.Version + } + toSerialize["source"] = o.Source + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SoftwareRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSoftwareRequest := _SoftwareRequest{} + + err = json.Unmarshal(data, &varSoftwareRequest) + + if err != nil { + return err + } + + *o = SoftwareRequest(varSoftwareRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "version") + delete(additionalProperties, "source") + delete(additionalProperties, "path") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSoftwareRequest struct { + value *SoftwareRequest + isSet bool +} + +func (v NullableSoftwareRequest) Get() *SoftwareRequest { + return v.value +} + +func (v *NullableSoftwareRequest) Set(val *SoftwareRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSoftwareRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSoftwareRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSoftwareRequest(val *SoftwareRequest) *NullableSoftwareRequest { + return &NullableSoftwareRequest{value: val, isSet: true} +} + +func (v NullableSoftwareRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSoftwareRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_source.go b/packages/client-go/model_source.go new file mode 100644 index 0000000000..abf4b3332a --- /dev/null +++ b/packages/client-go/model_source.go @@ -0,0 +1,838 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Source type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Source{} + +// Source Source Serializer +type Source struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // Get the URL to the source icon + IconUrl NullableString `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + AdditionalProperties map[string]interface{} +} + +type _Source Source + +// NewSource instantiates a new Source object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl NullableString, iconThemedUrls NullableThemedUrls) *Source { + this := Source{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + return &this +} + +// NewSourceWithDefaults instantiates a new Source object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceWithDefaults() *Source { + this := Source{} + return &this +} + +// GetPk returns the Pk field value +func (o *Source) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Source) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Source) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Source) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Source) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Source) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *Source) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *Source) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *Source) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *Source) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *Source) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *Source) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *Source) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *Source) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *Source) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Source) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Source) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *Source) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *Source) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *Source) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *Source) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Source) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Source) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *Source) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *Source) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *Source) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *Source) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *Source) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *Source) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *Source) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *Source) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *Source) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *Source) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *Source) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *Source) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *Source) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *Source) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Source) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Source) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Source) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Source) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Source) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Source) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Source) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Source) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *Source) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *Source) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *Source) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *Source) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *Source) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *Source) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Source) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Source) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *Source) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *Source) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *Source) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *Source) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *Source) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Source) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *Source) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *Source) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Source) GetIconUrl() string { + if o == nil || o.IconUrl.Get() == nil { + var ret string + return ret + } + + return *o.IconUrl.Get() +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Source) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IconUrl.Get(), o.IconUrl.IsSet() +} + +// SetIconUrl sets field value +func (o *Source) SetIconUrl(v string) { + o.IconUrl.Set(&v) +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *Source) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Source) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *Source) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +func (o Source) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Source) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl.Get() + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Source) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSource := _Source{} + + err = json.Unmarshal(data, &varSource) + + if err != nil { + return err + } + + *o = Source(varSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSource struct { + value *Source + isSet bool +} + +func (v NullableSource) Get() *Source { + return v.value +} + +func (v *NullableSource) Set(val *Source) { + v.value = val + v.isSet = true +} + +func (v NullableSource) IsSet() bool { + return v.isSet +} + +func (v *NullableSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSource(val *Source) *NullableSource { + return &NullableSource{value: val, isSet: true} +} + +func (v NullableSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_source_stage.go b/packages/client-go/model_source_stage.go new file mode 100644 index 0000000000..dd18f1b99c --- /dev/null +++ b/packages/client-go/model_source_stage.go @@ -0,0 +1,412 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SourceStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceStage{} + +// SourceStage SourceStage Serializer +type SourceStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + Source string `json:"source"` + // Amount of time a user can take to return from the source to continue the flow (Format: hours=-1;minutes=-2;seconds=-3) + ResumeTimeout *string `json:"resume_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SourceStage SourceStage + +// NewSourceStage instantiates a new SourceStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet, source string) *SourceStage { + this := SourceStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + this.Source = source + return &this +} + +// NewSourceStageWithDefaults instantiates a new SourceStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceStageWithDefaults() *SourceStage { + this := SourceStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *SourceStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SourceStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SourceStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SourceStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *SourceStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SourceStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SourceStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SourceStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SourceStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SourceStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SourceStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SourceStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *SourceStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *SourceStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetSource returns the Source field value +func (o *SourceStage) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SourceStage) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SourceStage) SetSource(v string) { + o.Source = v +} + +// GetResumeTimeout returns the ResumeTimeout field value if set, zero value otherwise. +func (o *SourceStage) GetResumeTimeout() string { + if o == nil || IsNil(o.ResumeTimeout) { + var ret string + return ret + } + return *o.ResumeTimeout +} + +// GetResumeTimeoutOk returns a tuple with the ResumeTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceStage) GetResumeTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ResumeTimeout) { + return nil, false + } + return o.ResumeTimeout, true +} + +// HasResumeTimeout returns a boolean if a field has been set. +func (o *SourceStage) HasResumeTimeout() bool { + if o != nil && !IsNil(o.ResumeTimeout) { + return true + } + + return false +} + +// SetResumeTimeout gets a reference to the given string and assigns it to the ResumeTimeout field. +func (o *SourceStage) SetResumeTimeout(v string) { + o.ResumeTimeout = &v +} + +func (o SourceStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + toSerialize["source"] = o.Source + if !IsNil(o.ResumeTimeout) { + toSerialize["resume_timeout"] = o.ResumeTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SourceStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceStage := _SourceStage{} + + err = json.Unmarshal(data, &varSourceStage) + + if err != nil { + return err + } + + *o = SourceStage(varSourceStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "source") + delete(additionalProperties, "resume_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSourceStage struct { + value *SourceStage + isSet bool +} + +func (v NullableSourceStage) Get() *SourceStage { + return v.value +} + +func (v *NullableSourceStage) Set(val *SourceStage) { + v.value = val + v.isSet = true +} + +func (v NullableSourceStage) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceStage(val *SourceStage) *NullableSourceStage { + return &NullableSourceStage{value: val, isSet: true} +} + +func (v NullableSourceStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_source_stage_request.go b/packages/client-go/model_source_stage_request.go new file mode 100644 index 0000000000..cb9939fa5d --- /dev/null +++ b/packages/client-go/model_source_stage_request.go @@ -0,0 +1,234 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SourceStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceStageRequest{} + +// SourceStageRequest SourceStage Serializer +type SourceStageRequest struct { + Name string `json:"name"` + Source string `json:"source"` + // Amount of time a user can take to return from the source to continue the flow (Format: hours=-1;minutes=-2;seconds=-3) + ResumeTimeout *string `json:"resume_timeout,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SourceStageRequest SourceStageRequest + +// NewSourceStageRequest instantiates a new SourceStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceStageRequest(name string, source string) *SourceStageRequest { + this := SourceStageRequest{} + this.Name = name + this.Source = source + return &this +} + +// NewSourceStageRequestWithDefaults instantiates a new SourceStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceStageRequestWithDefaults() *SourceStageRequest { + this := SourceStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SourceStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SourceStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SourceStageRequest) SetName(v string) { + o.Name = v +} + +// GetSource returns the Source field value +func (o *SourceStageRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *SourceStageRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *SourceStageRequest) SetSource(v string) { + o.Source = v +} + +// GetResumeTimeout returns the ResumeTimeout field value if set, zero value otherwise. +func (o *SourceStageRequest) GetResumeTimeout() string { + if o == nil || IsNil(o.ResumeTimeout) { + var ret string + return ret + } + return *o.ResumeTimeout +} + +// GetResumeTimeoutOk returns a tuple with the ResumeTimeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SourceStageRequest) GetResumeTimeoutOk() (*string, bool) { + if o == nil || IsNil(o.ResumeTimeout) { + return nil, false + } + return o.ResumeTimeout, true +} + +// HasResumeTimeout returns a boolean if a field has been set. +func (o *SourceStageRequest) HasResumeTimeout() bool { + if o != nil && !IsNil(o.ResumeTimeout) { + return true + } + + return false +} + +// SetResumeTimeout gets a reference to the given string and assigns it to the ResumeTimeout field. +func (o *SourceStageRequest) SetResumeTimeout(v string) { + o.ResumeTimeout = &v +} + +func (o SourceStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["source"] = o.Source + if !IsNil(o.ResumeTimeout) { + toSerialize["resume_timeout"] = o.ResumeTimeout + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SourceStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceStageRequest := _SourceStageRequest{} + + err = json.Unmarshal(data, &varSourceStageRequest) + + if err != nil { + return err + } + + *o = SourceStageRequest(varSourceStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "source") + delete(additionalProperties, "resume_timeout") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSourceStageRequest struct { + value *SourceStageRequest + isSet bool +} + +func (v NullableSourceStageRequest) Get() *SourceStageRequest { + return v.value +} + +func (v *NullableSourceStageRequest) Set(val *SourceStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSourceStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceStageRequest(val *SourceStageRequest) *NullableSourceStageRequest { + return &NullableSourceStageRequest{value: val, isSet: true} +} + +func (v NullableSourceStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_source_type.go b/packages/client-go/model_source_type.go new file mode 100644 index 0000000000..96ccaee7a8 --- /dev/null +++ b/packages/client-go/model_source_type.go @@ -0,0 +1,411 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SourceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SourceType{} + +// SourceType Serializer for SourceType +type SourceType struct { + Name string `json:"name"` + VerboseName string `json:"verbose_name"` + UrlsCustomizable bool `json:"urls_customizable"` + RequestTokenUrl NullableString `json:"request_token_url"` + AuthorizationUrl NullableString `json:"authorization_url"` + AccessTokenUrl NullableString `json:"access_token_url"` + ProfileUrl NullableString `json:"profile_url"` + OidcWellKnownUrl NullableString `json:"oidc_well_known_url"` + OidcJwksUrl NullableString `json:"oidc_jwks_url"` + AdditionalProperties map[string]interface{} +} + +type _SourceType SourceType + +// NewSourceType instantiates a new SourceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSourceType(name string, verboseName string, urlsCustomizable bool, requestTokenUrl NullableString, authorizationUrl NullableString, accessTokenUrl NullableString, profileUrl NullableString, oidcWellKnownUrl NullableString, oidcJwksUrl NullableString) *SourceType { + this := SourceType{} + this.Name = name + this.VerboseName = verboseName + this.UrlsCustomizable = urlsCustomizable + this.RequestTokenUrl = requestTokenUrl + this.AuthorizationUrl = authorizationUrl + this.AccessTokenUrl = accessTokenUrl + this.ProfileUrl = profileUrl + this.OidcWellKnownUrl = oidcWellKnownUrl + this.OidcJwksUrl = oidcJwksUrl + return &this +} + +// NewSourceTypeWithDefaults instantiates a new SourceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSourceTypeWithDefaults() *SourceType { + this := SourceType{} + return &this +} + +// GetName returns the Name field value +func (o *SourceType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SourceType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SourceType) SetName(v string) { + o.Name = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SourceType) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SourceType) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SourceType) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetUrlsCustomizable returns the UrlsCustomizable field value +func (o *SourceType) GetUrlsCustomizable() bool { + if o == nil { + var ret bool + return ret + } + + return o.UrlsCustomizable +} + +// GetUrlsCustomizableOk returns a tuple with the UrlsCustomizable field value +// and a boolean to check if the value has been set. +func (o *SourceType) GetUrlsCustomizableOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.UrlsCustomizable, true +} + +// SetUrlsCustomizable sets field value +func (o *SourceType) SetUrlsCustomizable(v bool) { + o.UrlsCustomizable = v +} + +// GetRequestTokenUrl returns the RequestTokenUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetRequestTokenUrl() string { + if o == nil || o.RequestTokenUrl.Get() == nil { + var ret string + return ret + } + + return *o.RequestTokenUrl.Get() +} + +// GetRequestTokenUrlOk returns a tuple with the RequestTokenUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetRequestTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RequestTokenUrl.Get(), o.RequestTokenUrl.IsSet() +} + +// SetRequestTokenUrl sets field value +func (o *SourceType) SetRequestTokenUrl(v string) { + o.RequestTokenUrl.Set(&v) +} + +// GetAuthorizationUrl returns the AuthorizationUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetAuthorizationUrl() string { + if o == nil || o.AuthorizationUrl.Get() == nil { + var ret string + return ret + } + + return *o.AuthorizationUrl.Get() +} + +// GetAuthorizationUrlOk returns a tuple with the AuthorizationUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetAuthorizationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthorizationUrl.Get(), o.AuthorizationUrl.IsSet() +} + +// SetAuthorizationUrl sets field value +func (o *SourceType) SetAuthorizationUrl(v string) { + o.AuthorizationUrl.Set(&v) +} + +// GetAccessTokenUrl returns the AccessTokenUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetAccessTokenUrl() string { + if o == nil || o.AccessTokenUrl.Get() == nil { + var ret string + return ret + } + + return *o.AccessTokenUrl.Get() +} + +// GetAccessTokenUrlOk returns a tuple with the AccessTokenUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetAccessTokenUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessTokenUrl.Get(), o.AccessTokenUrl.IsSet() +} + +// SetAccessTokenUrl sets field value +func (o *SourceType) SetAccessTokenUrl(v string) { + o.AccessTokenUrl.Set(&v) +} + +// GetProfileUrl returns the ProfileUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetProfileUrl() string { + if o == nil || o.ProfileUrl.Get() == nil { + var ret string + return ret + } + + return *o.ProfileUrl.Get() +} + +// GetProfileUrlOk returns a tuple with the ProfileUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetProfileUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ProfileUrl.Get(), o.ProfileUrl.IsSet() +} + +// SetProfileUrl sets field value +func (o *SourceType) SetProfileUrl(v string) { + o.ProfileUrl.Set(&v) +} + +// GetOidcWellKnownUrl returns the OidcWellKnownUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetOidcWellKnownUrl() string { + if o == nil || o.OidcWellKnownUrl.Get() == nil { + var ret string + return ret + } + + return *o.OidcWellKnownUrl.Get() +} + +// GetOidcWellKnownUrlOk returns a tuple with the OidcWellKnownUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetOidcWellKnownUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OidcWellKnownUrl.Get(), o.OidcWellKnownUrl.IsSet() +} + +// SetOidcWellKnownUrl sets field value +func (o *SourceType) SetOidcWellKnownUrl(v string) { + o.OidcWellKnownUrl.Set(&v) +} + +// GetOidcJwksUrl returns the OidcJwksUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SourceType) GetOidcJwksUrl() string { + if o == nil || o.OidcJwksUrl.Get() == nil { + var ret string + return ret + } + + return *o.OidcJwksUrl.Get() +} + +// GetOidcJwksUrlOk returns a tuple with the OidcJwksUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SourceType) GetOidcJwksUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OidcJwksUrl.Get(), o.OidcJwksUrl.IsSet() +} + +// SetOidcJwksUrl sets field value +func (o *SourceType) SetOidcJwksUrl(v string) { + o.OidcJwksUrl.Set(&v) +} + +func (o SourceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SourceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["verbose_name"] = o.VerboseName + toSerialize["urls_customizable"] = o.UrlsCustomizable + toSerialize["request_token_url"] = o.RequestTokenUrl.Get() + toSerialize["authorization_url"] = o.AuthorizationUrl.Get() + toSerialize["access_token_url"] = o.AccessTokenUrl.Get() + toSerialize["profile_url"] = o.ProfileUrl.Get() + toSerialize["oidc_well_known_url"] = o.OidcWellKnownUrl.Get() + toSerialize["oidc_jwks_url"] = o.OidcJwksUrl.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SourceType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "verbose_name", + "urls_customizable", + "request_token_url", + "authorization_url", + "access_token_url", + "profile_url", + "oidc_well_known_url", + "oidc_jwks_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSourceType := _SourceType{} + + err = json.Unmarshal(data, &varSourceType) + + if err != nil { + return err + } + + *o = SourceType(varSourceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "urls_customizable") + delete(additionalProperties, "request_token_url") + delete(additionalProperties, "authorization_url") + delete(additionalProperties, "access_token_url") + delete(additionalProperties, "profile_url") + delete(additionalProperties, "oidc_well_known_url") + delete(additionalProperties, "oidc_jwks_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSourceType struct { + value *SourceType + isSet bool +} + +func (v NullableSourceType) Get() *SourceType { + return v.value +} + +func (v *NullableSourceType) Set(val *SourceType) { + v.value = val + v.isSet = true +} + +func (v NullableSourceType) IsSet() bool { + return v.isSet +} + +func (v *NullableSourceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSourceType(val *SourceType) *NullableSourceType { + return &NullableSourceType{value: val, isSet: true} +} + +func (v NullableSourceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSourceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ssf_provider.go b/packages/client-go/model_ssf_provider.go new file mode 100644 index 0000000000..b588b9852c --- /dev/null +++ b/packages/client-go/model_ssf_provider.go @@ -0,0 +1,480 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SSFProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSFProvider{} + +// SSFProvider SSFProvider Serializer +type SSFProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Key used to sign the SSF Events. + SigningKey string `json:"signing_key"` + TokenObj Token `json:"token_obj"` + OidcAuthProviders []int32 `json:"oidc_auth_providers,omitempty"` + SsfUrl NullableString `json:"ssf_url"` + EventRetention *string `json:"event_retention,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSFProvider SSFProvider + +// NewSSFProvider instantiates a new SSFProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSFProvider(pk int32, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, signingKey string, tokenObj Token, ssfUrl NullableString) *SSFProvider { + this := SSFProvider{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.SigningKey = signingKey + this.TokenObj = tokenObj + this.SsfUrl = ssfUrl + return &this +} + +// NewSSFProviderWithDefaults instantiates a new SSFProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSFProviderWithDefaults() *SSFProvider { + this := SSFProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *SSFProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SSFProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *SSFProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SSFProvider) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *SSFProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *SSFProvider) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *SSFProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *SSFProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *SSFProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *SSFProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *SSFProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *SSFProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetSigningKey returns the SigningKey field value +func (o *SSFProvider) GetSigningKey() string { + if o == nil { + var ret string + return ret + } + + return o.SigningKey +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SigningKey, true +} + +// SetSigningKey sets field value +func (o *SSFProvider) SetSigningKey(v string) { + o.SigningKey = v +} + +// GetTokenObj returns the TokenObj field value +func (o *SSFProvider) GetTokenObj() Token { + if o == nil { + var ret Token + return ret + } + + return o.TokenObj +} + +// GetTokenObjOk returns a tuple with the TokenObj field value +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetTokenObjOk() (*Token, bool) { + if o == nil { + return nil, false + } + return &o.TokenObj, true +} + +// SetTokenObj sets field value +func (o *SSFProvider) SetTokenObj(v Token) { + o.TokenObj = v +} + +// GetOidcAuthProviders returns the OidcAuthProviders field value if set, zero value otherwise. +func (o *SSFProvider) GetOidcAuthProviders() []int32 { + if o == nil || IsNil(o.OidcAuthProviders) { + var ret []int32 + return ret + } + return o.OidcAuthProviders +} + +// GetOidcAuthProvidersOk returns a tuple with the OidcAuthProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetOidcAuthProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.OidcAuthProviders) { + return nil, false + } + return o.OidcAuthProviders, true +} + +// HasOidcAuthProviders returns a boolean if a field has been set. +func (o *SSFProvider) HasOidcAuthProviders() bool { + if o != nil && !IsNil(o.OidcAuthProviders) { + return true + } + + return false +} + +// SetOidcAuthProviders gets a reference to the given []int32 and assigns it to the OidcAuthProviders field. +func (o *SSFProvider) SetOidcAuthProviders(v []int32) { + o.OidcAuthProviders = v +} + +// GetSsfUrl returns the SsfUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *SSFProvider) GetSsfUrl() string { + if o == nil || o.SsfUrl.Get() == nil { + var ret string + return ret + } + + return *o.SsfUrl.Get() +} + +// GetSsfUrlOk returns a tuple with the SsfUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSFProvider) GetSsfUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SsfUrl.Get(), o.SsfUrl.IsSet() +} + +// SetSsfUrl sets field value +func (o *SSFProvider) SetSsfUrl(v string) { + o.SsfUrl.Set(&v) +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *SSFProvider) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFProvider) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *SSFProvider) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *SSFProvider) SetEventRetention(v string) { + o.EventRetention = &v +} + +func (o SSFProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSFProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["signing_key"] = o.SigningKey + toSerialize["token_obj"] = o.TokenObj + if !IsNil(o.OidcAuthProviders) { + toSerialize["oidc_auth_providers"] = o.OidcAuthProviders + } + toSerialize["ssf_url"] = o.SsfUrl.Get() + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSFProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "signing_key", + "token_obj", + "ssf_url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSSFProvider := _SSFProvider{} + + err = json.Unmarshal(data, &varSSFProvider) + + if err != nil { + return err + } + + *o = SSFProvider(varSSFProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "token_obj") + delete(additionalProperties, "oidc_auth_providers") + delete(additionalProperties, "ssf_url") + delete(additionalProperties, "event_retention") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSFProvider struct { + value *SSFProvider + isSet bool +} + +func (v NullableSSFProvider) Get() *SSFProvider { + return v.value +} + +func (v *NullableSSFProvider) Set(val *SSFProvider) { + v.value = val + v.isSet = true +} + +func (v NullableSSFProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableSSFProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSFProvider(val *SSFProvider) *NullableSSFProvider { + return &NullableSSFProvider{value: val, isSet: true} +} + +func (v NullableSSFProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSFProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ssf_provider_request.go b/packages/client-go/model_ssf_provider_request.go new file mode 100644 index 0000000000..4c4bf774bb --- /dev/null +++ b/packages/client-go/model_ssf_provider_request.go @@ -0,0 +1,271 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SSFProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSFProviderRequest{} + +// SSFProviderRequest SSFProvider Serializer +type SSFProviderRequest struct { + Name string `json:"name"` + // Key used to sign the SSF Events. + SigningKey string `json:"signing_key"` + OidcAuthProviders []int32 `json:"oidc_auth_providers,omitempty"` + EventRetention *string `json:"event_retention,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SSFProviderRequest SSFProviderRequest + +// NewSSFProviderRequest instantiates a new SSFProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSFProviderRequest(name string, signingKey string) *SSFProviderRequest { + this := SSFProviderRequest{} + this.Name = name + this.SigningKey = signingKey + return &this +} + +// NewSSFProviderRequestWithDefaults instantiates a new SSFProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSFProviderRequestWithDefaults() *SSFProviderRequest { + this := SSFProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *SSFProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SSFProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SSFProviderRequest) SetName(v string) { + o.Name = v +} + +// GetSigningKey returns the SigningKey field value +func (o *SSFProviderRequest) GetSigningKey() string { + if o == nil { + var ret string + return ret + } + + return o.SigningKey +} + +// GetSigningKeyOk returns a tuple with the SigningKey field value +// and a boolean to check if the value has been set. +func (o *SSFProviderRequest) GetSigningKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SigningKey, true +} + +// SetSigningKey sets field value +func (o *SSFProviderRequest) SetSigningKey(v string) { + o.SigningKey = v +} + +// GetOidcAuthProviders returns the OidcAuthProviders field value if set, zero value otherwise. +func (o *SSFProviderRequest) GetOidcAuthProviders() []int32 { + if o == nil || IsNil(o.OidcAuthProviders) { + var ret []int32 + return ret + } + return o.OidcAuthProviders +} + +// GetOidcAuthProvidersOk returns a tuple with the OidcAuthProviders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFProviderRequest) GetOidcAuthProvidersOk() ([]int32, bool) { + if o == nil || IsNil(o.OidcAuthProviders) { + return nil, false + } + return o.OidcAuthProviders, true +} + +// HasOidcAuthProviders returns a boolean if a field has been set. +func (o *SSFProviderRequest) HasOidcAuthProviders() bool { + if o != nil && !IsNil(o.OidcAuthProviders) { + return true + } + + return false +} + +// SetOidcAuthProviders gets a reference to the given []int32 and assigns it to the OidcAuthProviders field. +func (o *SSFProviderRequest) SetOidcAuthProviders(v []int32) { + o.OidcAuthProviders = v +} + +// GetEventRetention returns the EventRetention field value if set, zero value otherwise. +func (o *SSFProviderRequest) GetEventRetention() string { + if o == nil || IsNil(o.EventRetention) { + var ret string + return ret + } + return *o.EventRetention +} + +// GetEventRetentionOk returns a tuple with the EventRetention field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFProviderRequest) GetEventRetentionOk() (*string, bool) { + if o == nil || IsNil(o.EventRetention) { + return nil, false + } + return o.EventRetention, true +} + +// HasEventRetention returns a boolean if a field has been set. +func (o *SSFProviderRequest) HasEventRetention() bool { + if o != nil && !IsNil(o.EventRetention) { + return true + } + + return false +} + +// SetEventRetention gets a reference to the given string and assigns it to the EventRetention field. +func (o *SSFProviderRequest) SetEventRetention(v string) { + o.EventRetention = &v +} + +func (o SSFProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSFProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["signing_key"] = o.SigningKey + if !IsNil(o.OidcAuthProviders) { + toSerialize["oidc_auth_providers"] = o.OidcAuthProviders + } + if !IsNil(o.EventRetention) { + toSerialize["event_retention"] = o.EventRetention + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSFProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "signing_key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSSFProviderRequest := _SSFProviderRequest{} + + err = json.Unmarshal(data, &varSSFProviderRequest) + + if err != nil { + return err + } + + *o = SSFProviderRequest(varSSFProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "signing_key") + delete(additionalProperties, "oidc_auth_providers") + delete(additionalProperties, "event_retention") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSFProviderRequest struct { + value *SSFProviderRequest + isSet bool +} + +func (v NullableSSFProviderRequest) Get() *SSFProviderRequest { + return v.value +} + +func (v *NullableSSFProviderRequest) Set(val *SSFProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSSFProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSSFProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSFProviderRequest(val *SSFProviderRequest) *NullableSSFProviderRequest { + return &NullableSSFProviderRequest{value: val, isSet: true} +} + +func (v NullableSSFProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSFProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ssf_stream.go b/packages/client-go/model_ssf_stream.go new file mode 100644 index 0000000000..d40e17f020 --- /dev/null +++ b/packages/client-go/model_ssf_stream.go @@ -0,0 +1,434 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SSFStream type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SSFStream{} + +// SSFStream SSFStream Serializer +type SSFStream struct { + Pk string `json:"pk"` + Provider int32 `json:"provider"` + ProviderObj SSFProvider `json:"provider_obj"` + DeliveryMethod DeliveryMethodEnum `json:"delivery_method"` + EndpointUrl NullableString `json:"endpoint_url,omitempty"` + EventsRequested []EventsRequestedEnum `json:"events_requested,omitempty"` + Format string `json:"format"` + Aud []string `json:"aud,omitempty"` + Iss string `json:"iss"` + AdditionalProperties map[string]interface{} +} + +type _SSFStream SSFStream + +// NewSSFStream instantiates a new SSFStream object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSSFStream(pk string, provider int32, providerObj SSFProvider, deliveryMethod DeliveryMethodEnum, format string, iss string) *SSFStream { + this := SSFStream{} + this.Pk = pk + this.Provider = provider + this.ProviderObj = providerObj + this.DeliveryMethod = deliveryMethod + this.Format = format + this.Iss = iss + return &this +} + +// NewSSFStreamWithDefaults instantiates a new SSFStream object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSSFStreamWithDefaults() *SSFStream { + this := SSFStream{} + return &this +} + +// GetPk returns the Pk field value +func (o *SSFStream) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *SSFStream) SetPk(v string) { + o.Pk = v +} + +// GetProvider returns the Provider field value +func (o *SSFStream) GetProvider() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetProviderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *SSFStream) SetProvider(v int32) { + o.Provider = v +} + +// GetProviderObj returns the ProviderObj field value +func (o *SSFStream) GetProviderObj() SSFProvider { + if o == nil { + var ret SSFProvider + return ret + } + + return o.ProviderObj +} + +// GetProviderObjOk returns a tuple with the ProviderObj field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetProviderObjOk() (*SSFProvider, bool) { + if o == nil { + return nil, false + } + return &o.ProviderObj, true +} + +// SetProviderObj sets field value +func (o *SSFStream) SetProviderObj(v SSFProvider) { + o.ProviderObj = v +} + +// GetDeliveryMethod returns the DeliveryMethod field value +func (o *SSFStream) GetDeliveryMethod() DeliveryMethodEnum { + if o == nil { + var ret DeliveryMethodEnum + return ret + } + + return o.DeliveryMethod +} + +// GetDeliveryMethodOk returns a tuple with the DeliveryMethod field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetDeliveryMethodOk() (*DeliveryMethodEnum, bool) { + if o == nil { + return nil, false + } + return &o.DeliveryMethod, true +} + +// SetDeliveryMethod sets field value +func (o *SSFStream) SetDeliveryMethod(v DeliveryMethodEnum) { + o.DeliveryMethod = v +} + +// GetEndpointUrl returns the EndpointUrl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SSFStream) GetEndpointUrl() string { + if o == nil || IsNil(o.EndpointUrl.Get()) { + var ret string + return ret + } + return *o.EndpointUrl.Get() +} + +// GetEndpointUrlOk returns a tuple with the EndpointUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SSFStream) GetEndpointUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EndpointUrl.Get(), o.EndpointUrl.IsSet() +} + +// HasEndpointUrl returns a boolean if a field has been set. +func (o *SSFStream) HasEndpointUrl() bool { + if o != nil && o.EndpointUrl.IsSet() { + return true + } + + return false +} + +// SetEndpointUrl gets a reference to the given NullableString and assigns it to the EndpointUrl field. +func (o *SSFStream) SetEndpointUrl(v string) { + o.EndpointUrl.Set(&v) +} + +// SetEndpointUrlNil sets the value for EndpointUrl to be an explicit nil +func (o *SSFStream) SetEndpointUrlNil() { + o.EndpointUrl.Set(nil) +} + +// UnsetEndpointUrl ensures that no value is present for EndpointUrl, not even an explicit nil +func (o *SSFStream) UnsetEndpointUrl() { + o.EndpointUrl.Unset() +} + +// GetEventsRequested returns the EventsRequested field value if set, zero value otherwise. +func (o *SSFStream) GetEventsRequested() []EventsRequestedEnum { + if o == nil || IsNil(o.EventsRequested) { + var ret []EventsRequestedEnum + return ret + } + return o.EventsRequested +} + +// GetEventsRequestedOk returns a tuple with the EventsRequested field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFStream) GetEventsRequestedOk() ([]EventsRequestedEnum, bool) { + if o == nil || IsNil(o.EventsRequested) { + return nil, false + } + return o.EventsRequested, true +} + +// HasEventsRequested returns a boolean if a field has been set. +func (o *SSFStream) HasEventsRequested() bool { + if o != nil && !IsNil(o.EventsRequested) { + return true + } + + return false +} + +// SetEventsRequested gets a reference to the given []EventsRequestedEnum and assigns it to the EventsRequested field. +func (o *SSFStream) SetEventsRequested(v []EventsRequestedEnum) { + o.EventsRequested = v +} + +// GetFormat returns the Format field value +func (o *SSFStream) GetFormat() string { + if o == nil { + var ret string + return ret + } + + return o.Format +} + +// GetFormatOk returns a tuple with the Format field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Format, true +} + +// SetFormat sets field value +func (o *SSFStream) SetFormat(v string) { + o.Format = v +} + +// GetAud returns the Aud field value if set, zero value otherwise. +func (o *SSFStream) GetAud() []string { + if o == nil || IsNil(o.Aud) { + var ret []string + return ret + } + return o.Aud +} + +// GetAudOk returns a tuple with the Aud field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SSFStream) GetAudOk() ([]string, bool) { + if o == nil || IsNil(o.Aud) { + return nil, false + } + return o.Aud, true +} + +// HasAud returns a boolean if a field has been set. +func (o *SSFStream) HasAud() bool { + if o != nil && !IsNil(o.Aud) { + return true + } + + return false +} + +// SetAud gets a reference to the given []string and assigns it to the Aud field. +func (o *SSFStream) SetAud(v []string) { + o.Aud = v +} + +// GetIss returns the Iss field value +func (o *SSFStream) GetIss() string { + if o == nil { + var ret string + return ret + } + + return o.Iss +} + +// GetIssOk returns a tuple with the Iss field value +// and a boolean to check if the value has been set. +func (o *SSFStream) GetIssOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Iss, true +} + +// SetIss sets field value +func (o *SSFStream) SetIss(v string) { + o.Iss = v +} + +func (o SSFStream) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SSFStream) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["provider"] = o.Provider + toSerialize["provider_obj"] = o.ProviderObj + toSerialize["delivery_method"] = o.DeliveryMethod + if o.EndpointUrl.IsSet() { + toSerialize["endpoint_url"] = o.EndpointUrl.Get() + } + if !IsNil(o.EventsRequested) { + toSerialize["events_requested"] = o.EventsRequested + } + toSerialize["format"] = o.Format + if !IsNil(o.Aud) { + toSerialize["aud"] = o.Aud + } + toSerialize["iss"] = o.Iss + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SSFStream) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "provider", + "provider_obj", + "delivery_method", + "format", + "iss", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSSFStream := _SSFStream{} + + err = json.Unmarshal(data, &varSSFStream) + + if err != nil { + return err + } + + *o = SSFStream(varSSFStream) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "provider_obj") + delete(additionalProperties, "delivery_method") + delete(additionalProperties, "endpoint_url") + delete(additionalProperties, "events_requested") + delete(additionalProperties, "format") + delete(additionalProperties, "aud") + delete(additionalProperties, "iss") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSSFStream struct { + value *SSFStream + isSet bool +} + +func (v NullableSSFStream) Get() *SSFStream { + return v.value +} + +func (v *NullableSSFStream) Set(val *SSFStream) { + v.value = val + v.isSet = true +} + +func (v NullableSSFStream) IsSet() bool { + return v.isSet +} + +func (v *NullableSSFStream) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSSFStream(val *SSFStream) *NullableSSFStream { + return &NullableSSFStream{value: val, isSet: true} +} + +func (v NullableSSFStream) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSSFStream) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_stage.go b/packages/client-go/model_stage.go new file mode 100644 index 0000000000..975636ff42 --- /dev/null +++ b/packages/client-go/model_stage.go @@ -0,0 +1,345 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Stage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Stage{} + +// Stage Stage Serializer +type Stage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + AdditionalProperties map[string]interface{} +} + +type _Stage Stage + +// NewStage instantiates a new Stage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *Stage { + this := Stage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewStageWithDefaults instantiates a new Stage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStageWithDefaults() *Stage { + this := Stage{} + return &this +} + +// GetPk returns the Pk field value +func (o *Stage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Stage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Stage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *Stage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Stage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Stage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *Stage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *Stage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *Stage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *Stage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *Stage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *Stage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *Stage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *Stage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *Stage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *Stage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *Stage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *Stage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *Stage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *Stage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *Stage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +func (o Stage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Stage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Stage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStage := _Stage{} + + err = json.Unmarshal(data, &varStage) + + if err != nil { + return err + } + + *o = Stage(varStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStage struct { + value *Stage + isSet bool +} + +func (v NullableStage) Get() *Stage { + return v.value +} + +func (v *NullableStage) Set(val *Stage) { + v.value = val + v.isSet = true +} + +func (v NullableStage) IsSet() bool { + return v.isSet +} + +func (v *NullableStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStage(val *Stage) *NullableStage { + return &NullableStage{value: val, isSet: true} +} + +func (v NullableStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_stage_mode_enum.go b/packages/client-go/model_stage_mode_enum.go new file mode 100644 index 0000000000..6de4d539a9 --- /dev/null +++ b/packages/client-go/model_stage_mode_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// StageModeEnum the model 'StageModeEnum' +type StageModeEnum string + +// List of StageModeEnum +const ( + STAGEMODEENUM_OPTIONAL StageModeEnum = "optional" + STAGEMODEENUM_REQUIRED StageModeEnum = "required" +) + +// All allowed values of StageModeEnum enum +var AllowedStageModeEnumEnumValues = []StageModeEnum{ + "optional", + "required", +} + +func (v *StageModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StageModeEnum(value) + for _, existing := range AllowedStageModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StageModeEnum", value) +} + +// NewStageModeEnumFromValue returns a pointer to a valid StageModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStageModeEnumFromValue(v string) (*StageModeEnum, error) { + ev := StageModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StageModeEnum: valid values are %v", v, AllowedStageModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StageModeEnum) IsValid() bool { + for _, existing := range AllowedStageModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StageModeEnum value +func (v StageModeEnum) Ptr() *StageModeEnum { + return &v +} + +type NullableStageModeEnum struct { + value *StageModeEnum + isSet bool +} + +func (v NullableStageModeEnum) Get() *StageModeEnum { + return v.value +} + +func (v *NullableStageModeEnum) Set(val *StageModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableStageModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableStageModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStageModeEnum(val *StageModeEnum) *NullableStageModeEnum { + return &NullableStageModeEnum{value: val, isSet: true} +} + +func (v NullableStageModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStageModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_stage_prompt.go b/packages/client-go/model_stage_prompt.go new file mode 100644 index 0000000000..ea10446df1 --- /dev/null +++ b/packages/client-go/model_stage_prompt.go @@ -0,0 +1,403 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the StagePrompt type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StagePrompt{} + +// StagePrompt Serializer for a single Prompt field +type StagePrompt struct { + FieldKey string `json:"field_key"` + Label string `json:"label"` + Type PromptTypeEnum `json:"type"` + Required bool `json:"required"` + Placeholder string `json:"placeholder"` + InitialValue string `json:"initial_value"` + Order int32 `json:"order"` + SubText string `json:"sub_text"` + Choices []PromptChoice `json:"choices"` + AdditionalProperties map[string]interface{} +} + +type _StagePrompt StagePrompt + +// NewStagePrompt instantiates a new StagePrompt object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStagePrompt(fieldKey string, label string, type_ PromptTypeEnum, required bool, placeholder string, initialValue string, order int32, subText string, choices []PromptChoice) *StagePrompt { + this := StagePrompt{} + this.FieldKey = fieldKey + this.Label = label + this.Type = type_ + this.Required = required + this.Placeholder = placeholder + this.InitialValue = initialValue + this.Order = order + this.SubText = subText + this.Choices = choices + return &this +} + +// NewStagePromptWithDefaults instantiates a new StagePrompt object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStagePromptWithDefaults() *StagePrompt { + this := StagePrompt{} + return &this +} + +// GetFieldKey returns the FieldKey field value +func (o *StagePrompt) GetFieldKey() string { + if o == nil { + var ret string + return ret + } + + return o.FieldKey +} + +// GetFieldKeyOk returns a tuple with the FieldKey field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetFieldKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.FieldKey, true +} + +// SetFieldKey sets field value +func (o *StagePrompt) SetFieldKey(v string) { + o.FieldKey = v +} + +// GetLabel returns the Label field value +func (o *StagePrompt) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *StagePrompt) SetLabel(v string) { + o.Label = v +} + +// GetType returns the Type field value +func (o *StagePrompt) GetType() PromptTypeEnum { + if o == nil { + var ret PromptTypeEnum + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetTypeOk() (*PromptTypeEnum, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *StagePrompt) SetType(v PromptTypeEnum) { + o.Type = v +} + +// GetRequired returns the Required field value +func (o *StagePrompt) GetRequired() bool { + if o == nil { + var ret bool + return ret + } + + return o.Required +} + +// GetRequiredOk returns a tuple with the Required field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetRequiredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Required, true +} + +// SetRequired sets field value +func (o *StagePrompt) SetRequired(v bool) { + o.Required = v +} + +// GetPlaceholder returns the Placeholder field value +func (o *StagePrompt) GetPlaceholder() string { + if o == nil { + var ret string + return ret + } + + return o.Placeholder +} + +// GetPlaceholderOk returns a tuple with the Placeholder field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetPlaceholderOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Placeholder, true +} + +// SetPlaceholder sets field value +func (o *StagePrompt) SetPlaceholder(v string) { + o.Placeholder = v +} + +// GetInitialValue returns the InitialValue field value +func (o *StagePrompt) GetInitialValue() string { + if o == nil { + var ret string + return ret + } + + return o.InitialValue +} + +// GetInitialValueOk returns a tuple with the InitialValue field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetInitialValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InitialValue, true +} + +// SetInitialValue sets field value +func (o *StagePrompt) SetInitialValue(v string) { + o.InitialValue = v +} + +// GetOrder returns the Order field value +func (o *StagePrompt) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *StagePrompt) SetOrder(v int32) { + o.Order = v +} + +// GetSubText returns the SubText field value +func (o *StagePrompt) GetSubText() string { + if o == nil { + var ret string + return ret + } + + return o.SubText +} + +// GetSubTextOk returns a tuple with the SubText field value +// and a boolean to check if the value has been set. +func (o *StagePrompt) GetSubTextOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SubText, true +} + +// SetSubText sets field value +func (o *StagePrompt) SetSubText(v string) { + o.SubText = v +} + +// GetChoices returns the Choices field value +// If the value is explicit nil, the zero value for []PromptChoice will be returned +func (o *StagePrompt) GetChoices() []PromptChoice { + if o == nil { + var ret []PromptChoice + return ret + } + + return o.Choices +} + +// GetChoicesOk returns a tuple with the Choices field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *StagePrompt) GetChoicesOk() ([]PromptChoice, bool) { + if o == nil || IsNil(o.Choices) { + return nil, false + } + return o.Choices, true +} + +// SetChoices sets field value +func (o *StagePrompt) SetChoices(v []PromptChoice) { + o.Choices = v +} + +func (o StagePrompt) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StagePrompt) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["field_key"] = o.FieldKey + toSerialize["label"] = o.Label + toSerialize["type"] = o.Type + toSerialize["required"] = o.Required + toSerialize["placeholder"] = o.Placeholder + toSerialize["initial_value"] = o.InitialValue + toSerialize["order"] = o.Order + toSerialize["sub_text"] = o.SubText + if o.Choices != nil { + toSerialize["choices"] = o.Choices + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StagePrompt) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "field_key", + "label", + "type", + "required", + "placeholder", + "initial_value", + "order", + "sub_text", + "choices", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStagePrompt := _StagePrompt{} + + err = json.Unmarshal(data, &varStagePrompt) + + if err != nil { + return err + } + + *o = StagePrompt(varStagePrompt) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "field_key") + delete(additionalProperties, "label") + delete(additionalProperties, "type") + delete(additionalProperties, "required") + delete(additionalProperties, "placeholder") + delete(additionalProperties, "initial_value") + delete(additionalProperties, "order") + delete(additionalProperties, "sub_text") + delete(additionalProperties, "choices") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStagePrompt struct { + value *StagePrompt + isSet bool +} + +func (v NullableStagePrompt) Get() *StagePrompt { + return v.value +} + +func (v *NullableStagePrompt) Set(val *StagePrompt) { + v.value = val + v.isSet = true +} + +func (v NullableStagePrompt) IsSet() bool { + return v.isSet +} + +func (v *NullableStagePrompt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStagePrompt(val *StagePrompt) *NullableStagePrompt { + return &NullableStagePrompt{value: val, isSet: true} +} + +func (v NullableStagePrompt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStagePrompt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_static_device.go b/packages/client-go/model_static_device.go new file mode 100644 index 0000000000..79bb281ad3 --- /dev/null +++ b/packages/client-go/model_static_device.go @@ -0,0 +1,255 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the StaticDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StaticDevice{} + +// StaticDevice Serializer for static authenticator devices +type StaticDevice struct { + // The human-readable name of this device. + Name string `json:"name"` + TokenSet []StaticDeviceToken `json:"token_set"` + Pk int32 `json:"pk"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _StaticDevice StaticDevice + +// NewStaticDevice instantiates a new StaticDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStaticDevice(name string, tokenSet []StaticDeviceToken, pk int32, user PartialUser) *StaticDevice { + this := StaticDevice{} + this.Name = name + this.TokenSet = tokenSet + this.Pk = pk + this.User = user + return &this +} + +// NewStaticDeviceWithDefaults instantiates a new StaticDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStaticDeviceWithDefaults() *StaticDevice { + this := StaticDevice{} + return &this +} + +// GetName returns the Name field value +func (o *StaticDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *StaticDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *StaticDevice) SetName(v string) { + o.Name = v +} + +// GetTokenSet returns the TokenSet field value +func (o *StaticDevice) GetTokenSet() []StaticDeviceToken { + if o == nil { + var ret []StaticDeviceToken + return ret + } + + return o.TokenSet +} + +// GetTokenSetOk returns a tuple with the TokenSet field value +// and a boolean to check if the value has been set. +func (o *StaticDevice) GetTokenSetOk() ([]StaticDeviceToken, bool) { + if o == nil { + return nil, false + } + return o.TokenSet, true +} + +// SetTokenSet sets field value +func (o *StaticDevice) SetTokenSet(v []StaticDeviceToken) { + o.TokenSet = v +} + +// GetPk returns the Pk field value +func (o *StaticDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *StaticDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *StaticDevice) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *StaticDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *StaticDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *StaticDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o StaticDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StaticDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["token_set"] = o.TokenSet + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StaticDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "token_set", + "pk", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStaticDevice := _StaticDevice{} + + err = json.Unmarshal(data, &varStaticDevice) + + if err != nil { + return err + } + + *o = StaticDevice(varStaticDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "token_set") + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStaticDevice struct { + value *StaticDevice + isSet bool +} + +func (v NullableStaticDevice) Get() *StaticDevice { + return v.value +} + +func (v *NullableStaticDevice) Set(val *StaticDevice) { + v.value = val + v.isSet = true +} + +func (v NullableStaticDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticDevice(val *StaticDevice) *NullableStaticDevice { + return &NullableStaticDevice{value: val, isSet: true} +} + +func (v NullableStaticDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_static_device_request.go b/packages/client-go/model_static_device_request.go new file mode 100644 index 0000000000..c7e71cc6db --- /dev/null +++ b/packages/client-go/model_static_device_request.go @@ -0,0 +1,168 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the StaticDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StaticDeviceRequest{} + +// StaticDeviceRequest Serializer for static authenticator devices +type StaticDeviceRequest struct { + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _StaticDeviceRequest StaticDeviceRequest + +// NewStaticDeviceRequest instantiates a new StaticDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStaticDeviceRequest(name string) *StaticDeviceRequest { + this := StaticDeviceRequest{} + this.Name = name + return &this +} + +// NewStaticDeviceRequestWithDefaults instantiates a new StaticDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStaticDeviceRequestWithDefaults() *StaticDeviceRequest { + this := StaticDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *StaticDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *StaticDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *StaticDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o StaticDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StaticDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StaticDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStaticDeviceRequest := _StaticDeviceRequest{} + + err = json.Unmarshal(data, &varStaticDeviceRequest) + + if err != nil { + return err + } + + *o = StaticDeviceRequest(varStaticDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStaticDeviceRequest struct { + value *StaticDeviceRequest + isSet bool +} + +func (v NullableStaticDeviceRequest) Get() *StaticDeviceRequest { + return v.value +} + +func (v *NullableStaticDeviceRequest) Set(val *StaticDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableStaticDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticDeviceRequest(val *StaticDeviceRequest) *NullableStaticDeviceRequest { + return &NullableStaticDeviceRequest{value: val, isSet: true} +} + +func (v NullableStaticDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_static_device_token.go b/packages/client-go/model_static_device_token.go new file mode 100644 index 0000000000..57b0048b4b --- /dev/null +++ b/packages/client-go/model_static_device_token.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the StaticDeviceToken type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &StaticDeviceToken{} + +// StaticDeviceToken Serializer for static device's tokens +type StaticDeviceToken struct { + Token string `json:"token"` + AdditionalProperties map[string]interface{} +} + +type _StaticDeviceToken StaticDeviceToken + +// NewStaticDeviceToken instantiates a new StaticDeviceToken object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewStaticDeviceToken(token string) *StaticDeviceToken { + this := StaticDeviceToken{} + this.Token = token + return &this +} + +// NewStaticDeviceTokenWithDefaults instantiates a new StaticDeviceToken object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewStaticDeviceTokenWithDefaults() *StaticDeviceToken { + this := StaticDeviceToken{} + return &this +} + +// GetToken returns the Token field value +func (o *StaticDeviceToken) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *StaticDeviceToken) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *StaticDeviceToken) SetToken(v string) { + o.Token = v +} + +func (o StaticDeviceToken) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o StaticDeviceToken) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["token"] = o.Token + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *StaticDeviceToken) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStaticDeviceToken := _StaticDeviceToken{} + + err = json.Unmarshal(data, &varStaticDeviceToken) + + if err != nil { + return err + } + + *o = StaticDeviceToken(varStaticDeviceToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableStaticDeviceToken struct { + value *StaticDeviceToken + isSet bool +} + +func (v NullableStaticDeviceToken) Get() *StaticDeviceToken { + return v.value +} + +func (v *NullableStaticDeviceToken) Set(val *StaticDeviceToken) { + v.value = val + v.isSet = true +} + +func (v NullableStaticDeviceToken) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticDeviceToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticDeviceToken(val *StaticDeviceToken) *NullableStaticDeviceToken { + return &NullableStaticDeviceToken{value: val, isSet: true} +} + +func (v NullableStaticDeviceToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticDeviceToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sub_mode_enum.go b/packages/client-go/model_sub_mode_enum.go new file mode 100644 index 0000000000..e0e86196c2 --- /dev/null +++ b/packages/client-go/model_sub_mode_enum.go @@ -0,0 +1,119 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SubModeEnum the model 'SubModeEnum' +type SubModeEnum string + +// List of SubModeEnum +const ( + SUBMODEENUM_HASHED_USER_ID SubModeEnum = "hashed_user_id" + SUBMODEENUM_USER_ID SubModeEnum = "user_id" + SUBMODEENUM_USER_UUID SubModeEnum = "user_uuid" + SUBMODEENUM_USER_USERNAME SubModeEnum = "user_username" + SUBMODEENUM_USER_EMAIL SubModeEnum = "user_email" + SUBMODEENUM_USER_UPN SubModeEnum = "user_upn" +) + +// All allowed values of SubModeEnum enum +var AllowedSubModeEnumEnumValues = []SubModeEnum{ + "hashed_user_id", + "user_id", + "user_uuid", + "user_username", + "user_email", + "user_upn", +} + +func (v *SubModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SubModeEnum(value) + for _, existing := range AllowedSubModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SubModeEnum", value) +} + +// NewSubModeEnumFromValue returns a pointer to a valid SubModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSubModeEnumFromValue(v string) (*SubModeEnum, error) { + ev := SubModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SubModeEnum: valid values are %v", v, AllowedSubModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SubModeEnum) IsValid() bool { + for _, existing := range AllowedSubModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SubModeEnum value +func (v SubModeEnum) Ptr() *SubModeEnum { + return &v +} + +type NullableSubModeEnum struct { + value *SubModeEnum + isSet bool +} + +func (v NullableSubModeEnum) Get() *SubModeEnum { + return v.value +} + +func (v *NullableSubModeEnum) Set(val *SubModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSubModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSubModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubModeEnum(val *SubModeEnum) *NullableSubModeEnum { + return &NullableSubModeEnum{value: val, isSet: true} +} + +func (v NullableSubModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sync_object_model_enum.go b/packages/client-go/model_sync_object_model_enum.go new file mode 100644 index 0000000000..0d2be976bd --- /dev/null +++ b/packages/client-go/model_sync_object_model_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SyncObjectModelEnum the model 'SyncObjectModelEnum' +type SyncObjectModelEnum string + +// List of SyncObjectModelEnum +const ( + SYNCOBJECTMODELENUM_AUTHENTIK_CORE_MODELS_USER SyncObjectModelEnum = "authentik.core.models.User" + SYNCOBJECTMODELENUM_AUTHENTIK_CORE_MODELS_GROUP SyncObjectModelEnum = "authentik.core.models.Group" +) + +// All allowed values of SyncObjectModelEnum enum +var AllowedSyncObjectModelEnumEnumValues = []SyncObjectModelEnum{ + "authentik.core.models.User", + "authentik.core.models.Group", +} + +func (v *SyncObjectModelEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SyncObjectModelEnum(value) + for _, existing := range AllowedSyncObjectModelEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SyncObjectModelEnum", value) +} + +// NewSyncObjectModelEnumFromValue returns a pointer to a valid SyncObjectModelEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSyncObjectModelEnumFromValue(v string) (*SyncObjectModelEnum, error) { + ev := SyncObjectModelEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SyncObjectModelEnum: valid values are %v", v, AllowedSyncObjectModelEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SyncObjectModelEnum) IsValid() bool { + for _, existing := range AllowedSyncObjectModelEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyncObjectModelEnum value +func (v SyncObjectModelEnum) Ptr() *SyncObjectModelEnum { + return &v +} + +type NullableSyncObjectModelEnum struct { + value *SyncObjectModelEnum + isSet bool +} + +func (v NullableSyncObjectModelEnum) Get() *SyncObjectModelEnum { + return v.value +} + +func (v *NullableSyncObjectModelEnum) Set(val *SyncObjectModelEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSyncObjectModelEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSyncObjectModelEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyncObjectModelEnum(val *SyncObjectModelEnum) *NullableSyncObjectModelEnum { + return &NullableSyncObjectModelEnum{value: val, isSet: true} +} + +func (v NullableSyncObjectModelEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyncObjectModelEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sync_object_request.go b/packages/client-go/model_sync_object_request.go new file mode 100644 index 0000000000..1e76e688bb --- /dev/null +++ b/packages/client-go/model_sync_object_request.go @@ -0,0 +1,237 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SyncObjectRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SyncObjectRequest{} + +// SyncObjectRequest Sync object serializer +type SyncObjectRequest struct { + SyncObjectModel SyncObjectModelEnum `json:"sync_object_model"` + SyncObjectId string `json:"sync_object_id"` + OverrideDryRun *bool `json:"override_dry_run,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SyncObjectRequest SyncObjectRequest + +// NewSyncObjectRequest instantiates a new SyncObjectRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSyncObjectRequest(syncObjectModel SyncObjectModelEnum, syncObjectId string) *SyncObjectRequest { + this := SyncObjectRequest{} + this.SyncObjectModel = syncObjectModel + this.SyncObjectId = syncObjectId + var overrideDryRun bool = false + this.OverrideDryRun = &overrideDryRun + return &this +} + +// NewSyncObjectRequestWithDefaults instantiates a new SyncObjectRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSyncObjectRequestWithDefaults() *SyncObjectRequest { + this := SyncObjectRequest{} + var overrideDryRun bool = false + this.OverrideDryRun = &overrideDryRun + return &this +} + +// GetSyncObjectModel returns the SyncObjectModel field value +func (o *SyncObjectRequest) GetSyncObjectModel() SyncObjectModelEnum { + if o == nil { + var ret SyncObjectModelEnum + return ret + } + + return o.SyncObjectModel +} + +// GetSyncObjectModelOk returns a tuple with the SyncObjectModel field value +// and a boolean to check if the value has been set. +func (o *SyncObjectRequest) GetSyncObjectModelOk() (*SyncObjectModelEnum, bool) { + if o == nil { + return nil, false + } + return &o.SyncObjectModel, true +} + +// SetSyncObjectModel sets field value +func (o *SyncObjectRequest) SetSyncObjectModel(v SyncObjectModelEnum) { + o.SyncObjectModel = v +} + +// GetSyncObjectId returns the SyncObjectId field value +func (o *SyncObjectRequest) GetSyncObjectId() string { + if o == nil { + var ret string + return ret + } + + return o.SyncObjectId +} + +// GetSyncObjectIdOk returns a tuple with the SyncObjectId field value +// and a boolean to check if the value has been set. +func (o *SyncObjectRequest) GetSyncObjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SyncObjectId, true +} + +// SetSyncObjectId sets field value +func (o *SyncObjectRequest) SetSyncObjectId(v string) { + o.SyncObjectId = v +} + +// GetOverrideDryRun returns the OverrideDryRun field value if set, zero value otherwise. +func (o *SyncObjectRequest) GetOverrideDryRun() bool { + if o == nil || IsNil(o.OverrideDryRun) { + var ret bool + return ret + } + return *o.OverrideDryRun +} + +// GetOverrideDryRunOk returns a tuple with the OverrideDryRun field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyncObjectRequest) GetOverrideDryRunOk() (*bool, bool) { + if o == nil || IsNil(o.OverrideDryRun) { + return nil, false + } + return o.OverrideDryRun, true +} + +// HasOverrideDryRun returns a boolean if a field has been set. +func (o *SyncObjectRequest) HasOverrideDryRun() bool { + if o != nil && !IsNil(o.OverrideDryRun) { + return true + } + + return false +} + +// SetOverrideDryRun gets a reference to the given bool and assigns it to the OverrideDryRun field. +func (o *SyncObjectRequest) SetOverrideDryRun(v bool) { + o.OverrideDryRun = &v +} + +func (o SyncObjectRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SyncObjectRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sync_object_model"] = o.SyncObjectModel + toSerialize["sync_object_id"] = o.SyncObjectId + if !IsNil(o.OverrideDryRun) { + toSerialize["override_dry_run"] = o.OverrideDryRun + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SyncObjectRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "sync_object_model", + "sync_object_id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSyncObjectRequest := _SyncObjectRequest{} + + err = json.Unmarshal(data, &varSyncObjectRequest) + + if err != nil { + return err + } + + *o = SyncObjectRequest(varSyncObjectRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "sync_object_model") + delete(additionalProperties, "sync_object_id") + delete(additionalProperties, "override_dry_run") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSyncObjectRequest struct { + value *SyncObjectRequest + isSet bool +} + +func (v NullableSyncObjectRequest) Get() *SyncObjectRequest { + return v.value +} + +func (v *NullableSyncObjectRequest) Set(val *SyncObjectRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSyncObjectRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSyncObjectRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyncObjectRequest(val *SyncObjectRequest) *NullableSyncObjectRequest { + return &NullableSyncObjectRequest{value: val, isSet: true} +} + +func (v NullableSyncObjectRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyncObjectRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sync_object_result.go b/packages/client-go/model_sync_object_result.go new file mode 100644 index 0000000000..f68b46c5e2 --- /dev/null +++ b/packages/client-go/model_sync_object_result.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SyncObjectResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SyncObjectResult{} + +// SyncObjectResult Result of a single object sync +type SyncObjectResult struct { + Messages []LogEvent `json:"messages"` + AdditionalProperties map[string]interface{} +} + +type _SyncObjectResult SyncObjectResult + +// NewSyncObjectResult instantiates a new SyncObjectResult object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSyncObjectResult(messages []LogEvent) *SyncObjectResult { + this := SyncObjectResult{} + this.Messages = messages + return &this +} + +// NewSyncObjectResultWithDefaults instantiates a new SyncObjectResult object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSyncObjectResultWithDefaults() *SyncObjectResult { + this := SyncObjectResult{} + return &this +} + +// GetMessages returns the Messages field value +func (o *SyncObjectResult) GetMessages() []LogEvent { + if o == nil { + var ret []LogEvent + return ret + } + + return o.Messages +} + +// GetMessagesOk returns a tuple with the Messages field value +// and a boolean to check if the value has been set. +func (o *SyncObjectResult) GetMessagesOk() ([]LogEvent, bool) { + if o == nil { + return nil, false + } + return o.Messages, true +} + +// SetMessages sets field value +func (o *SyncObjectResult) SetMessages(v []LogEvent) { + o.Messages = v +} + +func (o SyncObjectResult) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SyncObjectResult) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["messages"] = o.Messages + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SyncObjectResult) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "messages", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSyncObjectResult := _SyncObjectResult{} + + err = json.Unmarshal(data, &varSyncObjectResult) + + if err != nil { + return err + } + + *o = SyncObjectResult(varSyncObjectResult) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "messages") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSyncObjectResult struct { + value *SyncObjectResult + isSet bool +} + +func (v NullableSyncObjectResult) Get() *SyncObjectResult { + return v.value +} + +func (v *NullableSyncObjectResult) Set(val *SyncObjectResult) { + v.value = val + v.isSet = true +} + +func (v NullableSyncObjectResult) IsSet() bool { + return v.isSet +} + +func (v *NullableSyncObjectResult) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyncObjectResult(val *SyncObjectResult) *NullableSyncObjectResult { + return &NullableSyncObjectResult{value: val, isSet: true} +} + +func (v NullableSyncObjectResult) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyncObjectResult) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sync_outgoing_trigger_mode_enum.go b/packages/client-go/model_sync_outgoing_trigger_mode_enum.go new file mode 100644 index 0000000000..8aa49b90c5 --- /dev/null +++ b/packages/client-go/model_sync_outgoing_trigger_mode_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// SyncOutgoingTriggerModeEnum the model 'SyncOutgoingTriggerModeEnum' +type SyncOutgoingTriggerModeEnum string + +// List of SyncOutgoingTriggerModeEnum +const ( + SYNCOUTGOINGTRIGGERMODEENUM_NONE SyncOutgoingTriggerModeEnum = "none" + SYNCOUTGOINGTRIGGERMODEENUM_IMMEDIATE SyncOutgoingTriggerModeEnum = "immediate" + SYNCOUTGOINGTRIGGERMODEENUM_DEFERRED_END SyncOutgoingTriggerModeEnum = "deferred_end" +) + +// All allowed values of SyncOutgoingTriggerModeEnum enum +var AllowedSyncOutgoingTriggerModeEnumEnumValues = []SyncOutgoingTriggerModeEnum{ + "none", + "immediate", + "deferred_end", +} + +func (v *SyncOutgoingTriggerModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SyncOutgoingTriggerModeEnum(value) + for _, existing := range AllowedSyncOutgoingTriggerModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SyncOutgoingTriggerModeEnum", value) +} + +// NewSyncOutgoingTriggerModeEnumFromValue returns a pointer to a valid SyncOutgoingTriggerModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewSyncOutgoingTriggerModeEnumFromValue(v string) (*SyncOutgoingTriggerModeEnum, error) { + ev := SyncOutgoingTriggerModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for SyncOutgoingTriggerModeEnum: valid values are %v", v, AllowedSyncOutgoingTriggerModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v SyncOutgoingTriggerModeEnum) IsValid() bool { + for _, existing := range AllowedSyncOutgoingTriggerModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyncOutgoingTriggerModeEnum value +func (v SyncOutgoingTriggerModeEnum) Ptr() *SyncOutgoingTriggerModeEnum { + return &v +} + +type NullableSyncOutgoingTriggerModeEnum struct { + value *SyncOutgoingTriggerModeEnum + isSet bool +} + +func (v NullableSyncOutgoingTriggerModeEnum) Get() *SyncOutgoingTriggerModeEnum { + return v.value +} + +func (v *NullableSyncOutgoingTriggerModeEnum) Set(val *SyncOutgoingTriggerModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableSyncOutgoingTriggerModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableSyncOutgoingTriggerModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyncOutgoingTriggerModeEnum(val *SyncOutgoingTriggerModeEnum) *NullableSyncOutgoingTriggerModeEnum { + return &NullableSyncOutgoingTriggerModeEnum{value: val, isSet: true} +} + +func (v NullableSyncOutgoingTriggerModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyncOutgoingTriggerModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_sync_status.go b/packages/client-go/model_sync_status.go new file mode 100644 index 0000000000..e64fc11369 --- /dev/null +++ b/packages/client-go/model_sync_status.go @@ -0,0 +1,242 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the SyncStatus type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SyncStatus{} + +// SyncStatus Provider/source sync status +type SyncStatus struct { + IsRunning bool `json:"is_running"` + LastSuccessfulSync *time.Time `json:"last_successful_sync,omitempty"` + LastSyncStatus *TaskAggregatedStatusEnum `json:"last_sync_status,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SyncStatus SyncStatus + +// NewSyncStatus instantiates a new SyncStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSyncStatus(isRunning bool) *SyncStatus { + this := SyncStatus{} + this.IsRunning = isRunning + return &this +} + +// NewSyncStatusWithDefaults instantiates a new SyncStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSyncStatusWithDefaults() *SyncStatus { + this := SyncStatus{} + return &this +} + +// GetIsRunning returns the IsRunning field value +func (o *SyncStatus) GetIsRunning() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsRunning +} + +// GetIsRunningOk returns a tuple with the IsRunning field value +// and a boolean to check if the value has been set. +func (o *SyncStatus) GetIsRunningOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsRunning, true +} + +// SetIsRunning sets field value +func (o *SyncStatus) SetIsRunning(v bool) { + o.IsRunning = v +} + +// GetLastSuccessfulSync returns the LastSuccessfulSync field value if set, zero value otherwise. +func (o *SyncStatus) GetLastSuccessfulSync() time.Time { + if o == nil || IsNil(o.LastSuccessfulSync) { + var ret time.Time + return ret + } + return *o.LastSuccessfulSync +} + +// GetLastSuccessfulSyncOk returns a tuple with the LastSuccessfulSync field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyncStatus) GetLastSuccessfulSyncOk() (*time.Time, bool) { + if o == nil || IsNil(o.LastSuccessfulSync) { + return nil, false + } + return o.LastSuccessfulSync, true +} + +// HasLastSuccessfulSync returns a boolean if a field has been set. +func (o *SyncStatus) HasLastSuccessfulSync() bool { + if o != nil && !IsNil(o.LastSuccessfulSync) { + return true + } + + return false +} + +// SetLastSuccessfulSync gets a reference to the given time.Time and assigns it to the LastSuccessfulSync field. +func (o *SyncStatus) SetLastSuccessfulSync(v time.Time) { + o.LastSuccessfulSync = &v +} + +// GetLastSyncStatus returns the LastSyncStatus field value if set, zero value otherwise. +func (o *SyncStatus) GetLastSyncStatus() TaskAggregatedStatusEnum { + if o == nil || IsNil(o.LastSyncStatus) { + var ret TaskAggregatedStatusEnum + return ret + } + return *o.LastSyncStatus +} + +// GetLastSyncStatusOk returns a tuple with the LastSyncStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyncStatus) GetLastSyncStatusOk() (*TaskAggregatedStatusEnum, bool) { + if o == nil || IsNil(o.LastSyncStatus) { + return nil, false + } + return o.LastSyncStatus, true +} + +// HasLastSyncStatus returns a boolean if a field has been set. +func (o *SyncStatus) HasLastSyncStatus() bool { + if o != nil && !IsNil(o.LastSyncStatus) { + return true + } + + return false +} + +// SetLastSyncStatus gets a reference to the given TaskAggregatedStatusEnum and assigns it to the LastSyncStatus field. +func (o *SyncStatus) SetLastSyncStatus(v TaskAggregatedStatusEnum) { + o.LastSyncStatus = &v +} + +func (o SyncStatus) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SyncStatus) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["is_running"] = o.IsRunning + if !IsNil(o.LastSuccessfulSync) { + toSerialize["last_successful_sync"] = o.LastSuccessfulSync + } + if !IsNil(o.LastSyncStatus) { + toSerialize["last_sync_status"] = o.LastSyncStatus + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SyncStatus) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "is_running", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSyncStatus := _SyncStatus{} + + err = json.Unmarshal(data, &varSyncStatus) + + if err != nil { + return err + } + + *o = SyncStatus(varSyncStatus) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "is_running") + delete(additionalProperties, "last_successful_sync") + delete(additionalProperties, "last_sync_status") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSyncStatus struct { + value *SyncStatus + isSet bool +} + +func (v NullableSyncStatus) Get() *SyncStatus { + return v.value +} + +func (v *NullableSyncStatus) Set(val *SyncStatus) { + v.value = val + v.isSet = true +} + +func (v NullableSyncStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableSyncStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyncStatus(val *SyncStatus) *NullableSyncStatus { + return &NullableSyncStatus{value: val, isSet: true} +} + +func (v NullableSyncStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyncStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_system_info.go b/packages/client-go/model_system_info.go new file mode 100644 index 0000000000..7ffcdf077f --- /dev/null +++ b/packages/client-go/model_system_info.go @@ -0,0 +1,378 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the SystemInfo type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SystemInfo{} + +// SystemInfo Get system information. +type SystemInfo struct { + // Get HTTP Request headers + HttpHeaders map[string]string `json:"http_headers"` + // Get HTTP host + HttpHost string `json:"http_host"` + // Get HTTP Secure flag + HttpIsSecure bool `json:"http_is_secure"` + Runtime SystemInfoRuntime `json:"runtime"` + // Currently active brand + Brand string `json:"brand"` + // Current server time + ServerTime time.Time `json:"server_time"` + // Whether the embedded outpost is disabled + EmbeddedOutpostDisabled bool `json:"embedded_outpost_disabled"` + // Get the FQDN configured on the embedded outpost + EmbeddedOutpostHost string `json:"embedded_outpost_host"` + AdditionalProperties map[string]interface{} +} + +type _SystemInfo SystemInfo + +// NewSystemInfo instantiates a new SystemInfo object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSystemInfo(httpHeaders map[string]string, httpHost string, httpIsSecure bool, runtime SystemInfoRuntime, brand string, serverTime time.Time, embeddedOutpostDisabled bool, embeddedOutpostHost string) *SystemInfo { + this := SystemInfo{} + this.HttpHeaders = httpHeaders + this.HttpHost = httpHost + this.HttpIsSecure = httpIsSecure + this.Runtime = runtime + this.Brand = brand + this.ServerTime = serverTime + this.EmbeddedOutpostDisabled = embeddedOutpostDisabled + this.EmbeddedOutpostHost = embeddedOutpostHost + return &this +} + +// NewSystemInfoWithDefaults instantiates a new SystemInfo object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSystemInfoWithDefaults() *SystemInfo { + this := SystemInfo{} + return &this +} + +// GetHttpHeaders returns the HttpHeaders field value +func (o *SystemInfo) GetHttpHeaders() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.HttpHeaders +} + +// GetHttpHeadersOk returns a tuple with the HttpHeaders field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetHttpHeadersOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.HttpHeaders, true +} + +// SetHttpHeaders sets field value +func (o *SystemInfo) SetHttpHeaders(v map[string]string) { + o.HttpHeaders = v +} + +// GetHttpHost returns the HttpHost field value +func (o *SystemInfo) GetHttpHost() string { + if o == nil { + var ret string + return ret + } + + return o.HttpHost +} + +// GetHttpHostOk returns a tuple with the HttpHost field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetHttpHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.HttpHost, true +} + +// SetHttpHost sets field value +func (o *SystemInfo) SetHttpHost(v string) { + o.HttpHost = v +} + +// GetHttpIsSecure returns the HttpIsSecure field value +func (o *SystemInfo) GetHttpIsSecure() bool { + if o == nil { + var ret bool + return ret + } + + return o.HttpIsSecure +} + +// GetHttpIsSecureOk returns a tuple with the HttpIsSecure field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetHttpIsSecureOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.HttpIsSecure, true +} + +// SetHttpIsSecure sets field value +func (o *SystemInfo) SetHttpIsSecure(v bool) { + o.HttpIsSecure = v +} + +// GetRuntime returns the Runtime field value +func (o *SystemInfo) GetRuntime() SystemInfoRuntime { + if o == nil { + var ret SystemInfoRuntime + return ret + } + + return o.Runtime +} + +// GetRuntimeOk returns a tuple with the Runtime field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetRuntimeOk() (*SystemInfoRuntime, bool) { + if o == nil { + return nil, false + } + return &o.Runtime, true +} + +// SetRuntime sets field value +func (o *SystemInfo) SetRuntime(v SystemInfoRuntime) { + o.Runtime = v +} + +// GetBrand returns the Brand field value +func (o *SystemInfo) GetBrand() string { + if o == nil { + var ret string + return ret + } + + return o.Brand +} + +// GetBrandOk returns a tuple with the Brand field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetBrandOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Brand, true +} + +// SetBrand sets field value +func (o *SystemInfo) SetBrand(v string) { + o.Brand = v +} + +// GetServerTime returns the ServerTime field value +func (o *SystemInfo) GetServerTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.ServerTime +} + +// GetServerTimeOk returns a tuple with the ServerTime field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetServerTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.ServerTime, true +} + +// SetServerTime sets field value +func (o *SystemInfo) SetServerTime(v time.Time) { + o.ServerTime = v +} + +// GetEmbeddedOutpostDisabled returns the EmbeddedOutpostDisabled field value +func (o *SystemInfo) GetEmbeddedOutpostDisabled() bool { + if o == nil { + var ret bool + return ret + } + + return o.EmbeddedOutpostDisabled +} + +// GetEmbeddedOutpostDisabledOk returns a tuple with the EmbeddedOutpostDisabled field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetEmbeddedOutpostDisabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.EmbeddedOutpostDisabled, true +} + +// SetEmbeddedOutpostDisabled sets field value +func (o *SystemInfo) SetEmbeddedOutpostDisabled(v bool) { + o.EmbeddedOutpostDisabled = v +} + +// GetEmbeddedOutpostHost returns the EmbeddedOutpostHost field value +func (o *SystemInfo) GetEmbeddedOutpostHost() string { + if o == nil { + var ret string + return ret + } + + return o.EmbeddedOutpostHost +} + +// GetEmbeddedOutpostHostOk returns a tuple with the EmbeddedOutpostHost field value +// and a boolean to check if the value has been set. +func (o *SystemInfo) GetEmbeddedOutpostHostOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EmbeddedOutpostHost, true +} + +// SetEmbeddedOutpostHost sets field value +func (o *SystemInfo) SetEmbeddedOutpostHost(v string) { + o.EmbeddedOutpostHost = v +} + +func (o SystemInfo) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SystemInfo) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["http_headers"] = o.HttpHeaders + toSerialize["http_host"] = o.HttpHost + toSerialize["http_is_secure"] = o.HttpIsSecure + toSerialize["runtime"] = o.Runtime + toSerialize["brand"] = o.Brand + toSerialize["server_time"] = o.ServerTime + toSerialize["embedded_outpost_disabled"] = o.EmbeddedOutpostDisabled + toSerialize["embedded_outpost_host"] = o.EmbeddedOutpostHost + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SystemInfo) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "http_headers", + "http_host", + "http_is_secure", + "runtime", + "brand", + "server_time", + "embedded_outpost_disabled", + "embedded_outpost_host", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSystemInfo := _SystemInfo{} + + err = json.Unmarshal(data, &varSystemInfo) + + if err != nil { + return err + } + + *o = SystemInfo(varSystemInfo) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "http_headers") + delete(additionalProperties, "http_host") + delete(additionalProperties, "http_is_secure") + delete(additionalProperties, "runtime") + delete(additionalProperties, "brand") + delete(additionalProperties, "server_time") + delete(additionalProperties, "embedded_outpost_disabled") + delete(additionalProperties, "embedded_outpost_host") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSystemInfo struct { + value *SystemInfo + isSet bool +} + +func (v NullableSystemInfo) Get() *SystemInfo { + return v.value +} + +func (v *NullableSystemInfo) Set(val *SystemInfo) { + v.value = val + v.isSet = true +} + +func (v NullableSystemInfo) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemInfo) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemInfo(val *SystemInfo) *NullableSystemInfo { + return &NullableSystemInfo{value: val, isSet: true} +} + +func (v NullableSystemInfo) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemInfo) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_system_info_runtime.go b/packages/client-go/model_system_info_runtime.go new file mode 100644 index 0000000000..3e3862cdc2 --- /dev/null +++ b/packages/client-go/model_system_info_runtime.go @@ -0,0 +1,372 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the SystemInfoRuntime type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SystemInfoRuntime{} + +// SystemInfoRuntime Get versions +type SystemInfoRuntime struct { + PythonVersion string `json:"python_version"` + Environment string `json:"environment"` + Architecture string `json:"architecture"` + Platform string `json:"platform"` + Uname string `json:"uname"` + OpensslVersion string `json:"openssl_version"` + OpensslFipsEnabled NullableBool `json:"openssl_fips_enabled"` + AuthentikVersion string `json:"authentik_version"` + AdditionalProperties map[string]interface{} +} + +type _SystemInfoRuntime SystemInfoRuntime + +// NewSystemInfoRuntime instantiates a new SystemInfoRuntime object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSystemInfoRuntime(pythonVersion string, environment string, architecture string, platform string, uname string, opensslVersion string, opensslFipsEnabled NullableBool, authentikVersion string) *SystemInfoRuntime { + this := SystemInfoRuntime{} + this.PythonVersion = pythonVersion + this.Environment = environment + this.Architecture = architecture + this.Platform = platform + this.Uname = uname + this.OpensslVersion = opensslVersion + this.OpensslFipsEnabled = opensslFipsEnabled + this.AuthentikVersion = authentikVersion + return &this +} + +// NewSystemInfoRuntimeWithDefaults instantiates a new SystemInfoRuntime object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSystemInfoRuntimeWithDefaults() *SystemInfoRuntime { + this := SystemInfoRuntime{} + return &this +} + +// GetPythonVersion returns the PythonVersion field value +func (o *SystemInfoRuntime) GetPythonVersion() string { + if o == nil { + var ret string + return ret + } + + return o.PythonVersion +} + +// GetPythonVersionOk returns a tuple with the PythonVersion field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetPythonVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PythonVersion, true +} + +// SetPythonVersion sets field value +func (o *SystemInfoRuntime) SetPythonVersion(v string) { + o.PythonVersion = v +} + +// GetEnvironment returns the Environment field value +func (o *SystemInfoRuntime) GetEnvironment() string { + if o == nil { + var ret string + return ret + } + + return o.Environment +} + +// GetEnvironmentOk returns a tuple with the Environment field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetEnvironmentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Environment, true +} + +// SetEnvironment sets field value +func (o *SystemInfoRuntime) SetEnvironment(v string) { + o.Environment = v +} + +// GetArchitecture returns the Architecture field value +func (o *SystemInfoRuntime) GetArchitecture() string { + if o == nil { + var ret string + return ret + } + + return o.Architecture +} + +// GetArchitectureOk returns a tuple with the Architecture field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetArchitectureOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Architecture, true +} + +// SetArchitecture sets field value +func (o *SystemInfoRuntime) SetArchitecture(v string) { + o.Architecture = v +} + +// GetPlatform returns the Platform field value +func (o *SystemInfoRuntime) GetPlatform() string { + if o == nil { + var ret string + return ret + } + + return o.Platform +} + +// GetPlatformOk returns a tuple with the Platform field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetPlatformOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Platform, true +} + +// SetPlatform sets field value +func (o *SystemInfoRuntime) SetPlatform(v string) { + o.Platform = v +} + +// GetUname returns the Uname field value +func (o *SystemInfoRuntime) GetUname() string { + if o == nil { + var ret string + return ret + } + + return o.Uname +} + +// GetUnameOk returns a tuple with the Uname field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetUnameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uname, true +} + +// SetUname sets field value +func (o *SystemInfoRuntime) SetUname(v string) { + o.Uname = v +} + +// GetOpensslVersion returns the OpensslVersion field value +func (o *SystemInfoRuntime) GetOpensslVersion() string { + if o == nil { + var ret string + return ret + } + + return o.OpensslVersion +} + +// GetOpensslVersionOk returns a tuple with the OpensslVersion field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetOpensslVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.OpensslVersion, true +} + +// SetOpensslVersion sets field value +func (o *SystemInfoRuntime) SetOpensslVersion(v string) { + o.OpensslVersion = v +} + +// GetOpensslFipsEnabled returns the OpensslFipsEnabled field value +// If the value is explicit nil, the zero value for bool will be returned +func (o *SystemInfoRuntime) GetOpensslFipsEnabled() bool { + if o == nil || o.OpensslFipsEnabled.Get() == nil { + var ret bool + return ret + } + + return *o.OpensslFipsEnabled.Get() +} + +// GetOpensslFipsEnabledOk returns a tuple with the OpensslFipsEnabled field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SystemInfoRuntime) GetOpensslFipsEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.OpensslFipsEnabled.Get(), o.OpensslFipsEnabled.IsSet() +} + +// SetOpensslFipsEnabled sets field value +func (o *SystemInfoRuntime) SetOpensslFipsEnabled(v bool) { + o.OpensslFipsEnabled.Set(&v) +} + +// GetAuthentikVersion returns the AuthentikVersion field value +func (o *SystemInfoRuntime) GetAuthentikVersion() string { + if o == nil { + var ret string + return ret + } + + return o.AuthentikVersion +} + +// GetAuthentikVersionOk returns a tuple with the AuthentikVersion field value +// and a boolean to check if the value has been set. +func (o *SystemInfoRuntime) GetAuthentikVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthentikVersion, true +} + +// SetAuthentikVersion sets field value +func (o *SystemInfoRuntime) SetAuthentikVersion(v string) { + o.AuthentikVersion = v +} + +func (o SystemInfoRuntime) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SystemInfoRuntime) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["python_version"] = o.PythonVersion + toSerialize["environment"] = o.Environment + toSerialize["architecture"] = o.Architecture + toSerialize["platform"] = o.Platform + toSerialize["uname"] = o.Uname + toSerialize["openssl_version"] = o.OpensslVersion + toSerialize["openssl_fips_enabled"] = o.OpensslFipsEnabled.Get() + toSerialize["authentik_version"] = o.AuthentikVersion + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SystemInfoRuntime) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "python_version", + "environment", + "architecture", + "platform", + "uname", + "openssl_version", + "openssl_fips_enabled", + "authentik_version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSystemInfoRuntime := _SystemInfoRuntime{} + + err = json.Unmarshal(data, &varSystemInfoRuntime) + + if err != nil { + return err + } + + *o = SystemInfoRuntime(varSystemInfoRuntime) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "python_version") + delete(additionalProperties, "environment") + delete(additionalProperties, "architecture") + delete(additionalProperties, "platform") + delete(additionalProperties, "uname") + delete(additionalProperties, "openssl_version") + delete(additionalProperties, "openssl_fips_enabled") + delete(additionalProperties, "authentik_version") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSystemInfoRuntime struct { + value *SystemInfoRuntime + isSet bool +} + +func (v NullableSystemInfoRuntime) Get() *SystemInfoRuntime { + return v.value +} + +func (v *NullableSystemInfoRuntime) Set(val *SystemInfoRuntime) { + v.value = val + v.isSet = true +} + +func (v NullableSystemInfoRuntime) IsSet() bool { + return v.isSet +} + +func (v *NullableSystemInfoRuntime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSystemInfoRuntime(val *SystemInfoRuntime) *NullableSystemInfoRuntime { + return &NullableSystemInfoRuntime{value: val, isSet: true} +} + +func (v NullableSystemInfoRuntime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSystemInfoRuntime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_task.go b/packages/client-go/model_task.go new file mode 100644 index 0000000000..f63df6e341 --- /dev/null +++ b/packages/client-go/model_task.go @@ -0,0 +1,660 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Task type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Task{} + +// Task struct for Task +type Task struct { + MessageId *string `json:"message_id,omitempty"` + // Queue name + QueueName *string `json:"queue_name,omitempty"` + // Dramatiq actor name + ActorName string `json:"actor_name"` + // Task status + State *TaskStateEnum `json:"state,omitempty"` + // Task last modified time + Mtime *time.Time `json:"mtime,omitempty"` + // Number of retries + Retries *int64 `json:"retries,omitempty"` + // Planned execution time + Eta NullableTime `json:"eta,omitempty"` + RelObjAppLabel string `json:"rel_obj_app_label"` + RelObjModel string `json:"rel_obj_model"` + RelObjId NullableString `json:"rel_obj_id,omitempty"` + Uid string `json:"uid"` + Logs []LogEvent `json:"logs"` + PreviousLogs []LogEvent `json:"previous_logs"` + AggregatedStatus TaskAggregatedStatusEnum `json:"aggregated_status"` + Description NullableString `json:"description"` + AdditionalProperties map[string]interface{} +} + +type _Task Task + +// NewTask instantiates a new Task object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTask(actorName string, relObjAppLabel string, relObjModel string, uid string, logs []LogEvent, previousLogs []LogEvent, aggregatedStatus TaskAggregatedStatusEnum, description NullableString) *Task { + this := Task{} + this.ActorName = actorName + this.RelObjAppLabel = relObjAppLabel + this.RelObjModel = relObjModel + this.Uid = uid + this.Logs = logs + this.PreviousLogs = previousLogs + this.AggregatedStatus = aggregatedStatus + this.Description = description + return &this +} + +// NewTaskWithDefaults instantiates a new Task object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTaskWithDefaults() *Task { + this := Task{} + return &this +} + +// GetMessageId returns the MessageId field value if set, zero value otherwise. +func (o *Task) GetMessageId() string { + if o == nil || IsNil(o.MessageId) { + var ret string + return ret + } + return *o.MessageId +} + +// GetMessageIdOk returns a tuple with the MessageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetMessageIdOk() (*string, bool) { + if o == nil || IsNil(o.MessageId) { + return nil, false + } + return o.MessageId, true +} + +// HasMessageId returns a boolean if a field has been set. +func (o *Task) HasMessageId() bool { + if o != nil && !IsNil(o.MessageId) { + return true + } + + return false +} + +// SetMessageId gets a reference to the given string and assigns it to the MessageId field. +func (o *Task) SetMessageId(v string) { + o.MessageId = &v +} + +// GetQueueName returns the QueueName field value if set, zero value otherwise. +func (o *Task) GetQueueName() string { + if o == nil || IsNil(o.QueueName) { + var ret string + return ret + } + return *o.QueueName +} + +// GetQueueNameOk returns a tuple with the QueueName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetQueueNameOk() (*string, bool) { + if o == nil || IsNil(o.QueueName) { + return nil, false + } + return o.QueueName, true +} + +// HasQueueName returns a boolean if a field has been set. +func (o *Task) HasQueueName() bool { + if o != nil && !IsNil(o.QueueName) { + return true + } + + return false +} + +// SetQueueName gets a reference to the given string and assigns it to the QueueName field. +func (o *Task) SetQueueName(v string) { + o.QueueName = &v +} + +// GetActorName returns the ActorName field value +func (o *Task) GetActorName() string { + if o == nil { + var ret string + return ret + } + + return o.ActorName +} + +// GetActorNameOk returns a tuple with the ActorName field value +// and a boolean to check if the value has been set. +func (o *Task) GetActorNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ActorName, true +} + +// SetActorName sets field value +func (o *Task) SetActorName(v string) { + o.ActorName = v +} + +// GetState returns the State field value if set, zero value otherwise. +func (o *Task) GetState() TaskStateEnum { + if o == nil || IsNil(o.State) { + var ret TaskStateEnum + return ret + } + return *o.State +} + +// GetStateOk returns a tuple with the State field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetStateOk() (*TaskStateEnum, bool) { + if o == nil || IsNil(o.State) { + return nil, false + } + return o.State, true +} + +// HasState returns a boolean if a field has been set. +func (o *Task) HasState() bool { + if o != nil && !IsNil(o.State) { + return true + } + + return false +} + +// SetState gets a reference to the given TaskStateEnum and assigns it to the State field. +func (o *Task) SetState(v TaskStateEnum) { + o.State = &v +} + +// GetMtime returns the Mtime field value if set, zero value otherwise. +func (o *Task) GetMtime() time.Time { + if o == nil || IsNil(o.Mtime) { + var ret time.Time + return ret + } + return *o.Mtime +} + +// GetMtimeOk returns a tuple with the Mtime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetMtimeOk() (*time.Time, bool) { + if o == nil || IsNil(o.Mtime) { + return nil, false + } + return o.Mtime, true +} + +// HasMtime returns a boolean if a field has been set. +func (o *Task) HasMtime() bool { + if o != nil && !IsNil(o.Mtime) { + return true + } + + return false +} + +// SetMtime gets a reference to the given time.Time and assigns it to the Mtime field. +func (o *Task) SetMtime(v time.Time) { + o.Mtime = &v +} + +// GetRetries returns the Retries field value if set, zero value otherwise. +func (o *Task) GetRetries() int64 { + if o == nil || IsNil(o.Retries) { + var ret int64 + return ret + } + return *o.Retries +} + +// GetRetriesOk returns a tuple with the Retries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Task) GetRetriesOk() (*int64, bool) { + if o == nil || IsNil(o.Retries) { + return nil, false + } + return o.Retries, true +} + +// HasRetries returns a boolean if a field has been set. +func (o *Task) HasRetries() bool { + if o != nil && !IsNil(o.Retries) { + return true + } + + return false +} + +// SetRetries gets a reference to the given int64 and assigns it to the Retries field. +func (o *Task) SetRetries(v int64) { + o.Retries = &v +} + +// GetEta returns the Eta field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetEta() time.Time { + if o == nil || IsNil(o.Eta.Get()) { + var ret time.Time + return ret + } + return *o.Eta.Get() +} + +// GetEtaOk returns a tuple with the Eta field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetEtaOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Eta.Get(), o.Eta.IsSet() +} + +// HasEta returns a boolean if a field has been set. +func (o *Task) HasEta() bool { + if o != nil && o.Eta.IsSet() { + return true + } + + return false +} + +// SetEta gets a reference to the given NullableTime and assigns it to the Eta field. +func (o *Task) SetEta(v time.Time) { + o.Eta.Set(&v) +} + +// SetEtaNil sets the value for Eta to be an explicit nil +func (o *Task) SetEtaNil() { + o.Eta.Set(nil) +} + +// UnsetEta ensures that no value is present for Eta, not even an explicit nil +func (o *Task) UnsetEta() { + o.Eta.Unset() +} + +// GetRelObjAppLabel returns the RelObjAppLabel field value +func (o *Task) GetRelObjAppLabel() string { + if o == nil { + var ret string + return ret + } + + return o.RelObjAppLabel +} + +// GetRelObjAppLabelOk returns a tuple with the RelObjAppLabel field value +// and a boolean to check if the value has been set. +func (o *Task) GetRelObjAppLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RelObjAppLabel, true +} + +// SetRelObjAppLabel sets field value +func (o *Task) SetRelObjAppLabel(v string) { + o.RelObjAppLabel = v +} + +// GetRelObjModel returns the RelObjModel field value +func (o *Task) GetRelObjModel() string { + if o == nil { + var ret string + return ret + } + + return o.RelObjModel +} + +// GetRelObjModelOk returns a tuple with the RelObjModel field value +// and a boolean to check if the value has been set. +func (o *Task) GetRelObjModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RelObjModel, true +} + +// SetRelObjModel sets field value +func (o *Task) SetRelObjModel(v string) { + o.RelObjModel = v +} + +// GetRelObjId returns the RelObjId field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Task) GetRelObjId() string { + if o == nil || IsNil(o.RelObjId.Get()) { + var ret string + return ret + } + return *o.RelObjId.Get() +} + +// GetRelObjIdOk returns a tuple with the RelObjId field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetRelObjIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RelObjId.Get(), o.RelObjId.IsSet() +} + +// HasRelObjId returns a boolean if a field has been set. +func (o *Task) HasRelObjId() bool { + if o != nil && o.RelObjId.IsSet() { + return true + } + + return false +} + +// SetRelObjId gets a reference to the given NullableString and assigns it to the RelObjId field. +func (o *Task) SetRelObjId(v string) { + o.RelObjId.Set(&v) +} + +// SetRelObjIdNil sets the value for RelObjId to be an explicit nil +func (o *Task) SetRelObjIdNil() { + o.RelObjId.Set(nil) +} + +// UnsetRelObjId ensures that no value is present for RelObjId, not even an explicit nil +func (o *Task) UnsetRelObjId() { + o.RelObjId.Unset() +} + +// GetUid returns the Uid field value +func (o *Task) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *Task) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *Task) SetUid(v string) { + o.Uid = v +} + +// GetLogs returns the Logs field value +func (o *Task) GetLogs() []LogEvent { + if o == nil { + var ret []LogEvent + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *Task) GetLogsOk() ([]LogEvent, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *Task) SetLogs(v []LogEvent) { + o.Logs = v +} + +// GetPreviousLogs returns the PreviousLogs field value +func (o *Task) GetPreviousLogs() []LogEvent { + if o == nil { + var ret []LogEvent + return ret + } + + return o.PreviousLogs +} + +// GetPreviousLogsOk returns a tuple with the PreviousLogs field value +// and a boolean to check if the value has been set. +func (o *Task) GetPreviousLogsOk() ([]LogEvent, bool) { + if o == nil { + return nil, false + } + return o.PreviousLogs, true +} + +// SetPreviousLogs sets field value +func (o *Task) SetPreviousLogs(v []LogEvent) { + o.PreviousLogs = v +} + +// GetAggregatedStatus returns the AggregatedStatus field value +func (o *Task) GetAggregatedStatus() TaskAggregatedStatusEnum { + if o == nil { + var ret TaskAggregatedStatusEnum + return ret + } + + return o.AggregatedStatus +} + +// GetAggregatedStatusOk returns a tuple with the AggregatedStatus field value +// and a boolean to check if the value has been set. +func (o *Task) GetAggregatedStatusOk() (*TaskAggregatedStatusEnum, bool) { + if o == nil { + return nil, false + } + return &o.AggregatedStatus, true +} + +// SetAggregatedStatus sets field value +func (o *Task) SetAggregatedStatus(v TaskAggregatedStatusEnum) { + o.AggregatedStatus = v +} + +// GetDescription returns the Description field value +// If the value is explicit nil, the zero value for string will be returned +func (o *Task) GetDescription() string { + if o == nil || o.Description.Get() == nil { + var ret string + return ret + } + + return *o.Description.Get() +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Task) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Description.Get(), o.Description.IsSet() +} + +// SetDescription sets field value +func (o *Task) SetDescription(v string) { + o.Description.Set(&v) +} + +func (o Task) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Task) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.MessageId) { + toSerialize["message_id"] = o.MessageId + } + if !IsNil(o.QueueName) { + toSerialize["queue_name"] = o.QueueName + } + toSerialize["actor_name"] = o.ActorName + if !IsNil(o.State) { + toSerialize["state"] = o.State + } + if !IsNil(o.Mtime) { + toSerialize["mtime"] = o.Mtime + } + if !IsNil(o.Retries) { + toSerialize["retries"] = o.Retries + } + if o.Eta.IsSet() { + toSerialize["eta"] = o.Eta.Get() + } + toSerialize["rel_obj_app_label"] = o.RelObjAppLabel + toSerialize["rel_obj_model"] = o.RelObjModel + if o.RelObjId.IsSet() { + toSerialize["rel_obj_id"] = o.RelObjId.Get() + } + toSerialize["uid"] = o.Uid + toSerialize["logs"] = o.Logs + toSerialize["previous_logs"] = o.PreviousLogs + toSerialize["aggregated_status"] = o.AggregatedStatus + toSerialize["description"] = o.Description.Get() + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Task) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "actor_name", + "rel_obj_app_label", + "rel_obj_model", + "uid", + "logs", + "previous_logs", + "aggregated_status", + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTask := _Task{} + + err = json.Unmarshal(data, &varTask) + + if err != nil { + return err + } + + *o = Task(varTask) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "message_id") + delete(additionalProperties, "queue_name") + delete(additionalProperties, "actor_name") + delete(additionalProperties, "state") + delete(additionalProperties, "mtime") + delete(additionalProperties, "retries") + delete(additionalProperties, "eta") + delete(additionalProperties, "rel_obj_app_label") + delete(additionalProperties, "rel_obj_model") + delete(additionalProperties, "rel_obj_id") + delete(additionalProperties, "uid") + delete(additionalProperties, "logs") + delete(additionalProperties, "previous_logs") + delete(additionalProperties, "aggregated_status") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTask struct { + value *Task + isSet bool +} + +func (v NullableTask) Get() *Task { + return v.value +} + +func (v *NullableTask) Set(val *Task) { + v.value = val + v.isSet = true +} + +func (v NullableTask) IsSet() bool { + return v.isSet +} + +func (v *NullableTask) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTask(val *Task) *NullableTask { + return &NullableTask{value: val, isSet: true} +} + +func (v NullableTask) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTask) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_task_aggregated_status_enum.go b/packages/client-go/model_task_aggregated_status_enum.go new file mode 100644 index 0000000000..81b70c989e --- /dev/null +++ b/packages/client-go/model_task_aggregated_status_enum.go @@ -0,0 +1,127 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// TaskAggregatedStatusEnum the model 'TaskAggregatedStatusEnum' +type TaskAggregatedStatusEnum string + +// List of TaskAggregatedStatusEnum +const ( + TASKAGGREGATEDSTATUSENUM_QUEUED TaskAggregatedStatusEnum = "queued" + TASKAGGREGATEDSTATUSENUM_CONSUMED TaskAggregatedStatusEnum = "consumed" + TASKAGGREGATEDSTATUSENUM_PREPROCESS TaskAggregatedStatusEnum = "preprocess" + TASKAGGREGATEDSTATUSENUM_RUNNING TaskAggregatedStatusEnum = "running" + TASKAGGREGATEDSTATUSENUM_POSTPROCESS TaskAggregatedStatusEnum = "postprocess" + TASKAGGREGATEDSTATUSENUM_REJECTED TaskAggregatedStatusEnum = "rejected" + TASKAGGREGATEDSTATUSENUM_DONE TaskAggregatedStatusEnum = "done" + TASKAGGREGATEDSTATUSENUM_INFO TaskAggregatedStatusEnum = "info" + TASKAGGREGATEDSTATUSENUM_WARNING TaskAggregatedStatusEnum = "warning" + TASKAGGREGATEDSTATUSENUM_ERROR TaskAggregatedStatusEnum = "error" +) + +// All allowed values of TaskAggregatedStatusEnum enum +var AllowedTaskAggregatedStatusEnumEnumValues = []TaskAggregatedStatusEnum{ + "queued", + "consumed", + "preprocess", + "running", + "postprocess", + "rejected", + "done", + "info", + "warning", + "error", +} + +func (v *TaskAggregatedStatusEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TaskAggregatedStatusEnum(value) + for _, existing := range AllowedTaskAggregatedStatusEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TaskAggregatedStatusEnum", value) +} + +// NewTaskAggregatedStatusEnumFromValue returns a pointer to a valid TaskAggregatedStatusEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTaskAggregatedStatusEnumFromValue(v string) (*TaskAggregatedStatusEnum, error) { + ev := TaskAggregatedStatusEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TaskAggregatedStatusEnum: valid values are %v", v, AllowedTaskAggregatedStatusEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TaskAggregatedStatusEnum) IsValid() bool { + for _, existing := range AllowedTaskAggregatedStatusEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TaskAggregatedStatusEnum value +func (v TaskAggregatedStatusEnum) Ptr() *TaskAggregatedStatusEnum { + return &v +} + +type NullableTaskAggregatedStatusEnum struct { + value *TaskAggregatedStatusEnum + isSet bool +} + +func (v NullableTaskAggregatedStatusEnum) Get() *TaskAggregatedStatusEnum { + return v.value +} + +func (v *NullableTaskAggregatedStatusEnum) Set(val *TaskAggregatedStatusEnum) { + v.value = val + v.isSet = true +} + +func (v NullableTaskAggregatedStatusEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskAggregatedStatusEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskAggregatedStatusEnum(val *TaskAggregatedStatusEnum) *NullableTaskAggregatedStatusEnum { + return &NullableTaskAggregatedStatusEnum{value: val, isSet: true} +} + +func (v NullableTaskAggregatedStatusEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskAggregatedStatusEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_task_state_enum.go b/packages/client-go/model_task_state_enum.go new file mode 100644 index 0000000000..92b56bf39f --- /dev/null +++ b/packages/client-go/model_task_state_enum.go @@ -0,0 +1,121 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// TaskStateEnum the model 'TaskStateEnum' +type TaskStateEnum string + +// List of TaskStateEnum +const ( + TASKSTATEENUM_QUEUED TaskStateEnum = "queued" + TASKSTATEENUM_CONSUMED TaskStateEnum = "consumed" + TASKSTATEENUM_PREPROCESS TaskStateEnum = "preprocess" + TASKSTATEENUM_RUNNING TaskStateEnum = "running" + TASKSTATEENUM_POSTPROCESS TaskStateEnum = "postprocess" + TASKSTATEENUM_REJECTED TaskStateEnum = "rejected" + TASKSTATEENUM_DONE TaskStateEnum = "done" +) + +// All allowed values of TaskStateEnum enum +var AllowedTaskStateEnumEnumValues = []TaskStateEnum{ + "queued", + "consumed", + "preprocess", + "running", + "postprocess", + "rejected", + "done", +} + +func (v *TaskStateEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := TaskStateEnum(value) + for _, existing := range AllowedTaskStateEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid TaskStateEnum", value) +} + +// NewTaskStateEnumFromValue returns a pointer to a valid TaskStateEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewTaskStateEnumFromValue(v string) (*TaskStateEnum, error) { + ev := TaskStateEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for TaskStateEnum: valid values are %v", v, AllowedTaskStateEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v TaskStateEnum) IsValid() bool { + for _, existing := range AllowedTaskStateEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to TaskStateEnum value +func (v TaskStateEnum) Ptr() *TaskStateEnum { + return &v +} + +type NullableTaskStateEnum struct { + value *TaskStateEnum + isSet bool +} + +func (v NullableTaskStateEnum) Get() *TaskStateEnum { + return v.value +} + +func (v *NullableTaskStateEnum) Set(val *TaskStateEnum) { + v.value = val + v.isSet = true +} + +func (v NullableTaskStateEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableTaskStateEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTaskStateEnum(val *TaskStateEnum) *NullableTaskStateEnum { + return &NullableTaskStateEnum{value: val, isSet: true} +} + +func (v NullableTaskStateEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTaskStateEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_auth_request.go b/packages/client-go/model_telegram_auth_request.go new file mode 100644 index 0000000000..a2850a5c81 --- /dev/null +++ b/packages/client-go/model_telegram_auth_request.go @@ -0,0 +1,373 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramAuthRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramAuthRequest{} + +// TelegramAuthRequest struct for TelegramAuthRequest +type TelegramAuthRequest struct { + Id int32 `json:"id"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Username *string `json:"username,omitempty"` + PhotoUrl *string `json:"photo_url,omitempty"` + AuthDate int32 `json:"auth_date"` + Hash string `json:"hash"` + AdditionalProperties map[string]interface{} +} + +type _TelegramAuthRequest TelegramAuthRequest + +// NewTelegramAuthRequest instantiates a new TelegramAuthRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramAuthRequest(id int32, authDate int32, hash string) *TelegramAuthRequest { + this := TelegramAuthRequest{} + this.Id = id + this.AuthDate = authDate + this.Hash = hash + return &this +} + +// NewTelegramAuthRequestWithDefaults instantiates a new TelegramAuthRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramAuthRequestWithDefaults() *TelegramAuthRequest { + this := TelegramAuthRequest{} + return &this +} + +// GetId returns the Id field value +func (o *TelegramAuthRequest) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TelegramAuthRequest) SetId(v int32) { + o.Id = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *TelegramAuthRequest) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *TelegramAuthRequest) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *TelegramAuthRequest) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *TelegramAuthRequest) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *TelegramAuthRequest) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *TelegramAuthRequest) SetLastName(v string) { + o.LastName = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *TelegramAuthRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *TelegramAuthRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *TelegramAuthRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPhotoUrl returns the PhotoUrl field value if set, zero value otherwise. +func (o *TelegramAuthRequest) GetPhotoUrl() string { + if o == nil || IsNil(o.PhotoUrl) { + var ret string + return ret + } + return *o.PhotoUrl +} + +// GetPhotoUrlOk returns a tuple with the PhotoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetPhotoUrlOk() (*string, bool) { + if o == nil || IsNil(o.PhotoUrl) { + return nil, false + } + return o.PhotoUrl, true +} + +// HasPhotoUrl returns a boolean if a field has been set. +func (o *TelegramAuthRequest) HasPhotoUrl() bool { + if o != nil && !IsNil(o.PhotoUrl) { + return true + } + + return false +} + +// SetPhotoUrl gets a reference to the given string and assigns it to the PhotoUrl field. +func (o *TelegramAuthRequest) SetPhotoUrl(v string) { + o.PhotoUrl = &v +} + +// GetAuthDate returns the AuthDate field value +func (o *TelegramAuthRequest) GetAuthDate() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AuthDate +} + +// GetAuthDateOk returns a tuple with the AuthDate field value +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetAuthDateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AuthDate, true +} + +// SetAuthDate sets field value +func (o *TelegramAuthRequest) SetAuthDate(v int32) { + o.AuthDate = v +} + +// GetHash returns the Hash field value +func (o *TelegramAuthRequest) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *TelegramAuthRequest) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *TelegramAuthRequest) SetHash(v string) { + o.Hash = v +} + +func (o TelegramAuthRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramAuthRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.PhotoUrl) { + toSerialize["photo_url"] = o.PhotoUrl + } + toSerialize["auth_date"] = o.AuthDate + toSerialize["hash"] = o.Hash + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramAuthRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "auth_date", + "hash", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramAuthRequest := _TelegramAuthRequest{} + + err = json.Unmarshal(data, &varTelegramAuthRequest) + + if err != nil { + return err + } + + *o = TelegramAuthRequest(varTelegramAuthRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "username") + delete(additionalProperties, "photo_url") + delete(additionalProperties, "auth_date") + delete(additionalProperties, "hash") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramAuthRequest struct { + value *TelegramAuthRequest + isSet bool +} + +func (v NullableTelegramAuthRequest) Get() *TelegramAuthRequest { + return v.value +} + +func (v *NullableTelegramAuthRequest) Set(val *TelegramAuthRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramAuthRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramAuthRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramAuthRequest(val *TelegramAuthRequest) *NullableTelegramAuthRequest { + return &NullableTelegramAuthRequest{value: val, isSet: true} +} + +func (v NullableTelegramAuthRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramAuthRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_challenge_response_request.go b/packages/client-go/model_telegram_challenge_response_request.go new file mode 100644 index 0000000000..f1d9b6f834 --- /dev/null +++ b/packages/client-go/model_telegram_challenge_response_request.go @@ -0,0 +1,414 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramChallengeResponseRequest{} + +// TelegramChallengeResponseRequest Base class for all challenge responses +type TelegramChallengeResponseRequest struct { + Id int32 `json:"id"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + Username *string `json:"username,omitempty"` + PhotoUrl *string `json:"photo_url,omitempty"` + AuthDate int32 `json:"auth_date"` + Hash string `json:"hash"` + Component *string `json:"component,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TelegramChallengeResponseRequest TelegramChallengeResponseRequest + +// NewTelegramChallengeResponseRequest instantiates a new TelegramChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramChallengeResponseRequest(id int32, authDate int32, hash string) *TelegramChallengeResponseRequest { + this := TelegramChallengeResponseRequest{} + this.Id = id + this.AuthDate = authDate + this.Hash = hash + var component string = "ak-source-telegram" + this.Component = &component + return &this +} + +// NewTelegramChallengeResponseRequestWithDefaults instantiates a new TelegramChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramChallengeResponseRequestWithDefaults() *TelegramChallengeResponseRequest { + this := TelegramChallengeResponseRequest{} + var component string = "ak-source-telegram" + this.Component = &component + return &this +} + +// GetId returns the Id field value +func (o *TelegramChallengeResponseRequest) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *TelegramChallengeResponseRequest) SetId(v int32) { + o.Id = v +} + +// GetFirstName returns the FirstName field value if set, zero value otherwise. +func (o *TelegramChallengeResponseRequest) GetFirstName() string { + if o == nil || IsNil(o.FirstName) { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetFirstNameOk() (*string, bool) { + if o == nil || IsNil(o.FirstName) { + return nil, false + } + return o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *TelegramChallengeResponseRequest) HasFirstName() bool { + if o != nil && !IsNil(o.FirstName) { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *TelegramChallengeResponseRequest) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field value if set, zero value otherwise. +func (o *TelegramChallengeResponseRequest) GetLastName() string { + if o == nil || IsNil(o.LastName) { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetLastNameOk() (*string, bool) { + if o == nil || IsNil(o.LastName) { + return nil, false + } + return o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *TelegramChallengeResponseRequest) HasLastName() bool { + if o != nil && !IsNil(o.LastName) { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *TelegramChallengeResponseRequest) SetLastName(v string) { + o.LastName = &v +} + +// GetUsername returns the Username field value if set, zero value otherwise. +func (o *TelegramChallengeResponseRequest) GetUsername() string { + if o == nil || IsNil(o.Username) { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetUsernameOk() (*string, bool) { + if o == nil || IsNil(o.Username) { + return nil, false + } + return o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *TelegramChallengeResponseRequest) HasUsername() bool { + if o != nil && !IsNil(o.Username) { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *TelegramChallengeResponseRequest) SetUsername(v string) { + o.Username = &v +} + +// GetPhotoUrl returns the PhotoUrl field value if set, zero value otherwise. +func (o *TelegramChallengeResponseRequest) GetPhotoUrl() string { + if o == nil || IsNil(o.PhotoUrl) { + var ret string + return ret + } + return *o.PhotoUrl +} + +// GetPhotoUrlOk returns a tuple with the PhotoUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetPhotoUrlOk() (*string, bool) { + if o == nil || IsNil(o.PhotoUrl) { + return nil, false + } + return o.PhotoUrl, true +} + +// HasPhotoUrl returns a boolean if a field has been set. +func (o *TelegramChallengeResponseRequest) HasPhotoUrl() bool { + if o != nil && !IsNil(o.PhotoUrl) { + return true + } + + return false +} + +// SetPhotoUrl gets a reference to the given string and assigns it to the PhotoUrl field. +func (o *TelegramChallengeResponseRequest) SetPhotoUrl(v string) { + o.PhotoUrl = &v +} + +// GetAuthDate returns the AuthDate field value +func (o *TelegramChallengeResponseRequest) GetAuthDate() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.AuthDate +} + +// GetAuthDateOk returns a tuple with the AuthDate field value +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetAuthDateOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.AuthDate, true +} + +// SetAuthDate sets field value +func (o *TelegramChallengeResponseRequest) SetAuthDate(v int32) { + o.AuthDate = v +} + +// GetHash returns the Hash field value +func (o *TelegramChallengeResponseRequest) GetHash() string { + if o == nil { + var ret string + return ret + } + + return o.Hash +} + +// GetHashOk returns a tuple with the Hash field value +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Hash, true +} + +// SetHash sets field value +func (o *TelegramChallengeResponseRequest) SetHash(v string) { + o.Hash = v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *TelegramChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *TelegramChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *TelegramChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +func (o TelegramChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + if !IsNil(o.FirstName) { + toSerialize["first_name"] = o.FirstName + } + if !IsNil(o.LastName) { + toSerialize["last_name"] = o.LastName + } + if !IsNil(o.Username) { + toSerialize["username"] = o.Username + } + if !IsNil(o.PhotoUrl) { + toSerialize["photo_url"] = o.PhotoUrl + } + toSerialize["auth_date"] = o.AuthDate + toSerialize["hash"] = o.Hash + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "auth_date", + "hash", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramChallengeResponseRequest := _TelegramChallengeResponseRequest{} + + err = json.Unmarshal(data, &varTelegramChallengeResponseRequest) + + if err != nil { + return err + } + + *o = TelegramChallengeResponseRequest(varTelegramChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "first_name") + delete(additionalProperties, "last_name") + delete(additionalProperties, "username") + delete(additionalProperties, "photo_url") + delete(additionalProperties, "auth_date") + delete(additionalProperties, "hash") + delete(additionalProperties, "component") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramChallengeResponseRequest struct { + value *TelegramChallengeResponseRequest + isSet bool +} + +func (v NullableTelegramChallengeResponseRequest) Get() *TelegramChallengeResponseRequest { + return v.value +} + +func (v *NullableTelegramChallengeResponseRequest) Set(val *TelegramChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramChallengeResponseRequest(val *TelegramChallengeResponseRequest) *NullableTelegramChallengeResponseRequest { + return &NullableTelegramChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableTelegramChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_login_challenge.go b/packages/client-go/model_telegram_login_challenge.go new file mode 100644 index 0000000000..33eb36d62d --- /dev/null +++ b/packages/client-go/model_telegram_login_challenge.go @@ -0,0 +1,312 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramLoginChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramLoginChallenge{} + +// TelegramLoginChallenge Base login challenge for Identification stage +type TelegramLoginChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + // Telegram bot username + BotUsername string `json:"bot_username"` + RequestMessageAccess bool `json:"request_message_access"` + AdditionalProperties map[string]interface{} +} + +type _TelegramLoginChallenge TelegramLoginChallenge + +// NewTelegramLoginChallenge instantiates a new TelegramLoginChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramLoginChallenge(botUsername string, requestMessageAccess bool) *TelegramLoginChallenge { + this := TelegramLoginChallenge{} + var component string = "ak-source-telegram" + this.Component = &component + this.BotUsername = botUsername + this.RequestMessageAccess = requestMessageAccess + return &this +} + +// NewTelegramLoginChallengeWithDefaults instantiates a new TelegramLoginChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramLoginChallengeWithDefaults() *TelegramLoginChallenge { + this := TelegramLoginChallenge{} + var component string = "ak-source-telegram" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *TelegramLoginChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramLoginChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *TelegramLoginChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *TelegramLoginChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *TelegramLoginChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramLoginChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *TelegramLoginChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *TelegramLoginChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *TelegramLoginChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramLoginChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *TelegramLoginChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *TelegramLoginChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetBotUsername returns the BotUsername field value +func (o *TelegramLoginChallenge) GetBotUsername() string { + if o == nil { + var ret string + return ret + } + + return o.BotUsername +} + +// GetBotUsernameOk returns a tuple with the BotUsername field value +// and a boolean to check if the value has been set. +func (o *TelegramLoginChallenge) GetBotUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BotUsername, true +} + +// SetBotUsername sets field value +func (o *TelegramLoginChallenge) SetBotUsername(v string) { + o.BotUsername = v +} + +// GetRequestMessageAccess returns the RequestMessageAccess field value +func (o *TelegramLoginChallenge) GetRequestMessageAccess() bool { + if o == nil { + var ret bool + return ret + } + + return o.RequestMessageAccess +} + +// GetRequestMessageAccessOk returns a tuple with the RequestMessageAccess field value +// and a boolean to check if the value has been set. +func (o *TelegramLoginChallenge) GetRequestMessageAccessOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.RequestMessageAccess, true +} + +// SetRequestMessageAccess sets field value +func (o *TelegramLoginChallenge) SetRequestMessageAccess(v bool) { + o.RequestMessageAccess = v +} + +func (o TelegramLoginChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramLoginChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["bot_username"] = o.BotUsername + toSerialize["request_message_access"] = o.RequestMessageAccess + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramLoginChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "bot_username", + "request_message_access", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramLoginChallenge := _TelegramLoginChallenge{} + + err = json.Unmarshal(data, &varTelegramLoginChallenge) + + if err != nil { + return err + } + + *o = TelegramLoginChallenge(varTelegramLoginChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "bot_username") + delete(additionalProperties, "request_message_access") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramLoginChallenge struct { + value *TelegramLoginChallenge + isSet bool +} + +func (v NullableTelegramLoginChallenge) Get() *TelegramLoginChallenge { + return v.value +} + +func (v *NullableTelegramLoginChallenge) Set(val *TelegramLoginChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramLoginChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramLoginChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramLoginChallenge(val *TelegramLoginChallenge) *NullableTelegramLoginChallenge { + return &NullableTelegramLoginChallenge{value: val, isSet: true} +} + +func (v NullableTelegramLoginChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramLoginChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_source.go b/packages/client-go/model_telegram_source.go new file mode 100644 index 0000000000..b706f3af6a --- /dev/null +++ b/packages/client-go/model_telegram_source.go @@ -0,0 +1,935 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramSource{} + +// TelegramSource Source Serializer +type TelegramSource struct { + Pk string `json:"pk"` + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + IconUrl NullableString `json:"icon_url"` + IconThemedUrls NullableThemedUrls `json:"icon_themed_urls"` + // Telegram bot username + BotUsername string `json:"bot_username"` + // Request access to send messages from your bot. + RequestMessageAccess *bool `json:"request_message_access,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow string `json:"pre_authentication_flow"` + AdditionalProperties map[string]interface{} +} + +type _TelegramSource TelegramSource + +// NewTelegramSource instantiates a new TelegramSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramSource(pk string, name string, slug string, component string, verboseName string, verboseNamePlural string, metaModelName string, managed NullableString, iconUrl NullableString, iconThemedUrls NullableThemedUrls, botUsername string, preAuthenticationFlow string) *TelegramSource { + this := TelegramSource{} + this.Pk = pk + this.Name = name + this.Slug = slug + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.Managed = managed + this.IconUrl = iconUrl + this.IconThemedUrls = iconThemedUrls + this.BotUsername = botUsername + this.PreAuthenticationFlow = preAuthenticationFlow + return &this +} + +// NewTelegramSourceWithDefaults instantiates a new TelegramSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramSourceWithDefaults() *TelegramSource { + this := TelegramSource{} + return &this +} + +// GetPk returns the Pk field value +func (o *TelegramSource) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *TelegramSource) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *TelegramSource) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TelegramSource) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TelegramSource) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TelegramSource) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *TelegramSource) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *TelegramSource) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *TelegramSource) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *TelegramSource) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *TelegramSource) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *TelegramSource) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSource) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSource) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *TelegramSource) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *TelegramSource) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *TelegramSource) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *TelegramSource) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSource) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSource) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *TelegramSource) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *TelegramSource) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *TelegramSource) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *TelegramSource) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *TelegramSource) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *TelegramSource) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *TelegramSource) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *TelegramSource) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *TelegramSource) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *TelegramSource) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *TelegramSource) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *TelegramSource) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *TelegramSource) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *TelegramSource) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *TelegramSource) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *TelegramSource) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *TelegramSource) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *TelegramSource) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *TelegramSource) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *TelegramSource) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *TelegramSource) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *TelegramSource) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *TelegramSource) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *TelegramSource) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetManaged returns the Managed field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TelegramSource) GetManaged() string { + if o == nil || o.Managed.Get() == nil { + var ret string + return ret + } + + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSource) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// SetManaged sets field value +func (o *TelegramSource) SetManaged(v string) { + o.Managed.Set(&v) +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *TelegramSource) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *TelegramSource) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *TelegramSource) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *TelegramSource) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *TelegramSource) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *TelegramSource) SetIcon(v string) { + o.Icon = &v +} + +// GetIconUrl returns the IconUrl field value +// If the value is explicit nil, the zero value for string will be returned +func (o *TelegramSource) GetIconUrl() string { + if o == nil || o.IconUrl.Get() == nil { + var ret string + return ret + } + + return *o.IconUrl.Get() +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSource) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.IconUrl.Get(), o.IconUrl.IsSet() +} + +// SetIconUrl sets field value +func (o *TelegramSource) SetIconUrl(v string) { + o.IconUrl.Set(&v) +} + +// GetIconThemedUrls returns the IconThemedUrls field value +// If the value is explicit nil, the zero value for ThemedUrls will be returned +func (o *TelegramSource) GetIconThemedUrls() ThemedUrls { + if o == nil || o.IconThemedUrls.Get() == nil { + var ret ThemedUrls + return ret + } + + return *o.IconThemedUrls.Get() +} + +// GetIconThemedUrlsOk returns a tuple with the IconThemedUrls field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSource) GetIconThemedUrlsOk() (*ThemedUrls, bool) { + if o == nil { + return nil, false + } + return o.IconThemedUrls.Get(), o.IconThemedUrls.IsSet() +} + +// SetIconThemedUrls sets field value +func (o *TelegramSource) SetIconThemedUrls(v ThemedUrls) { + o.IconThemedUrls.Set(&v) +} + +// GetBotUsername returns the BotUsername field value +func (o *TelegramSource) GetBotUsername() string { + if o == nil { + var ret string + return ret + } + + return o.BotUsername +} + +// GetBotUsernameOk returns a tuple with the BotUsername field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetBotUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BotUsername, true +} + +// SetBotUsername sets field value +func (o *TelegramSource) SetBotUsername(v string) { + o.BotUsername = v +} + +// GetRequestMessageAccess returns the RequestMessageAccess field value if set, zero value otherwise. +func (o *TelegramSource) GetRequestMessageAccess() bool { + if o == nil || IsNil(o.RequestMessageAccess) { + var ret bool + return ret + } + return *o.RequestMessageAccess +} + +// GetRequestMessageAccessOk returns a tuple with the RequestMessageAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetRequestMessageAccessOk() (*bool, bool) { + if o == nil || IsNil(o.RequestMessageAccess) { + return nil, false + } + return o.RequestMessageAccess, true +} + +// HasRequestMessageAccess returns a boolean if a field has been set. +func (o *TelegramSource) HasRequestMessageAccess() bool { + if o != nil && !IsNil(o.RequestMessageAccess) { + return true + } + + return false +} + +// SetRequestMessageAccess gets a reference to the given bool and assigns it to the RequestMessageAccess field. +func (o *TelegramSource) SetRequestMessageAccess(v bool) { + o.RequestMessageAccess = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value +func (o *TelegramSource) GetPreAuthenticationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value +// and a boolean to check if the value has been set. +func (o *TelegramSource) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreAuthenticationFlow, true +} + +// SetPreAuthenticationFlow sets field value +func (o *TelegramSource) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = v +} + +func (o TelegramSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + toSerialize["managed"] = o.Managed.Get() + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["icon_url"] = o.IconUrl.Get() + toSerialize["icon_themed_urls"] = o.IconThemedUrls.Get() + toSerialize["bot_username"] = o.BotUsername + if !IsNil(o.RequestMessageAccess) { + toSerialize["request_message_access"] = o.RequestMessageAccess + } + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "slug", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "managed", + "icon_url", + "icon_themed_urls", + "bot_username", + "pre_authentication_flow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramSource := _TelegramSource{} + + err = json.Unmarshal(data, &varTelegramSource) + + if err != nil { + return err + } + + *o = TelegramSource(varTelegramSource) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "managed") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "icon_themed_urls") + delete(additionalProperties, "bot_username") + delete(additionalProperties, "request_message_access") + delete(additionalProperties, "pre_authentication_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramSource struct { + value *TelegramSource + isSet bool +} + +func (v NullableTelegramSource) Get() *TelegramSource { + return v.value +} + +func (v *NullableTelegramSource) Set(val *TelegramSource) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramSource) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramSource(val *TelegramSource) *NullableTelegramSource { + return &NullableTelegramSource{value: val, isSet: true} +} + +func (v NullableTelegramSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_source_property_mapping.go b/packages/client-go/model_telegram_source_property_mapping.go new file mode 100644 index 0000000000..3a0ea18234 --- /dev/null +++ b/packages/client-go/model_telegram_source_property_mapping.go @@ -0,0 +1,394 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramSourcePropertyMapping type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramSourcePropertyMapping{} + +// TelegramSourcePropertyMapping TelegramSourcePropertyMapping Serializer +type TelegramSourcePropertyMapping struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + // Get object's component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + AdditionalProperties map[string]interface{} +} + +type _TelegramSourcePropertyMapping TelegramSourcePropertyMapping + +// NewTelegramSourcePropertyMapping instantiates a new TelegramSourcePropertyMapping object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramSourcePropertyMapping(pk string, name string, expression string, component string, verboseName string, verboseNamePlural string, metaModelName string) *TelegramSourcePropertyMapping { + this := TelegramSourcePropertyMapping{} + this.Pk = pk + this.Name = name + this.Expression = expression + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + return &this +} + +// NewTelegramSourcePropertyMappingWithDefaults instantiates a new TelegramSourcePropertyMapping object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramSourcePropertyMappingWithDefaults() *TelegramSourcePropertyMapping { + this := TelegramSourcePropertyMapping{} + return &this +} + +// GetPk returns the Pk field value +func (o *TelegramSourcePropertyMapping) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *TelegramSourcePropertyMapping) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSourcePropertyMapping) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSourcePropertyMapping) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *TelegramSourcePropertyMapping) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *TelegramSourcePropertyMapping) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *TelegramSourcePropertyMapping) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *TelegramSourcePropertyMapping) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *TelegramSourcePropertyMapping) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TelegramSourcePropertyMapping) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *TelegramSourcePropertyMapping) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *TelegramSourcePropertyMapping) SetExpression(v string) { + o.Expression = v +} + +// GetComponent returns the Component field value +func (o *TelegramSourcePropertyMapping) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *TelegramSourcePropertyMapping) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *TelegramSourcePropertyMapping) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *TelegramSourcePropertyMapping) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *TelegramSourcePropertyMapping) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *TelegramSourcePropertyMapping) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *TelegramSourcePropertyMapping) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMapping) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *TelegramSourcePropertyMapping) SetMetaModelName(v string) { + o.MetaModelName = v +} + +func (o TelegramSourcePropertyMapping) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramSourcePropertyMapping) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramSourcePropertyMapping) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "expression", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramSourcePropertyMapping := _TelegramSourcePropertyMapping{} + + err = json.Unmarshal(data, &varTelegramSourcePropertyMapping) + + if err != nil { + return err + } + + *o = TelegramSourcePropertyMapping(varTelegramSourcePropertyMapping) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramSourcePropertyMapping struct { + value *TelegramSourcePropertyMapping + isSet bool +} + +func (v NullableTelegramSourcePropertyMapping) Get() *TelegramSourcePropertyMapping { + return v.value +} + +func (v *NullableTelegramSourcePropertyMapping) Set(val *TelegramSourcePropertyMapping) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramSourcePropertyMapping) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramSourcePropertyMapping) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramSourcePropertyMapping(val *TelegramSourcePropertyMapping) *NullableTelegramSourcePropertyMapping { + return &NullableTelegramSourcePropertyMapping{value: val, isSet: true} +} + +func (v NullableTelegramSourcePropertyMapping) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramSourcePropertyMapping) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_source_property_mapping_request.go b/packages/client-go/model_telegram_source_property_mapping_request.go new file mode 100644 index 0000000000..9659a72d93 --- /dev/null +++ b/packages/client-go/model_telegram_source_property_mapping_request.go @@ -0,0 +1,245 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramSourcePropertyMappingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramSourcePropertyMappingRequest{} + +// TelegramSourcePropertyMappingRequest TelegramSourcePropertyMapping Serializer +type TelegramSourcePropertyMappingRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Name string `json:"name"` + Expression string `json:"expression"` + AdditionalProperties map[string]interface{} +} + +type _TelegramSourcePropertyMappingRequest TelegramSourcePropertyMappingRequest + +// NewTelegramSourcePropertyMappingRequest instantiates a new TelegramSourcePropertyMappingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramSourcePropertyMappingRequest(name string, expression string) *TelegramSourcePropertyMappingRequest { + this := TelegramSourcePropertyMappingRequest{} + this.Name = name + this.Expression = expression + return &this +} + +// NewTelegramSourcePropertyMappingRequestWithDefaults instantiates a new TelegramSourcePropertyMappingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramSourcePropertyMappingRequestWithDefaults() *TelegramSourcePropertyMappingRequest { + this := TelegramSourcePropertyMappingRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSourcePropertyMappingRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSourcePropertyMappingRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *TelegramSourcePropertyMappingRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *TelegramSourcePropertyMappingRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *TelegramSourcePropertyMappingRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *TelegramSourcePropertyMappingRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetName returns the Name field value +func (o *TelegramSourcePropertyMappingRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMappingRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TelegramSourcePropertyMappingRequest) SetName(v string) { + o.Name = v +} + +// GetExpression returns the Expression field value +func (o *TelegramSourcePropertyMappingRequest) GetExpression() string { + if o == nil { + var ret string + return ret + } + + return o.Expression +} + +// GetExpressionOk returns a tuple with the Expression field value +// and a boolean to check if the value has been set. +func (o *TelegramSourcePropertyMappingRequest) GetExpressionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Expression, true +} + +// SetExpression sets field value +func (o *TelegramSourcePropertyMappingRequest) SetExpression(v string) { + o.Expression = v +} + +func (o TelegramSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramSourcePropertyMappingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["name"] = o.Name + toSerialize["expression"] = o.Expression + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramSourcePropertyMappingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "expression", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramSourcePropertyMappingRequest := _TelegramSourcePropertyMappingRequest{} + + err = json.Unmarshal(data, &varTelegramSourcePropertyMappingRequest) + + if err != nil { + return err + } + + *o = TelegramSourcePropertyMappingRequest(varTelegramSourcePropertyMappingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "name") + delete(additionalProperties, "expression") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramSourcePropertyMappingRequest struct { + value *TelegramSourcePropertyMappingRequest + isSet bool +} + +func (v NullableTelegramSourcePropertyMappingRequest) Get() *TelegramSourcePropertyMappingRequest { + return v.value +} + +func (v *NullableTelegramSourcePropertyMappingRequest) Set(val *TelegramSourcePropertyMappingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramSourcePropertyMappingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramSourcePropertyMappingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramSourcePropertyMappingRequest(val *TelegramSourcePropertyMappingRequest) *NullableTelegramSourcePropertyMappingRequest { + return &NullableTelegramSourcePropertyMappingRequest{value: val, isSet: true} +} + +func (v NullableTelegramSourcePropertyMappingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramSourcePropertyMappingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_telegram_source_request.go b/packages/client-go/model_telegram_source_request.go new file mode 100644 index 0000000000..c56aec938f --- /dev/null +++ b/packages/client-go/model_telegram_source_request.go @@ -0,0 +1,722 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TelegramSourceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TelegramSourceRequest{} + +// TelegramSourceRequest Source Serializer +type TelegramSourceRequest struct { + // Source's display Name. + Name string `json:"name"` + // Internal source name, used in URLs. + Slug string `json:"slug" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Enabled *bool `json:"enabled,omitempty"` + // When enabled, this source will be displayed as a prominent button on the login page, instead of a small icon. + Promoted *bool `json:"promoted,omitempty"` + // Flow to use when authenticating existing users. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow to use when enrolling new users. + EnrollmentFlow NullableString `json:"enrollment_flow,omitempty"` + UserPropertyMappings []string `json:"user_property_mappings,omitempty"` + GroupPropertyMappings []string `json:"group_property_mappings,omitempty"` + PolicyEngineMode *PolicyEngineMode `json:"policy_engine_mode,omitempty"` + // How the source determines if an existing user should be authenticated or a new user enrolled. + UserMatchingMode *UserMatchingModeEnum `json:"user_matching_mode,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + Icon *string `json:"icon,omitempty"` + // Telegram bot username + BotUsername string `json:"bot_username"` + // Telegram bot token + BotToken string `json:"bot_token"` + // Request access to send messages from your bot. + RequestMessageAccess *bool `json:"request_message_access,omitempty"` + // Flow used before authentication. + PreAuthenticationFlow string `json:"pre_authentication_flow"` + AdditionalProperties map[string]interface{} +} + +type _TelegramSourceRequest TelegramSourceRequest + +// NewTelegramSourceRequest instantiates a new TelegramSourceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTelegramSourceRequest(name string, slug string, botUsername string, botToken string, preAuthenticationFlow string) *TelegramSourceRequest { + this := TelegramSourceRequest{} + this.Name = name + this.Slug = slug + this.BotUsername = botUsername + this.BotToken = botToken + this.PreAuthenticationFlow = preAuthenticationFlow + return &this +} + +// NewTelegramSourceRequestWithDefaults instantiates a new TelegramSourceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTelegramSourceRequestWithDefaults() *TelegramSourceRequest { + this := TelegramSourceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TelegramSourceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TelegramSourceRequest) SetName(v string) { + o.Name = v +} + +// GetSlug returns the Slug field value +func (o *TelegramSourceRequest) GetSlug() string { + if o == nil { + var ret string + return ret + } + + return o.Slug +} + +// GetSlugOk returns a tuple with the Slug field value +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Slug, true +} + +// SetSlug sets field value +func (o *TelegramSourceRequest) SetSlug(v string) { + o.Slug = v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *TelegramSourceRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetPromoted returns the Promoted field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetPromoted() bool { + if o == nil || IsNil(o.Promoted) { + var ret bool + return ret + } + return *o.Promoted +} + +// GetPromotedOk returns a tuple with the Promoted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetPromotedOk() (*bool, bool) { + if o == nil || IsNil(o.Promoted) { + return nil, false + } + return o.Promoted, true +} + +// HasPromoted returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasPromoted() bool { + if o != nil && !IsNil(o.Promoted) { + return true + } + + return false +} + +// SetPromoted gets a reference to the given bool and assigns it to the Promoted field. +func (o *TelegramSourceRequest) SetPromoted(v bool) { + o.Promoted = &v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSourceRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSourceRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *TelegramSourceRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *TelegramSourceRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *TelegramSourceRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetEnrollmentFlow returns the EnrollmentFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TelegramSourceRequest) GetEnrollmentFlow() string { + if o == nil || IsNil(o.EnrollmentFlow.Get()) { + var ret string + return ret + } + return *o.EnrollmentFlow.Get() +} + +// GetEnrollmentFlowOk returns a tuple with the EnrollmentFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TelegramSourceRequest) GetEnrollmentFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EnrollmentFlow.Get(), o.EnrollmentFlow.IsSet() +} + +// HasEnrollmentFlow returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasEnrollmentFlow() bool { + if o != nil && o.EnrollmentFlow.IsSet() { + return true + } + + return false +} + +// SetEnrollmentFlow gets a reference to the given NullableString and assigns it to the EnrollmentFlow field. +func (o *TelegramSourceRequest) SetEnrollmentFlow(v string) { + o.EnrollmentFlow.Set(&v) +} + +// SetEnrollmentFlowNil sets the value for EnrollmentFlow to be an explicit nil +func (o *TelegramSourceRequest) SetEnrollmentFlowNil() { + o.EnrollmentFlow.Set(nil) +} + +// UnsetEnrollmentFlow ensures that no value is present for EnrollmentFlow, not even an explicit nil +func (o *TelegramSourceRequest) UnsetEnrollmentFlow() { + o.EnrollmentFlow.Unset() +} + +// GetUserPropertyMappings returns the UserPropertyMappings field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetUserPropertyMappings() []string { + if o == nil || IsNil(o.UserPropertyMappings) { + var ret []string + return ret + } + return o.UserPropertyMappings +} + +// GetUserPropertyMappingsOk returns a tuple with the UserPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetUserPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.UserPropertyMappings) { + return nil, false + } + return o.UserPropertyMappings, true +} + +// HasUserPropertyMappings returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasUserPropertyMappings() bool { + if o != nil && !IsNil(o.UserPropertyMappings) { + return true + } + + return false +} + +// SetUserPropertyMappings gets a reference to the given []string and assigns it to the UserPropertyMappings field. +func (o *TelegramSourceRequest) SetUserPropertyMappings(v []string) { + o.UserPropertyMappings = v +} + +// GetGroupPropertyMappings returns the GroupPropertyMappings field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetGroupPropertyMappings() []string { + if o == nil || IsNil(o.GroupPropertyMappings) { + var ret []string + return ret + } + return o.GroupPropertyMappings +} + +// GetGroupPropertyMappingsOk returns a tuple with the GroupPropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetGroupPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.GroupPropertyMappings) { + return nil, false + } + return o.GroupPropertyMappings, true +} + +// HasGroupPropertyMappings returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasGroupPropertyMappings() bool { + if o != nil && !IsNil(o.GroupPropertyMappings) { + return true + } + + return false +} + +// SetGroupPropertyMappings gets a reference to the given []string and assigns it to the GroupPropertyMappings field. +func (o *TelegramSourceRequest) SetGroupPropertyMappings(v []string) { + o.GroupPropertyMappings = v +} + +// GetPolicyEngineMode returns the PolicyEngineMode field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetPolicyEngineMode() PolicyEngineMode { + if o == nil || IsNil(o.PolicyEngineMode) { + var ret PolicyEngineMode + return ret + } + return *o.PolicyEngineMode +} + +// GetPolicyEngineModeOk returns a tuple with the PolicyEngineMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetPolicyEngineModeOk() (*PolicyEngineMode, bool) { + if o == nil || IsNil(o.PolicyEngineMode) { + return nil, false + } + return o.PolicyEngineMode, true +} + +// HasPolicyEngineMode returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasPolicyEngineMode() bool { + if o != nil && !IsNil(o.PolicyEngineMode) { + return true + } + + return false +} + +// SetPolicyEngineMode gets a reference to the given PolicyEngineMode and assigns it to the PolicyEngineMode field. +func (o *TelegramSourceRequest) SetPolicyEngineMode(v PolicyEngineMode) { + o.PolicyEngineMode = &v +} + +// GetUserMatchingMode returns the UserMatchingMode field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetUserMatchingMode() UserMatchingModeEnum { + if o == nil || IsNil(o.UserMatchingMode) { + var ret UserMatchingModeEnum + return ret + } + return *o.UserMatchingMode +} + +// GetUserMatchingModeOk returns a tuple with the UserMatchingMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetUserMatchingModeOk() (*UserMatchingModeEnum, bool) { + if o == nil || IsNil(o.UserMatchingMode) { + return nil, false + } + return o.UserMatchingMode, true +} + +// HasUserMatchingMode returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasUserMatchingMode() bool { + if o != nil && !IsNil(o.UserMatchingMode) { + return true + } + + return false +} + +// SetUserMatchingMode gets a reference to the given UserMatchingModeEnum and assigns it to the UserMatchingMode field. +func (o *TelegramSourceRequest) SetUserMatchingMode(v UserMatchingModeEnum) { + o.UserMatchingMode = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *TelegramSourceRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +// GetIcon returns the Icon field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetIcon() string { + if o == nil || IsNil(o.Icon) { + var ret string + return ret + } + return *o.Icon +} + +// GetIconOk returns a tuple with the Icon field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetIconOk() (*string, bool) { + if o == nil || IsNil(o.Icon) { + return nil, false + } + return o.Icon, true +} + +// HasIcon returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasIcon() bool { + if o != nil && !IsNil(o.Icon) { + return true + } + + return false +} + +// SetIcon gets a reference to the given string and assigns it to the Icon field. +func (o *TelegramSourceRequest) SetIcon(v string) { + o.Icon = &v +} + +// GetBotUsername returns the BotUsername field value +func (o *TelegramSourceRequest) GetBotUsername() string { + if o == nil { + var ret string + return ret + } + + return o.BotUsername +} + +// GetBotUsernameOk returns a tuple with the BotUsername field value +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetBotUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BotUsername, true +} + +// SetBotUsername sets field value +func (o *TelegramSourceRequest) SetBotUsername(v string) { + o.BotUsername = v +} + +// GetBotToken returns the BotToken field value +func (o *TelegramSourceRequest) GetBotToken() string { + if o == nil { + var ret string + return ret + } + + return o.BotToken +} + +// GetBotTokenOk returns a tuple with the BotToken field value +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetBotTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BotToken, true +} + +// SetBotToken sets field value +func (o *TelegramSourceRequest) SetBotToken(v string) { + o.BotToken = v +} + +// GetRequestMessageAccess returns the RequestMessageAccess field value if set, zero value otherwise. +func (o *TelegramSourceRequest) GetRequestMessageAccess() bool { + if o == nil || IsNil(o.RequestMessageAccess) { + var ret bool + return ret + } + return *o.RequestMessageAccess +} + +// GetRequestMessageAccessOk returns a tuple with the RequestMessageAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetRequestMessageAccessOk() (*bool, bool) { + if o == nil || IsNil(o.RequestMessageAccess) { + return nil, false + } + return o.RequestMessageAccess, true +} + +// HasRequestMessageAccess returns a boolean if a field has been set. +func (o *TelegramSourceRequest) HasRequestMessageAccess() bool { + if o != nil && !IsNil(o.RequestMessageAccess) { + return true + } + + return false +} + +// SetRequestMessageAccess gets a reference to the given bool and assigns it to the RequestMessageAccess field. +func (o *TelegramSourceRequest) SetRequestMessageAccess(v bool) { + o.RequestMessageAccess = &v +} + +// GetPreAuthenticationFlow returns the PreAuthenticationFlow field value +func (o *TelegramSourceRequest) GetPreAuthenticationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.PreAuthenticationFlow +} + +// GetPreAuthenticationFlowOk returns a tuple with the PreAuthenticationFlow field value +// and a boolean to check if the value has been set. +func (o *TelegramSourceRequest) GetPreAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PreAuthenticationFlow, true +} + +// SetPreAuthenticationFlow sets field value +func (o *TelegramSourceRequest) SetPreAuthenticationFlow(v string) { + o.PreAuthenticationFlow = v +} + +func (o TelegramSourceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TelegramSourceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["slug"] = o.Slug + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Promoted) { + toSerialize["promoted"] = o.Promoted + } + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + if o.EnrollmentFlow.IsSet() { + toSerialize["enrollment_flow"] = o.EnrollmentFlow.Get() + } + if !IsNil(o.UserPropertyMappings) { + toSerialize["user_property_mappings"] = o.UserPropertyMappings + } + if !IsNil(o.GroupPropertyMappings) { + toSerialize["group_property_mappings"] = o.GroupPropertyMappings + } + if !IsNil(o.PolicyEngineMode) { + toSerialize["policy_engine_mode"] = o.PolicyEngineMode + } + if !IsNil(o.UserMatchingMode) { + toSerialize["user_matching_mode"] = o.UserMatchingMode + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + if !IsNil(o.Icon) { + toSerialize["icon"] = o.Icon + } + toSerialize["bot_username"] = o.BotUsername + toSerialize["bot_token"] = o.BotToken + if !IsNil(o.RequestMessageAccess) { + toSerialize["request_message_access"] = o.RequestMessageAccess + } + toSerialize["pre_authentication_flow"] = o.PreAuthenticationFlow + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TelegramSourceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "slug", + "bot_username", + "bot_token", + "pre_authentication_flow", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTelegramSourceRequest := _TelegramSourceRequest{} + + err = json.Unmarshal(data, &varTelegramSourceRequest) + + if err != nil { + return err + } + + *o = TelegramSourceRequest(varTelegramSourceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "slug") + delete(additionalProperties, "enabled") + delete(additionalProperties, "promoted") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "enrollment_flow") + delete(additionalProperties, "user_property_mappings") + delete(additionalProperties, "group_property_mappings") + delete(additionalProperties, "policy_engine_mode") + delete(additionalProperties, "user_matching_mode") + delete(additionalProperties, "user_path_template") + delete(additionalProperties, "icon") + delete(additionalProperties, "bot_username") + delete(additionalProperties, "bot_token") + delete(additionalProperties, "request_message_access") + delete(additionalProperties, "pre_authentication_flow") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTelegramSourceRequest struct { + value *TelegramSourceRequest + isSet bool +} + +func (v NullableTelegramSourceRequest) Get() *TelegramSourceRequest { + return v.value +} + +func (v *NullableTelegramSourceRequest) Set(val *TelegramSourceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTelegramSourceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTelegramSourceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTelegramSourceRequest(val *TelegramSourceRequest) *NullableTelegramSourceRequest { + return &NullableTelegramSourceRequest{value: val, isSet: true} +} + +func (v NullableTelegramSourceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTelegramSourceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_tenant.go b/packages/client-go/model_tenant.go new file mode 100644 index 0000000000..4f50b7abc8 --- /dev/null +++ b/packages/client-go/model_tenant.go @@ -0,0 +1,262 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Tenant type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Tenant{} + +// Tenant Tenant Serializer +type Tenant struct { + TenantUuid string `json:"tenant_uuid"` + SchemaName string `json:"schema_name"` + Name string `json:"name"` + Ready *bool `json:"ready,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Tenant Tenant + +// NewTenant instantiates a new Tenant object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenant(tenantUuid string, schemaName string, name string) *Tenant { + this := Tenant{} + this.TenantUuid = tenantUuid + this.SchemaName = schemaName + this.Name = name + return &this +} + +// NewTenantWithDefaults instantiates a new Tenant object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantWithDefaults() *Tenant { + this := Tenant{} + return &this +} + +// GetTenantUuid returns the TenantUuid field value +func (o *Tenant) GetTenantUuid() string { + if o == nil { + var ret string + return ret + } + + return o.TenantUuid +} + +// GetTenantUuidOk returns a tuple with the TenantUuid field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetTenantUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TenantUuid, true +} + +// SetTenantUuid sets field value +func (o *Tenant) SetTenantUuid(v string) { + o.TenantUuid = v +} + +// GetSchemaName returns the SchemaName field value +func (o *Tenant) GetSchemaName() string { + if o == nil { + var ret string + return ret + } + + return o.SchemaName +} + +// GetSchemaNameOk returns a tuple with the SchemaName field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetSchemaNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SchemaName, true +} + +// SetSchemaName sets field value +func (o *Tenant) SetSchemaName(v string) { + o.SchemaName = v +} + +// GetName returns the Name field value +func (o *Tenant) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Tenant) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Tenant) SetName(v string) { + o.Name = v +} + +// GetReady returns the Ready field value if set, zero value otherwise. +func (o *Tenant) GetReady() bool { + if o == nil || IsNil(o.Ready) { + var ret bool + return ret + } + return *o.Ready +} + +// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Tenant) GetReadyOk() (*bool, bool) { + if o == nil || IsNil(o.Ready) { + return nil, false + } + return o.Ready, true +} + +// HasReady returns a boolean if a field has been set. +func (o *Tenant) HasReady() bool { + if o != nil && !IsNil(o.Ready) { + return true + } + + return false +} + +// SetReady gets a reference to the given bool and assigns it to the Ready field. +func (o *Tenant) SetReady(v bool) { + o.Ready = &v +} + +func (o Tenant) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Tenant) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["tenant_uuid"] = o.TenantUuid + toSerialize["schema_name"] = o.SchemaName + toSerialize["name"] = o.Name + if !IsNil(o.Ready) { + toSerialize["ready"] = o.Ready + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Tenant) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "tenant_uuid", + "schema_name", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenant := _Tenant{} + + err = json.Unmarshal(data, &varTenant) + + if err != nil { + return err + } + + *o = Tenant(varTenant) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "tenant_uuid") + delete(additionalProperties, "schema_name") + delete(additionalProperties, "name") + delete(additionalProperties, "ready") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenant struct { + value *Tenant + isSet bool +} + +func (v NullableTenant) Get() *Tenant { + return v.value +} + +func (v *NullableTenant) Set(val *Tenant) { + v.value = val + v.isSet = true +} + +func (v NullableTenant) IsSet() bool { + return v.isSet +} + +func (v *NullableTenant) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenant(val *Tenant) *NullableTenant { + return &NullableTenant{value: val, isSet: true} +} + +func (v NullableTenant) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenant) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_tenant_admin_group_request_request.go b/packages/client-go/model_tenant_admin_group_request_request.go new file mode 100644 index 0000000000..20b47ba930 --- /dev/null +++ b/packages/client-go/model_tenant_admin_group_request_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TenantAdminGroupRequestRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantAdminGroupRequestRequest{} + +// TenantAdminGroupRequestRequest Tenant admin group creation request serializer +type TenantAdminGroupRequestRequest struct { + User string `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _TenantAdminGroupRequestRequest TenantAdminGroupRequestRequest + +// NewTenantAdminGroupRequestRequest instantiates a new TenantAdminGroupRequestRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantAdminGroupRequestRequest(user string) *TenantAdminGroupRequestRequest { + this := TenantAdminGroupRequestRequest{} + this.User = user + return &this +} + +// NewTenantAdminGroupRequestRequestWithDefaults instantiates a new TenantAdminGroupRequestRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantAdminGroupRequestRequestWithDefaults() *TenantAdminGroupRequestRequest { + this := TenantAdminGroupRequestRequest{} + return &this +} + +// GetUser returns the User field value +func (o *TenantAdminGroupRequestRequest) GetUser() string { + if o == nil { + var ret string + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TenantAdminGroupRequestRequest) GetUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TenantAdminGroupRequestRequest) SetUser(v string) { + o.User = v +} + +func (o TenantAdminGroupRequestRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantAdminGroupRequestRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantAdminGroupRequestRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantAdminGroupRequestRequest := _TenantAdminGroupRequestRequest{} + + err = json.Unmarshal(data, &varTenantAdminGroupRequestRequest) + + if err != nil { + return err + } + + *o = TenantAdminGroupRequestRequest(varTenantAdminGroupRequestRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantAdminGroupRequestRequest struct { + value *TenantAdminGroupRequestRequest + isSet bool +} + +func (v NullableTenantAdminGroupRequestRequest) Get() *TenantAdminGroupRequestRequest { + return v.value +} + +func (v *NullableTenantAdminGroupRequestRequest) Set(val *TenantAdminGroupRequestRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTenantAdminGroupRequestRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantAdminGroupRequestRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantAdminGroupRequestRequest(val *TenantAdminGroupRequestRequest) *NullableTenantAdminGroupRequestRequest { + return &NullableTenantAdminGroupRequestRequest{value: val, isSet: true} +} + +func (v NullableTenantAdminGroupRequestRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantAdminGroupRequestRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_tenant_recovery_key_request_request.go b/packages/client-go/model_tenant_recovery_key_request_request.go new file mode 100644 index 0000000000..5ddd7ca71d --- /dev/null +++ b/packages/client-go/model_tenant_recovery_key_request_request.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TenantRecoveryKeyRequestRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantRecoveryKeyRequestRequest{} + +// TenantRecoveryKeyRequestRequest Tenant recovery key creation request serializer +type TenantRecoveryKeyRequestRequest struct { + User string `json:"user"` + DurationDays int32 `json:"duration_days"` + AdditionalProperties map[string]interface{} +} + +type _TenantRecoveryKeyRequestRequest TenantRecoveryKeyRequestRequest + +// NewTenantRecoveryKeyRequestRequest instantiates a new TenantRecoveryKeyRequestRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantRecoveryKeyRequestRequest(user string, durationDays int32) *TenantRecoveryKeyRequestRequest { + this := TenantRecoveryKeyRequestRequest{} + this.User = user + this.DurationDays = durationDays + return &this +} + +// NewTenantRecoveryKeyRequestRequestWithDefaults instantiates a new TenantRecoveryKeyRequestRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantRecoveryKeyRequestRequestWithDefaults() *TenantRecoveryKeyRequestRequest { + this := TenantRecoveryKeyRequestRequest{} + return &this +} + +// GetUser returns the User field value +func (o *TenantRecoveryKeyRequestRequest) GetUser() string { + if o == nil { + var ret string + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TenantRecoveryKeyRequestRequest) GetUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TenantRecoveryKeyRequestRequest) SetUser(v string) { + o.User = v +} + +// GetDurationDays returns the DurationDays field value +func (o *TenantRecoveryKeyRequestRequest) GetDurationDays() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.DurationDays +} + +// GetDurationDaysOk returns a tuple with the DurationDays field value +// and a boolean to check if the value has been set. +func (o *TenantRecoveryKeyRequestRequest) GetDurationDaysOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.DurationDays, true +} + +// SetDurationDays sets field value +func (o *TenantRecoveryKeyRequestRequest) SetDurationDays(v int32) { + o.DurationDays = v +} + +func (o TenantRecoveryKeyRequestRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantRecoveryKeyRequestRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["duration_days"] = o.DurationDays + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantRecoveryKeyRequestRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "duration_days", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantRecoveryKeyRequestRequest := _TenantRecoveryKeyRequestRequest{} + + err = json.Unmarshal(data, &varTenantRecoveryKeyRequestRequest) + + if err != nil { + return err + } + + *o = TenantRecoveryKeyRequestRequest(varTenantRecoveryKeyRequestRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "duration_days") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantRecoveryKeyRequestRequest struct { + value *TenantRecoveryKeyRequestRequest + isSet bool +} + +func (v NullableTenantRecoveryKeyRequestRequest) Get() *TenantRecoveryKeyRequestRequest { + return v.value +} + +func (v *NullableTenantRecoveryKeyRequestRequest) Set(val *TenantRecoveryKeyRequestRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTenantRecoveryKeyRequestRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantRecoveryKeyRequestRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantRecoveryKeyRequestRequest(val *TenantRecoveryKeyRequestRequest) *NullableTenantRecoveryKeyRequestRequest { + return &NullableTenantRecoveryKeyRequestRequest{value: val, isSet: true} +} + +func (v NullableTenantRecoveryKeyRequestRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantRecoveryKeyRequestRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_tenant_recovery_key_response.go b/packages/client-go/model_tenant_recovery_key_response.go new file mode 100644 index 0000000000..eb98919113 --- /dev/null +++ b/packages/client-go/model_tenant_recovery_key_response.go @@ -0,0 +1,197 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TenantRecoveryKeyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantRecoveryKeyResponse{} + +// TenantRecoveryKeyResponse Tenant recovery key creation response serializer +type TenantRecoveryKeyResponse struct { + Expiry time.Time `json:"expiry"` + Url string `json:"url"` + AdditionalProperties map[string]interface{} +} + +type _TenantRecoveryKeyResponse TenantRecoveryKeyResponse + +// NewTenantRecoveryKeyResponse instantiates a new TenantRecoveryKeyResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantRecoveryKeyResponse(expiry time.Time, url string) *TenantRecoveryKeyResponse { + this := TenantRecoveryKeyResponse{} + this.Expiry = expiry + this.Url = url + return &this +} + +// NewTenantRecoveryKeyResponseWithDefaults instantiates a new TenantRecoveryKeyResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantRecoveryKeyResponseWithDefaults() *TenantRecoveryKeyResponse { + this := TenantRecoveryKeyResponse{} + return &this +} + +// GetExpiry returns the Expiry field value +func (o *TenantRecoveryKeyResponse) GetExpiry() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Expiry +} + +// GetExpiryOk returns a tuple with the Expiry field value +// and a boolean to check if the value has been set. +func (o *TenantRecoveryKeyResponse) GetExpiryOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Expiry, true +} + +// SetExpiry sets field value +func (o *TenantRecoveryKeyResponse) SetExpiry(v time.Time) { + o.Expiry = v +} + +// GetUrl returns the Url field value +func (o *TenantRecoveryKeyResponse) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *TenantRecoveryKeyResponse) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *TenantRecoveryKeyResponse) SetUrl(v string) { + o.Url = v +} + +func (o TenantRecoveryKeyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantRecoveryKeyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["expiry"] = o.Expiry + toSerialize["url"] = o.Url + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantRecoveryKeyResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "expiry", + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantRecoveryKeyResponse := _TenantRecoveryKeyResponse{} + + err = json.Unmarshal(data, &varTenantRecoveryKeyResponse) + + if err != nil { + return err + } + + *o = TenantRecoveryKeyResponse(varTenantRecoveryKeyResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "expiry") + delete(additionalProperties, "url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantRecoveryKeyResponse struct { + value *TenantRecoveryKeyResponse + isSet bool +} + +func (v NullableTenantRecoveryKeyResponse) Get() *TenantRecoveryKeyResponse { + return v.value +} + +func (v *NullableTenantRecoveryKeyResponse) Set(val *TenantRecoveryKeyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTenantRecoveryKeyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantRecoveryKeyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantRecoveryKeyResponse(val *TenantRecoveryKeyResponse) *NullableTenantRecoveryKeyResponse { + return &NullableTenantRecoveryKeyResponse{value: val, isSet: true} +} + +func (v NullableTenantRecoveryKeyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantRecoveryKeyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_tenant_request.go b/packages/client-go/model_tenant_request.go new file mode 100644 index 0000000000..ac11778fb8 --- /dev/null +++ b/packages/client-go/model_tenant_request.go @@ -0,0 +1,233 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TenantRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TenantRequest{} + +// TenantRequest Tenant Serializer +type TenantRequest struct { + SchemaName string `json:"schema_name"` + Name string `json:"name"` + Ready *bool `json:"ready,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TenantRequest TenantRequest + +// NewTenantRequest instantiates a new TenantRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTenantRequest(schemaName string, name string) *TenantRequest { + this := TenantRequest{} + this.SchemaName = schemaName + this.Name = name + return &this +} + +// NewTenantRequestWithDefaults instantiates a new TenantRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTenantRequestWithDefaults() *TenantRequest { + this := TenantRequest{} + return &this +} + +// GetSchemaName returns the SchemaName field value +func (o *TenantRequest) GetSchemaName() string { + if o == nil { + var ret string + return ret + } + + return o.SchemaName +} + +// GetSchemaNameOk returns a tuple with the SchemaName field value +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetSchemaNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SchemaName, true +} + +// SetSchemaName sets field value +func (o *TenantRequest) SetSchemaName(v string) { + o.SchemaName = v +} + +// GetName returns the Name field value +func (o *TenantRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TenantRequest) SetName(v string) { + o.Name = v +} + +// GetReady returns the Ready field value if set, zero value otherwise. +func (o *TenantRequest) GetReady() bool { + if o == nil || IsNil(o.Ready) { + var ret bool + return ret + } + return *o.Ready +} + +// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TenantRequest) GetReadyOk() (*bool, bool) { + if o == nil || IsNil(o.Ready) { + return nil, false + } + return o.Ready, true +} + +// HasReady returns a boolean if a field has been set. +func (o *TenantRequest) HasReady() bool { + if o != nil && !IsNil(o.Ready) { + return true + } + + return false +} + +// SetReady gets a reference to the given bool and assigns it to the Ready field. +func (o *TenantRequest) SetReady(v bool) { + o.Ready = &v +} + +func (o TenantRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TenantRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["schema_name"] = o.SchemaName + toSerialize["name"] = o.Name + if !IsNil(o.Ready) { + toSerialize["ready"] = o.Ready + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TenantRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "schema_name", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTenantRequest := _TenantRequest{} + + err = json.Unmarshal(data, &varTenantRequest) + + if err != nil { + return err + } + + *o = TenantRequest(varTenantRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "schema_name") + delete(additionalProperties, "name") + delete(additionalProperties, "ready") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTenantRequest struct { + value *TenantRequest + isSet bool +} + +func (v NullableTenantRequest) Get() *TenantRequest { + return v.value +} + +func (v *NullableTenantRequest) Set(val *TenantRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTenantRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTenantRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTenantRequest(val *TenantRequest) *NullableTenantRequest { + return &NullableTenantRequest{value: val, isSet: true} +} + +func (v NullableTenantRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTenantRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_themed_urls.go b/packages/client-go/model_themed_urls.go new file mode 100644 index 0000000000..c882b4cef9 --- /dev/null +++ b/packages/client-go/model_themed_urls.go @@ -0,0 +1,213 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the ThemedUrls type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ThemedUrls{} + +// ThemedUrls Themed URLs - maps theme names to URLs for light and dark themes +type ThemedUrls struct { + Light NullableString `json:"light,omitempty"` + Dark NullableString `json:"dark,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ThemedUrls ThemedUrls + +// NewThemedUrls instantiates a new ThemedUrls object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewThemedUrls() *ThemedUrls { + this := ThemedUrls{} + return &this +} + +// NewThemedUrlsWithDefaults instantiates a new ThemedUrls object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewThemedUrlsWithDefaults() *ThemedUrls { + this := ThemedUrls{} + return &this +} + +// GetLight returns the Light field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ThemedUrls) GetLight() string { + if o == nil || IsNil(o.Light.Get()) { + var ret string + return ret + } + return *o.Light.Get() +} + +// GetLightOk returns a tuple with the Light field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ThemedUrls) GetLightOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Light.Get(), o.Light.IsSet() +} + +// HasLight returns a boolean if a field has been set. +func (o *ThemedUrls) HasLight() bool { + if o != nil && o.Light.IsSet() { + return true + } + + return false +} + +// SetLight gets a reference to the given NullableString and assigns it to the Light field. +func (o *ThemedUrls) SetLight(v string) { + o.Light.Set(&v) +} + +// SetLightNil sets the value for Light to be an explicit nil +func (o *ThemedUrls) SetLightNil() { + o.Light.Set(nil) +} + +// UnsetLight ensures that no value is present for Light, not even an explicit nil +func (o *ThemedUrls) UnsetLight() { + o.Light.Unset() +} + +// GetDark returns the Dark field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ThemedUrls) GetDark() string { + if o == nil || IsNil(o.Dark.Get()) { + var ret string + return ret + } + return *o.Dark.Get() +} + +// GetDarkOk returns a tuple with the Dark field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ThemedUrls) GetDarkOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Dark.Get(), o.Dark.IsSet() +} + +// HasDark returns a boolean if a field has been set. +func (o *ThemedUrls) HasDark() bool { + if o != nil && o.Dark.IsSet() { + return true + } + + return false +} + +// SetDark gets a reference to the given NullableString and assigns it to the Dark field. +func (o *ThemedUrls) SetDark(v string) { + o.Dark.Set(&v) +} + +// SetDarkNil sets the value for Dark to be an explicit nil +func (o *ThemedUrls) SetDarkNil() { + o.Dark.Set(nil) +} + +// UnsetDark ensures that no value is present for Dark, not even an explicit nil +func (o *ThemedUrls) UnsetDark() { + o.Dark.Unset() +} + +func (o ThemedUrls) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ThemedUrls) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Light.IsSet() { + toSerialize["light"] = o.Light.Get() + } + if o.Dark.IsSet() { + toSerialize["dark"] = o.Dark.Get() + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ThemedUrls) UnmarshalJSON(data []byte) (err error) { + varThemedUrls := _ThemedUrls{} + + err = json.Unmarshal(data, &varThemedUrls) + + if err != nil { + return err + } + + *o = ThemedUrls(varThemedUrls) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "light") + delete(additionalProperties, "dark") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableThemedUrls struct { + value *ThemedUrls + isSet bool +} + +func (v NullableThemedUrls) Get() *ThemedUrls { + return v.value +} + +func (v *NullableThemedUrls) Set(val *ThemedUrls) { + v.value = val + v.isSet = true +} + +func (v NullableThemedUrls) IsSet() bool { + return v.isSet +} + +func (v *NullableThemedUrls) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableThemedUrls(val *ThemedUrls) *NullableThemedUrls { + return &NullableThemedUrls{value: val, isSet: true} +} + +func (v NullableThemedUrls) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableThemedUrls) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_token.go b/packages/client-go/model_token.go new file mode 100644 index 0000000000..c47e02376e --- /dev/null +++ b/packages/client-go/model_token.go @@ -0,0 +1,471 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the Token type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Token{} + +// Token Token Serializer +type Token struct { + Pk string `json:"pk"` + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Identifier string `json:"identifier" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Intent *IntentEnum `json:"intent,omitempty"` + User *int32 `json:"user,omitempty"` + UserObj User `json:"user_obj"` + Description *string `json:"description,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Token Token + +// NewToken instantiates a new Token object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewToken(pk string, identifier string, userObj User) *Token { + this := Token{} + this.Pk = pk + this.Identifier = identifier + this.UserObj = userObj + return &this +} + +// NewTokenWithDefaults instantiates a new Token object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenWithDefaults() *Token { + this := Token{} + return &this +} + +// GetPk returns the Pk field value +func (o *Token) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *Token) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *Token) SetPk(v string) { + o.Pk = v +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Token) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Token) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *Token) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *Token) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *Token) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *Token) UnsetManaged() { + o.Managed.Unset() +} + +// GetIdentifier returns the Identifier field value +func (o *Token) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *Token) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *Token) SetIdentifier(v string) { + o.Identifier = v +} + +// GetIntent returns the Intent field value if set, zero value otherwise. +func (o *Token) GetIntent() IntentEnum { + if o == nil || IsNil(o.Intent) { + var ret IntentEnum + return ret + } + return *o.Intent +} + +// GetIntentOk returns a tuple with the Intent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetIntentOk() (*IntentEnum, bool) { + if o == nil || IsNil(o.Intent) { + return nil, false + } + return o.Intent, true +} + +// HasIntent returns a boolean if a field has been set. +func (o *Token) HasIntent() bool { + if o != nil && !IsNil(o.Intent) { + return true + } + + return false +} + +// SetIntent gets a reference to the given IntentEnum and assigns it to the Intent field. +func (o *Token) SetIntent(v IntentEnum) { + o.Intent = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *Token) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *Token) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *Token) SetUser(v int32) { + o.User = &v +} + +// GetUserObj returns the UserObj field value +func (o *Token) GetUserObj() User { + if o == nil { + var ret User + return ret + } + + return o.UserObj +} + +// GetUserObjOk returns a tuple with the UserObj field value +// and a boolean to check if the value has been set. +func (o *Token) GetUserObjOk() (*User, bool) { + if o == nil { + return nil, false + } + return &o.UserObj, true +} + +// SetUserObj sets field value +func (o *Token) SetUserObj(v User) { + o.UserObj = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Token) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Token) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Token) SetDescription(v string) { + o.Description = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Token) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Token) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *Token) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *Token) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *Token) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *Token) UnsetExpires() { + o.Expires.Unset() +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *Token) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Token) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *Token) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *Token) SetExpiring(v bool) { + o.Expiring = &v +} + +func (o Token) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Token) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["identifier"] = o.Identifier + if !IsNil(o.Intent) { + toSerialize["intent"] = o.Intent + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + toSerialize["user_obj"] = o.UserObj + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Token) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "identifier", + "user_obj", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varToken := _Token{} + + err = json.Unmarshal(data, &varToken) + + if err != nil { + return err + } + + *o = Token(varToken) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "managed") + delete(additionalProperties, "identifier") + delete(additionalProperties, "intent") + delete(additionalProperties, "user") + delete(additionalProperties, "user_obj") + delete(additionalProperties, "description") + delete(additionalProperties, "expires") + delete(additionalProperties, "expiring") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableToken struct { + value *Token + isSet bool +} + +func (v NullableToken) Get() *Token { + return v.value +} + +func (v *NullableToken) Set(val *Token) { + v.value = val + v.isSet = true +} + +func (v NullableToken) IsSet() bool { + return v.isSet +} + +func (v *NullableToken) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableToken(val *Token) *NullableToken { + return &NullableToken{value: val, isSet: true} +} + +func (v NullableToken) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableToken) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_token_model.go b/packages/client-go/model_token_model.go new file mode 100644 index 0000000000..9fb8de3758 --- /dev/null +++ b/packages/client-go/model_token_model.go @@ -0,0 +1,400 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TokenModel type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenModel{} + +// TokenModel Serializer for BaseGrantModel and RefreshToken +type TokenModel struct { + Pk int32 `json:"pk"` + Provider OAuth2Provider `json:"provider"` + User User `json:"user"` + // Check if token is expired yet. + IsExpired bool `json:"is_expired"` + Expires NullableTime `json:"expires,omitempty"` + Scope []string `json:"scope"` + // Get the token's id_token as JSON String + IdToken string `json:"id_token"` + Revoked *bool `json:"revoked,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TokenModel TokenModel + +// NewTokenModel instantiates a new TokenModel object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenModel(pk int32, provider OAuth2Provider, user User, isExpired bool, scope []string, idToken string) *TokenModel { + this := TokenModel{} + this.Pk = pk + this.Provider = provider + this.User = user + this.IsExpired = isExpired + this.Scope = scope + this.IdToken = idToken + return &this +} + +// NewTokenModelWithDefaults instantiates a new TokenModel object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenModelWithDefaults() *TokenModel { + this := TokenModel{} + return &this +} + +// GetPk returns the Pk field value +func (o *TokenModel) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *TokenModel) SetPk(v int32) { + o.Pk = v +} + +// GetProvider returns the Provider field value +func (o *TokenModel) GetProvider() OAuth2Provider { + if o == nil { + var ret OAuth2Provider + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetProviderOk() (*OAuth2Provider, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *TokenModel) SetProvider(v OAuth2Provider) { + o.Provider = v +} + +// GetUser returns the User field value +func (o *TokenModel) GetUser() User { + if o == nil { + var ret User + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetUserOk() (*User, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TokenModel) SetUser(v User) { + o.User = v +} + +// GetIsExpired returns the IsExpired field value +func (o *TokenModel) GetIsExpired() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsExpired +} + +// GetIsExpiredOk returns a tuple with the IsExpired field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetIsExpiredOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsExpired, true +} + +// SetIsExpired sets field value +func (o *TokenModel) SetIsExpired(v bool) { + o.IsExpired = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenModel) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenModel) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *TokenModel) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *TokenModel) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *TokenModel) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *TokenModel) UnsetExpires() { + o.Expires.Unset() +} + +// GetScope returns the Scope field value +func (o *TokenModel) GetScope() []string { + if o == nil { + var ret []string + return ret + } + + return o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetScopeOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Scope, true +} + +// SetScope sets field value +func (o *TokenModel) SetScope(v []string) { + o.Scope = v +} + +// GetIdToken returns the IdToken field value +func (o *TokenModel) GetIdToken() string { + if o == nil { + var ret string + return ret + } + + return o.IdToken +} + +// GetIdTokenOk returns a tuple with the IdToken field value +// and a boolean to check if the value has been set. +func (o *TokenModel) GetIdTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IdToken, true +} + +// SetIdToken sets field value +func (o *TokenModel) SetIdToken(v string) { + o.IdToken = v +} + +// GetRevoked returns the Revoked field value if set, zero value otherwise. +func (o *TokenModel) GetRevoked() bool { + if o == nil || IsNil(o.Revoked) { + var ret bool + return ret + } + return *o.Revoked +} + +// GetRevokedOk returns a tuple with the Revoked field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenModel) GetRevokedOk() (*bool, bool) { + if o == nil || IsNil(o.Revoked) { + return nil, false + } + return o.Revoked, true +} + +// HasRevoked returns a boolean if a field has been set. +func (o *TokenModel) HasRevoked() bool { + if o != nil && !IsNil(o.Revoked) { + return true + } + + return false +} + +// SetRevoked gets a reference to the given bool and assigns it to the Revoked field. +func (o *TokenModel) SetRevoked(v bool) { + o.Revoked = &v +} + +func (o TokenModel) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenModel) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["provider"] = o.Provider + toSerialize["user"] = o.User + toSerialize["is_expired"] = o.IsExpired + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + toSerialize["scope"] = o.Scope + toSerialize["id_token"] = o.IdToken + if !IsNil(o.Revoked) { + toSerialize["revoked"] = o.Revoked + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenModel) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "provider", + "user", + "is_expired", + "scope", + "id_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenModel := _TokenModel{} + + err = json.Unmarshal(data, &varTokenModel) + + if err != nil { + return err + } + + *o = TokenModel(varTokenModel) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "provider") + delete(additionalProperties, "user") + delete(additionalProperties, "is_expired") + delete(additionalProperties, "expires") + delete(additionalProperties, "scope") + delete(additionalProperties, "id_token") + delete(additionalProperties, "revoked") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenModel struct { + value *TokenModel + isSet bool +} + +func (v NullableTokenModel) Get() *TokenModel { + return v.value +} + +func (v *NullableTokenModel) Set(val *TokenModel) { + v.value = val + v.isSet = true +} + +func (v NullableTokenModel) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenModel) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenModel(val *TokenModel) *NullableTokenModel { + return &NullableTokenModel{value: val, isSet: true} +} + +func (v NullableTokenModel) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenModel) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_token_request.go b/packages/client-go/model_token_request.go new file mode 100644 index 0000000000..c54d233702 --- /dev/null +++ b/packages/client-go/model_token_request.go @@ -0,0 +1,413 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the TokenRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenRequest{} + +// TokenRequest Token Serializer +type TokenRequest struct { + // Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update. + Managed NullableString `json:"managed,omitempty"` + Identifier string `json:"identifier" validate:"regexp=^[-a-zA-Z0-9_]+$"` + Intent *IntentEnum `json:"intent,omitempty"` + User *int32 `json:"user,omitempty"` + Description *string `json:"description,omitempty"` + Expires NullableTime `json:"expires,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TokenRequest TokenRequest + +// NewTokenRequest instantiates a new TokenRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenRequest(identifier string) *TokenRequest { + this := TokenRequest{} + this.Identifier = identifier + return &this +} + +// NewTokenRequestWithDefaults instantiates a new TokenRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenRequestWithDefaults() *TokenRequest { + this := TokenRequest{} + return &this +} + +// GetManaged returns the Managed field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenRequest) GetManaged() string { + if o == nil || IsNil(o.Managed.Get()) { + var ret string + return ret + } + return *o.Managed.Get() +} + +// GetManagedOk returns a tuple with the Managed field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenRequest) GetManagedOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Managed.Get(), o.Managed.IsSet() +} + +// HasManaged returns a boolean if a field has been set. +func (o *TokenRequest) HasManaged() bool { + if o != nil && o.Managed.IsSet() { + return true + } + + return false +} + +// SetManaged gets a reference to the given NullableString and assigns it to the Managed field. +func (o *TokenRequest) SetManaged(v string) { + o.Managed.Set(&v) +} + +// SetManagedNil sets the value for Managed to be an explicit nil +func (o *TokenRequest) SetManagedNil() { + o.Managed.Set(nil) +} + +// UnsetManaged ensures that no value is present for Managed, not even an explicit nil +func (o *TokenRequest) UnsetManaged() { + o.Managed.Unset() +} + +// GetIdentifier returns the Identifier field value +func (o *TokenRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *TokenRequest) SetIdentifier(v string) { + o.Identifier = v +} + +// GetIntent returns the Intent field value if set, zero value otherwise. +func (o *TokenRequest) GetIntent() IntentEnum { + if o == nil || IsNil(o.Intent) { + var ret IntentEnum + return ret + } + return *o.Intent +} + +// GetIntentOk returns a tuple with the Intent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetIntentOk() (*IntentEnum, bool) { + if o == nil || IsNil(o.Intent) { + return nil, false + } + return o.Intent, true +} + +// HasIntent returns a boolean if a field has been set. +func (o *TokenRequest) HasIntent() bool { + if o != nil && !IsNil(o.Intent) { + return true + } + + return false +} + +// SetIntent gets a reference to the given IntentEnum and assigns it to the Intent field. +func (o *TokenRequest) SetIntent(v IntentEnum) { + o.Intent = &v +} + +// GetUser returns the User field value if set, zero value otherwise. +func (o *TokenRequest) GetUser() int32 { + if o == nil || IsNil(o.User) { + var ret int32 + return ret + } + return *o.User +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetUserOk() (*int32, bool) { + if o == nil || IsNil(o.User) { + return nil, false + } + return o.User, true +} + +// HasUser returns a boolean if a field has been set. +func (o *TokenRequest) HasUser() bool { + if o != nil && !IsNil(o.User) { + return true + } + + return false +} + +// SetUser gets a reference to the given int32 and assigns it to the User field. +func (o *TokenRequest) SetUser(v int32) { + o.User = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *TokenRequest) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *TokenRequest) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *TokenRequest) SetDescription(v string) { + o.Description = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TokenRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TokenRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *TokenRequest) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *TokenRequest) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *TokenRequest) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *TokenRequest) UnsetExpires() { + o.Expires.Unset() +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *TokenRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TokenRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *TokenRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *TokenRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +func (o TokenRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Managed.IsSet() { + toSerialize["managed"] = o.Managed.Get() + } + toSerialize["identifier"] = o.Identifier + if !IsNil(o.Intent) { + toSerialize["intent"] = o.Intent + } + if !IsNil(o.User) { + toSerialize["user"] = o.User + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenRequest := _TokenRequest{} + + err = json.Unmarshal(data, &varTokenRequest) + + if err != nil { + return err + } + + *o = TokenRequest(varTokenRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "managed") + delete(additionalProperties, "identifier") + delete(additionalProperties, "intent") + delete(additionalProperties, "user") + delete(additionalProperties, "description") + delete(additionalProperties, "expires") + delete(additionalProperties, "expiring") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenRequest struct { + value *TokenRequest + isSet bool +} + +func (v NullableTokenRequest) Get() *TokenRequest { + return v.value +} + +func (v *NullableTokenRequest) Set(val *TokenRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTokenRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenRequest(val *TokenRequest) *NullableTokenRequest { + return &NullableTokenRequest{value: val, isSet: true} +} + +func (v NullableTokenRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_token_set_key_request.go b/packages/client-go/model_token_set_key_request.go new file mode 100644 index 0000000000..f5c7d32f2b --- /dev/null +++ b/packages/client-go/model_token_set_key_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TokenSetKeyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenSetKeyRequest{} + +// TokenSetKeyRequest Set token's key +type TokenSetKeyRequest struct { + Key string `json:"key"` + AdditionalProperties map[string]interface{} +} + +type _TokenSetKeyRequest TokenSetKeyRequest + +// NewTokenSetKeyRequest instantiates a new TokenSetKeyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenSetKeyRequest(key string) *TokenSetKeyRequest { + this := TokenSetKeyRequest{} + this.Key = key + return &this +} + +// NewTokenSetKeyRequestWithDefaults instantiates a new TokenSetKeyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenSetKeyRequestWithDefaults() *TokenSetKeyRequest { + this := TokenSetKeyRequest{} + return &this +} + +// GetKey returns the Key field value +func (o *TokenSetKeyRequest) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *TokenSetKeyRequest) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *TokenSetKeyRequest) SetKey(v string) { + o.Key = v +} + +func (o TokenSetKeyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenSetKeyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenSetKeyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenSetKeyRequest := _TokenSetKeyRequest{} + + err = json.Unmarshal(data, &varTokenSetKeyRequest) + + if err != nil { + return err + } + + *o = TokenSetKeyRequest(varTokenSetKeyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenSetKeyRequest struct { + value *TokenSetKeyRequest + isSet bool +} + +func (v NullableTokenSetKeyRequest) Get() *TokenSetKeyRequest { + return v.value +} + +func (v *NullableTokenSetKeyRequest) Set(val *TokenSetKeyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTokenSetKeyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenSetKeyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenSetKeyRequest(val *TokenSetKeyRequest) *NullableTokenSetKeyRequest { + return &NullableTokenSetKeyRequest{value: val, isSet: true} +} + +func (v NullableTokenSetKeyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenSetKeyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_token_view.go b/packages/client-go/model_token_view.go new file mode 100644 index 0000000000..db44415cdc --- /dev/null +++ b/packages/client-go/model_token_view.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TokenView type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TokenView{} + +// TokenView Show token's current key +type TokenView struct { + Key string `json:"key"` + AdditionalProperties map[string]interface{} +} + +type _TokenView TokenView + +// NewTokenView instantiates a new TokenView object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTokenView(key string) *TokenView { + this := TokenView{} + this.Key = key + return &this +} + +// NewTokenViewWithDefaults instantiates a new TokenView object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTokenViewWithDefaults() *TokenView { + this := TokenView{} + return &this +} + +// GetKey returns the Key field value +func (o *TokenView) GetKey() string { + if o == nil { + var ret string + return ret + } + + return o.Key +} + +// GetKeyOk returns a tuple with the Key field value +// and a boolean to check if the value has been set. +func (o *TokenView) GetKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Key, true +} + +// SetKey sets field value +func (o *TokenView) SetKey(v string) { + o.Key = v +} + +func (o TokenView) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TokenView) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["key"] = o.Key + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TokenView) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "key", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTokenView := _TokenView{} + + err = json.Unmarshal(data, &varTokenView) + + if err != nil { + return err + } + + *o = TokenView(varTokenView) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "key") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTokenView struct { + value *TokenView + isSet bool +} + +func (v NullableTokenView) Get() *TokenView { + return v.value +} + +func (v *NullableTokenView) Set(val *TokenView) { + v.value = val + v.isSet = true +} + +func (v NullableTokenView) IsSet() bool { + return v.isSet +} + +func (v *NullableTokenView) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTokenView(val *TokenView) *NullableTokenView { + return &NullableTokenView{value: val, isSet: true} +} + +func (v NullableTokenView) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTokenView) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_totp_device.go b/packages/client-go/model_totp_device.go new file mode 100644 index 0000000000..6ac31b0f24 --- /dev/null +++ b/packages/client-go/model_totp_device.go @@ -0,0 +1,226 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TOTPDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TOTPDevice{} + +// TOTPDevice Serializer for totp authenticator devices +type TOTPDevice struct { + // The human-readable name of this device. + Name string `json:"name"` + Pk int32 `json:"pk"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _TOTPDevice TOTPDevice + +// NewTOTPDevice instantiates a new TOTPDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTOTPDevice(name string, pk int32, user PartialUser) *TOTPDevice { + this := TOTPDevice{} + this.Name = name + this.Pk = pk + this.User = user + return &this +} + +// NewTOTPDeviceWithDefaults instantiates a new TOTPDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTOTPDeviceWithDefaults() *TOTPDevice { + this := TOTPDevice{} + return &this +} + +// GetName returns the Name field value +func (o *TOTPDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TOTPDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TOTPDevice) SetName(v string) { + o.Name = v +} + +// GetPk returns the Pk field value +func (o *TOTPDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *TOTPDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *TOTPDevice) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *TOTPDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *TOTPDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *TOTPDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o TOTPDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TOTPDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TOTPDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "pk", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTOTPDevice := _TOTPDevice{} + + err = json.Unmarshal(data, &varTOTPDevice) + + if err != nil { + return err + } + + *o = TOTPDevice(varTOTPDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTOTPDevice struct { + value *TOTPDevice + isSet bool +} + +func (v NullableTOTPDevice) Get() *TOTPDevice { + return v.value +} + +func (v *NullableTOTPDevice) Set(val *TOTPDevice) { + v.value = val + v.isSet = true +} + +func (v NullableTOTPDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableTOTPDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTOTPDevice(val *TOTPDevice) *NullableTOTPDevice { + return &NullableTOTPDevice{value: val, isSet: true} +} + +func (v NullableTOTPDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTOTPDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_totp_device_request.go b/packages/client-go/model_totp_device_request.go new file mode 100644 index 0000000000..005bdcedc7 --- /dev/null +++ b/packages/client-go/model_totp_device_request.go @@ -0,0 +1,168 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TOTPDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TOTPDeviceRequest{} + +// TOTPDeviceRequest Serializer for totp authenticator devices +type TOTPDeviceRequest struct { + // The human-readable name of this device. + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _TOTPDeviceRequest TOTPDeviceRequest + +// NewTOTPDeviceRequest instantiates a new TOTPDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTOTPDeviceRequest(name string) *TOTPDeviceRequest { + this := TOTPDeviceRequest{} + this.Name = name + return &this +} + +// NewTOTPDeviceRequestWithDefaults instantiates a new TOTPDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTOTPDeviceRequestWithDefaults() *TOTPDeviceRequest { + this := TOTPDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *TOTPDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TOTPDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TOTPDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o TOTPDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TOTPDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TOTPDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTOTPDeviceRequest := _TOTPDeviceRequest{} + + err = json.Unmarshal(data, &varTOTPDeviceRequest) + + if err != nil { + return err + } + + *o = TOTPDeviceRequest(varTOTPDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTOTPDeviceRequest struct { + value *TOTPDeviceRequest + isSet bool +} + +func (v NullableTOTPDeviceRequest) Get() *TOTPDeviceRequest { + return v.value +} + +func (v *NullableTOTPDeviceRequest) Set(val *TOTPDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTOTPDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTOTPDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTOTPDeviceRequest(val *TOTPDeviceRequest) *NullableTOTPDeviceRequest { + return &NullableTOTPDeviceRequest{value: val, isSet: true} +} + +func (v NullableTOTPDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTOTPDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_transaction_application_request.go b/packages/client-go/model_transaction_application_request.go new file mode 100644 index 0000000000..100723893c --- /dev/null +++ b/packages/client-go/model_transaction_application_request.go @@ -0,0 +1,262 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TransactionApplicationRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionApplicationRequest{} + +// TransactionApplicationRequest Serializer for creating a provider and an application in one transaction +type TransactionApplicationRequest struct { + App ApplicationRequest `json:"app"` + ProviderModel ProviderModelEnum `json:"provider_model"` + Provider ModelRequest `json:"provider"` + PolicyBindings []TransactionPolicyBindingRequest `json:"policy_bindings,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransactionApplicationRequest TransactionApplicationRequest + +// NewTransactionApplicationRequest instantiates a new TransactionApplicationRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionApplicationRequest(app ApplicationRequest, providerModel ProviderModelEnum, provider ModelRequest) *TransactionApplicationRequest { + this := TransactionApplicationRequest{} + this.App = app + this.ProviderModel = providerModel + this.Provider = provider + return &this +} + +// NewTransactionApplicationRequestWithDefaults instantiates a new TransactionApplicationRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionApplicationRequestWithDefaults() *TransactionApplicationRequest { + this := TransactionApplicationRequest{} + return &this +} + +// GetApp returns the App field value +func (o *TransactionApplicationRequest) GetApp() ApplicationRequest { + if o == nil { + var ret ApplicationRequest + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *TransactionApplicationRequest) GetAppOk() (*ApplicationRequest, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *TransactionApplicationRequest) SetApp(v ApplicationRequest) { + o.App = v +} + +// GetProviderModel returns the ProviderModel field value +func (o *TransactionApplicationRequest) GetProviderModel() ProviderModelEnum { + if o == nil { + var ret ProviderModelEnum + return ret + } + + return o.ProviderModel +} + +// GetProviderModelOk returns a tuple with the ProviderModel field value +// and a boolean to check if the value has been set. +func (o *TransactionApplicationRequest) GetProviderModelOk() (*ProviderModelEnum, bool) { + if o == nil { + return nil, false + } + return &o.ProviderModel, true +} + +// SetProviderModel sets field value +func (o *TransactionApplicationRequest) SetProviderModel(v ProviderModelEnum) { + o.ProviderModel = v +} + +// GetProvider returns the Provider field value +func (o *TransactionApplicationRequest) GetProvider() ModelRequest { + if o == nil { + var ret ModelRequest + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *TransactionApplicationRequest) GetProviderOk() (*ModelRequest, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *TransactionApplicationRequest) SetProvider(v ModelRequest) { + o.Provider = v +} + +// GetPolicyBindings returns the PolicyBindings field value if set, zero value otherwise. +func (o *TransactionApplicationRequest) GetPolicyBindings() []TransactionPolicyBindingRequest { + if o == nil || IsNil(o.PolicyBindings) { + var ret []TransactionPolicyBindingRequest + return ret + } + return o.PolicyBindings +} + +// GetPolicyBindingsOk returns a tuple with the PolicyBindings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionApplicationRequest) GetPolicyBindingsOk() ([]TransactionPolicyBindingRequest, bool) { + if o == nil || IsNil(o.PolicyBindings) { + return nil, false + } + return o.PolicyBindings, true +} + +// HasPolicyBindings returns a boolean if a field has been set. +func (o *TransactionApplicationRequest) HasPolicyBindings() bool { + if o != nil && !IsNil(o.PolicyBindings) { + return true + } + + return false +} + +// SetPolicyBindings gets a reference to the given []TransactionPolicyBindingRequest and assigns it to the PolicyBindings field. +func (o *TransactionApplicationRequest) SetPolicyBindings(v []TransactionPolicyBindingRequest) { + o.PolicyBindings = v +} + +func (o TransactionApplicationRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionApplicationRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["app"] = o.App + toSerialize["provider_model"] = o.ProviderModel + toSerialize["provider"] = o.Provider + if !IsNil(o.PolicyBindings) { + toSerialize["policy_bindings"] = o.PolicyBindings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransactionApplicationRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "app", + "provider_model", + "provider", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTransactionApplicationRequest := _TransactionApplicationRequest{} + + err = json.Unmarshal(data, &varTransactionApplicationRequest) + + if err != nil { + return err + } + + *o = TransactionApplicationRequest(varTransactionApplicationRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "app") + delete(additionalProperties, "provider_model") + delete(additionalProperties, "provider") + delete(additionalProperties, "policy_bindings") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransactionApplicationRequest struct { + value *TransactionApplicationRequest + isSet bool +} + +func (v NullableTransactionApplicationRequest) Get() *TransactionApplicationRequest { + return v.value +} + +func (v *NullableTransactionApplicationRequest) Set(val *TransactionApplicationRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionApplicationRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionApplicationRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionApplicationRequest(val *TransactionApplicationRequest) *NullableTransactionApplicationRequest { + return &NullableTransactionApplicationRequest{value: val, isSet: true} +} + +func (v NullableTransactionApplicationRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionApplicationRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_transaction_application_response.go b/packages/client-go/model_transaction_application_response.go new file mode 100644 index 0000000000..9ed3d03c91 --- /dev/null +++ b/packages/client-go/model_transaction_application_response.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TransactionApplicationResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionApplicationResponse{} + +// TransactionApplicationResponse Transactional creation response +type TransactionApplicationResponse struct { + Applied bool `json:"applied"` + Logs []string `json:"logs"` + AdditionalProperties map[string]interface{} +} + +type _TransactionApplicationResponse TransactionApplicationResponse + +// NewTransactionApplicationResponse instantiates a new TransactionApplicationResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionApplicationResponse(applied bool, logs []string) *TransactionApplicationResponse { + this := TransactionApplicationResponse{} + this.Applied = applied + this.Logs = logs + return &this +} + +// NewTransactionApplicationResponseWithDefaults instantiates a new TransactionApplicationResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionApplicationResponseWithDefaults() *TransactionApplicationResponse { + this := TransactionApplicationResponse{} + return &this +} + +// GetApplied returns the Applied field value +func (o *TransactionApplicationResponse) GetApplied() bool { + if o == nil { + var ret bool + return ret + } + + return o.Applied +} + +// GetAppliedOk returns a tuple with the Applied field value +// and a boolean to check if the value has been set. +func (o *TransactionApplicationResponse) GetAppliedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Applied, true +} + +// SetApplied sets field value +func (o *TransactionApplicationResponse) SetApplied(v bool) { + o.Applied = v +} + +// GetLogs returns the Logs field value +func (o *TransactionApplicationResponse) GetLogs() []string { + if o == nil { + var ret []string + return ret + } + + return o.Logs +} + +// GetLogsOk returns a tuple with the Logs field value +// and a boolean to check if the value has been set. +func (o *TransactionApplicationResponse) GetLogsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Logs, true +} + +// SetLogs sets field value +func (o *TransactionApplicationResponse) SetLogs(v []string) { + o.Logs = v +} + +func (o TransactionApplicationResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionApplicationResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["applied"] = o.Applied + toSerialize["logs"] = o.Logs + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransactionApplicationResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "applied", + "logs", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTransactionApplicationResponse := _TransactionApplicationResponse{} + + err = json.Unmarshal(data, &varTransactionApplicationResponse) + + if err != nil { + return err + } + + *o = TransactionApplicationResponse(varTransactionApplicationResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "applied") + delete(additionalProperties, "logs") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransactionApplicationResponse struct { + value *TransactionApplicationResponse + isSet bool +} + +func (v NullableTransactionApplicationResponse) Get() *TransactionApplicationResponse { + return v.value +} + +func (v *NullableTransactionApplicationResponse) Set(val *TransactionApplicationResponse) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionApplicationResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionApplicationResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionApplicationResponse(val *TransactionApplicationResponse) *NullableTransactionApplicationResponse { + return &NullableTransactionApplicationResponse{value: val, isSet: true} +} + +func (v NullableTransactionApplicationResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionApplicationResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_transaction_policy_binding_request.go b/packages/client-go/model_transaction_policy_binding_request.go new file mode 100644 index 0000000000..593bdd0190 --- /dev/null +++ b/packages/client-go/model_transaction_policy_binding_request.go @@ -0,0 +1,462 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TransactionPolicyBindingRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TransactionPolicyBindingRequest{} + +// TransactionPolicyBindingRequest PolicyBindingSerializer which does not require target as target is set implicitly +type TransactionPolicyBindingRequest struct { + Policy NullableString `json:"policy,omitempty"` + Group NullableString `json:"group,omitempty"` + User NullableInt32 `json:"user,omitempty"` + // Negates the outcome of the policy. Messages are unaffected. + Negate *bool `json:"negate,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Order int32 `json:"order"` + // Timeout after which Policy execution is terminated. + Timeout *int32 `json:"timeout,omitempty"` + // Result if the Policy execution fails. + FailureResult *bool `json:"failure_result,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TransactionPolicyBindingRequest TransactionPolicyBindingRequest + +// NewTransactionPolicyBindingRequest instantiates a new TransactionPolicyBindingRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTransactionPolicyBindingRequest(order int32) *TransactionPolicyBindingRequest { + this := TransactionPolicyBindingRequest{} + this.Order = order + return &this +} + +// NewTransactionPolicyBindingRequestWithDefaults instantiates a new TransactionPolicyBindingRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTransactionPolicyBindingRequestWithDefaults() *TransactionPolicyBindingRequest { + this := TransactionPolicyBindingRequest{} + return &this +} + +// GetPolicy returns the Policy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransactionPolicyBindingRequest) GetPolicy() string { + if o == nil || IsNil(o.Policy.Get()) { + var ret string + return ret + } + return *o.Policy.Get() +} + +// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionPolicyBindingRequest) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Policy.Get(), o.Policy.IsSet() +} + +// HasPolicy returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasPolicy() bool { + if o != nil && o.Policy.IsSet() { + return true + } + + return false +} + +// SetPolicy gets a reference to the given NullableString and assigns it to the Policy field. +func (o *TransactionPolicyBindingRequest) SetPolicy(v string) { + o.Policy.Set(&v) +} + +// SetPolicyNil sets the value for Policy to be an explicit nil +func (o *TransactionPolicyBindingRequest) SetPolicyNil() { + o.Policy.Set(nil) +} + +// UnsetPolicy ensures that no value is present for Policy, not even an explicit nil +func (o *TransactionPolicyBindingRequest) UnsetPolicy() { + o.Policy.Unset() +} + +// GetGroup returns the Group field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransactionPolicyBindingRequest) GetGroup() string { + if o == nil || IsNil(o.Group.Get()) { + var ret string + return ret + } + return *o.Group.Get() +} + +// GetGroupOk returns a tuple with the Group field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionPolicyBindingRequest) GetGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Group.Get(), o.Group.IsSet() +} + +// HasGroup returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasGroup() bool { + if o != nil && o.Group.IsSet() { + return true + } + + return false +} + +// SetGroup gets a reference to the given NullableString and assigns it to the Group field. +func (o *TransactionPolicyBindingRequest) SetGroup(v string) { + o.Group.Set(&v) +} + +// SetGroupNil sets the value for Group to be an explicit nil +func (o *TransactionPolicyBindingRequest) SetGroupNil() { + o.Group.Set(nil) +} + +// UnsetGroup ensures that no value is present for Group, not even an explicit nil +func (o *TransactionPolicyBindingRequest) UnsetGroup() { + o.Group.Unset() +} + +// GetUser returns the User field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *TransactionPolicyBindingRequest) GetUser() int32 { + if o == nil || IsNil(o.User.Get()) { + var ret int32 + return ret + } + return *o.User.Get() +} + +// GetUserOk returns a tuple with the User field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *TransactionPolicyBindingRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.User.Get(), o.User.IsSet() +} + +// HasUser returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasUser() bool { + if o != nil && o.User.IsSet() { + return true + } + + return false +} + +// SetUser gets a reference to the given NullableInt32 and assigns it to the User field. +func (o *TransactionPolicyBindingRequest) SetUser(v int32) { + o.User.Set(&v) +} + +// SetUserNil sets the value for User to be an explicit nil +func (o *TransactionPolicyBindingRequest) SetUserNil() { + o.User.Set(nil) +} + +// UnsetUser ensures that no value is present for User, not even an explicit nil +func (o *TransactionPolicyBindingRequest) UnsetUser() { + o.User.Unset() +} + +// GetNegate returns the Negate field value if set, zero value otherwise. +func (o *TransactionPolicyBindingRequest) GetNegate() bool { + if o == nil || IsNil(o.Negate) { + var ret bool + return ret + } + return *o.Negate +} + +// GetNegateOk returns a tuple with the Negate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionPolicyBindingRequest) GetNegateOk() (*bool, bool) { + if o == nil || IsNil(o.Negate) { + return nil, false + } + return o.Negate, true +} + +// HasNegate returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasNegate() bool { + if o != nil && !IsNil(o.Negate) { + return true + } + + return false +} + +// SetNegate gets a reference to the given bool and assigns it to the Negate field. +func (o *TransactionPolicyBindingRequest) SetNegate(v bool) { + o.Negate = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *TransactionPolicyBindingRequest) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionPolicyBindingRequest) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *TransactionPolicyBindingRequest) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetOrder returns the Order field value +func (o *TransactionPolicyBindingRequest) GetOrder() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Order +} + +// GetOrderOk returns a tuple with the Order field value +// and a boolean to check if the value has been set. +func (o *TransactionPolicyBindingRequest) GetOrderOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Order, true +} + +// SetOrder sets field value +func (o *TransactionPolicyBindingRequest) SetOrder(v int32) { + o.Order = v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *TransactionPolicyBindingRequest) GetTimeout() int32 { + if o == nil || IsNil(o.Timeout) { + var ret int32 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionPolicyBindingRequest) GetTimeoutOk() (*int32, bool) { + if o == nil || IsNil(o.Timeout) { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasTimeout() bool { + if o != nil && !IsNil(o.Timeout) { + return true + } + + return false +} + +// SetTimeout gets a reference to the given int32 and assigns it to the Timeout field. +func (o *TransactionPolicyBindingRequest) SetTimeout(v int32) { + o.Timeout = &v +} + +// GetFailureResult returns the FailureResult field value if set, zero value otherwise. +func (o *TransactionPolicyBindingRequest) GetFailureResult() bool { + if o == nil || IsNil(o.FailureResult) { + var ret bool + return ret + } + return *o.FailureResult +} + +// GetFailureResultOk returns a tuple with the FailureResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TransactionPolicyBindingRequest) GetFailureResultOk() (*bool, bool) { + if o == nil || IsNil(o.FailureResult) { + return nil, false + } + return o.FailureResult, true +} + +// HasFailureResult returns a boolean if a field has been set. +func (o *TransactionPolicyBindingRequest) HasFailureResult() bool { + if o != nil && !IsNil(o.FailureResult) { + return true + } + + return false +} + +// SetFailureResult gets a reference to the given bool and assigns it to the FailureResult field. +func (o *TransactionPolicyBindingRequest) SetFailureResult(v bool) { + o.FailureResult = &v +} + +func (o TransactionPolicyBindingRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TransactionPolicyBindingRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Policy.IsSet() { + toSerialize["policy"] = o.Policy.Get() + } + if o.Group.IsSet() { + toSerialize["group"] = o.Group.Get() + } + if o.User.IsSet() { + toSerialize["user"] = o.User.Get() + } + if !IsNil(o.Negate) { + toSerialize["negate"] = o.Negate + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + toSerialize["order"] = o.Order + if !IsNil(o.Timeout) { + toSerialize["timeout"] = o.Timeout + } + if !IsNil(o.FailureResult) { + toSerialize["failure_result"] = o.FailureResult + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TransactionPolicyBindingRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "order", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTransactionPolicyBindingRequest := _TransactionPolicyBindingRequest{} + + err = json.Unmarshal(data, &varTransactionPolicyBindingRequest) + + if err != nil { + return err + } + + *o = TransactionPolicyBindingRequest(varTransactionPolicyBindingRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "policy") + delete(additionalProperties, "group") + delete(additionalProperties, "user") + delete(additionalProperties, "negate") + delete(additionalProperties, "enabled") + delete(additionalProperties, "order") + delete(additionalProperties, "timeout") + delete(additionalProperties, "failure_result") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTransactionPolicyBindingRequest struct { + value *TransactionPolicyBindingRequest + isSet bool +} + +func (v NullableTransactionPolicyBindingRequest) Get() *TransactionPolicyBindingRequest { + return v.value +} + +func (v *NullableTransactionPolicyBindingRequest) Set(val *TransactionPolicyBindingRequest) { + v.value = val + v.isSet = true +} + +func (v NullableTransactionPolicyBindingRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableTransactionPolicyBindingRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTransactionPolicyBindingRequest(val *TransactionPolicyBindingRequest) *NullableTransactionPolicyBindingRequest { + return &NullableTransactionPolicyBindingRequest{value: val, isSet: true} +} + +func (v NullableTransactionPolicyBindingRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTransactionPolicyBindingRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_type_create.go b/packages/client-go/model_type_create.go new file mode 100644 index 0000000000..baa5017f4d --- /dev/null +++ b/packages/client-go/model_type_create.go @@ -0,0 +1,373 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the TypeCreate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &TypeCreate{} + +// TypeCreate Types of an object that can be created +type TypeCreate struct { + Name string `json:"name"` + Description string `json:"description"` + Component string `json:"component"` + ModelName string `json:"model_name"` + IconUrl *string `json:"icon_url,omitempty"` + RequiresEnterprise *bool `json:"requires_enterprise,omitempty"` + Deprecated *bool `json:"deprecated,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _TypeCreate TypeCreate + +// NewTypeCreate instantiates a new TypeCreate object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewTypeCreate(name string, description string, component string, modelName string) *TypeCreate { + this := TypeCreate{} + this.Name = name + this.Description = description + this.Component = component + this.ModelName = modelName + var requiresEnterprise bool = false + this.RequiresEnterprise = &requiresEnterprise + var deprecated bool = false + this.Deprecated = &deprecated + return &this +} + +// NewTypeCreateWithDefaults instantiates a new TypeCreate object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewTypeCreateWithDefaults() *TypeCreate { + this := TypeCreate{} + var requiresEnterprise bool = false + this.RequiresEnterprise = &requiresEnterprise + var deprecated bool = false + this.Deprecated = &deprecated + return &this +} + +// GetName returns the Name field value +func (o *TypeCreate) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *TypeCreate) SetName(v string) { + o.Name = v +} + +// GetDescription returns the Description field value +func (o *TypeCreate) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *TypeCreate) SetDescription(v string) { + o.Description = v +} + +// GetComponent returns the Component field value +func (o *TypeCreate) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *TypeCreate) SetComponent(v string) { + o.Component = v +} + +// GetModelName returns the ModelName field value +func (o *TypeCreate) GetModelName() string { + if o == nil { + var ret string + return ret + } + + return o.ModelName +} + +// GetModelNameOk returns a tuple with the ModelName field value +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelName, true +} + +// SetModelName sets field value +func (o *TypeCreate) SetModelName(v string) { + o.ModelName = v +} + +// GetIconUrl returns the IconUrl field value if set, zero value otherwise. +func (o *TypeCreate) GetIconUrl() string { + if o == nil || IsNil(o.IconUrl) { + var ret string + return ret + } + return *o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetIconUrlOk() (*string, bool) { + if o == nil || IsNil(o.IconUrl) { + return nil, false + } + return o.IconUrl, true +} + +// HasIconUrl returns a boolean if a field has been set. +func (o *TypeCreate) HasIconUrl() bool { + if o != nil && !IsNil(o.IconUrl) { + return true + } + + return false +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +func (o *TypeCreate) SetIconUrl(v string) { + o.IconUrl = &v +} + +// GetRequiresEnterprise returns the RequiresEnterprise field value if set, zero value otherwise. +func (o *TypeCreate) GetRequiresEnterprise() bool { + if o == nil || IsNil(o.RequiresEnterprise) { + var ret bool + return ret + } + return *o.RequiresEnterprise +} + +// GetRequiresEnterpriseOk returns a tuple with the RequiresEnterprise field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetRequiresEnterpriseOk() (*bool, bool) { + if o == nil || IsNil(o.RequiresEnterprise) { + return nil, false + } + return o.RequiresEnterprise, true +} + +// HasRequiresEnterprise returns a boolean if a field has been set. +func (o *TypeCreate) HasRequiresEnterprise() bool { + if o != nil && !IsNil(o.RequiresEnterprise) { + return true + } + + return false +} + +// SetRequiresEnterprise gets a reference to the given bool and assigns it to the RequiresEnterprise field. +func (o *TypeCreate) SetRequiresEnterprise(v bool) { + o.RequiresEnterprise = &v +} + +// GetDeprecated returns the Deprecated field value if set, zero value otherwise. +func (o *TypeCreate) GetDeprecated() bool { + if o == nil || IsNil(o.Deprecated) { + var ret bool + return ret + } + return *o.Deprecated +} + +// GetDeprecatedOk returns a tuple with the Deprecated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *TypeCreate) GetDeprecatedOk() (*bool, bool) { + if o == nil || IsNil(o.Deprecated) { + return nil, false + } + return o.Deprecated, true +} + +// HasDeprecated returns a boolean if a field has been set. +func (o *TypeCreate) HasDeprecated() bool { + if o != nil && !IsNil(o.Deprecated) { + return true + } + + return false +} + +// SetDeprecated gets a reference to the given bool and assigns it to the Deprecated field. +func (o *TypeCreate) SetDeprecated(v bool) { + o.Deprecated = &v +} + +func (o TypeCreate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o TypeCreate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["description"] = o.Description + toSerialize["component"] = o.Component + toSerialize["model_name"] = o.ModelName + if !IsNil(o.IconUrl) { + toSerialize["icon_url"] = o.IconUrl + } + if !IsNil(o.RequiresEnterprise) { + toSerialize["requires_enterprise"] = o.RequiresEnterprise + } + if !IsNil(o.Deprecated) { + toSerialize["deprecated"] = o.Deprecated + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *TypeCreate) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "description", + "component", + "model_name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTypeCreate := _TypeCreate{} + + err = json.Unmarshal(data, &varTypeCreate) + + if err != nil { + return err + } + + *o = TypeCreate(varTypeCreate) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "description") + delete(additionalProperties, "component") + delete(additionalProperties, "model_name") + delete(additionalProperties, "icon_url") + delete(additionalProperties, "requires_enterprise") + delete(additionalProperties, "deprecated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableTypeCreate struct { + value *TypeCreate + isSet bool +} + +func (v NullableTypeCreate) Get() *TypeCreate { + return v.value +} + +func (v *NullableTypeCreate) Set(val *TypeCreate) { + v.value = val + v.isSet = true +} + +func (v NullableTypeCreate) IsSet() bool { + return v.isSet +} + +func (v *NullableTypeCreate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTypeCreate(val *TypeCreate) *NullableTypeCreate { + return &NullableTypeCreate{value: val, isSet: true} +} + +func (v NullableTypeCreate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTypeCreate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ui_theme_enum.go b/packages/client-go/model_ui_theme_enum.go new file mode 100644 index 0000000000..fe117717b9 --- /dev/null +++ b/packages/client-go/model_ui_theme_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UiThemeEnum the model 'UiThemeEnum' +type UiThemeEnum string + +// List of UiThemeEnum +const ( + UITHEMEENUM_AUTOMATIC UiThemeEnum = "automatic" + UITHEMEENUM_LIGHT UiThemeEnum = "light" + UITHEMEENUM_DARK UiThemeEnum = "dark" +) + +// All allowed values of UiThemeEnum enum +var AllowedUiThemeEnumEnumValues = []UiThemeEnum{ + "automatic", + "light", + "dark", +} + +func (v *UiThemeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UiThemeEnum(value) + for _, existing := range AllowedUiThemeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UiThemeEnum", value) +} + +// NewUiThemeEnumFromValue returns a pointer to a valid UiThemeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUiThemeEnumFromValue(v string) (*UiThemeEnum, error) { + ev := UiThemeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UiThemeEnum: valid values are %v", v, AllowedUiThemeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UiThemeEnum) IsValid() bool { + for _, existing := range AllowedUiThemeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UiThemeEnum value +func (v UiThemeEnum) Ptr() *UiThemeEnum { + return &v +} + +type NullableUiThemeEnum struct { + value *UiThemeEnum + isSet bool +} + +func (v NullableUiThemeEnum) Get() *UiThemeEnum { + return v.value +} + +func (v *NullableUiThemeEnum) Set(val *UiThemeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUiThemeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUiThemeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUiThemeEnum(val *UiThemeEnum) *NullableUiThemeEnum { + return &NullableUiThemeEnum{value: val, isSet: true} +} + +func (v NullableUiThemeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUiThemeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_unique_password_policy.go b/packages/client-go/model_unique_password_policy.go new file mode 100644 index 0000000000..33c19f7c5a --- /dev/null +++ b/packages/client-go/model_unique_password_policy.go @@ -0,0 +1,460 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UniquePasswordPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UniquePasswordPolicy{} + +// UniquePasswordPolicy Password Uniqueness Policy Serializer +type UniquePasswordPolicy struct { + Pk string `json:"pk"` + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + // Return objects policy is bound to + BoundTo int32 `json:"bound_to"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + // Number of passwords to check against. + NumHistoricalPasswords *int32 `json:"num_historical_passwords,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UniquePasswordPolicy UniquePasswordPolicy + +// NewUniquePasswordPolicy instantiates a new UniquePasswordPolicy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUniquePasswordPolicy(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, boundTo int32) *UniquePasswordPolicy { + this := UniquePasswordPolicy{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.BoundTo = boundTo + return &this +} + +// NewUniquePasswordPolicyWithDefaults instantiates a new UniquePasswordPolicy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUniquePasswordPolicyWithDefaults() *UniquePasswordPolicy { + this := UniquePasswordPolicy{} + return &this +} + +// GetPk returns the Pk field value +func (o *UniquePasswordPolicy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UniquePasswordPolicy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UniquePasswordPolicy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UniquePasswordPolicy) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *UniquePasswordPolicy) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *UniquePasswordPolicy) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *UniquePasswordPolicy) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetComponent returns the Component field value +func (o *UniquePasswordPolicy) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UniquePasswordPolicy) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *UniquePasswordPolicy) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *UniquePasswordPolicy) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *UniquePasswordPolicy) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *UniquePasswordPolicy) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *UniquePasswordPolicy) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *UniquePasswordPolicy) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetBoundTo returns the BoundTo field value +func (o *UniquePasswordPolicy) GetBoundTo() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.BoundTo +} + +// GetBoundToOk returns a tuple with the BoundTo field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetBoundToOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.BoundTo, true +} + +// SetBoundTo sets field value +func (o *UniquePasswordPolicy) SetBoundTo(v int32) { + o.BoundTo = v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *UniquePasswordPolicy) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *UniquePasswordPolicy) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *UniquePasswordPolicy) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetNumHistoricalPasswords returns the NumHistoricalPasswords field value if set, zero value otherwise. +func (o *UniquePasswordPolicy) GetNumHistoricalPasswords() int32 { + if o == nil || IsNil(o.NumHistoricalPasswords) { + var ret int32 + return ret + } + return *o.NumHistoricalPasswords +} + +// GetNumHistoricalPasswordsOk returns a tuple with the NumHistoricalPasswords field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicy) GetNumHistoricalPasswordsOk() (*int32, bool) { + if o == nil || IsNil(o.NumHistoricalPasswords) { + return nil, false + } + return o.NumHistoricalPasswords, true +} + +// HasNumHistoricalPasswords returns a boolean if a field has been set. +func (o *UniquePasswordPolicy) HasNumHistoricalPasswords() bool { + if o != nil && !IsNil(o.NumHistoricalPasswords) { + return true + } + + return false +} + +// SetNumHistoricalPasswords gets a reference to the given int32 and assigns it to the NumHistoricalPasswords field. +func (o *UniquePasswordPolicy) SetNumHistoricalPasswords(v int32) { + o.NumHistoricalPasswords = &v +} + +func (o UniquePasswordPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UniquePasswordPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["bound_to"] = o.BoundTo + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.NumHistoricalPasswords) { + toSerialize["num_historical_passwords"] = o.NumHistoricalPasswords + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UniquePasswordPolicy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "bound_to", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUniquePasswordPolicy := _UniquePasswordPolicy{} + + err = json.Unmarshal(data, &varUniquePasswordPolicy) + + if err != nil { + return err + } + + *o = UniquePasswordPolicy(varUniquePasswordPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "bound_to") + delete(additionalProperties, "password_field") + delete(additionalProperties, "num_historical_passwords") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUniquePasswordPolicy struct { + value *UniquePasswordPolicy + isSet bool +} + +func (v NullableUniquePasswordPolicy) Get() *UniquePasswordPolicy { + return v.value +} + +func (v *NullableUniquePasswordPolicy) Set(val *UniquePasswordPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableUniquePasswordPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableUniquePasswordPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUniquePasswordPolicy(val *UniquePasswordPolicy) *NullableUniquePasswordPolicy { + return &NullableUniquePasswordPolicy{value: val, isSet: true} +} + +func (v NullableUniquePasswordPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUniquePasswordPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_unique_password_policy_request.go b/packages/client-go/model_unique_password_policy_request.go new file mode 100644 index 0000000000..3b1bc30091 --- /dev/null +++ b/packages/client-go/model_unique_password_policy_request.go @@ -0,0 +1,281 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UniquePasswordPolicyRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UniquePasswordPolicyRequest{} + +// UniquePasswordPolicyRequest Password Uniqueness Policy Serializer +type UniquePasswordPolicyRequest struct { + Name string `json:"name"` + // When this option is enabled, all executions of this policy will be logged. By default, only execution errors are logged. + ExecutionLogging *bool `json:"execution_logging,omitempty"` + // Field key to check, field keys defined in Prompt stages are available. + PasswordField *string `json:"password_field,omitempty"` + // Number of passwords to check against. + NumHistoricalPasswords *int32 `json:"num_historical_passwords,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UniquePasswordPolicyRequest UniquePasswordPolicyRequest + +// NewUniquePasswordPolicyRequest instantiates a new UniquePasswordPolicyRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUniquePasswordPolicyRequest(name string) *UniquePasswordPolicyRequest { + this := UniquePasswordPolicyRequest{} + this.Name = name + return &this +} + +// NewUniquePasswordPolicyRequestWithDefaults instantiates a new UniquePasswordPolicyRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUniquePasswordPolicyRequestWithDefaults() *UniquePasswordPolicyRequest { + this := UniquePasswordPolicyRequest{} + return &this +} + +// GetName returns the Name field value +func (o *UniquePasswordPolicyRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicyRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UniquePasswordPolicyRequest) SetName(v string) { + o.Name = v +} + +// GetExecutionLogging returns the ExecutionLogging field value if set, zero value otherwise. +func (o *UniquePasswordPolicyRequest) GetExecutionLogging() bool { + if o == nil || IsNil(o.ExecutionLogging) { + var ret bool + return ret + } + return *o.ExecutionLogging +} + +// GetExecutionLoggingOk returns a tuple with the ExecutionLogging field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicyRequest) GetExecutionLoggingOk() (*bool, bool) { + if o == nil || IsNil(o.ExecutionLogging) { + return nil, false + } + return o.ExecutionLogging, true +} + +// HasExecutionLogging returns a boolean if a field has been set. +func (o *UniquePasswordPolicyRequest) HasExecutionLogging() bool { + if o != nil && !IsNil(o.ExecutionLogging) { + return true + } + + return false +} + +// SetExecutionLogging gets a reference to the given bool and assigns it to the ExecutionLogging field. +func (o *UniquePasswordPolicyRequest) SetExecutionLogging(v bool) { + o.ExecutionLogging = &v +} + +// GetPasswordField returns the PasswordField field value if set, zero value otherwise. +func (o *UniquePasswordPolicyRequest) GetPasswordField() string { + if o == nil || IsNil(o.PasswordField) { + var ret string + return ret + } + return *o.PasswordField +} + +// GetPasswordFieldOk returns a tuple with the PasswordField field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicyRequest) GetPasswordFieldOk() (*string, bool) { + if o == nil || IsNil(o.PasswordField) { + return nil, false + } + return o.PasswordField, true +} + +// HasPasswordField returns a boolean if a field has been set. +func (o *UniquePasswordPolicyRequest) HasPasswordField() bool { + if o != nil && !IsNil(o.PasswordField) { + return true + } + + return false +} + +// SetPasswordField gets a reference to the given string and assigns it to the PasswordField field. +func (o *UniquePasswordPolicyRequest) SetPasswordField(v string) { + o.PasswordField = &v +} + +// GetNumHistoricalPasswords returns the NumHistoricalPasswords field value if set, zero value otherwise. +func (o *UniquePasswordPolicyRequest) GetNumHistoricalPasswords() int32 { + if o == nil || IsNil(o.NumHistoricalPasswords) { + var ret int32 + return ret + } + return *o.NumHistoricalPasswords +} + +// GetNumHistoricalPasswordsOk returns a tuple with the NumHistoricalPasswords field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UniquePasswordPolicyRequest) GetNumHistoricalPasswordsOk() (*int32, bool) { + if o == nil || IsNil(o.NumHistoricalPasswords) { + return nil, false + } + return o.NumHistoricalPasswords, true +} + +// HasNumHistoricalPasswords returns a boolean if a field has been set. +func (o *UniquePasswordPolicyRequest) HasNumHistoricalPasswords() bool { + if o != nil && !IsNil(o.NumHistoricalPasswords) { + return true + } + + return false +} + +// SetNumHistoricalPasswords gets a reference to the given int32 and assigns it to the NumHistoricalPasswords field. +func (o *UniquePasswordPolicyRequest) SetNumHistoricalPasswords(v int32) { + o.NumHistoricalPasswords = &v +} + +func (o UniquePasswordPolicyRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UniquePasswordPolicyRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.ExecutionLogging) { + toSerialize["execution_logging"] = o.ExecutionLogging + } + if !IsNil(o.PasswordField) { + toSerialize["password_field"] = o.PasswordField + } + if !IsNil(o.NumHistoricalPasswords) { + toSerialize["num_historical_passwords"] = o.NumHistoricalPasswords + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UniquePasswordPolicyRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUniquePasswordPolicyRequest := _UniquePasswordPolicyRequest{} + + err = json.Unmarshal(data, &varUniquePasswordPolicyRequest) + + if err != nil { + return err + } + + *o = UniquePasswordPolicyRequest(varUniquePasswordPolicyRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "execution_logging") + delete(additionalProperties, "password_field") + delete(additionalProperties, "num_historical_passwords") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUniquePasswordPolicyRequest struct { + value *UniquePasswordPolicyRequest + isSet bool +} + +func (v NullableUniquePasswordPolicyRequest) Get() *UniquePasswordPolicyRequest { + return v.value +} + +func (v *NullableUniquePasswordPolicyRequest) Set(val *UniquePasswordPolicyRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUniquePasswordPolicyRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUniquePasswordPolicyRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUniquePasswordPolicyRequest(val *UniquePasswordPolicyRequest) *NullableUniquePasswordPolicyRequest { + return &NullableUniquePasswordPolicyRequest{value: val, isSet: true} +} + +func (v NullableUniquePasswordPolicyRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUniquePasswordPolicyRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_used_by.go b/packages/client-go/model_used_by.go new file mode 100644 index 0000000000..d55e055161 --- /dev/null +++ b/packages/client-go/model_used_by.go @@ -0,0 +1,283 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UsedBy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UsedBy{} + +// UsedBy A list of all objects referencing the queried object +type UsedBy struct { + App string `json:"app"` + ModelName string `json:"model_name"` + Pk string `json:"pk"` + Name string `json:"name"` + Action UsedByActionEnum `json:"action"` + AdditionalProperties map[string]interface{} +} + +type _UsedBy UsedBy + +// NewUsedBy instantiates a new UsedBy object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsedBy(app string, modelName string, pk string, name string, action UsedByActionEnum) *UsedBy { + this := UsedBy{} + this.App = app + this.ModelName = modelName + this.Pk = pk + this.Name = name + this.Action = action + return &this +} + +// NewUsedByWithDefaults instantiates a new UsedBy object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsedByWithDefaults() *UsedBy { + this := UsedBy{} + return &this +} + +// GetApp returns the App field value +func (o *UsedBy) GetApp() string { + if o == nil { + var ret string + return ret + } + + return o.App +} + +// GetAppOk returns a tuple with the App field value +// and a boolean to check if the value has been set. +func (o *UsedBy) GetAppOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.App, true +} + +// SetApp sets field value +func (o *UsedBy) SetApp(v string) { + o.App = v +} + +// GetModelName returns the ModelName field value +func (o *UsedBy) GetModelName() string { + if o == nil { + var ret string + return ret + } + + return o.ModelName +} + +// GetModelNameOk returns a tuple with the ModelName field value +// and a boolean to check if the value has been set. +func (o *UsedBy) GetModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ModelName, true +} + +// SetModelName sets field value +func (o *UsedBy) SetModelName(v string) { + o.ModelName = v +} + +// GetPk returns the Pk field value +func (o *UsedBy) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UsedBy) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UsedBy) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UsedBy) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UsedBy) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UsedBy) SetName(v string) { + o.Name = v +} + +// GetAction returns the Action field value +func (o *UsedBy) GetAction() UsedByActionEnum { + if o == nil { + var ret UsedByActionEnum + return ret + } + + return o.Action +} + +// GetActionOk returns a tuple with the Action field value +// and a boolean to check if the value has been set. +func (o *UsedBy) GetActionOk() (*UsedByActionEnum, bool) { + if o == nil { + return nil, false + } + return &o.Action, true +} + +// SetAction sets field value +func (o *UsedBy) SetAction(v UsedByActionEnum) { + o.Action = v +} + +func (o UsedBy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UsedBy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["app"] = o.App + toSerialize["model_name"] = o.ModelName + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["action"] = o.Action + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UsedBy) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "app", + "model_name", + "pk", + "name", + "action", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUsedBy := _UsedBy{} + + err = json.Unmarshal(data, &varUsedBy) + + if err != nil { + return err + } + + *o = UsedBy(varUsedBy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "app") + delete(additionalProperties, "model_name") + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "action") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUsedBy struct { + value *UsedBy + isSet bool +} + +func (v NullableUsedBy) Get() *UsedBy { + return v.value +} + +func (v *NullableUsedBy) Set(val *UsedBy) { + v.value = val + v.isSet = true +} + +func (v NullableUsedBy) IsSet() bool { + return v.isSet +} + +func (v *NullableUsedBy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsedBy(val *UsedBy) *NullableUsedBy { + return &NullableUsedBy{value: val, isSet: true} +} + +func (v NullableUsedBy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsedBy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_used_by_action_enum.go b/packages/client-go/model_used_by_action_enum.go new file mode 100644 index 0000000000..4c37799f62 --- /dev/null +++ b/packages/client-go/model_used_by_action_enum.go @@ -0,0 +1,117 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UsedByActionEnum the model 'UsedByActionEnum' +type UsedByActionEnum string + +// List of UsedByActionEnum +const ( + USEDBYACTIONENUM_CASCADE UsedByActionEnum = "cascade" + USEDBYACTIONENUM_CASCADE_MANY UsedByActionEnum = "cascade_many" + USEDBYACTIONENUM_SET_NULL UsedByActionEnum = "set_null" + USEDBYACTIONENUM_SET_DEFAULT UsedByActionEnum = "set_default" + USEDBYACTIONENUM_LEFT_DANGLING UsedByActionEnum = "left_dangling" +) + +// All allowed values of UsedByActionEnum enum +var AllowedUsedByActionEnumEnumValues = []UsedByActionEnum{ + "cascade", + "cascade_many", + "set_null", + "set_default", + "left_dangling", +} + +func (v *UsedByActionEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UsedByActionEnum(value) + for _, existing := range AllowedUsedByActionEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UsedByActionEnum", value) +} + +// NewUsedByActionEnumFromValue returns a pointer to a valid UsedByActionEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUsedByActionEnumFromValue(v string) (*UsedByActionEnum, error) { + ev := UsedByActionEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UsedByActionEnum: valid values are %v", v, AllowedUsedByActionEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UsedByActionEnum) IsValid() bool { + for _, existing := range AllowedUsedByActionEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UsedByActionEnum value +func (v UsedByActionEnum) Ptr() *UsedByActionEnum { + return &v +} + +type NullableUsedByActionEnum struct { + value *UsedByActionEnum + isSet bool +} + +func (v NullableUsedByActionEnum) Get() *UsedByActionEnum { + return v.value +} + +func (v *NullableUsedByActionEnum) Set(val *UsedByActionEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUsedByActionEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUsedByActionEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsedByActionEnum(val *UsedByActionEnum) *NullableUsedByActionEnum { + return &NullableUsedByActionEnum{value: val, isSet: true} +} + +func (v NullableUsedByActionEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsedByActionEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user.go b/packages/client-go/model_user.go new file mode 100644 index 0000000000..72197bbb37 --- /dev/null +++ b/packages/client-go/model_user.go @@ -0,0 +1,805 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the User type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &User{} + +// User User Serializer +type User struct { + Pk int32 `json:"pk"` + Username string `json:"username"` + // User's display name. + Name string `json:"name"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + LastLogin NullableTime `json:"last_login,omitempty"` + DateJoined time.Time `json:"date_joined"` + IsSuperuser bool `json:"is_superuser"` + Groups []string `json:"groups,omitempty"` + GroupsObj []PartialGroup `json:"groups_obj"` + Roles []string `json:"roles,omitempty"` + RolesObj []Role `json:"roles_obj"` + Email *string `json:"email,omitempty"` + // User's avatar, either a http/https URL or a data URI + Avatar string `json:"avatar"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Uid string `json:"uid"` + Path *string `json:"path,omitempty"` + Type *UserTypeEnum `json:"type,omitempty"` + Uuid string `json:"uuid"` + PasswordChangeDate time.Time `json:"password_change_date"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _User User + +// NewUser instantiates a new User object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUser(pk int32, username string, name string, dateJoined time.Time, isSuperuser bool, groupsObj []PartialGroup, rolesObj []Role, avatar string, uid string, uuid string, passwordChangeDate time.Time, lastUpdated time.Time) *User { + this := User{} + this.Pk = pk + this.Username = username + this.Name = name + this.DateJoined = dateJoined + this.IsSuperuser = isSuperuser + this.GroupsObj = groupsObj + this.RolesObj = rolesObj + this.Avatar = avatar + this.Uid = uid + this.Uuid = uuid + this.PasswordChangeDate = passwordChangeDate + this.LastUpdated = lastUpdated + return &this +} + +// NewUserWithDefaults instantiates a new User object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWithDefaults() *User { + this := User{} + return &this +} + +// GetPk returns the Pk field value +func (o *User) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *User) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *User) SetPk(v int32) { + o.Pk = v +} + +// GetUsername returns the Username field value +func (o *User) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *User) SetUsername(v string) { + o.Username = v +} + +// GetName returns the Name field value +func (o *User) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *User) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *User) SetName(v string) { + o.Name = v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *User) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *User) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *User) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetLastLogin() time.Time { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret time.Time + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetLastLoginOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *User) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableTime and assigns it to the LastLogin field. +func (o *User) SetLastLogin(v time.Time) { + o.LastLogin.Set(&v) +} + +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *User) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *User) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetDateJoined returns the DateJoined field value +func (o *User) GetDateJoined() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.DateJoined +} + +// GetDateJoinedOk returns a tuple with the DateJoined field value +// and a boolean to check if the value has been set. +func (o *User) GetDateJoinedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.DateJoined, true +} + +// SetDateJoined sets field value +func (o *User) SetDateJoined(v time.Time) { + o.DateJoined = v +} + +// GetIsSuperuser returns the IsSuperuser field value +func (o *User) GetIsSuperuser() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value +// and a boolean to check if the value has been set. +func (o *User) GetIsSuperuserOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsSuperuser, true +} + +// SetIsSuperuser sets field value +func (o *User) SetIsSuperuser(v bool) { + o.IsSuperuser = v +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *User) GetGroups() []string { + if o == nil || IsNil(o.Groups) { + var ret []string + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *User) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []string and assigns it to the Groups field. +func (o *User) SetGroups(v []string) { + o.Groups = v +} + +// GetGroupsObj returns the GroupsObj field value +// If the value is explicit nil, the zero value for []PartialGroup will be returned +func (o *User) GetGroupsObj() []PartialGroup { + if o == nil { + var ret []PartialGroup + return ret + } + + return o.GroupsObj +} + +// GetGroupsObjOk returns a tuple with the GroupsObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetGroupsObjOk() ([]PartialGroup, bool) { + if o == nil || IsNil(o.GroupsObj) { + return nil, false + } + return o.GroupsObj, true +} + +// SetGroupsObj sets field value +func (o *User) SetGroupsObj(v []PartialGroup) { + o.GroupsObj = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *User) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *User) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *User) SetRoles(v []string) { + o.Roles = v +} + +// GetRolesObj returns the RolesObj field value +// If the value is explicit nil, the zero value for []Role will be returned +func (o *User) GetRolesObj() []Role { + if o == nil { + var ret []Role + return ret + } + + return o.RolesObj +} + +// GetRolesObjOk returns a tuple with the RolesObj field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetRolesObjOk() ([]Role, bool) { + if o == nil || IsNil(o.RolesObj) { + return nil, false + } + return o.RolesObj, true +} + +// SetRolesObj sets field value +func (o *User) SetRolesObj(v []Role) { + o.RolesObj = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetAvatar returns the Avatar field value +func (o *User) GetAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.Avatar +} + +// GetAvatarOk returns a tuple with the Avatar field value +// and a boolean to check if the value has been set. +func (o *User) GetAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Avatar, true +} + +// SetAvatar sets field value +func (o *User) SetAvatar(v string) { + o.Avatar = v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *User) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *User) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *User) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetUid returns the Uid field value +func (o *User) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *User) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *User) SetUid(v string) { + o.Uid = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *User) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *User) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *User) SetPath(v string) { + o.Path = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *User) GetType() UserTypeEnum { + if o == nil || IsNil(o.Type) { + var ret UserTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *User) GetTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *User) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given UserTypeEnum and assigns it to the Type field. +func (o *User) SetType(v UserTypeEnum) { + o.Type = &v +} + +// GetUuid returns the Uuid field value +func (o *User) GetUuid() string { + if o == nil { + var ret string + return ret + } + + return o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field value +// and a boolean to check if the value has been set. +func (o *User) GetUuidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uuid, true +} + +// SetUuid sets field value +func (o *User) SetUuid(v string) { + o.Uuid = v +} + +// GetPasswordChangeDate returns the PasswordChangeDate field value +func (o *User) GetPasswordChangeDate() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.PasswordChangeDate +} + +// GetPasswordChangeDateOk returns a tuple with the PasswordChangeDate field value +// and a boolean to check if the value has been set. +func (o *User) GetPasswordChangeDateOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.PasswordChangeDate, true +} + +// SetPasswordChangeDate sets field value +func (o *User) SetPasswordChangeDate(v time.Time) { + o.PasswordChangeDate = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *User) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *User) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *User) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o User) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o User) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["username"] = o.Username + toSerialize["name"] = o.Name + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + toSerialize["date_joined"] = o.DateJoined + toSerialize["is_superuser"] = o.IsSuperuser + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if o.GroupsObj != nil { + toSerialize["groups_obj"] = o.GroupsObj + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if o.RolesObj != nil { + toSerialize["roles_obj"] = o.RolesObj + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + toSerialize["avatar"] = o.Avatar + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + toSerialize["uid"] = o.Uid + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + toSerialize["uuid"] = o.Uuid + toSerialize["password_change_date"] = o.PasswordChangeDate + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *User) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "username", + "name", + "date_joined", + "is_superuser", + "groups_obj", + "roles_obj", + "avatar", + "uid", + "uuid", + "password_change_date", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUser := _User{} + + err = json.Unmarshal(data, &varUser) + + if err != nil { + return err + } + + *o = User(varUser) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "is_active") + delete(additionalProperties, "last_login") + delete(additionalProperties, "date_joined") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "groups") + delete(additionalProperties, "groups_obj") + delete(additionalProperties, "roles") + delete(additionalProperties, "roles_obj") + delete(additionalProperties, "email") + delete(additionalProperties, "avatar") + delete(additionalProperties, "attributes") + delete(additionalProperties, "uid") + delete(additionalProperties, "path") + delete(additionalProperties, "type") + delete(additionalProperties, "uuid") + delete(additionalProperties, "password_change_date") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUser struct { + value *User + isSet bool +} + +func (v NullableUser) Get() *User { + return v.value +} + +func (v *NullableUser) Set(val *User) { + v.value = val + v.isSet = true +} + +func (v NullableUser) IsSet() bool { + return v.isSet +} + +func (v *NullableUser) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUser(val *User) *NullableUser { + return &NullableUser{value: val, isSet: true} +} + +func (v NullableUser) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUser) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_account_request.go b/packages/client-go/model_user_account_request.go new file mode 100644 index 0000000000..180b121de9 --- /dev/null +++ b/packages/client-go/model_user_account_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserAccountRequest{} + +// UserAccountRequest Account adding/removing operations +type UserAccountRequest struct { + Pk int32 `json:"pk"` + AdditionalProperties map[string]interface{} +} + +type _UserAccountRequest UserAccountRequest + +// NewUserAccountRequest instantiates a new UserAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserAccountRequest(pk int32) *UserAccountRequest { + this := UserAccountRequest{} + this.Pk = pk + return &this +} + +// NewUserAccountRequestWithDefaults instantiates a new UserAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserAccountRequestWithDefaults() *UserAccountRequest { + this := UserAccountRequest{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserAccountRequest) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserAccountRequest) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserAccountRequest) SetPk(v int32) { + o.Pk = v +} + +func (o UserAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserAccountRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserAccountRequest := _UserAccountRequest{} + + err = json.Unmarshal(data, &varUserAccountRequest) + + if err != nil { + return err + } + + *o = UserAccountRequest(varUserAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserAccountRequest struct { + value *UserAccountRequest + isSet bool +} + +func (v NullableUserAccountRequest) Get() *UserAccountRequest { + return v.value +} + +func (v *NullableUserAccountRequest) Set(val *UserAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserAccountRequest(val *UserAccountRequest) *NullableUserAccountRequest { + return &NullableUserAccountRequest{value: val, isSet: true} +} + +func (v NullableUserAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_account_serializer_for_role_request.go b/packages/client-go/model_user_account_serializer_for_role_request.go new file mode 100644 index 0000000000..d920b5ebff --- /dev/null +++ b/packages/client-go/model_user_account_serializer_for_role_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserAccountSerializerForRoleRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserAccountSerializerForRoleRequest{} + +// UserAccountSerializerForRoleRequest Account adding/removing operations +type UserAccountSerializerForRoleRequest struct { + Pk int32 `json:"pk"` + AdditionalProperties map[string]interface{} +} + +type _UserAccountSerializerForRoleRequest UserAccountSerializerForRoleRequest + +// NewUserAccountSerializerForRoleRequest instantiates a new UserAccountSerializerForRoleRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserAccountSerializerForRoleRequest(pk int32) *UserAccountSerializerForRoleRequest { + this := UserAccountSerializerForRoleRequest{} + this.Pk = pk + return &this +} + +// NewUserAccountSerializerForRoleRequestWithDefaults instantiates a new UserAccountSerializerForRoleRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserAccountSerializerForRoleRequestWithDefaults() *UserAccountSerializerForRoleRequest { + this := UserAccountSerializerForRoleRequest{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserAccountSerializerForRoleRequest) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserAccountSerializerForRoleRequest) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserAccountSerializerForRoleRequest) SetPk(v int32) { + o.Pk = v +} + +func (o UserAccountSerializerForRoleRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserAccountSerializerForRoleRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserAccountSerializerForRoleRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserAccountSerializerForRoleRequest := _UserAccountSerializerForRoleRequest{} + + err = json.Unmarshal(data, &varUserAccountSerializerForRoleRequest) + + if err != nil { + return err + } + + *o = UserAccountSerializerForRoleRequest(varUserAccountSerializerForRoleRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserAccountSerializerForRoleRequest struct { + value *UserAccountSerializerForRoleRequest + isSet bool +} + +func (v NullableUserAccountSerializerForRoleRequest) Get() *UserAccountSerializerForRoleRequest { + return v.value +} + +func (v *NullableUserAccountSerializerForRoleRequest) Set(val *UserAccountSerializerForRoleRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserAccountSerializerForRoleRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserAccountSerializerForRoleRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserAccountSerializerForRoleRequest(val *UserAccountSerializerForRoleRequest) *NullableUserAccountSerializerForRoleRequest { + return &NullableUserAccountSerializerForRoleRequest{value: val, isSet: true} +} + +func (v NullableUserAccountSerializerForRoleRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserAccountSerializerForRoleRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_attribute_enum.go b/packages/client-go/model_user_attribute_enum.go new file mode 100644 index 0000000000..95dccb3af9 --- /dev/null +++ b/packages/client-go/model_user_attribute_enum.go @@ -0,0 +1,111 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserAttributeEnum the model 'UserAttributeEnum' +type UserAttributeEnum string + +// List of UserAttributeEnum +const ( + USERATTRIBUTEENUM_USERNAME UserAttributeEnum = "username" + USERATTRIBUTEENUM_EMAIL UserAttributeEnum = "email" +) + +// All allowed values of UserAttributeEnum enum +var AllowedUserAttributeEnumEnumValues = []UserAttributeEnum{ + "username", + "email", +} + +func (v *UserAttributeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserAttributeEnum(value) + for _, existing := range AllowedUserAttributeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserAttributeEnum", value) +} + +// NewUserAttributeEnumFromValue returns a pointer to a valid UserAttributeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserAttributeEnumFromValue(v string) (*UserAttributeEnum, error) { + ev := UserAttributeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserAttributeEnum: valid values are %v", v, AllowedUserAttributeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserAttributeEnum) IsValid() bool { + for _, existing := range AllowedUserAttributeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserAttributeEnum value +func (v UserAttributeEnum) Ptr() *UserAttributeEnum { + return &v +} + +type NullableUserAttributeEnum struct { + value *UserAttributeEnum + isSet bool +} + +func (v NullableUserAttributeEnum) Get() *UserAttributeEnum { + return v.value +} + +func (v *NullableUserAttributeEnum) Set(val *UserAttributeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserAttributeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserAttributeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserAttributeEnum(val *UserAttributeEnum) *NullableUserAttributeEnum { + return &NullableUserAttributeEnum{value: val, isSet: true} +} + +func (v NullableUserAttributeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserAttributeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_consent.go b/packages/client-go/model_user_consent.go new file mode 100644 index 0000000000..4f52124a57 --- /dev/null +++ b/packages/client-go/model_user_consent.go @@ -0,0 +1,352 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserConsent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserConsent{} + +// UserConsent UserConsent Serializer +type UserConsent struct { + Pk int32 `json:"pk"` + Expires NullableTime `json:"expires,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + User User `json:"user"` + Application Application `json:"application"` + Permissions *string `json:"permissions,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserConsent UserConsent + +// NewUserConsent instantiates a new UserConsent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserConsent(pk int32, user User, application Application) *UserConsent { + this := UserConsent{} + this.Pk = pk + this.User = user + this.Application = application + var permissions string = "" + this.Permissions = &permissions + return &this +} + +// NewUserConsentWithDefaults instantiates a new UserConsent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserConsentWithDefaults() *UserConsent { + this := UserConsent{} + var permissions string = "" + this.Permissions = &permissions + return &this +} + +// GetPk returns the Pk field value +func (o *UserConsent) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserConsent) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserConsent) SetPk(v int32) { + o.Pk = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserConsent) GetExpires() time.Time { + if o == nil || IsNil(o.Expires.Get()) { + var ret time.Time + return ret + } + return *o.Expires.Get() +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserConsent) GetExpiresOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.Expires.Get(), o.Expires.IsSet() +} + +// HasExpires returns a boolean if a field has been set. +func (o *UserConsent) HasExpires() bool { + if o != nil && o.Expires.IsSet() { + return true + } + + return false +} + +// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field. +func (o *UserConsent) SetExpires(v time.Time) { + o.Expires.Set(&v) +} + +// SetExpiresNil sets the value for Expires to be an explicit nil +func (o *UserConsent) SetExpiresNil() { + o.Expires.Set(nil) +} + +// UnsetExpires ensures that no value is present for Expires, not even an explicit nil +func (o *UserConsent) UnsetExpires() { + o.Expires.Unset() +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *UserConsent) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserConsent) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *UserConsent) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *UserConsent) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetUser returns the User field value +func (o *UserConsent) GetUser() User { + if o == nil { + var ret User + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserConsent) GetUserOk() (*User, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserConsent) SetUser(v User) { + o.User = v +} + +// GetApplication returns the Application field value +func (o *UserConsent) GetApplication() Application { + if o == nil { + var ret Application + return ret + } + + return o.Application +} + +// GetApplicationOk returns a tuple with the Application field value +// and a boolean to check if the value has been set. +func (o *UserConsent) GetApplicationOk() (*Application, bool) { + if o == nil { + return nil, false + } + return &o.Application, true +} + +// SetApplication sets field value +func (o *UserConsent) SetApplication(v Application) { + o.Application = v +} + +// GetPermissions returns the Permissions field value if set, zero value otherwise. +func (o *UserConsent) GetPermissions() string { + if o == nil || IsNil(o.Permissions) { + var ret string + return ret + } + return *o.Permissions +} + +// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserConsent) GetPermissionsOk() (*string, bool) { + if o == nil || IsNil(o.Permissions) { + return nil, false + } + return o.Permissions, true +} + +// HasPermissions returns a boolean if a field has been set. +func (o *UserConsent) HasPermissions() bool { + if o != nil && !IsNil(o.Permissions) { + return true + } + + return false +} + +// SetPermissions gets a reference to the given string and assigns it to the Permissions field. +func (o *UserConsent) SetPermissions(v string) { + o.Permissions = &v +} + +func (o UserConsent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserConsent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + if o.Expires.IsSet() { + toSerialize["expires"] = o.Expires.Get() + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + toSerialize["user"] = o.User + toSerialize["application"] = o.Application + if !IsNil(o.Permissions) { + toSerialize["permissions"] = o.Permissions + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserConsent) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "application", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserConsent := _UserConsent{} + + err = json.Unmarshal(data, &varUserConsent) + + if err != nil { + return err + } + + *o = UserConsent(varUserConsent) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "expires") + delete(additionalProperties, "expiring") + delete(additionalProperties, "user") + delete(additionalProperties, "application") + delete(additionalProperties, "permissions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserConsent struct { + value *UserConsent + isSet bool +} + +func (v NullableUserConsent) Get() *UserConsent { + return v.value +} + +func (v *NullableUserConsent) Set(val *UserConsent) { + v.value = val + v.isSet = true +} + +func (v NullableUserConsent) IsSet() bool { + return v.isSet +} + +func (v *NullableUserConsent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserConsent(val *UserConsent) *NullableUserConsent { + return &NullableUserConsent{value: val, isSet: true} +} + +func (v NullableUserConsent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserConsent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_creation_mode_enum.go b/packages/client-go/model_user_creation_mode_enum.go new file mode 100644 index 0000000000..eca0d7e814 --- /dev/null +++ b/packages/client-go/model_user_creation_mode_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserCreationModeEnum the model 'UserCreationModeEnum' +type UserCreationModeEnum string + +// List of UserCreationModeEnum +const ( + USERCREATIONMODEENUM_NEVER_CREATE UserCreationModeEnum = "never_create" + USERCREATIONMODEENUM_CREATE_WHEN_REQUIRED UserCreationModeEnum = "create_when_required" + USERCREATIONMODEENUM_ALWAYS_CREATE UserCreationModeEnum = "always_create" +) + +// All allowed values of UserCreationModeEnum enum +var AllowedUserCreationModeEnumEnumValues = []UserCreationModeEnum{ + "never_create", + "create_when_required", + "always_create", +} + +func (v *UserCreationModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserCreationModeEnum(value) + for _, existing := range AllowedUserCreationModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserCreationModeEnum", value) +} + +// NewUserCreationModeEnumFromValue returns a pointer to a valid UserCreationModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserCreationModeEnumFromValue(v string) (*UserCreationModeEnum, error) { + ev := UserCreationModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserCreationModeEnum: valid values are %v", v, AllowedUserCreationModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserCreationModeEnum) IsValid() bool { + for _, existing := range AllowedUserCreationModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserCreationModeEnum value +func (v UserCreationModeEnum) Ptr() *UserCreationModeEnum { + return &v +} + +type NullableUserCreationModeEnum struct { + value *UserCreationModeEnum + isSet bool +} + +func (v NullableUserCreationModeEnum) Get() *UserCreationModeEnum { + return v.value +} + +func (v *NullableUserCreationModeEnum) Set(val *UserCreationModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserCreationModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserCreationModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserCreationModeEnum(val *UserCreationModeEnum) *NullableUserCreationModeEnum { + return &NullableUserCreationModeEnum{value: val, isSet: true} +} + +func (v NullableUserCreationModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserCreationModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_delete_stage.go b/packages/client-go/model_user_delete_stage.go new file mode 100644 index 0000000000..2eabfb5181 --- /dev/null +++ b/packages/client-go/model_user_delete_stage.go @@ -0,0 +1,345 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserDeleteStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserDeleteStage{} + +// UserDeleteStage UserDeleteStage Serializer +type UserDeleteStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + AdditionalProperties map[string]interface{} +} + +type _UserDeleteStage UserDeleteStage + +// NewUserDeleteStage instantiates a new UserDeleteStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserDeleteStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *UserDeleteStage { + this := UserDeleteStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewUserDeleteStageWithDefaults instantiates a new UserDeleteStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserDeleteStageWithDefaults() *UserDeleteStage { + this := UserDeleteStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserDeleteStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserDeleteStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UserDeleteStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserDeleteStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *UserDeleteStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UserDeleteStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *UserDeleteStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *UserDeleteStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *UserDeleteStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *UserDeleteStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *UserDeleteStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *UserDeleteStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *UserDeleteStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *UserDeleteStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +func (o UserDeleteStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserDeleteStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserDeleteStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserDeleteStage := _UserDeleteStage{} + + err = json.Unmarshal(data, &varUserDeleteStage) + + if err != nil { + return err + } + + *o = UserDeleteStage(varUserDeleteStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserDeleteStage struct { + value *UserDeleteStage + isSet bool +} + +func (v NullableUserDeleteStage) Get() *UserDeleteStage { + return v.value +} + +func (v *NullableUserDeleteStage) Set(val *UserDeleteStage) { + v.value = val + v.isSet = true +} + +func (v NullableUserDeleteStage) IsSet() bool { + return v.isSet +} + +func (v *NullableUserDeleteStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserDeleteStage(val *UserDeleteStage) *NullableUserDeleteStage { + return &NullableUserDeleteStage{value: val, isSet: true} +} + +func (v NullableUserDeleteStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserDeleteStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_delete_stage_request.go b/packages/client-go/model_user_delete_stage_request.go new file mode 100644 index 0000000000..c618c1a38a --- /dev/null +++ b/packages/client-go/model_user_delete_stage_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserDeleteStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserDeleteStageRequest{} + +// UserDeleteStageRequest UserDeleteStage Serializer +type UserDeleteStageRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _UserDeleteStageRequest UserDeleteStageRequest + +// NewUserDeleteStageRequest instantiates a new UserDeleteStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserDeleteStageRequest(name string) *UserDeleteStageRequest { + this := UserDeleteStageRequest{} + this.Name = name + return &this +} + +// NewUserDeleteStageRequestWithDefaults instantiates a new UserDeleteStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserDeleteStageRequestWithDefaults() *UserDeleteStageRequest { + this := UserDeleteStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *UserDeleteStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserDeleteStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserDeleteStageRequest) SetName(v string) { + o.Name = v +} + +func (o UserDeleteStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserDeleteStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserDeleteStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserDeleteStageRequest := _UserDeleteStageRequest{} + + err = json.Unmarshal(data, &varUserDeleteStageRequest) + + if err != nil { + return err + } + + *o = UserDeleteStageRequest(varUserDeleteStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserDeleteStageRequest struct { + value *UserDeleteStageRequest + isSet bool +} + +func (v NullableUserDeleteStageRequest) Get() *UserDeleteStageRequest { + return v.value +} + +func (v *NullableUserDeleteStageRequest) Set(val *UserDeleteStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserDeleteStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserDeleteStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserDeleteStageRequest(val *UserDeleteStageRequest) *NullableUserDeleteStageRequest { + return &NullableUserDeleteStageRequest{value: val, isSet: true} +} + +func (v NullableUserDeleteStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserDeleteStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_fields_enum.go b/packages/client-go/model_user_fields_enum.go new file mode 100644 index 0000000000..84602e4159 --- /dev/null +++ b/packages/client-go/model_user_fields_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserFieldsEnum the model 'UserFieldsEnum' +type UserFieldsEnum string + +// List of UserFieldsEnum +const ( + USERFIELDSENUM_EMAIL UserFieldsEnum = "email" + USERFIELDSENUM_USERNAME UserFieldsEnum = "username" + USERFIELDSENUM_UPN UserFieldsEnum = "upn" +) + +// All allowed values of UserFieldsEnum enum +var AllowedUserFieldsEnumEnumValues = []UserFieldsEnum{ + "email", + "username", + "upn", +} + +func (v *UserFieldsEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserFieldsEnum(value) + for _, existing := range AllowedUserFieldsEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserFieldsEnum", value) +} + +// NewUserFieldsEnumFromValue returns a pointer to a valid UserFieldsEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserFieldsEnumFromValue(v string) (*UserFieldsEnum, error) { + ev := UserFieldsEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserFieldsEnum: valid values are %v", v, AllowedUserFieldsEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserFieldsEnum) IsValid() bool { + for _, existing := range AllowedUserFieldsEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserFieldsEnum value +func (v UserFieldsEnum) Ptr() *UserFieldsEnum { + return &v +} + +type NullableUserFieldsEnum struct { + value *UserFieldsEnum + isSet bool +} + +func (v NullableUserFieldsEnum) Get() *UserFieldsEnum { + return v.value +} + +func (v *NullableUserFieldsEnum) Set(val *UserFieldsEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserFieldsEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserFieldsEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserFieldsEnum(val *UserFieldsEnum) *NullableUserFieldsEnum { + return &NullableUserFieldsEnum{value: val, isSet: true} +} + +func (v NullableUserFieldsEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserFieldsEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_kerberos_source_connection.go b/packages/client-go/model_user_kerberos_source_connection.go new file mode 100644 index 0000000000..a251ffafec --- /dev/null +++ b/packages/client-go/model_user_kerberos_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserKerberosSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserKerberosSourceConnection{} + +// UserKerberosSourceConnection User source connection +type UserKerberosSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserKerberosSourceConnection UserKerberosSourceConnection + +// NewUserKerberosSourceConnection instantiates a new UserKerberosSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserKerberosSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserKerberosSourceConnection { + this := UserKerberosSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserKerberosSourceConnectionWithDefaults instantiates a new UserKerberosSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserKerberosSourceConnectionWithDefaults() *UserKerberosSourceConnection { + this := UserKerberosSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserKerberosSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserKerberosSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserKerberosSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserKerberosSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserKerberosSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserKerberosSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserKerberosSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserKerberosSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserKerberosSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserKerberosSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserKerberosSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserKerberosSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserKerberosSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserKerberosSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserKerberosSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserKerberosSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserKerberosSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserKerberosSourceConnection := _UserKerberosSourceConnection{} + + err = json.Unmarshal(data, &varUserKerberosSourceConnection) + + if err != nil { + return err + } + + *o = UserKerberosSourceConnection(varUserKerberosSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserKerberosSourceConnection struct { + value *UserKerberosSourceConnection + isSet bool +} + +func (v NullableUserKerberosSourceConnection) Get() *UserKerberosSourceConnection { + return v.value +} + +func (v *NullableUserKerberosSourceConnection) Set(val *UserKerberosSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserKerberosSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserKerberosSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserKerberosSourceConnection(val *UserKerberosSourceConnection) *NullableUserKerberosSourceConnection { + return &NullableUserKerberosSourceConnection{value: val, isSet: true} +} + +func (v NullableUserKerberosSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserKerberosSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_kerberos_source_connection_request.go b/packages/client-go/model_user_kerberos_source_connection_request.go new file mode 100644 index 0000000000..f54cfa662f --- /dev/null +++ b/packages/client-go/model_user_kerberos_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserKerberosSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserKerberosSourceConnectionRequest{} + +// UserKerberosSourceConnectionRequest User source connection +type UserKerberosSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _UserKerberosSourceConnectionRequest UserKerberosSourceConnectionRequest + +// NewUserKerberosSourceConnectionRequest instantiates a new UserKerberosSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserKerberosSourceConnectionRequest(user int32, source string, identifier string) *UserKerberosSourceConnectionRequest { + this := UserKerberosSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserKerberosSourceConnectionRequestWithDefaults instantiates a new UserKerberosSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserKerberosSourceConnectionRequestWithDefaults() *UserKerberosSourceConnectionRequest { + this := UserKerberosSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserKerberosSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserKerberosSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserKerberosSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserKerberosSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserKerberosSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserKerberosSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserKerberosSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o UserKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserKerberosSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserKerberosSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserKerberosSourceConnectionRequest := _UserKerberosSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserKerberosSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserKerberosSourceConnectionRequest(varUserKerberosSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserKerberosSourceConnectionRequest struct { + value *UserKerberosSourceConnectionRequest + isSet bool +} + +func (v NullableUserKerberosSourceConnectionRequest) Get() *UserKerberosSourceConnectionRequest { + return v.value +} + +func (v *NullableUserKerberosSourceConnectionRequest) Set(val *UserKerberosSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserKerberosSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserKerberosSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserKerberosSourceConnectionRequest(val *UserKerberosSourceConnectionRequest) *NullableUserKerberosSourceConnectionRequest { + return &NullableUserKerberosSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserKerberosSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserKerberosSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_ldap_source_connection.go b/packages/client-go/model_user_ldap_source_connection.go new file mode 100644 index 0000000000..1dd7efa6b1 --- /dev/null +++ b/packages/client-go/model_user_ldap_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserLDAPSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLDAPSourceConnection{} + +// UserLDAPSourceConnection User source connection +type UserLDAPSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserLDAPSourceConnection UserLDAPSourceConnection + +// NewUserLDAPSourceConnection instantiates a new UserLDAPSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLDAPSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserLDAPSourceConnection { + this := UserLDAPSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserLDAPSourceConnectionWithDefaults instantiates a new UserLDAPSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLDAPSourceConnectionWithDefaults() *UserLDAPSourceConnection { + this := UserLDAPSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserLDAPSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserLDAPSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserLDAPSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserLDAPSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserLDAPSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserLDAPSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserLDAPSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserLDAPSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserLDAPSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserLDAPSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserLDAPSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserLDAPSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserLDAPSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserLDAPSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserLDAPSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLDAPSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLDAPSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLDAPSourceConnection := _UserLDAPSourceConnection{} + + err = json.Unmarshal(data, &varUserLDAPSourceConnection) + + if err != nil { + return err + } + + *o = UserLDAPSourceConnection(varUserLDAPSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLDAPSourceConnection struct { + value *UserLDAPSourceConnection + isSet bool +} + +func (v NullableUserLDAPSourceConnection) Get() *UserLDAPSourceConnection { + return v.value +} + +func (v *NullableUserLDAPSourceConnection) Set(val *UserLDAPSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserLDAPSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLDAPSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLDAPSourceConnection(val *UserLDAPSourceConnection) *NullableUserLDAPSourceConnection { + return &NullableUserLDAPSourceConnection{value: val, isSet: true} +} + +func (v NullableUserLDAPSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLDAPSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_ldap_source_connection_request.go b/packages/client-go/model_user_ldap_source_connection_request.go new file mode 100644 index 0000000000..05f2768651 --- /dev/null +++ b/packages/client-go/model_user_ldap_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLDAPSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLDAPSourceConnectionRequest{} + +// UserLDAPSourceConnectionRequest User source connection +type UserLDAPSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _UserLDAPSourceConnectionRequest UserLDAPSourceConnectionRequest + +// NewUserLDAPSourceConnectionRequest instantiates a new UserLDAPSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLDAPSourceConnectionRequest(user int32, source string, identifier string) *UserLDAPSourceConnectionRequest { + this := UserLDAPSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserLDAPSourceConnectionRequestWithDefaults instantiates a new UserLDAPSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLDAPSourceConnectionRequestWithDefaults() *UserLDAPSourceConnectionRequest { + this := UserLDAPSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserLDAPSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserLDAPSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserLDAPSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserLDAPSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserLDAPSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserLDAPSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserLDAPSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o UserLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLDAPSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLDAPSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLDAPSourceConnectionRequest := _UserLDAPSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserLDAPSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserLDAPSourceConnectionRequest(varUserLDAPSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLDAPSourceConnectionRequest struct { + value *UserLDAPSourceConnectionRequest + isSet bool +} + +func (v NullableUserLDAPSourceConnectionRequest) Get() *UserLDAPSourceConnectionRequest { + return v.value +} + +func (v *NullableUserLDAPSourceConnectionRequest) Set(val *UserLDAPSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserLDAPSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLDAPSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLDAPSourceConnectionRequest(val *UserLDAPSourceConnectionRequest) *NullableUserLDAPSourceConnectionRequest { + return &NullableUserLDAPSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserLDAPSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLDAPSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_login_challenge.go b/packages/client-go/model_user_login_challenge.go new file mode 100644 index 0000000000..502b913606 --- /dev/null +++ b/packages/client-go/model_user_login_challenge.go @@ -0,0 +1,311 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLoginChallenge type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLoginChallenge{} + +// UserLoginChallenge Empty challenge +type UserLoginChallenge struct { + FlowInfo *ContextualFlowInfo `json:"flow_info,omitempty"` + Component *string `json:"component,omitempty"` + ResponseErrors *map[string][]ErrorDetail `json:"response_errors,omitempty"` + PendingUser string `json:"pending_user"` + PendingUserAvatar string `json:"pending_user_avatar"` + AdditionalProperties map[string]interface{} +} + +type _UserLoginChallenge UserLoginChallenge + +// NewUserLoginChallenge instantiates a new UserLoginChallenge object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLoginChallenge(pendingUser string, pendingUserAvatar string) *UserLoginChallenge { + this := UserLoginChallenge{} + var component string = "ak-stage-user-login" + this.Component = &component + this.PendingUser = pendingUser + this.PendingUserAvatar = pendingUserAvatar + return &this +} + +// NewUserLoginChallengeWithDefaults instantiates a new UserLoginChallenge object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLoginChallengeWithDefaults() *UserLoginChallenge { + this := UserLoginChallenge{} + var component string = "ak-stage-user-login" + this.Component = &component + return &this +} + +// GetFlowInfo returns the FlowInfo field value if set, zero value otherwise. +func (o *UserLoginChallenge) GetFlowInfo() ContextualFlowInfo { + if o == nil || IsNil(o.FlowInfo) { + var ret ContextualFlowInfo + return ret + } + return *o.FlowInfo +} + +// GetFlowInfoOk returns a tuple with the FlowInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginChallenge) GetFlowInfoOk() (*ContextualFlowInfo, bool) { + if o == nil || IsNil(o.FlowInfo) { + return nil, false + } + return o.FlowInfo, true +} + +// HasFlowInfo returns a boolean if a field has been set. +func (o *UserLoginChallenge) HasFlowInfo() bool { + if o != nil && !IsNil(o.FlowInfo) { + return true + } + + return false +} + +// SetFlowInfo gets a reference to the given ContextualFlowInfo and assigns it to the FlowInfo field. +func (o *UserLoginChallenge) SetFlowInfo(v ContextualFlowInfo) { + o.FlowInfo = &v +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *UserLoginChallenge) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginChallenge) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *UserLoginChallenge) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *UserLoginChallenge) SetComponent(v string) { + o.Component = &v +} + +// GetResponseErrors returns the ResponseErrors field value if set, zero value otherwise. +func (o *UserLoginChallenge) GetResponseErrors() map[string][]ErrorDetail { + if o == nil || IsNil(o.ResponseErrors) { + var ret map[string][]ErrorDetail + return ret + } + return *o.ResponseErrors +} + +// GetResponseErrorsOk returns a tuple with the ResponseErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginChallenge) GetResponseErrorsOk() (*map[string][]ErrorDetail, bool) { + if o == nil || IsNil(o.ResponseErrors) { + return nil, false + } + return o.ResponseErrors, true +} + +// HasResponseErrors returns a boolean if a field has been set. +func (o *UserLoginChallenge) HasResponseErrors() bool { + if o != nil && !IsNil(o.ResponseErrors) { + return true + } + + return false +} + +// SetResponseErrors gets a reference to the given map[string][]ErrorDetail and assigns it to the ResponseErrors field. +func (o *UserLoginChallenge) SetResponseErrors(v map[string][]ErrorDetail) { + o.ResponseErrors = &v +} + +// GetPendingUser returns the PendingUser field value +func (o *UserLoginChallenge) GetPendingUser() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUser +} + +// GetPendingUserOk returns a tuple with the PendingUser field value +// and a boolean to check if the value has been set. +func (o *UserLoginChallenge) GetPendingUserOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUser, true +} + +// SetPendingUser sets field value +func (o *UserLoginChallenge) SetPendingUser(v string) { + o.PendingUser = v +} + +// GetPendingUserAvatar returns the PendingUserAvatar field value +func (o *UserLoginChallenge) GetPendingUserAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.PendingUserAvatar +} + +// GetPendingUserAvatarOk returns a tuple with the PendingUserAvatar field value +// and a boolean to check if the value has been set. +func (o *UserLoginChallenge) GetPendingUserAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PendingUserAvatar, true +} + +// SetPendingUserAvatar sets field value +func (o *UserLoginChallenge) SetPendingUserAvatar(v string) { + o.PendingUserAvatar = v +} + +func (o UserLoginChallenge) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLoginChallenge) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.FlowInfo) { + toSerialize["flow_info"] = o.FlowInfo + } + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + if !IsNil(o.ResponseErrors) { + toSerialize["response_errors"] = o.ResponseErrors + } + toSerialize["pending_user"] = o.PendingUser + toSerialize["pending_user_avatar"] = o.PendingUserAvatar + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLoginChallenge) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pending_user", + "pending_user_avatar", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLoginChallenge := _UserLoginChallenge{} + + err = json.Unmarshal(data, &varUserLoginChallenge) + + if err != nil { + return err + } + + *o = UserLoginChallenge(varUserLoginChallenge) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "flow_info") + delete(additionalProperties, "component") + delete(additionalProperties, "response_errors") + delete(additionalProperties, "pending_user") + delete(additionalProperties, "pending_user_avatar") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLoginChallenge struct { + value *UserLoginChallenge + isSet bool +} + +func (v NullableUserLoginChallenge) Get() *UserLoginChallenge { + return v.value +} + +func (v *NullableUserLoginChallenge) Set(val *UserLoginChallenge) { + v.value = val + v.isSet = true +} + +func (v NullableUserLoginChallenge) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLoginChallenge) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLoginChallenge(val *UserLoginChallenge) *NullableUserLoginChallenge { + return &NullableUserLoginChallenge{value: val, isSet: true} +} + +func (v NullableUserLoginChallenge) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLoginChallenge) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_login_challenge_response_request.go b/packages/client-go/model_user_login_challenge_response_request.go new file mode 100644 index 0000000000..d75826b2e9 --- /dev/null +++ b/packages/client-go/model_user_login_challenge_response_request.go @@ -0,0 +1,208 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLoginChallengeResponseRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLoginChallengeResponseRequest{} + +// UserLoginChallengeResponseRequest User login challenge +type UserLoginChallengeResponseRequest struct { + Component *string `json:"component,omitempty"` + RememberMe bool `json:"remember_me"` + AdditionalProperties map[string]interface{} +} + +type _UserLoginChallengeResponseRequest UserLoginChallengeResponseRequest + +// NewUserLoginChallengeResponseRequest instantiates a new UserLoginChallengeResponseRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLoginChallengeResponseRequest(rememberMe bool) *UserLoginChallengeResponseRequest { + this := UserLoginChallengeResponseRequest{} + var component string = "ak-stage-user-login" + this.Component = &component + this.RememberMe = rememberMe + return &this +} + +// NewUserLoginChallengeResponseRequestWithDefaults instantiates a new UserLoginChallengeResponseRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLoginChallengeResponseRequestWithDefaults() *UserLoginChallengeResponseRequest { + this := UserLoginChallengeResponseRequest{} + var component string = "ak-stage-user-login" + this.Component = &component + return &this +} + +// GetComponent returns the Component field value if set, zero value otherwise. +func (o *UserLoginChallengeResponseRequest) GetComponent() string { + if o == nil || IsNil(o.Component) { + var ret string + return ret + } + return *o.Component +} + +// GetComponentOk returns a tuple with the Component field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginChallengeResponseRequest) GetComponentOk() (*string, bool) { + if o == nil || IsNil(o.Component) { + return nil, false + } + return o.Component, true +} + +// HasComponent returns a boolean if a field has been set. +func (o *UserLoginChallengeResponseRequest) HasComponent() bool { + if o != nil && !IsNil(o.Component) { + return true + } + + return false +} + +// SetComponent gets a reference to the given string and assigns it to the Component field. +func (o *UserLoginChallengeResponseRequest) SetComponent(v string) { + o.Component = &v +} + +// GetRememberMe returns the RememberMe field value +func (o *UserLoginChallengeResponseRequest) GetRememberMe() bool { + if o == nil { + var ret bool + return ret + } + + return o.RememberMe +} + +// GetRememberMeOk returns a tuple with the RememberMe field value +// and a boolean to check if the value has been set. +func (o *UserLoginChallengeResponseRequest) GetRememberMeOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.RememberMe, true +} + +// SetRememberMe sets field value +func (o *UserLoginChallengeResponseRequest) SetRememberMe(v bool) { + o.RememberMe = v +} + +func (o UserLoginChallengeResponseRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLoginChallengeResponseRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Component) { + toSerialize["component"] = o.Component + } + toSerialize["remember_me"] = o.RememberMe + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLoginChallengeResponseRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "remember_me", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLoginChallengeResponseRequest := _UserLoginChallengeResponseRequest{} + + err = json.Unmarshal(data, &varUserLoginChallengeResponseRequest) + + if err != nil { + return err + } + + *o = UserLoginChallengeResponseRequest(varUserLoginChallengeResponseRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "component") + delete(additionalProperties, "remember_me") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLoginChallengeResponseRequest struct { + value *UserLoginChallengeResponseRequest + isSet bool +} + +func (v NullableUserLoginChallengeResponseRequest) Get() *UserLoginChallengeResponseRequest { + return v.value +} + +func (v *NullableUserLoginChallengeResponseRequest) Set(val *UserLoginChallengeResponseRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserLoginChallengeResponseRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLoginChallengeResponseRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLoginChallengeResponseRequest(val *UserLoginChallengeResponseRequest) *NullableUserLoginChallengeResponseRequest { + return &NullableUserLoginChallengeResponseRequest{value: val, isSet: true} +} + +func (v NullableUserLoginChallengeResponseRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLoginChallengeResponseRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_login_stage.go b/packages/client-go/model_user_login_stage.go new file mode 100644 index 0000000000..0b18c0ed63 --- /dev/null +++ b/packages/client-go/model_user_login_stage.go @@ -0,0 +1,573 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLoginStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLoginStage{} + +// UserLoginStage UserLoginStage Serializer +type UserLoginStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + SessionDuration *string `json:"session_duration,omitempty"` + // Terminate all other sessions of the user logging in. + TerminateOtherSessions *bool `json:"terminate_other_sessions,omitempty"` + // Offset the session will be extended by when the user picks the remember me option. Default of 0 means that the remember me option will not be shown. (Format: hours=-1;minutes=-2;seconds=-3) + RememberMeOffset *string `json:"remember_me_offset,omitempty"` + // Bind sessions created by this stage to the configured network + NetworkBinding *NetworkBindingEnum `json:"network_binding,omitempty"` + // Bind sessions created by this stage to the configured GeoIP location + GeoipBinding *GeoipBindingEnum `json:"geoip_binding,omitempty"` + // When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + RememberDevice *string `json:"remember_device,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserLoginStage UserLoginStage + +// NewUserLoginStage instantiates a new UserLoginStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLoginStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *UserLoginStage { + this := UserLoginStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewUserLoginStageWithDefaults instantiates a new UserLoginStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLoginStageWithDefaults() *UserLoginStage { + this := UserLoginStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserLoginStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserLoginStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UserLoginStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserLoginStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *UserLoginStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UserLoginStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *UserLoginStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *UserLoginStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *UserLoginStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *UserLoginStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *UserLoginStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *UserLoginStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *UserLoginStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *UserLoginStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetSessionDuration returns the SessionDuration field value if set, zero value otherwise. +func (o *UserLoginStage) GetSessionDuration() string { + if o == nil || IsNil(o.SessionDuration) { + var ret string + return ret + } + return *o.SessionDuration +} + +// GetSessionDurationOk returns a tuple with the SessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.SessionDuration) { + return nil, false + } + return o.SessionDuration, true +} + +// HasSessionDuration returns a boolean if a field has been set. +func (o *UserLoginStage) HasSessionDuration() bool { + if o != nil && !IsNil(o.SessionDuration) { + return true + } + + return false +} + +// SetSessionDuration gets a reference to the given string and assigns it to the SessionDuration field. +func (o *UserLoginStage) SetSessionDuration(v string) { + o.SessionDuration = &v +} + +// GetTerminateOtherSessions returns the TerminateOtherSessions field value if set, zero value otherwise. +func (o *UserLoginStage) GetTerminateOtherSessions() bool { + if o == nil || IsNil(o.TerminateOtherSessions) { + var ret bool + return ret + } + return *o.TerminateOtherSessions +} + +// GetTerminateOtherSessionsOk returns a tuple with the TerminateOtherSessions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetTerminateOtherSessionsOk() (*bool, bool) { + if o == nil || IsNil(o.TerminateOtherSessions) { + return nil, false + } + return o.TerminateOtherSessions, true +} + +// HasTerminateOtherSessions returns a boolean if a field has been set. +func (o *UserLoginStage) HasTerminateOtherSessions() bool { + if o != nil && !IsNil(o.TerminateOtherSessions) { + return true + } + + return false +} + +// SetTerminateOtherSessions gets a reference to the given bool and assigns it to the TerminateOtherSessions field. +func (o *UserLoginStage) SetTerminateOtherSessions(v bool) { + o.TerminateOtherSessions = &v +} + +// GetRememberMeOffset returns the RememberMeOffset field value if set, zero value otherwise. +func (o *UserLoginStage) GetRememberMeOffset() string { + if o == nil || IsNil(o.RememberMeOffset) { + var ret string + return ret + } + return *o.RememberMeOffset +} + +// GetRememberMeOffsetOk returns a tuple with the RememberMeOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetRememberMeOffsetOk() (*string, bool) { + if o == nil || IsNil(o.RememberMeOffset) { + return nil, false + } + return o.RememberMeOffset, true +} + +// HasRememberMeOffset returns a boolean if a field has been set. +func (o *UserLoginStage) HasRememberMeOffset() bool { + if o != nil && !IsNil(o.RememberMeOffset) { + return true + } + + return false +} + +// SetRememberMeOffset gets a reference to the given string and assigns it to the RememberMeOffset field. +func (o *UserLoginStage) SetRememberMeOffset(v string) { + o.RememberMeOffset = &v +} + +// GetNetworkBinding returns the NetworkBinding field value if set, zero value otherwise. +func (o *UserLoginStage) GetNetworkBinding() NetworkBindingEnum { + if o == nil || IsNil(o.NetworkBinding) { + var ret NetworkBindingEnum + return ret + } + return *o.NetworkBinding +} + +// GetNetworkBindingOk returns a tuple with the NetworkBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetNetworkBindingOk() (*NetworkBindingEnum, bool) { + if o == nil || IsNil(o.NetworkBinding) { + return nil, false + } + return o.NetworkBinding, true +} + +// HasNetworkBinding returns a boolean if a field has been set. +func (o *UserLoginStage) HasNetworkBinding() bool { + if o != nil && !IsNil(o.NetworkBinding) { + return true + } + + return false +} + +// SetNetworkBinding gets a reference to the given NetworkBindingEnum and assigns it to the NetworkBinding field. +func (o *UserLoginStage) SetNetworkBinding(v NetworkBindingEnum) { + o.NetworkBinding = &v +} + +// GetGeoipBinding returns the GeoipBinding field value if set, zero value otherwise. +func (o *UserLoginStage) GetGeoipBinding() GeoipBindingEnum { + if o == nil || IsNil(o.GeoipBinding) { + var ret GeoipBindingEnum + return ret + } + return *o.GeoipBinding +} + +// GetGeoipBindingOk returns a tuple with the GeoipBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetGeoipBindingOk() (*GeoipBindingEnum, bool) { + if o == nil || IsNil(o.GeoipBinding) { + return nil, false + } + return o.GeoipBinding, true +} + +// HasGeoipBinding returns a boolean if a field has been set. +func (o *UserLoginStage) HasGeoipBinding() bool { + if o != nil && !IsNil(o.GeoipBinding) { + return true + } + + return false +} + +// SetGeoipBinding gets a reference to the given GeoipBindingEnum and assigns it to the GeoipBinding field. +func (o *UserLoginStage) SetGeoipBinding(v GeoipBindingEnum) { + o.GeoipBinding = &v +} + +// GetRememberDevice returns the RememberDevice field value if set, zero value otherwise. +func (o *UserLoginStage) GetRememberDevice() string { + if o == nil || IsNil(o.RememberDevice) { + var ret string + return ret + } + return *o.RememberDevice +} + +// GetRememberDeviceOk returns a tuple with the RememberDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStage) GetRememberDeviceOk() (*string, bool) { + if o == nil || IsNil(o.RememberDevice) { + return nil, false + } + return o.RememberDevice, true +} + +// HasRememberDevice returns a boolean if a field has been set. +func (o *UserLoginStage) HasRememberDevice() bool { + if o != nil && !IsNil(o.RememberDevice) { + return true + } + + return false +} + +// SetRememberDevice gets a reference to the given string and assigns it to the RememberDevice field. +func (o *UserLoginStage) SetRememberDevice(v string) { + o.RememberDevice = &v +} + +func (o UserLoginStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLoginStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.SessionDuration) { + toSerialize["session_duration"] = o.SessionDuration + } + if !IsNil(o.TerminateOtherSessions) { + toSerialize["terminate_other_sessions"] = o.TerminateOtherSessions + } + if !IsNil(o.RememberMeOffset) { + toSerialize["remember_me_offset"] = o.RememberMeOffset + } + if !IsNil(o.NetworkBinding) { + toSerialize["network_binding"] = o.NetworkBinding + } + if !IsNil(o.GeoipBinding) { + toSerialize["geoip_binding"] = o.GeoipBinding + } + if !IsNil(o.RememberDevice) { + toSerialize["remember_device"] = o.RememberDevice + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLoginStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLoginStage := _UserLoginStage{} + + err = json.Unmarshal(data, &varUserLoginStage) + + if err != nil { + return err + } + + *o = UserLoginStage(varUserLoginStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "session_duration") + delete(additionalProperties, "terminate_other_sessions") + delete(additionalProperties, "remember_me_offset") + delete(additionalProperties, "network_binding") + delete(additionalProperties, "geoip_binding") + delete(additionalProperties, "remember_device") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLoginStage struct { + value *UserLoginStage + isSet bool +} + +func (v NullableUserLoginStage) Get() *UserLoginStage { + return v.value +} + +func (v *NullableUserLoginStage) Set(val *UserLoginStage) { + v.value = val + v.isSet = true +} + +func (v NullableUserLoginStage) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLoginStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLoginStage(val *UserLoginStage) *NullableUserLoginStage { + return &NullableUserLoginStage{value: val, isSet: true} +} + +func (v NullableUserLoginStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLoginStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_login_stage_request.go b/packages/client-go/model_user_login_stage_request.go new file mode 100644 index 0000000000..89ab790440 --- /dev/null +++ b/packages/client-go/model_user_login_stage_request.go @@ -0,0 +1,395 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLoginStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLoginStageRequest{} + +// UserLoginStageRequest UserLoginStage Serializer +type UserLoginStageRequest struct { + Name string `json:"name"` + // Determines how long a session lasts. Default of 0 means that the sessions lasts until the browser is closed. (Format: hours=-1;minutes=-2;seconds=-3) + SessionDuration *string `json:"session_duration,omitempty"` + // Terminate all other sessions of the user logging in. + TerminateOtherSessions *bool `json:"terminate_other_sessions,omitempty"` + // Offset the session will be extended by when the user picks the remember me option. Default of 0 means that the remember me option will not be shown. (Format: hours=-1;minutes=-2;seconds=-3) + RememberMeOffset *string `json:"remember_me_offset,omitempty"` + // Bind sessions created by this stage to the configured network + NetworkBinding *NetworkBindingEnum `json:"network_binding,omitempty"` + // Bind sessions created by this stage to the configured GeoIP location + GeoipBinding *GeoipBindingEnum `json:"geoip_binding,omitempty"` + // When set to a non-zero value, authentik will save a cookie with a longer expiry,to remember the device the user is logging in from. (Format: hours=-1;minutes=-2;seconds=-3) + RememberDevice *string `json:"remember_device,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserLoginStageRequest UserLoginStageRequest + +// NewUserLoginStageRequest instantiates a new UserLoginStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLoginStageRequest(name string) *UserLoginStageRequest { + this := UserLoginStageRequest{} + this.Name = name + return &this +} + +// NewUserLoginStageRequestWithDefaults instantiates a new UserLoginStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLoginStageRequestWithDefaults() *UserLoginStageRequest { + this := UserLoginStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *UserLoginStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserLoginStageRequest) SetName(v string) { + o.Name = v +} + +// GetSessionDuration returns the SessionDuration field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetSessionDuration() string { + if o == nil || IsNil(o.SessionDuration) { + var ret string + return ret + } + return *o.SessionDuration +} + +// GetSessionDurationOk returns a tuple with the SessionDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetSessionDurationOk() (*string, bool) { + if o == nil || IsNil(o.SessionDuration) { + return nil, false + } + return o.SessionDuration, true +} + +// HasSessionDuration returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasSessionDuration() bool { + if o != nil && !IsNil(o.SessionDuration) { + return true + } + + return false +} + +// SetSessionDuration gets a reference to the given string and assigns it to the SessionDuration field. +func (o *UserLoginStageRequest) SetSessionDuration(v string) { + o.SessionDuration = &v +} + +// GetTerminateOtherSessions returns the TerminateOtherSessions field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetTerminateOtherSessions() bool { + if o == nil || IsNil(o.TerminateOtherSessions) { + var ret bool + return ret + } + return *o.TerminateOtherSessions +} + +// GetTerminateOtherSessionsOk returns a tuple with the TerminateOtherSessions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetTerminateOtherSessionsOk() (*bool, bool) { + if o == nil || IsNil(o.TerminateOtherSessions) { + return nil, false + } + return o.TerminateOtherSessions, true +} + +// HasTerminateOtherSessions returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasTerminateOtherSessions() bool { + if o != nil && !IsNil(o.TerminateOtherSessions) { + return true + } + + return false +} + +// SetTerminateOtherSessions gets a reference to the given bool and assigns it to the TerminateOtherSessions field. +func (o *UserLoginStageRequest) SetTerminateOtherSessions(v bool) { + o.TerminateOtherSessions = &v +} + +// GetRememberMeOffset returns the RememberMeOffset field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetRememberMeOffset() string { + if o == nil || IsNil(o.RememberMeOffset) { + var ret string + return ret + } + return *o.RememberMeOffset +} + +// GetRememberMeOffsetOk returns a tuple with the RememberMeOffset field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetRememberMeOffsetOk() (*string, bool) { + if o == nil || IsNil(o.RememberMeOffset) { + return nil, false + } + return o.RememberMeOffset, true +} + +// HasRememberMeOffset returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasRememberMeOffset() bool { + if o != nil && !IsNil(o.RememberMeOffset) { + return true + } + + return false +} + +// SetRememberMeOffset gets a reference to the given string and assigns it to the RememberMeOffset field. +func (o *UserLoginStageRequest) SetRememberMeOffset(v string) { + o.RememberMeOffset = &v +} + +// GetNetworkBinding returns the NetworkBinding field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetNetworkBinding() NetworkBindingEnum { + if o == nil || IsNil(o.NetworkBinding) { + var ret NetworkBindingEnum + return ret + } + return *o.NetworkBinding +} + +// GetNetworkBindingOk returns a tuple with the NetworkBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetNetworkBindingOk() (*NetworkBindingEnum, bool) { + if o == nil || IsNil(o.NetworkBinding) { + return nil, false + } + return o.NetworkBinding, true +} + +// HasNetworkBinding returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasNetworkBinding() bool { + if o != nil && !IsNil(o.NetworkBinding) { + return true + } + + return false +} + +// SetNetworkBinding gets a reference to the given NetworkBindingEnum and assigns it to the NetworkBinding field. +func (o *UserLoginStageRequest) SetNetworkBinding(v NetworkBindingEnum) { + o.NetworkBinding = &v +} + +// GetGeoipBinding returns the GeoipBinding field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetGeoipBinding() GeoipBindingEnum { + if o == nil || IsNil(o.GeoipBinding) { + var ret GeoipBindingEnum + return ret + } + return *o.GeoipBinding +} + +// GetGeoipBindingOk returns a tuple with the GeoipBinding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetGeoipBindingOk() (*GeoipBindingEnum, bool) { + if o == nil || IsNil(o.GeoipBinding) { + return nil, false + } + return o.GeoipBinding, true +} + +// HasGeoipBinding returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasGeoipBinding() bool { + if o != nil && !IsNil(o.GeoipBinding) { + return true + } + + return false +} + +// SetGeoipBinding gets a reference to the given GeoipBindingEnum and assigns it to the GeoipBinding field. +func (o *UserLoginStageRequest) SetGeoipBinding(v GeoipBindingEnum) { + o.GeoipBinding = &v +} + +// GetRememberDevice returns the RememberDevice field value if set, zero value otherwise. +func (o *UserLoginStageRequest) GetRememberDevice() string { + if o == nil || IsNil(o.RememberDevice) { + var ret string + return ret + } + return *o.RememberDevice +} + +// GetRememberDeviceOk returns a tuple with the RememberDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserLoginStageRequest) GetRememberDeviceOk() (*string, bool) { + if o == nil || IsNil(o.RememberDevice) { + return nil, false + } + return o.RememberDevice, true +} + +// HasRememberDevice returns a boolean if a field has been set. +func (o *UserLoginStageRequest) HasRememberDevice() bool { + if o != nil && !IsNil(o.RememberDevice) { + return true + } + + return false +} + +// SetRememberDevice gets a reference to the given string and assigns it to the RememberDevice field. +func (o *UserLoginStageRequest) SetRememberDevice(v string) { + o.RememberDevice = &v +} + +func (o UserLoginStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLoginStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.SessionDuration) { + toSerialize["session_duration"] = o.SessionDuration + } + if !IsNil(o.TerminateOtherSessions) { + toSerialize["terminate_other_sessions"] = o.TerminateOtherSessions + } + if !IsNil(o.RememberMeOffset) { + toSerialize["remember_me_offset"] = o.RememberMeOffset + } + if !IsNil(o.NetworkBinding) { + toSerialize["network_binding"] = o.NetworkBinding + } + if !IsNil(o.GeoipBinding) { + toSerialize["geoip_binding"] = o.GeoipBinding + } + if !IsNil(o.RememberDevice) { + toSerialize["remember_device"] = o.RememberDevice + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLoginStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLoginStageRequest := _UserLoginStageRequest{} + + err = json.Unmarshal(data, &varUserLoginStageRequest) + + if err != nil { + return err + } + + *o = UserLoginStageRequest(varUserLoginStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "session_duration") + delete(additionalProperties, "terminate_other_sessions") + delete(additionalProperties, "remember_me_offset") + delete(additionalProperties, "network_binding") + delete(additionalProperties, "geoip_binding") + delete(additionalProperties, "remember_device") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLoginStageRequest struct { + value *UserLoginStageRequest + isSet bool +} + +func (v NullableUserLoginStageRequest) Get() *UserLoginStageRequest { + return v.value +} + +func (v *NullableUserLoginStageRequest) Set(val *UserLoginStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserLoginStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLoginStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLoginStageRequest(val *UserLoginStageRequest) *NullableUserLoginStageRequest { + return &NullableUserLoginStageRequest{value: val, isSet: true} +} + +func (v NullableUserLoginStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLoginStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_logout_stage.go b/packages/client-go/model_user_logout_stage.go new file mode 100644 index 0000000000..8813806ade --- /dev/null +++ b/packages/client-go/model_user_logout_stage.go @@ -0,0 +1,345 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLogoutStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLogoutStage{} + +// UserLogoutStage UserLogoutStage Serializer +type UserLogoutStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + AdditionalProperties map[string]interface{} +} + +type _UserLogoutStage UserLogoutStage + +// NewUserLogoutStage instantiates a new UserLogoutStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLogoutStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *UserLogoutStage { + this := UserLogoutStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewUserLogoutStageWithDefaults instantiates a new UserLogoutStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLogoutStageWithDefaults() *UserLogoutStage { + this := UserLogoutStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserLogoutStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserLogoutStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UserLogoutStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserLogoutStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *UserLogoutStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UserLogoutStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *UserLogoutStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *UserLogoutStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *UserLogoutStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *UserLogoutStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *UserLogoutStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *UserLogoutStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *UserLogoutStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *UserLogoutStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +func (o UserLogoutStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLogoutStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLogoutStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLogoutStage := _UserLogoutStage{} + + err = json.Unmarshal(data, &varUserLogoutStage) + + if err != nil { + return err + } + + *o = UserLogoutStage(varUserLogoutStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLogoutStage struct { + value *UserLogoutStage + isSet bool +} + +func (v NullableUserLogoutStage) Get() *UserLogoutStage { + return v.value +} + +func (v *NullableUserLogoutStage) Set(val *UserLogoutStage) { + v.value = val + v.isSet = true +} + +func (v NullableUserLogoutStage) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLogoutStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLogoutStage(val *UserLogoutStage) *NullableUserLogoutStage { + return &NullableUserLogoutStage{value: val, isSet: true} +} + +func (v NullableUserLogoutStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLogoutStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_logout_stage_request.go b/packages/client-go/model_user_logout_stage_request.go new file mode 100644 index 0000000000..3776634799 --- /dev/null +++ b/packages/client-go/model_user_logout_stage_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserLogoutStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserLogoutStageRequest{} + +// UserLogoutStageRequest UserLogoutStage Serializer +type UserLogoutStageRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _UserLogoutStageRequest UserLogoutStageRequest + +// NewUserLogoutStageRequest instantiates a new UserLogoutStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserLogoutStageRequest(name string) *UserLogoutStageRequest { + this := UserLogoutStageRequest{} + this.Name = name + return &this +} + +// NewUserLogoutStageRequestWithDefaults instantiates a new UserLogoutStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserLogoutStageRequestWithDefaults() *UserLogoutStageRequest { + this := UserLogoutStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *UserLogoutStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserLogoutStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserLogoutStageRequest) SetName(v string) { + o.Name = v +} + +func (o UserLogoutStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserLogoutStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserLogoutStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserLogoutStageRequest := _UserLogoutStageRequest{} + + err = json.Unmarshal(data, &varUserLogoutStageRequest) + + if err != nil { + return err + } + + *o = UserLogoutStageRequest(varUserLogoutStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserLogoutStageRequest struct { + value *UserLogoutStageRequest + isSet bool +} + +func (v NullableUserLogoutStageRequest) Get() *UserLogoutStageRequest { + return v.value +} + +func (v *NullableUserLogoutStageRequest) Set(val *UserLogoutStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserLogoutStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserLogoutStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserLogoutStageRequest(val *UserLogoutStageRequest) *NullableUserLogoutStageRequest { + return &NullableUserLogoutStageRequest{value: val, isSet: true} +} + +func (v NullableUserLogoutStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserLogoutStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_matching_mode_enum.go b/packages/client-go/model_user_matching_mode_enum.go new file mode 100644 index 0000000000..ce345aad24 --- /dev/null +++ b/packages/client-go/model_user_matching_mode_enum.go @@ -0,0 +1,117 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserMatchingModeEnum the model 'UserMatchingModeEnum' +type UserMatchingModeEnum string + +// List of UserMatchingModeEnum +const ( + USERMATCHINGMODEENUM_IDENTIFIER UserMatchingModeEnum = "identifier" + USERMATCHINGMODEENUM_EMAIL_LINK UserMatchingModeEnum = "email_link" + USERMATCHINGMODEENUM_EMAIL_DENY UserMatchingModeEnum = "email_deny" + USERMATCHINGMODEENUM_USERNAME_LINK UserMatchingModeEnum = "username_link" + USERMATCHINGMODEENUM_USERNAME_DENY UserMatchingModeEnum = "username_deny" +) + +// All allowed values of UserMatchingModeEnum enum +var AllowedUserMatchingModeEnumEnumValues = []UserMatchingModeEnum{ + "identifier", + "email_link", + "email_deny", + "username_link", + "username_deny", +} + +func (v *UserMatchingModeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserMatchingModeEnum(value) + for _, existing := range AllowedUserMatchingModeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserMatchingModeEnum", value) +} + +// NewUserMatchingModeEnumFromValue returns a pointer to a valid UserMatchingModeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserMatchingModeEnumFromValue(v string) (*UserMatchingModeEnum, error) { + ev := UserMatchingModeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserMatchingModeEnum: valid values are %v", v, AllowedUserMatchingModeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserMatchingModeEnum) IsValid() bool { + for _, existing := range AllowedUserMatchingModeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserMatchingModeEnum value +func (v UserMatchingModeEnum) Ptr() *UserMatchingModeEnum { + return &v +} + +type NullableUserMatchingModeEnum struct { + value *UserMatchingModeEnum + isSet bool +} + +func (v NullableUserMatchingModeEnum) Get() *UserMatchingModeEnum { + return v.value +} + +func (v *NullableUserMatchingModeEnum) Set(val *UserMatchingModeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserMatchingModeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserMatchingModeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserMatchingModeEnum(val *UserMatchingModeEnum) *NullableUserMatchingModeEnum { + return &NullableUserMatchingModeEnum{value: val, isSet: true} +} + +func (v NullableUserMatchingModeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserMatchingModeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_o_auth_source_connection.go b/packages/client-go/model_user_o_auth_source_connection.go new file mode 100644 index 0000000000..f2a47763cb --- /dev/null +++ b/packages/client-go/model_user_o_auth_source_connection.go @@ -0,0 +1,379 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserOAuthSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserOAuthSourceConnection{} + +// UserOAuthSourceConnection User source connection +type UserOAuthSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + Expires *time.Time `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserOAuthSourceConnection UserOAuthSourceConnection + +// NewUserOAuthSourceConnection instantiates a new UserOAuthSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserOAuthSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserOAuthSourceConnection { + this := UserOAuthSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserOAuthSourceConnectionWithDefaults instantiates a new UserOAuthSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserOAuthSourceConnectionWithDefaults() *UserOAuthSourceConnection { + this := UserOAuthSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserOAuthSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserOAuthSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserOAuthSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserOAuthSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserOAuthSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserOAuthSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserOAuthSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserOAuthSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserOAuthSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserOAuthSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserOAuthSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserOAuthSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserOAuthSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserOAuthSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *UserOAuthSourceConnection) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnection) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *UserOAuthSourceConnection) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *UserOAuthSourceConnection) SetExpires(v time.Time) { + o.Expires = &v +} + +func (o UserOAuthSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserOAuthSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserOAuthSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserOAuthSourceConnection := _UserOAuthSourceConnection{} + + err = json.Unmarshal(data, &varUserOAuthSourceConnection) + + if err != nil { + return err + } + + *o = UserOAuthSourceConnection(varUserOAuthSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserOAuthSourceConnection struct { + value *UserOAuthSourceConnection + isSet bool +} + +func (v NullableUserOAuthSourceConnection) Get() *UserOAuthSourceConnection { + return v.value +} + +func (v *NullableUserOAuthSourceConnection) Set(val *UserOAuthSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserOAuthSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserOAuthSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserOAuthSourceConnection(val *UserOAuthSourceConnection) *NullableUserOAuthSourceConnection { + return &NullableUserOAuthSourceConnection{value: val, isSet: true} +} + +func (v NullableUserOAuthSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserOAuthSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_o_auth_source_connection_request.go b/packages/client-go/model_user_o_auth_source_connection_request.go new file mode 100644 index 0000000000..e9738ca47c --- /dev/null +++ b/packages/client-go/model_user_o_auth_source_connection_request.go @@ -0,0 +1,311 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserOAuthSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserOAuthSourceConnectionRequest{} + +// UserOAuthSourceConnectionRequest User source connection +type UserOAuthSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AccessToken NullableString `json:"access_token,omitempty"` + Expires *time.Time `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserOAuthSourceConnectionRequest UserOAuthSourceConnectionRequest + +// NewUserOAuthSourceConnectionRequest instantiates a new UserOAuthSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserOAuthSourceConnectionRequest(user int32, source string, identifier string) *UserOAuthSourceConnectionRequest { + this := UserOAuthSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserOAuthSourceConnectionRequestWithDefaults instantiates a new UserOAuthSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserOAuthSourceConnectionRequestWithDefaults() *UserOAuthSourceConnectionRequest { + this := UserOAuthSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserOAuthSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserOAuthSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserOAuthSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserOAuthSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserOAuthSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserOAuthSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +// GetAccessToken returns the AccessToken field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserOAuthSourceConnectionRequest) GetAccessToken() string { + if o == nil || IsNil(o.AccessToken.Get()) { + var ret string + return ret + } + return *o.AccessToken.Get() +} + +// GetAccessTokenOk returns a tuple with the AccessToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserOAuthSourceConnectionRequest) GetAccessTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AccessToken.Get(), o.AccessToken.IsSet() +} + +// HasAccessToken returns a boolean if a field has been set. +func (o *UserOAuthSourceConnectionRequest) HasAccessToken() bool { + if o != nil && o.AccessToken.IsSet() { + return true + } + + return false +} + +// SetAccessToken gets a reference to the given NullableString and assigns it to the AccessToken field. +func (o *UserOAuthSourceConnectionRequest) SetAccessToken(v string) { + o.AccessToken.Set(&v) +} + +// SetAccessTokenNil sets the value for AccessToken to be an explicit nil +func (o *UserOAuthSourceConnectionRequest) SetAccessTokenNil() { + o.AccessToken.Set(nil) +} + +// UnsetAccessToken ensures that no value is present for AccessToken, not even an explicit nil +func (o *UserOAuthSourceConnectionRequest) UnsetAccessToken() { + o.AccessToken.Unset() +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *UserOAuthSourceConnectionRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserOAuthSourceConnectionRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *UserOAuthSourceConnectionRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *UserOAuthSourceConnectionRequest) SetExpires(v time.Time) { + o.Expires = &v +} + +func (o UserOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserOAuthSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + if o.AccessToken.IsSet() { + toSerialize["access_token"] = o.AccessToken.Get() + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserOAuthSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserOAuthSourceConnectionRequest := _UserOAuthSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserOAuthSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserOAuthSourceConnectionRequest(varUserOAuthSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + delete(additionalProperties, "access_token") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserOAuthSourceConnectionRequest struct { + value *UserOAuthSourceConnectionRequest + isSet bool +} + +func (v NullableUserOAuthSourceConnectionRequest) Get() *UserOAuthSourceConnectionRequest { + return v.value +} + +func (v *NullableUserOAuthSourceConnectionRequest) Set(val *UserOAuthSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserOAuthSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserOAuthSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserOAuthSourceConnectionRequest(val *UserOAuthSourceConnectionRequest) *NullableUserOAuthSourceConnectionRequest { + return &NullableUserOAuthSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserOAuthSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserOAuthSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_password_set_request.go b/packages/client-go/model_user_password_set_request.go new file mode 100644 index 0000000000..134d04fbff --- /dev/null +++ b/packages/client-go/model_user_password_set_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserPasswordSetRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPasswordSetRequest{} + +// UserPasswordSetRequest Payload to set a users' password directly +type UserPasswordSetRequest struct { + Password string `json:"password"` + AdditionalProperties map[string]interface{} +} + +type _UserPasswordSetRequest UserPasswordSetRequest + +// NewUserPasswordSetRequest instantiates a new UserPasswordSetRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPasswordSetRequest(password string) *UserPasswordSetRequest { + this := UserPasswordSetRequest{} + this.Password = password + return &this +} + +// NewUserPasswordSetRequestWithDefaults instantiates a new UserPasswordSetRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPasswordSetRequestWithDefaults() *UserPasswordSetRequest { + this := UserPasswordSetRequest{} + return &this +} + +// GetPassword returns the Password field value +func (o *UserPasswordSetRequest) GetPassword() string { + if o == nil { + var ret string + return ret + } + + return o.Password +} + +// GetPasswordOk returns a tuple with the Password field value +// and a boolean to check if the value has been set. +func (o *UserPasswordSetRequest) GetPasswordOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Password, true +} + +// SetPassword sets field value +func (o *UserPasswordSetRequest) SetPassword(v string) { + o.Password = v +} + +func (o UserPasswordSetRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPasswordSetRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["password"] = o.Password + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserPasswordSetRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "password", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPasswordSetRequest := _UserPasswordSetRequest{} + + err = json.Unmarshal(data, &varUserPasswordSetRequest) + + if err != nil { + return err + } + + *o = UserPasswordSetRequest(varUserPasswordSetRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "password") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserPasswordSetRequest struct { + value *UserPasswordSetRequest + isSet bool +} + +func (v NullableUserPasswordSetRequest) Get() *UserPasswordSetRequest { + return v.value +} + +func (v *NullableUserPasswordSetRequest) Set(val *UserPasswordSetRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserPasswordSetRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPasswordSetRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPasswordSetRequest(val *UserPasswordSetRequest) *NullableUserPasswordSetRequest { + return &NullableUserPasswordSetRequest{value: val, isSet: true} +} + +func (v NullableUserPasswordSetRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPasswordSetRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_path.go b/packages/client-go/model_user_path.go new file mode 100644 index 0000000000..9d3d03ee0e --- /dev/null +++ b/packages/client-go/model_user_path.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserPath type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPath{} + +// UserPath struct for UserPath +type UserPath struct { + Paths []string `json:"paths"` + AdditionalProperties map[string]interface{} +} + +type _UserPath UserPath + +// NewUserPath instantiates a new UserPath object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPath(paths []string) *UserPath { + this := UserPath{} + this.Paths = paths + return &this +} + +// NewUserPathWithDefaults instantiates a new UserPath object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPathWithDefaults() *UserPath { + this := UserPath{} + return &this +} + +// GetPaths returns the Paths field value +func (o *UserPath) GetPaths() []string { + if o == nil { + var ret []string + return ret + } + + return o.Paths +} + +// GetPathsOk returns a tuple with the Paths field value +// and a boolean to check if the value has been set. +func (o *UserPath) GetPathsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Paths, true +} + +// SetPaths sets field value +func (o *UserPath) SetPaths(v []string) { + o.Paths = v +} + +func (o UserPath) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPath) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["paths"] = o.Paths + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserPath) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "paths", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPath := _UserPath{} + + err = json.Unmarshal(data, &varUserPath) + + if err != nil { + return err + } + + *o = UserPath(varUserPath) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "paths") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserPath struct { + value *UserPath + isSet bool +} + +func (v NullableUserPath) Get() *UserPath { + return v.value +} + +func (v *NullableUserPath) Set(val *UserPath) { + v.value = val + v.isSet = true +} + +func (v NullableUserPath) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPath) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPath(val *UserPath) *NullableUserPath { + return &NullableUserPath{value: val, isSet: true} +} + +func (v NullableUserPath) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPath) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_plex_source_connection.go b/packages/client-go/model_user_plex_source_connection.go new file mode 100644 index 0000000000..14fd637bf2 --- /dev/null +++ b/packages/client-go/model_user_plex_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserPlexSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPlexSourceConnection{} + +// UserPlexSourceConnection User source connection +type UserPlexSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserPlexSourceConnection UserPlexSourceConnection + +// NewUserPlexSourceConnection instantiates a new UserPlexSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPlexSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserPlexSourceConnection { + this := UserPlexSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserPlexSourceConnectionWithDefaults instantiates a new UserPlexSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPlexSourceConnectionWithDefaults() *UserPlexSourceConnection { + this := UserPlexSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserPlexSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserPlexSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserPlexSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserPlexSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserPlexSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserPlexSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserPlexSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserPlexSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserPlexSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserPlexSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserPlexSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserPlexSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserPlexSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserPlexSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserPlexSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPlexSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserPlexSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPlexSourceConnection := _UserPlexSourceConnection{} + + err = json.Unmarshal(data, &varUserPlexSourceConnection) + + if err != nil { + return err + } + + *o = UserPlexSourceConnection(varUserPlexSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserPlexSourceConnection struct { + value *UserPlexSourceConnection + isSet bool +} + +func (v NullableUserPlexSourceConnection) Get() *UserPlexSourceConnection { + return v.value +} + +func (v *NullableUserPlexSourceConnection) Set(val *UserPlexSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserPlexSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPlexSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPlexSourceConnection(val *UserPlexSourceConnection) *NullableUserPlexSourceConnection { + return &NullableUserPlexSourceConnection{value: val, isSet: true} +} + +func (v NullableUserPlexSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPlexSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_plex_source_connection_request.go b/packages/client-go/model_user_plex_source_connection_request.go new file mode 100644 index 0000000000..4641c24bf0 --- /dev/null +++ b/packages/client-go/model_user_plex_source_connection_request.go @@ -0,0 +1,254 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserPlexSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserPlexSourceConnectionRequest{} + +// UserPlexSourceConnectionRequest User source connection +type UserPlexSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + PlexToken string `json:"plex_token"` + AdditionalProperties map[string]interface{} +} + +type _UserPlexSourceConnectionRequest UserPlexSourceConnectionRequest + +// NewUserPlexSourceConnectionRequest instantiates a new UserPlexSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserPlexSourceConnectionRequest(user int32, source string, identifier string, plexToken string) *UserPlexSourceConnectionRequest { + this := UserPlexSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + this.PlexToken = plexToken + return &this +} + +// NewUserPlexSourceConnectionRequestWithDefaults instantiates a new UserPlexSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserPlexSourceConnectionRequestWithDefaults() *UserPlexSourceConnectionRequest { + this := UserPlexSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserPlexSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserPlexSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserPlexSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserPlexSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserPlexSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserPlexSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +// GetPlexToken returns the PlexToken field value +func (o *UserPlexSourceConnectionRequest) GetPlexToken() string { + if o == nil { + var ret string + return ret + } + + return o.PlexToken +} + +// GetPlexTokenOk returns a tuple with the PlexToken field value +// and a boolean to check if the value has been set. +func (o *UserPlexSourceConnectionRequest) GetPlexTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PlexToken, true +} + +// SetPlexToken sets field value +func (o *UserPlexSourceConnectionRequest) SetPlexToken(v string) { + o.PlexToken = v +} + +func (o UserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserPlexSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + toSerialize["plex_token"] = o.PlexToken + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserPlexSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + "plex_token", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserPlexSourceConnectionRequest := _UserPlexSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserPlexSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserPlexSourceConnectionRequest(varUserPlexSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + delete(additionalProperties, "plex_token") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserPlexSourceConnectionRequest struct { + value *UserPlexSourceConnectionRequest + isSet bool +} + +func (v NullableUserPlexSourceConnectionRequest) Get() *UserPlexSourceConnectionRequest { + return v.value +} + +func (v *NullableUserPlexSourceConnectionRequest) Set(val *UserPlexSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserPlexSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserPlexSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserPlexSourceConnectionRequest(val *UserPlexSourceConnectionRequest) *NullableUserPlexSourceConnectionRequest { + return &NullableUserPlexSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserPlexSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserPlexSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_recovery_email_request.go b/packages/client-go/model_user_recovery_email_request.go new file mode 100644 index 0000000000..149a83a9e3 --- /dev/null +++ b/packages/client-go/model_user_recovery_email_request.go @@ -0,0 +1,204 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserRecoveryEmailRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRecoveryEmailRequest{} + +// UserRecoveryEmailRequest Payload to create and email a recovery link +type UserRecoveryEmailRequest struct { + TokenDuration *string `json:"token_duration,omitempty"` + EmailStage string `json:"email_stage"` + AdditionalProperties map[string]interface{} +} + +type _UserRecoveryEmailRequest UserRecoveryEmailRequest + +// NewUserRecoveryEmailRequest instantiates a new UserRecoveryEmailRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRecoveryEmailRequest(emailStage string) *UserRecoveryEmailRequest { + this := UserRecoveryEmailRequest{} + this.EmailStage = emailStage + return &this +} + +// NewUserRecoveryEmailRequestWithDefaults instantiates a new UserRecoveryEmailRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRecoveryEmailRequestWithDefaults() *UserRecoveryEmailRequest { + this := UserRecoveryEmailRequest{} + return &this +} + +// GetTokenDuration returns the TokenDuration field value if set, zero value otherwise. +func (o *UserRecoveryEmailRequest) GetTokenDuration() string { + if o == nil || IsNil(o.TokenDuration) { + var ret string + return ret + } + return *o.TokenDuration +} + +// GetTokenDurationOk returns a tuple with the TokenDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRecoveryEmailRequest) GetTokenDurationOk() (*string, bool) { + if o == nil || IsNil(o.TokenDuration) { + return nil, false + } + return o.TokenDuration, true +} + +// HasTokenDuration returns a boolean if a field has been set. +func (o *UserRecoveryEmailRequest) HasTokenDuration() bool { + if o != nil && !IsNil(o.TokenDuration) { + return true + } + + return false +} + +// SetTokenDuration gets a reference to the given string and assigns it to the TokenDuration field. +func (o *UserRecoveryEmailRequest) SetTokenDuration(v string) { + o.TokenDuration = &v +} + +// GetEmailStage returns the EmailStage field value +func (o *UserRecoveryEmailRequest) GetEmailStage() string { + if o == nil { + var ret string + return ret + } + + return o.EmailStage +} + +// GetEmailStageOk returns a tuple with the EmailStage field value +// and a boolean to check if the value has been set. +func (o *UserRecoveryEmailRequest) GetEmailStageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.EmailStage, true +} + +// SetEmailStage sets field value +func (o *UserRecoveryEmailRequest) SetEmailStage(v string) { + o.EmailStage = v +} + +func (o UserRecoveryEmailRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRecoveryEmailRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TokenDuration) { + toSerialize["token_duration"] = o.TokenDuration + } + toSerialize["email_stage"] = o.EmailStage + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserRecoveryEmailRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "email_stage", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserRecoveryEmailRequest := _UserRecoveryEmailRequest{} + + err = json.Unmarshal(data, &varUserRecoveryEmailRequest) + + if err != nil { + return err + } + + *o = UserRecoveryEmailRequest(varUserRecoveryEmailRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token_duration") + delete(additionalProperties, "email_stage") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserRecoveryEmailRequest struct { + value *UserRecoveryEmailRequest + isSet bool +} + +func (v NullableUserRecoveryEmailRequest) Get() *UserRecoveryEmailRequest { + return v.value +} + +func (v *NullableUserRecoveryEmailRequest) Set(val *UserRecoveryEmailRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserRecoveryEmailRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRecoveryEmailRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRecoveryEmailRequest(val *UserRecoveryEmailRequest) *NullableUserRecoveryEmailRequest { + return &NullableUserRecoveryEmailRequest{value: val, isSet: true} +} + +func (v NullableUserRecoveryEmailRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRecoveryEmailRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_recovery_link_request.go b/packages/client-go/model_user_recovery_link_request.go new file mode 100644 index 0000000000..a7bc788cbb --- /dev/null +++ b/packages/client-go/model_user_recovery_link_request.go @@ -0,0 +1,154 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the UserRecoveryLinkRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRecoveryLinkRequest{} + +// UserRecoveryLinkRequest Payload to create a recovery link +type UserRecoveryLinkRequest struct { + TokenDuration *string `json:"token_duration,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserRecoveryLinkRequest UserRecoveryLinkRequest + +// NewUserRecoveryLinkRequest instantiates a new UserRecoveryLinkRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRecoveryLinkRequest() *UserRecoveryLinkRequest { + this := UserRecoveryLinkRequest{} + return &this +} + +// NewUserRecoveryLinkRequestWithDefaults instantiates a new UserRecoveryLinkRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRecoveryLinkRequestWithDefaults() *UserRecoveryLinkRequest { + this := UserRecoveryLinkRequest{} + return &this +} + +// GetTokenDuration returns the TokenDuration field value if set, zero value otherwise. +func (o *UserRecoveryLinkRequest) GetTokenDuration() string { + if o == nil || IsNil(o.TokenDuration) { + var ret string + return ret + } + return *o.TokenDuration +} + +// GetTokenDurationOk returns a tuple with the TokenDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRecoveryLinkRequest) GetTokenDurationOk() (*string, bool) { + if o == nil || IsNil(o.TokenDuration) { + return nil, false + } + return o.TokenDuration, true +} + +// HasTokenDuration returns a boolean if a field has been set. +func (o *UserRecoveryLinkRequest) HasTokenDuration() bool { + if o != nil && !IsNil(o.TokenDuration) { + return true + } + + return false +} + +// SetTokenDuration gets a reference to the given string and assigns it to the TokenDuration field. +func (o *UserRecoveryLinkRequest) SetTokenDuration(v string) { + o.TokenDuration = &v +} + +func (o UserRecoveryLinkRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRecoveryLinkRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TokenDuration) { + toSerialize["token_duration"] = o.TokenDuration + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserRecoveryLinkRequest) UnmarshalJSON(data []byte) (err error) { + varUserRecoveryLinkRequest := _UserRecoveryLinkRequest{} + + err = json.Unmarshal(data, &varUserRecoveryLinkRequest) + + if err != nil { + return err + } + + *o = UserRecoveryLinkRequest(varUserRecoveryLinkRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "token_duration") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserRecoveryLinkRequest struct { + value *UserRecoveryLinkRequest + isSet bool +} + +func (v NullableUserRecoveryLinkRequest) Get() *UserRecoveryLinkRequest { + return v.value +} + +func (v *NullableUserRecoveryLinkRequest) Set(val *UserRecoveryLinkRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserRecoveryLinkRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRecoveryLinkRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRecoveryLinkRequest(val *UserRecoveryLinkRequest) *NullableUserRecoveryLinkRequest { + return &NullableUserRecoveryLinkRequest{value: val, isSet: true} +} + +func (v NullableUserRecoveryLinkRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRecoveryLinkRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_request.go b/packages/client-go/model_user_request.go new file mode 100644 index 0000000000..02b9573bdf --- /dev/null +++ b/packages/client-go/model_user_request.go @@ -0,0 +1,506 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserRequest{} + +// UserRequest User Serializer +type UserRequest struct { + Username string `json:"username"` + // User's display name. + Name string `json:"name"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive *bool `json:"is_active,omitempty"` + LastLogin NullableTime `json:"last_login,omitempty"` + Groups []string `json:"groups,omitempty"` + Roles []string `json:"roles,omitempty"` + Email *string `json:"email,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` + Path *string `json:"path,omitempty"` + Type *UserTypeEnum `json:"type,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserRequest UserRequest + +// NewUserRequest instantiates a new UserRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserRequest(username string, name string) *UserRequest { + this := UserRequest{} + this.Username = username + this.Name = name + return &this +} + +// NewUserRequestWithDefaults instantiates a new UserRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserRequestWithDefaults() *UserRequest { + this := UserRequest{} + return &this +} + +// GetUsername returns the Username field value +func (o *UserRequest) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserRequest) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserRequest) SetUsername(v string) { + o.Username = v +} + +// GetName returns the Name field value +func (o *UserRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserRequest) SetName(v string) { + o.Name = v +} + +// GetIsActive returns the IsActive field value if set, zero value otherwise. +func (o *UserRequest) GetIsActive() bool { + if o == nil || IsNil(o.IsActive) { + var ret bool + return ret + } + return *o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetIsActiveOk() (*bool, bool) { + if o == nil || IsNil(o.IsActive) { + return nil, false + } + return o.IsActive, true +} + +// HasIsActive returns a boolean if a field has been set. +func (o *UserRequest) HasIsActive() bool { + if o != nil && !IsNil(o.IsActive) { + return true + } + + return false +} + +// SetIsActive gets a reference to the given bool and assigns it to the IsActive field. +func (o *UserRequest) SetIsActive(v bool) { + o.IsActive = &v +} + +// GetLastLogin returns the LastLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserRequest) GetLastLogin() time.Time { + if o == nil || IsNil(o.LastLogin.Get()) { + var ret time.Time + return ret + } + return *o.LastLogin.Get() +} + +// GetLastLoginOk returns a tuple with the LastLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserRequest) GetLastLoginOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.LastLogin.Get(), o.LastLogin.IsSet() +} + +// HasLastLogin returns a boolean if a field has been set. +func (o *UserRequest) HasLastLogin() bool { + if o != nil && o.LastLogin.IsSet() { + return true + } + + return false +} + +// SetLastLogin gets a reference to the given NullableTime and assigns it to the LastLogin field. +func (o *UserRequest) SetLastLogin(v time.Time) { + o.LastLogin.Set(&v) +} + +// SetLastLoginNil sets the value for LastLogin to be an explicit nil +func (o *UserRequest) SetLastLoginNil() { + o.LastLogin.Set(nil) +} + +// UnsetLastLogin ensures that no value is present for LastLogin, not even an explicit nil +func (o *UserRequest) UnsetLastLogin() { + o.LastLogin.Unset() +} + +// GetGroups returns the Groups field value if set, zero value otherwise. +func (o *UserRequest) GetGroups() []string { + if o == nil || IsNil(o.Groups) { + var ret []string + return ret + } + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.Groups) { + return nil, false + } + return o.Groups, true +} + +// HasGroups returns a boolean if a field has been set. +func (o *UserRequest) HasGroups() bool { + if o != nil && !IsNil(o.Groups) { + return true + } + + return false +} + +// SetGroups gets a reference to the given []string and assigns it to the Groups field. +func (o *UserRequest) SetGroups(v []string) { + o.Groups = v +} + +// GetRoles returns the Roles field value if set, zero value otherwise. +func (o *UserRequest) GetRoles() []string { + if o == nil || IsNil(o.Roles) { + var ret []string + return ret + } + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetRolesOk() ([]string, bool) { + if o == nil || IsNil(o.Roles) { + return nil, false + } + return o.Roles, true +} + +// HasRoles returns a boolean if a field has been set. +func (o *UserRequest) HasRoles() bool { + if o != nil && !IsNil(o.Roles) { + return true + } + + return false +} + +// SetRoles gets a reference to the given []string and assigns it to the Roles field. +func (o *UserRequest) SetRoles(v []string) { + o.Roles = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserRequest) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserRequest) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserRequest) SetEmail(v string) { + o.Email = &v +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *UserRequest) GetAttributes() map[string]interface{} { + if o == nil || IsNil(o.Attributes) { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetAttributesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Attributes) { + return map[string]interface{}{}, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *UserRequest) HasAttributes() bool { + if o != nil && !IsNil(o.Attributes) { + return true + } + + return false +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *UserRequest) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *UserRequest) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *UserRequest) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *UserRequest) SetPath(v string) { + o.Path = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UserRequest) GetType() UserTypeEnum { + if o == nil || IsNil(o.Type) { + var ret UserTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserRequest) GetTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UserRequest) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given UserTypeEnum and assigns it to the Type field. +func (o *UserRequest) SetType(v UserTypeEnum) { + o.Type = &v +} + +func (o UserRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + toSerialize["name"] = o.Name + if !IsNil(o.IsActive) { + toSerialize["is_active"] = o.IsActive + } + if o.LastLogin.IsSet() { + toSerialize["last_login"] = o.LastLogin.Get() + } + if !IsNil(o.Groups) { + toSerialize["groups"] = o.Groups + } + if !IsNil(o.Roles) { + toSerialize["roles"] = o.Roles + } + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + if !IsNil(o.Attributes) { + toSerialize["attributes"] = o.Attributes + } + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserRequest := _UserRequest{} + + err = json.Unmarshal(data, &varUserRequest) + + if err != nil { + return err + } + + *o = UserRequest(varUserRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "is_active") + delete(additionalProperties, "last_login") + delete(additionalProperties, "groups") + delete(additionalProperties, "roles") + delete(additionalProperties, "email") + delete(additionalProperties, "attributes") + delete(additionalProperties, "path") + delete(additionalProperties, "type") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserRequest struct { + value *UserRequest + isSet bool +} + +func (v NullableUserRequest) Get() *UserRequest { + return v.value +} + +func (v *NullableUserRequest) Set(val *UserRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserRequest(val *UserRequest) *NullableUserRequest { + return &NullableUserRequest{value: val, isSet: true} +} + +func (v NullableUserRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_saml_source_connection.go b/packages/client-go/model_user_saml_source_connection.go new file mode 100644 index 0000000000..9c107f9cb5 --- /dev/null +++ b/packages/client-go/model_user_saml_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserSAMLSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSAMLSourceConnection{} + +// UserSAMLSourceConnection User source connection +type UserSAMLSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserSAMLSourceConnection UserSAMLSourceConnection + +// NewUserSAMLSourceConnection instantiates a new UserSAMLSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSAMLSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserSAMLSourceConnection { + this := UserSAMLSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserSAMLSourceConnectionWithDefaults instantiates a new UserSAMLSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSAMLSourceConnectionWithDefaults() *UserSAMLSourceConnection { + this := UserSAMLSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserSAMLSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserSAMLSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserSAMLSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserSAMLSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserSAMLSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserSAMLSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserSAMLSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserSAMLSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserSAMLSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserSAMLSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserSAMLSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserSAMLSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserSAMLSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserSAMLSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserSAMLSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSAMLSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSAMLSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSAMLSourceConnection := _UserSAMLSourceConnection{} + + err = json.Unmarshal(data, &varUserSAMLSourceConnection) + + if err != nil { + return err + } + + *o = UserSAMLSourceConnection(varUserSAMLSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSAMLSourceConnection struct { + value *UserSAMLSourceConnection + isSet bool +} + +func (v NullableUserSAMLSourceConnection) Get() *UserSAMLSourceConnection { + return v.value +} + +func (v *NullableUserSAMLSourceConnection) Set(val *UserSAMLSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserSAMLSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSAMLSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSAMLSourceConnection(val *UserSAMLSourceConnection) *NullableUserSAMLSourceConnection { + return &NullableUserSAMLSourceConnection{value: val, isSet: true} +} + +func (v NullableUserSAMLSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSAMLSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_saml_source_connection_request.go b/packages/client-go/model_user_saml_source_connection_request.go new file mode 100644 index 0000000000..2717beec7d --- /dev/null +++ b/packages/client-go/model_user_saml_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSAMLSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSAMLSourceConnectionRequest{} + +// UserSAMLSourceConnectionRequest User source connection +type UserSAMLSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _UserSAMLSourceConnectionRequest UserSAMLSourceConnectionRequest + +// NewUserSAMLSourceConnectionRequest instantiates a new UserSAMLSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSAMLSourceConnectionRequest(user int32, source string, identifier string) *UserSAMLSourceConnectionRequest { + this := UserSAMLSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserSAMLSourceConnectionRequestWithDefaults instantiates a new UserSAMLSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSAMLSourceConnectionRequestWithDefaults() *UserSAMLSourceConnectionRequest { + this := UserSAMLSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserSAMLSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserSAMLSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserSAMLSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserSAMLSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserSAMLSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserSAMLSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserSAMLSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o UserSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSAMLSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSAMLSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSAMLSourceConnectionRequest := _UserSAMLSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserSAMLSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserSAMLSourceConnectionRequest(varUserSAMLSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSAMLSourceConnectionRequest struct { + value *UserSAMLSourceConnectionRequest + isSet bool +} + +func (v NullableUserSAMLSourceConnectionRequest) Get() *UserSAMLSourceConnectionRequest { + return v.value +} + +func (v *NullableUserSAMLSourceConnectionRequest) Set(val *UserSAMLSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserSAMLSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSAMLSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSAMLSourceConnectionRequest(val *UserSAMLSourceConnectionRequest) *NullableUserSAMLSourceConnectionRequest { + return &NullableUserSAMLSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserSAMLSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSAMLSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_self.go b/packages/client-go/model_user_self.go new file mode 100644 index 0000000000..d59b796617 --- /dev/null +++ b/packages/client-go/model_user_self.go @@ -0,0 +1,537 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSelf type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSelf{} + +// UserSelf User Serializer for information a user can retrieve about themselves +type UserSelf struct { + Pk int32 `json:"pk"` + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + Username string `json:"username" validate:"regexp=^[\\\\w.@+-]+$"` + // User's display name. + Name string `json:"name"` + // Designates whether this user should be treated as active. Unselect this instead of deleting accounts. + IsActive bool `json:"is_active"` + IsSuperuser bool `json:"is_superuser"` + Groups []UserSelfGroups `json:"groups"` + Roles []UserSelfRoles `json:"roles"` + Email *string `json:"email,omitempty"` + // User's avatar, either a http/https URL or a data URI + Avatar string `json:"avatar"` + Uid string `json:"uid"` + // Get user settings with brand and group settings applied + Settings map[string]interface{} `json:"settings"` + Type *UserTypeEnum `json:"type,omitempty"` + // Get all system permissions assigned to the user + SystemPermissions []string `json:"system_permissions"` + AdditionalProperties map[string]interface{} +} + +type _UserSelf UserSelf + +// NewUserSelf instantiates a new UserSelf object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSelf(pk int32, username string, name string, isActive bool, isSuperuser bool, groups []UserSelfGroups, roles []UserSelfRoles, avatar string, uid string, settings map[string]interface{}, systemPermissions []string) *UserSelf { + this := UserSelf{} + this.Pk = pk + this.Username = username + this.Name = name + this.IsActive = isActive + this.IsSuperuser = isSuperuser + this.Groups = groups + this.Roles = roles + this.Avatar = avatar + this.Uid = uid + this.Settings = settings + this.SystemPermissions = systemPermissions + return &this +} + +// NewUserSelfWithDefaults instantiates a new UserSelf object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSelfWithDefaults() *UserSelf { + this := UserSelf{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserSelf) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserSelf) SetPk(v int32) { + o.Pk = v +} + +// GetUsername returns the Username field value +func (o *UserSelf) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserSelf) SetUsername(v string) { + o.Username = v +} + +// GetName returns the Name field value +func (o *UserSelf) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserSelf) SetName(v string) { + o.Name = v +} + +// GetIsActive returns the IsActive field value +func (o *UserSelf) GetIsActive() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsActive +} + +// GetIsActiveOk returns a tuple with the IsActive field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetIsActiveOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsActive, true +} + +// SetIsActive sets field value +func (o *UserSelf) SetIsActive(v bool) { + o.IsActive = v +} + +// GetIsSuperuser returns the IsSuperuser field value +func (o *UserSelf) GetIsSuperuser() bool { + if o == nil { + var ret bool + return ret + } + + return o.IsSuperuser +} + +// GetIsSuperuserOk returns a tuple with the IsSuperuser field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetIsSuperuserOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsSuperuser, true +} + +// SetIsSuperuser sets field value +func (o *UserSelf) SetIsSuperuser(v bool) { + o.IsSuperuser = v +} + +// GetGroups returns the Groups field value +func (o *UserSelf) GetGroups() []UserSelfGroups { + if o == nil { + var ret []UserSelfGroups + return ret + } + + return o.Groups +} + +// GetGroupsOk returns a tuple with the Groups field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetGroupsOk() ([]UserSelfGroups, bool) { + if o == nil { + return nil, false + } + return o.Groups, true +} + +// SetGroups sets field value +func (o *UserSelf) SetGroups(v []UserSelfGroups) { + o.Groups = v +} + +// GetRoles returns the Roles field value +func (o *UserSelf) GetRoles() []UserSelfRoles { + if o == nil { + var ret []UserSelfRoles + return ret + } + + return o.Roles +} + +// GetRolesOk returns a tuple with the Roles field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetRolesOk() ([]UserSelfRoles, bool) { + if o == nil { + return nil, false + } + return o.Roles, true +} + +// SetRoles sets field value +func (o *UserSelf) SetRoles(v []UserSelfRoles) { + o.Roles = v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *UserSelf) GetEmail() string { + if o == nil || IsNil(o.Email) { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserSelf) GetEmailOk() (*string, bool) { + if o == nil || IsNil(o.Email) { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *UserSelf) HasEmail() bool { + if o != nil && !IsNil(o.Email) { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *UserSelf) SetEmail(v string) { + o.Email = &v +} + +// GetAvatar returns the Avatar field value +func (o *UserSelf) GetAvatar() string { + if o == nil { + var ret string + return ret + } + + return o.Avatar +} + +// GetAvatarOk returns a tuple with the Avatar field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetAvatarOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Avatar, true +} + +// SetAvatar sets field value +func (o *UserSelf) SetAvatar(v string) { + o.Avatar = v +} + +// GetUid returns the Uid field value +func (o *UserSelf) GetUid() string { + if o == nil { + var ret string + return ret + } + + return o.Uid +} + +// GetUidOk returns a tuple with the Uid field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Uid, true +} + +// SetUid sets field value +func (o *UserSelf) SetUid(v string) { + o.Uid = v +} + +// GetSettings returns the Settings field value +func (o *UserSelf) GetSettings() map[string]interface{} { + if o == nil { + var ret map[string]interface{} + return ret + } + + return o.Settings +} + +// GetSettingsOk returns a tuple with the Settings field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetSettingsOk() (map[string]interface{}, bool) { + if o == nil { + return map[string]interface{}{}, false + } + return o.Settings, true +} + +// SetSettings sets field value +func (o *UserSelf) SetSettings(v map[string]interface{}) { + o.Settings = v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *UserSelf) GetType() UserTypeEnum { + if o == nil || IsNil(o.Type) { + var ret UserTypeEnum + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserSelf) GetTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *UserSelf) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given UserTypeEnum and assigns it to the Type field. +func (o *UserSelf) SetType(v UserTypeEnum) { + o.Type = &v +} + +// GetSystemPermissions returns the SystemPermissions field value +func (o *UserSelf) GetSystemPermissions() []string { + if o == nil { + var ret []string + return ret + } + + return o.SystemPermissions +} + +// GetSystemPermissionsOk returns a tuple with the SystemPermissions field value +// and a boolean to check if the value has been set. +func (o *UserSelf) GetSystemPermissionsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.SystemPermissions, true +} + +// SetSystemPermissions sets field value +func (o *UserSelf) SetSystemPermissions(v []string) { + o.SystemPermissions = v +} + +func (o UserSelf) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSelf) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["username"] = o.Username + toSerialize["name"] = o.Name + toSerialize["is_active"] = o.IsActive + toSerialize["is_superuser"] = o.IsSuperuser + toSerialize["groups"] = o.Groups + toSerialize["roles"] = o.Roles + if !IsNil(o.Email) { + toSerialize["email"] = o.Email + } + toSerialize["avatar"] = o.Avatar + toSerialize["uid"] = o.Uid + toSerialize["settings"] = o.Settings + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + toSerialize["system_permissions"] = o.SystemPermissions + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSelf) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "username", + "name", + "is_active", + "is_superuser", + "groups", + "roles", + "avatar", + "uid", + "settings", + "system_permissions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSelf := _UserSelf{} + + err = json.Unmarshal(data, &varUserSelf) + + if err != nil { + return err + } + + *o = UserSelf(varUserSelf) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "username") + delete(additionalProperties, "name") + delete(additionalProperties, "is_active") + delete(additionalProperties, "is_superuser") + delete(additionalProperties, "groups") + delete(additionalProperties, "roles") + delete(additionalProperties, "email") + delete(additionalProperties, "avatar") + delete(additionalProperties, "uid") + delete(additionalProperties, "settings") + delete(additionalProperties, "type") + delete(additionalProperties, "system_permissions") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSelf struct { + value *UserSelf + isSet bool +} + +func (v NullableUserSelf) Get() *UserSelf { + return v.value +} + +func (v *NullableUserSelf) Set(val *UserSelf) { + v.value = val + v.isSet = true +} + +func (v NullableUserSelf) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSelf) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSelf(val *UserSelf) *NullableUserSelf { + return &NullableUserSelf{value: val, isSet: true} +} + +func (v NullableUserSelf) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSelf) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_self_groups.go b/packages/client-go/model_user_self_groups.go new file mode 100644 index 0000000000..c8429cf7df --- /dev/null +++ b/packages/client-go/model_user_self_groups.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSelfGroups type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSelfGroups{} + +// UserSelfGroups struct for UserSelfGroups +type UserSelfGroups struct { + Name string `json:"name"` + Pk string `json:"pk"` + AdditionalProperties map[string]interface{} +} + +type _UserSelfGroups UserSelfGroups + +// NewUserSelfGroups instantiates a new UserSelfGroups object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSelfGroups(name string, pk string) *UserSelfGroups { + this := UserSelfGroups{} + this.Name = name + this.Pk = pk + return &this +} + +// NewUserSelfGroupsWithDefaults instantiates a new UserSelfGroups object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSelfGroupsWithDefaults() *UserSelfGroups { + this := UserSelfGroups{} + return &this +} + +// GetName returns the Name field value +func (o *UserSelfGroups) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserSelfGroups) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserSelfGroups) SetName(v string) { + o.Name = v +} + +// GetPk returns the Pk field value +func (o *UserSelfGroups) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserSelfGroups) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserSelfGroups) SetPk(v string) { + o.Pk = v +} + +func (o UserSelfGroups) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSelfGroups) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["pk"] = o.Pk + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSelfGroups) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "pk", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSelfGroups := _UserSelfGroups{} + + err = json.Unmarshal(data, &varUserSelfGroups) + + if err != nil { + return err + } + + *o = UserSelfGroups(varUserSelfGroups) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSelfGroups struct { + value *UserSelfGroups + isSet bool +} + +func (v NullableUserSelfGroups) Get() *UserSelfGroups { + return v.value +} + +func (v *NullableUserSelfGroups) Set(val *UserSelfGroups) { + v.value = val + v.isSet = true +} + +func (v NullableUserSelfGroups) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSelfGroups) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSelfGroups(val *UserSelfGroups) *NullableUserSelfGroups { + return &NullableUserSelfGroups{value: val, isSet: true} +} + +func (v NullableUserSelfGroups) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSelfGroups) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_self_roles.go b/packages/client-go/model_user_self_roles.go new file mode 100644 index 0000000000..a02fc08b71 --- /dev/null +++ b/packages/client-go/model_user_self_roles.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSelfRoles type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSelfRoles{} + +// UserSelfRoles struct for UserSelfRoles +type UserSelfRoles struct { + Name string `json:"name"` + Pk string `json:"pk"` + AdditionalProperties map[string]interface{} +} + +type _UserSelfRoles UserSelfRoles + +// NewUserSelfRoles instantiates a new UserSelfRoles object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSelfRoles(name string, pk string) *UserSelfRoles { + this := UserSelfRoles{} + this.Name = name + this.Pk = pk + return &this +} + +// NewUserSelfRolesWithDefaults instantiates a new UserSelfRoles object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSelfRolesWithDefaults() *UserSelfRoles { + this := UserSelfRoles{} + return &this +} + +// GetName returns the Name field value +func (o *UserSelfRoles) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserSelfRoles) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserSelfRoles) SetName(v string) { + o.Name = v +} + +// GetPk returns the Pk field value +func (o *UserSelfRoles) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserSelfRoles) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserSelfRoles) SetPk(v string) { + o.Pk = v +} + +func (o UserSelfRoles) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSelfRoles) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["pk"] = o.Pk + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSelfRoles) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "pk", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSelfRoles := _UserSelfRoles{} + + err = json.Unmarshal(data, &varUserSelfRoles) + + if err != nil { + return err + } + + *o = UserSelfRoles(varUserSelfRoles) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSelfRoles struct { + value *UserSelfRoles + isSet bool +} + +func (v NullableUserSelfRoles) Get() *UserSelfRoles { + return v.value +} + +func (v *NullableUserSelfRoles) Set(val *UserSelfRoles) { + v.value = val + v.isSet = true +} + +func (v NullableUserSelfRoles) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSelfRoles) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSelfRoles(val *UserSelfRoles) *NullableUserSelfRoles { + return &NullableUserSelfRoles{value: val, isSet: true} +} + +func (v NullableUserSelfRoles) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSelfRoles) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_service_account_request.go b/packages/client-go/model_user_service_account_request.go new file mode 100644 index 0000000000..cdc6bd8036 --- /dev/null +++ b/packages/client-go/model_user_service_account_request.go @@ -0,0 +1,288 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserServiceAccountRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserServiceAccountRequest{} + +// UserServiceAccountRequest Payload to create a service account +type UserServiceAccountRequest struct { + Name string `json:"name"` + CreateGroup *bool `json:"create_group,omitempty"` + Expiring *bool `json:"expiring,omitempty"` + // If not provided, valid for 360 days + Expires *time.Time `json:"expires,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserServiceAccountRequest UserServiceAccountRequest + +// NewUserServiceAccountRequest instantiates a new UserServiceAccountRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserServiceAccountRequest(name string) *UserServiceAccountRequest { + this := UserServiceAccountRequest{} + this.Name = name + var createGroup bool = false + this.CreateGroup = &createGroup + var expiring bool = true + this.Expiring = &expiring + return &this +} + +// NewUserServiceAccountRequestWithDefaults instantiates a new UserServiceAccountRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserServiceAccountRequestWithDefaults() *UserServiceAccountRequest { + this := UserServiceAccountRequest{} + var createGroup bool = false + this.CreateGroup = &createGroup + var expiring bool = true + this.Expiring = &expiring + return &this +} + +// GetName returns the Name field value +func (o *UserServiceAccountRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserServiceAccountRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserServiceAccountRequest) SetName(v string) { + o.Name = v +} + +// GetCreateGroup returns the CreateGroup field value if set, zero value otherwise. +func (o *UserServiceAccountRequest) GetCreateGroup() bool { + if o == nil || IsNil(o.CreateGroup) { + var ret bool + return ret + } + return *o.CreateGroup +} + +// GetCreateGroupOk returns a tuple with the CreateGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserServiceAccountRequest) GetCreateGroupOk() (*bool, bool) { + if o == nil || IsNil(o.CreateGroup) { + return nil, false + } + return o.CreateGroup, true +} + +// HasCreateGroup returns a boolean if a field has been set. +func (o *UserServiceAccountRequest) HasCreateGroup() bool { + if o != nil && !IsNil(o.CreateGroup) { + return true + } + + return false +} + +// SetCreateGroup gets a reference to the given bool and assigns it to the CreateGroup field. +func (o *UserServiceAccountRequest) SetCreateGroup(v bool) { + o.CreateGroup = &v +} + +// GetExpiring returns the Expiring field value if set, zero value otherwise. +func (o *UserServiceAccountRequest) GetExpiring() bool { + if o == nil || IsNil(o.Expiring) { + var ret bool + return ret + } + return *o.Expiring +} + +// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserServiceAccountRequest) GetExpiringOk() (*bool, bool) { + if o == nil || IsNil(o.Expiring) { + return nil, false + } + return o.Expiring, true +} + +// HasExpiring returns a boolean if a field has been set. +func (o *UserServiceAccountRequest) HasExpiring() bool { + if o != nil && !IsNil(o.Expiring) { + return true + } + + return false +} + +// SetExpiring gets a reference to the given bool and assigns it to the Expiring field. +func (o *UserServiceAccountRequest) SetExpiring(v bool) { + o.Expiring = &v +} + +// GetExpires returns the Expires field value if set, zero value otherwise. +func (o *UserServiceAccountRequest) GetExpires() time.Time { + if o == nil || IsNil(o.Expires) { + var ret time.Time + return ret + } + return *o.Expires +} + +// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserServiceAccountRequest) GetExpiresOk() (*time.Time, bool) { + if o == nil || IsNil(o.Expires) { + return nil, false + } + return o.Expires, true +} + +// HasExpires returns a boolean if a field has been set. +func (o *UserServiceAccountRequest) HasExpires() bool { + if o != nil && !IsNil(o.Expires) { + return true + } + + return false +} + +// SetExpires gets a reference to the given time.Time and assigns it to the Expires field. +func (o *UserServiceAccountRequest) SetExpires(v time.Time) { + o.Expires = &v +} + +func (o UserServiceAccountRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserServiceAccountRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.CreateGroup) { + toSerialize["create_group"] = o.CreateGroup + } + if !IsNil(o.Expiring) { + toSerialize["expiring"] = o.Expiring + } + if !IsNil(o.Expires) { + toSerialize["expires"] = o.Expires + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserServiceAccountRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserServiceAccountRequest := _UserServiceAccountRequest{} + + err = json.Unmarshal(data, &varUserServiceAccountRequest) + + if err != nil { + return err + } + + *o = UserServiceAccountRequest(varUserServiceAccountRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "create_group") + delete(additionalProperties, "expiring") + delete(additionalProperties, "expires") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserServiceAccountRequest struct { + value *UserServiceAccountRequest + isSet bool +} + +func (v NullableUserServiceAccountRequest) Get() *UserServiceAccountRequest { + return v.value +} + +func (v *NullableUserServiceAccountRequest) Set(val *UserServiceAccountRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserServiceAccountRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserServiceAccountRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserServiceAccountRequest(val *UserServiceAccountRequest) *NullableUserServiceAccountRequest { + return &NullableUserServiceAccountRequest{value: val, isSet: true} +} + +func (v NullableUserServiceAccountRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserServiceAccountRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_service_account_response.go b/packages/client-go/model_user_service_account_response.go new file mode 100644 index 0000000000..a78097f471 --- /dev/null +++ b/packages/client-go/model_user_service_account_response.go @@ -0,0 +1,291 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserServiceAccountResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserServiceAccountResponse{} + +// UserServiceAccountResponse struct for UserServiceAccountResponse +type UserServiceAccountResponse struct { + Username string `json:"username"` + Token string `json:"token"` + UserUid string `json:"user_uid"` + UserPk int32 `json:"user_pk"` + GroupPk *string `json:"group_pk,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserServiceAccountResponse UserServiceAccountResponse + +// NewUserServiceAccountResponse instantiates a new UserServiceAccountResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserServiceAccountResponse(username string, token string, userUid string, userPk int32) *UserServiceAccountResponse { + this := UserServiceAccountResponse{} + this.Username = username + this.Token = token + this.UserUid = userUid + this.UserPk = userPk + return &this +} + +// NewUserServiceAccountResponseWithDefaults instantiates a new UserServiceAccountResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserServiceAccountResponseWithDefaults() *UserServiceAccountResponse { + this := UserServiceAccountResponse{} + return &this +} + +// GetUsername returns the Username field value +func (o *UserServiceAccountResponse) GetUsername() string { + if o == nil { + var ret string + return ret + } + + return o.Username +} + +// GetUsernameOk returns a tuple with the Username field value +// and a boolean to check if the value has been set. +func (o *UserServiceAccountResponse) GetUsernameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Username, true +} + +// SetUsername sets field value +func (o *UserServiceAccountResponse) SetUsername(v string) { + o.Username = v +} + +// GetToken returns the Token field value +func (o *UserServiceAccountResponse) GetToken() string { + if o == nil { + var ret string + return ret + } + + return o.Token +} + +// GetTokenOk returns a tuple with the Token field value +// and a boolean to check if the value has been set. +func (o *UserServiceAccountResponse) GetTokenOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Token, true +} + +// SetToken sets field value +func (o *UserServiceAccountResponse) SetToken(v string) { + o.Token = v +} + +// GetUserUid returns the UserUid field value +func (o *UserServiceAccountResponse) GetUserUid() string { + if o == nil { + var ret string + return ret + } + + return o.UserUid +} + +// GetUserUidOk returns a tuple with the UserUid field value +// and a boolean to check if the value has been set. +func (o *UserServiceAccountResponse) GetUserUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UserUid, true +} + +// SetUserUid sets field value +func (o *UserServiceAccountResponse) SetUserUid(v string) { + o.UserUid = v +} + +// GetUserPk returns the UserPk field value +func (o *UserServiceAccountResponse) GetUserPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.UserPk +} + +// GetUserPkOk returns a tuple with the UserPk field value +// and a boolean to check if the value has been set. +func (o *UserServiceAccountResponse) GetUserPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.UserPk, true +} + +// SetUserPk sets field value +func (o *UserServiceAccountResponse) SetUserPk(v int32) { + o.UserPk = v +} + +// GetGroupPk returns the GroupPk field value if set, zero value otherwise. +func (o *UserServiceAccountResponse) GetGroupPk() string { + if o == nil || IsNil(o.GroupPk) { + var ret string + return ret + } + return *o.GroupPk +} + +// GetGroupPkOk returns a tuple with the GroupPk field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserServiceAccountResponse) GetGroupPkOk() (*string, bool) { + if o == nil || IsNil(o.GroupPk) { + return nil, false + } + return o.GroupPk, true +} + +// HasGroupPk returns a boolean if a field has been set. +func (o *UserServiceAccountResponse) HasGroupPk() bool { + if o != nil && !IsNil(o.GroupPk) { + return true + } + + return false +} + +// SetGroupPk gets a reference to the given string and assigns it to the GroupPk field. +func (o *UserServiceAccountResponse) SetGroupPk(v string) { + o.GroupPk = &v +} + +func (o UserServiceAccountResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserServiceAccountResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["username"] = o.Username + toSerialize["token"] = o.Token + toSerialize["user_uid"] = o.UserUid + toSerialize["user_pk"] = o.UserPk + if !IsNil(o.GroupPk) { + toSerialize["group_pk"] = o.GroupPk + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserServiceAccountResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "username", + "token", + "user_uid", + "user_pk", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserServiceAccountResponse := _UserServiceAccountResponse{} + + err = json.Unmarshal(data, &varUserServiceAccountResponse) + + if err != nil { + return err + } + + *o = UserServiceAccountResponse(varUserServiceAccountResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "username") + delete(additionalProperties, "token") + delete(additionalProperties, "user_uid") + delete(additionalProperties, "user_pk") + delete(additionalProperties, "group_pk") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserServiceAccountResponse struct { + value *UserServiceAccountResponse + isSet bool +} + +func (v NullableUserServiceAccountResponse) Get() *UserServiceAccountResponse { + return v.value +} + +func (v *NullableUserServiceAccountResponse) Set(val *UserServiceAccountResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUserServiceAccountResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUserServiceAccountResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserServiceAccountResponse(val *UserServiceAccountResponse) *NullableUserServiceAccountResponse { + return &NullableUserServiceAccountResponse{value: val, isSet: true} +} + +func (v NullableUserServiceAccountResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserServiceAccountResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_setting.go b/packages/client-go/model_user_setting.go new file mode 100644 index 0000000000..8b48c1e0c0 --- /dev/null +++ b/packages/client-go/model_user_setting.go @@ -0,0 +1,299 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSetting type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSetting{} + +// UserSetting Serializer for User settings for stages and sources +type UserSetting struct { + ObjectUid string `json:"object_uid"` + Component string `json:"component"` + Title string `json:"title"` + ConfigureUrl *string `json:"configure_url,omitempty"` + IconUrl *string `json:"icon_url,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserSetting UserSetting + +// NewUserSetting instantiates a new UserSetting object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSetting(objectUid string, component string, title string) *UserSetting { + this := UserSetting{} + this.ObjectUid = objectUid + this.Component = component + this.Title = title + return &this +} + +// NewUserSettingWithDefaults instantiates a new UserSetting object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSettingWithDefaults() *UserSetting { + this := UserSetting{} + return &this +} + +// GetObjectUid returns the ObjectUid field value +func (o *UserSetting) GetObjectUid() string { + if o == nil { + var ret string + return ret + } + + return o.ObjectUid +} + +// GetObjectUidOk returns a tuple with the ObjectUid field value +// and a boolean to check if the value has been set. +func (o *UserSetting) GetObjectUidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ObjectUid, true +} + +// SetObjectUid sets field value +func (o *UserSetting) SetObjectUid(v string) { + o.ObjectUid = v +} + +// GetComponent returns the Component field value +func (o *UserSetting) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UserSetting) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UserSetting) SetComponent(v string) { + o.Component = v +} + +// GetTitle returns the Title field value +func (o *UserSetting) GetTitle() string { + if o == nil { + var ret string + return ret + } + + return o.Title +} + +// GetTitleOk returns a tuple with the Title field value +// and a boolean to check if the value has been set. +func (o *UserSetting) GetTitleOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Title, true +} + +// SetTitle sets field value +func (o *UserSetting) SetTitle(v string) { + o.Title = v +} + +// GetConfigureUrl returns the ConfigureUrl field value if set, zero value otherwise. +func (o *UserSetting) GetConfigureUrl() string { + if o == nil || IsNil(o.ConfigureUrl) { + var ret string + return ret + } + return *o.ConfigureUrl +} + +// GetConfigureUrlOk returns a tuple with the ConfigureUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserSetting) GetConfigureUrlOk() (*string, bool) { + if o == nil || IsNil(o.ConfigureUrl) { + return nil, false + } + return o.ConfigureUrl, true +} + +// HasConfigureUrl returns a boolean if a field has been set. +func (o *UserSetting) HasConfigureUrl() bool { + if o != nil && !IsNil(o.ConfigureUrl) { + return true + } + + return false +} + +// SetConfigureUrl gets a reference to the given string and assigns it to the ConfigureUrl field. +func (o *UserSetting) SetConfigureUrl(v string) { + o.ConfigureUrl = &v +} + +// GetIconUrl returns the IconUrl field value if set, zero value otherwise. +func (o *UserSetting) GetIconUrl() string { + if o == nil || IsNil(o.IconUrl) { + var ret string + return ret + } + return *o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserSetting) GetIconUrlOk() (*string, bool) { + if o == nil || IsNil(o.IconUrl) { + return nil, false + } + return o.IconUrl, true +} + +// HasIconUrl returns a boolean if a field has been set. +func (o *UserSetting) HasIconUrl() bool { + if o != nil && !IsNil(o.IconUrl) { + return true + } + + return false +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +func (o *UserSetting) SetIconUrl(v string) { + o.IconUrl = &v +} + +func (o UserSetting) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSetting) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["object_uid"] = o.ObjectUid + toSerialize["component"] = o.Component + toSerialize["title"] = o.Title + if !IsNil(o.ConfigureUrl) { + toSerialize["configure_url"] = o.ConfigureUrl + } + if !IsNil(o.IconUrl) { + toSerialize["icon_url"] = o.IconUrl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSetting) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "object_uid", + "component", + "title", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSetting := _UserSetting{} + + err = json.Unmarshal(data, &varUserSetting) + + if err != nil { + return err + } + + *o = UserSetting(varUserSetting) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "object_uid") + delete(additionalProperties, "component") + delete(additionalProperties, "title") + delete(additionalProperties, "configure_url") + delete(additionalProperties, "icon_url") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSetting struct { + value *UserSetting + isSet bool +} + +func (v NullableUserSetting) Get() *UserSetting { + return v.value +} + +func (v *NullableUserSetting) Set(val *UserSetting) { + v.value = val + v.isSet = true +} + +func (v NullableUserSetting) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSetting) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSetting(val *UserSetting) *NullableUserSetting { + return &NullableUserSetting{value: val, isSet: true} +} + +func (v NullableUserSetting) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSetting) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_source_connection.go b/packages/client-go/model_user_source_connection.go new file mode 100644 index 0000000000..12b00a5929 --- /dev/null +++ b/packages/client-go/model_user_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSourceConnection{} + +// UserSourceConnection User source connection +type UserSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserSourceConnection UserSourceConnection + +// NewUserSourceConnection instantiates a new UserSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserSourceConnection { + this := UserSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserSourceConnectionWithDefaults instantiates a new UserSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSourceConnectionWithDefaults() *UserSourceConnection { + this := UserSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSourceConnection := _UserSourceConnection{} + + err = json.Unmarshal(data, &varUserSourceConnection) + + if err != nil { + return err + } + + *o = UserSourceConnection(varUserSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSourceConnection struct { + value *UserSourceConnection + isSet bool +} + +func (v NullableUserSourceConnection) Get() *UserSourceConnection { + return v.value +} + +func (v *NullableUserSourceConnection) Set(val *UserSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSourceConnection(val *UserSourceConnection) *NullableUserSourceConnection { + return &NullableUserSourceConnection{value: val, isSet: true} +} + +func (v NullableUserSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_source_connection_request.go b/packages/client-go/model_user_source_connection_request.go new file mode 100644 index 0000000000..c650287eff --- /dev/null +++ b/packages/client-go/model_user_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserSourceConnectionRequest{} + +// UserSourceConnectionRequest User source connection +type UserSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _UserSourceConnectionRequest UserSourceConnectionRequest + +// NewUserSourceConnectionRequest instantiates a new UserSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserSourceConnectionRequest(user int32, source string, identifier string) *UserSourceConnectionRequest { + this := UserSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserSourceConnectionRequestWithDefaults instantiates a new UserSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserSourceConnectionRequestWithDefaults() *UserSourceConnectionRequest { + this := UserSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o UserSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserSourceConnectionRequest := _UserSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserSourceConnectionRequest(varUserSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserSourceConnectionRequest struct { + value *UserSourceConnectionRequest + isSet bool +} + +func (v NullableUserSourceConnectionRequest) Get() *UserSourceConnectionRequest { + return v.value +} + +func (v *NullableUserSourceConnectionRequest) Set(val *UserSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserSourceConnectionRequest(val *UserSourceConnectionRequest) *NullableUserSourceConnectionRequest { + return &NullableUserSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_telegram_source_connection.go b/packages/client-go/model_user_telegram_source_connection.go new file mode 100644 index 0000000000..a31d9e0b96 --- /dev/null +++ b/packages/client-go/model_user_telegram_source_connection.go @@ -0,0 +1,342 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the UserTelegramSourceConnection type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserTelegramSourceConnection{} + +// UserTelegramSourceConnection User source connection +type UserTelegramSourceConnection struct { + Pk int32 `json:"pk"` + User int32 `json:"user"` + Source string `json:"source"` + SourceObj Source `json:"source_obj"` + Identifier string `json:"identifier"` + Created time.Time `json:"created"` + LastUpdated time.Time `json:"last_updated"` + AdditionalProperties map[string]interface{} +} + +type _UserTelegramSourceConnection UserTelegramSourceConnection + +// NewUserTelegramSourceConnection instantiates a new UserTelegramSourceConnection object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserTelegramSourceConnection(pk int32, user int32, source string, sourceObj Source, identifier string, created time.Time, lastUpdated time.Time) *UserTelegramSourceConnection { + this := UserTelegramSourceConnection{} + this.Pk = pk + this.User = user + this.Source = source + this.SourceObj = sourceObj + this.Identifier = identifier + this.Created = created + this.LastUpdated = lastUpdated + return &this +} + +// NewUserTelegramSourceConnectionWithDefaults instantiates a new UserTelegramSourceConnection object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserTelegramSourceConnectionWithDefaults() *UserTelegramSourceConnection { + this := UserTelegramSourceConnection{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserTelegramSourceConnection) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserTelegramSourceConnection) SetPk(v int32) { + o.Pk = v +} + +// GetUser returns the User field value +func (o *UserTelegramSourceConnection) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserTelegramSourceConnection) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserTelegramSourceConnection) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserTelegramSourceConnection) SetSource(v string) { + o.Source = v +} + +// GetSourceObj returns the SourceObj field value +func (o *UserTelegramSourceConnection) GetSourceObj() Source { + if o == nil { + var ret Source + return ret + } + + return o.SourceObj +} + +// GetSourceObjOk returns a tuple with the SourceObj field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetSourceObjOk() (*Source, bool) { + if o == nil { + return nil, false + } + return &o.SourceObj, true +} + +// SetSourceObj sets field value +func (o *UserTelegramSourceConnection) SetSourceObj(v Source) { + o.SourceObj = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserTelegramSourceConnection) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserTelegramSourceConnection) SetIdentifier(v string) { + o.Identifier = v +} + +// GetCreated returns the Created field value +func (o *UserTelegramSourceConnection) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *UserTelegramSourceConnection) SetCreated(v time.Time) { + o.Created = v +} + +// GetLastUpdated returns the LastUpdated field value +func (o *UserTelegramSourceConnection) GetLastUpdated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.LastUpdated +} + +// GetLastUpdatedOk returns a tuple with the LastUpdated field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnection) GetLastUpdatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.LastUpdated, true +} + +// SetLastUpdated sets field value +func (o *UserTelegramSourceConnection) SetLastUpdated(v time.Time) { + o.LastUpdated = v +} + +func (o UserTelegramSourceConnection) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserTelegramSourceConnection) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["source_obj"] = o.SourceObj + toSerialize["identifier"] = o.Identifier + toSerialize["created"] = o.Created + toSerialize["last_updated"] = o.LastUpdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserTelegramSourceConnection) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "user", + "source", + "source_obj", + "identifier", + "created", + "last_updated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserTelegramSourceConnection := _UserTelegramSourceConnection{} + + err = json.Unmarshal(data, &varUserTelegramSourceConnection) + + if err != nil { + return err + } + + *o = UserTelegramSourceConnection(varUserTelegramSourceConnection) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "source_obj") + delete(additionalProperties, "identifier") + delete(additionalProperties, "created") + delete(additionalProperties, "last_updated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserTelegramSourceConnection struct { + value *UserTelegramSourceConnection + isSet bool +} + +func (v NullableUserTelegramSourceConnection) Get() *UserTelegramSourceConnection { + return v.value +} + +func (v *NullableUserTelegramSourceConnection) Set(val *UserTelegramSourceConnection) { + v.value = val + v.isSet = true +} + +func (v NullableUserTelegramSourceConnection) IsSet() bool { + return v.isSet +} + +func (v *NullableUserTelegramSourceConnection) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserTelegramSourceConnection(val *UserTelegramSourceConnection) *NullableUserTelegramSourceConnection { + return &NullableUserTelegramSourceConnection{value: val, isSet: true} +} + +func (v NullableUserTelegramSourceConnection) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserTelegramSourceConnection) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_telegram_source_connection_request.go b/packages/client-go/model_user_telegram_source_connection_request.go new file mode 100644 index 0000000000..252d7f5568 --- /dev/null +++ b/packages/client-go/model_user_telegram_source_connection_request.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserTelegramSourceConnectionRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserTelegramSourceConnectionRequest{} + +// UserTelegramSourceConnectionRequest User source connection +type UserTelegramSourceConnectionRequest struct { + User int32 `json:"user"` + Source string `json:"source"` + Identifier string `json:"identifier"` + AdditionalProperties map[string]interface{} +} + +type _UserTelegramSourceConnectionRequest UserTelegramSourceConnectionRequest + +// NewUserTelegramSourceConnectionRequest instantiates a new UserTelegramSourceConnectionRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserTelegramSourceConnectionRequest(user int32, source string, identifier string) *UserTelegramSourceConnectionRequest { + this := UserTelegramSourceConnectionRequest{} + this.User = user + this.Source = source + this.Identifier = identifier + return &this +} + +// NewUserTelegramSourceConnectionRequestWithDefaults instantiates a new UserTelegramSourceConnectionRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserTelegramSourceConnectionRequestWithDefaults() *UserTelegramSourceConnectionRequest { + this := UserTelegramSourceConnectionRequest{} + return &this +} + +// GetUser returns the User field value +func (o *UserTelegramSourceConnectionRequest) GetUser() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnectionRequest) GetUserOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *UserTelegramSourceConnectionRequest) SetUser(v int32) { + o.User = v +} + +// GetSource returns the Source field value +func (o *UserTelegramSourceConnectionRequest) GetSource() string { + if o == nil { + var ret string + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnectionRequest) GetSourceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *UserTelegramSourceConnectionRequest) SetSource(v string) { + o.Source = v +} + +// GetIdentifier returns the Identifier field value +func (o *UserTelegramSourceConnectionRequest) GetIdentifier() string { + if o == nil { + var ret string + return ret + } + + return o.Identifier +} + +// GetIdentifierOk returns a tuple with the Identifier field value +// and a boolean to check if the value has been set. +func (o *UserTelegramSourceConnectionRequest) GetIdentifierOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Identifier, true +} + +// SetIdentifier sets field value +func (o *UserTelegramSourceConnectionRequest) SetIdentifier(v string) { + o.Identifier = v +} + +func (o UserTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserTelegramSourceConnectionRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["user"] = o.User + toSerialize["source"] = o.Source + toSerialize["identifier"] = o.Identifier + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserTelegramSourceConnectionRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "user", + "source", + "identifier", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserTelegramSourceConnectionRequest := _UserTelegramSourceConnectionRequest{} + + err = json.Unmarshal(data, &varUserTelegramSourceConnectionRequest) + + if err != nil { + return err + } + + *o = UserTelegramSourceConnectionRequest(varUserTelegramSourceConnectionRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "user") + delete(additionalProperties, "source") + delete(additionalProperties, "identifier") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserTelegramSourceConnectionRequest struct { + value *UserTelegramSourceConnectionRequest + isSet bool +} + +func (v NullableUserTelegramSourceConnectionRequest) Get() *UserTelegramSourceConnectionRequest { + return v.value +} + +func (v *NullableUserTelegramSourceConnectionRequest) Set(val *UserTelegramSourceConnectionRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserTelegramSourceConnectionRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserTelegramSourceConnectionRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserTelegramSourceConnectionRequest(val *UserTelegramSourceConnectionRequest) *NullableUserTelegramSourceConnectionRequest { + return &NullableUserTelegramSourceConnectionRequest{value: val, isSet: true} +} + +func (v NullableUserTelegramSourceConnectionRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserTelegramSourceConnectionRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_type_enum.go b/packages/client-go/model_user_type_enum.go new file mode 100644 index 0000000000..c3d0f350b9 --- /dev/null +++ b/packages/client-go/model_user_type_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserTypeEnum the model 'UserTypeEnum' +type UserTypeEnum string + +// List of UserTypeEnum +const ( + USERTYPEENUM_INTERNAL UserTypeEnum = "internal" + USERTYPEENUM_EXTERNAL UserTypeEnum = "external" + USERTYPEENUM_SERVICE_ACCOUNT UserTypeEnum = "service_account" + USERTYPEENUM_INTERNAL_SERVICE_ACCOUNT UserTypeEnum = "internal_service_account" +) + +// All allowed values of UserTypeEnum enum +var AllowedUserTypeEnumEnumValues = []UserTypeEnum{ + "internal", + "external", + "service_account", + "internal_service_account", +} + +func (v *UserTypeEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserTypeEnum(value) + for _, existing := range AllowedUserTypeEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserTypeEnum", value) +} + +// NewUserTypeEnumFromValue returns a pointer to a valid UserTypeEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserTypeEnumFromValue(v string) (*UserTypeEnum, error) { + ev := UserTypeEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserTypeEnum: valid values are %v", v, AllowedUserTypeEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserTypeEnum) IsValid() bool { + for _, existing := range AllowedUserTypeEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserTypeEnum value +func (v UserTypeEnum) Ptr() *UserTypeEnum { + return &v +} + +type NullableUserTypeEnum struct { + value *UserTypeEnum + isSet bool +} + +func (v NullableUserTypeEnum) Get() *UserTypeEnum { + return v.value +} + +func (v *NullableUserTypeEnum) Set(val *UserTypeEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserTypeEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserTypeEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserTypeEnum(val *UserTypeEnum) *NullableUserTypeEnum { + return &NullableUserTypeEnum{value: val, isSet: true} +} + +func (v NullableUserTypeEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserTypeEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_verification_enum.go b/packages/client-go/model_user_verification_enum.go new file mode 100644 index 0000000000..6167bb1fb9 --- /dev/null +++ b/packages/client-go/model_user_verification_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// UserVerificationEnum the model 'UserVerificationEnum' +type UserVerificationEnum string + +// List of UserVerificationEnum +const ( + USERVERIFICATIONENUM_REQUIRED UserVerificationEnum = "required" + USERVERIFICATIONENUM_PREFERRED UserVerificationEnum = "preferred" + USERVERIFICATIONENUM_DISCOURAGED UserVerificationEnum = "discouraged" +) + +// All allowed values of UserVerificationEnum enum +var AllowedUserVerificationEnumEnumValues = []UserVerificationEnum{ + "required", + "preferred", + "discouraged", +} + +func (v *UserVerificationEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := UserVerificationEnum(value) + for _, existing := range AllowedUserVerificationEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid UserVerificationEnum", value) +} + +// NewUserVerificationEnumFromValue returns a pointer to a valid UserVerificationEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewUserVerificationEnumFromValue(v string) (*UserVerificationEnum, error) { + ev := UserVerificationEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for UserVerificationEnum: valid values are %v", v, AllowedUserVerificationEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v UserVerificationEnum) IsValid() bool { + for _, existing := range AllowedUserVerificationEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to UserVerificationEnum value +func (v UserVerificationEnum) Ptr() *UserVerificationEnum { + return &v +} + +type NullableUserVerificationEnum struct { + value *UserVerificationEnum + isSet bool +} + +func (v NullableUserVerificationEnum) Get() *UserVerificationEnum { + return v.value +} + +func (v *NullableUserVerificationEnum) Set(val *UserVerificationEnum) { + v.value = val + v.isSet = true +} + +func (v NullableUserVerificationEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableUserVerificationEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserVerificationEnum(val *UserVerificationEnum) *NullableUserVerificationEnum { + return &NullableUserVerificationEnum{value: val, isSet: true} +} + +func (v NullableUserVerificationEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserVerificationEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_write_stage.go b/packages/client-go/model_user_write_stage.go new file mode 100644 index 0000000000..1302db95dc --- /dev/null +++ b/packages/client-go/model_user_write_stage.go @@ -0,0 +1,543 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserWriteStage type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserWriteStage{} + +// UserWriteStage UserWriteStage Serializer +type UserWriteStage struct { + Pk string `json:"pk"` + Name string `json:"name"` + // Get object type so that we know how to edit the object + Component string `json:"component"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + FlowSet []FlowSet `json:"flow_set"` + UserCreationMode *UserCreationModeEnum `json:"user_creation_mode,omitempty"` + // When set, newly created users are inactive and cannot login. + CreateUsersAsInactive *bool `json:"create_users_as_inactive,omitempty"` + // Optionally add newly created users to this group. + CreateUsersGroup NullableString `json:"create_users_group,omitempty"` + UserType *UserTypeEnum `json:"user_type,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserWriteStage UserWriteStage + +// NewUserWriteStage instantiates a new UserWriteStage object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserWriteStage(pk string, name string, component string, verboseName string, verboseNamePlural string, metaModelName string, flowSet []FlowSet) *UserWriteStage { + this := UserWriteStage{} + this.Pk = pk + this.Name = name + this.Component = component + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.FlowSet = flowSet + return &this +} + +// NewUserWriteStageWithDefaults instantiates a new UserWriteStage object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWriteStageWithDefaults() *UserWriteStage { + this := UserWriteStage{} + return &this +} + +// GetPk returns the Pk field value +func (o *UserWriteStage) GetPk() string { + if o == nil { + var ret string + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetPkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *UserWriteStage) SetPk(v string) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *UserWriteStage) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserWriteStage) SetName(v string) { + o.Name = v +} + +// GetComponent returns the Component field value +func (o *UserWriteStage) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *UserWriteStage) SetComponent(v string) { + o.Component = v +} + +// GetVerboseName returns the VerboseName field value +func (o *UserWriteStage) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *UserWriteStage) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *UserWriteStage) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *UserWriteStage) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *UserWriteStage) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *UserWriteStage) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetFlowSet returns the FlowSet field value +func (o *UserWriteStage) GetFlowSet() []FlowSet { + if o == nil { + var ret []FlowSet + return ret + } + + return o.FlowSet +} + +// GetFlowSetOk returns a tuple with the FlowSet field value +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetFlowSetOk() ([]FlowSet, bool) { + if o == nil { + return nil, false + } + return o.FlowSet, true +} + +// SetFlowSet sets field value +func (o *UserWriteStage) SetFlowSet(v []FlowSet) { + o.FlowSet = v +} + +// GetUserCreationMode returns the UserCreationMode field value if set, zero value otherwise. +func (o *UserWriteStage) GetUserCreationMode() UserCreationModeEnum { + if o == nil || IsNil(o.UserCreationMode) { + var ret UserCreationModeEnum + return ret + } + return *o.UserCreationMode +} + +// GetUserCreationModeOk returns a tuple with the UserCreationMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetUserCreationModeOk() (*UserCreationModeEnum, bool) { + if o == nil || IsNil(o.UserCreationMode) { + return nil, false + } + return o.UserCreationMode, true +} + +// HasUserCreationMode returns a boolean if a field has been set. +func (o *UserWriteStage) HasUserCreationMode() bool { + if o != nil && !IsNil(o.UserCreationMode) { + return true + } + + return false +} + +// SetUserCreationMode gets a reference to the given UserCreationModeEnum and assigns it to the UserCreationMode field. +func (o *UserWriteStage) SetUserCreationMode(v UserCreationModeEnum) { + o.UserCreationMode = &v +} + +// GetCreateUsersAsInactive returns the CreateUsersAsInactive field value if set, zero value otherwise. +func (o *UserWriteStage) GetCreateUsersAsInactive() bool { + if o == nil || IsNil(o.CreateUsersAsInactive) { + var ret bool + return ret + } + return *o.CreateUsersAsInactive +} + +// GetCreateUsersAsInactiveOk returns a tuple with the CreateUsersAsInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetCreateUsersAsInactiveOk() (*bool, bool) { + if o == nil || IsNil(o.CreateUsersAsInactive) { + return nil, false + } + return o.CreateUsersAsInactive, true +} + +// HasCreateUsersAsInactive returns a boolean if a field has been set. +func (o *UserWriteStage) HasCreateUsersAsInactive() bool { + if o != nil && !IsNil(o.CreateUsersAsInactive) { + return true + } + + return false +} + +// SetCreateUsersAsInactive gets a reference to the given bool and assigns it to the CreateUsersAsInactive field. +func (o *UserWriteStage) SetCreateUsersAsInactive(v bool) { + o.CreateUsersAsInactive = &v +} + +// GetCreateUsersGroup returns the CreateUsersGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserWriteStage) GetCreateUsersGroup() string { + if o == nil || IsNil(o.CreateUsersGroup.Get()) { + var ret string + return ret + } + return *o.CreateUsersGroup.Get() +} + +// GetCreateUsersGroupOk returns a tuple with the CreateUsersGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserWriteStage) GetCreateUsersGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreateUsersGroup.Get(), o.CreateUsersGroup.IsSet() +} + +// HasCreateUsersGroup returns a boolean if a field has been set. +func (o *UserWriteStage) HasCreateUsersGroup() bool { + if o != nil && o.CreateUsersGroup.IsSet() { + return true + } + + return false +} + +// SetCreateUsersGroup gets a reference to the given NullableString and assigns it to the CreateUsersGroup field. +func (o *UserWriteStage) SetCreateUsersGroup(v string) { + o.CreateUsersGroup.Set(&v) +} + +// SetCreateUsersGroupNil sets the value for CreateUsersGroup to be an explicit nil +func (o *UserWriteStage) SetCreateUsersGroupNil() { + o.CreateUsersGroup.Set(nil) +} + +// UnsetCreateUsersGroup ensures that no value is present for CreateUsersGroup, not even an explicit nil +func (o *UserWriteStage) UnsetCreateUsersGroup() { + o.CreateUsersGroup.Unset() +} + +// GetUserType returns the UserType field value if set, zero value otherwise. +func (o *UserWriteStage) GetUserType() UserTypeEnum { + if o == nil || IsNil(o.UserType) { + var ret UserTypeEnum + return ret + } + return *o.UserType +} + +// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetUserTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.UserType) { + return nil, false + } + return o.UserType, true +} + +// HasUserType returns a boolean if a field has been set. +func (o *UserWriteStage) HasUserType() bool { + if o != nil && !IsNil(o.UserType) { + return true + } + + return false +} + +// SetUserType gets a reference to the given UserTypeEnum and assigns it to the UserType field. +func (o *UserWriteStage) SetUserType(v UserTypeEnum) { + o.UserType = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *UserWriteStage) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStage) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *UserWriteStage) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *UserWriteStage) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +func (o UserWriteStage) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserWriteStage) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["component"] = o.Component + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["flow_set"] = o.FlowSet + if !IsNil(o.UserCreationMode) { + toSerialize["user_creation_mode"] = o.UserCreationMode + } + if !IsNil(o.CreateUsersAsInactive) { + toSerialize["create_users_as_inactive"] = o.CreateUsersAsInactive + } + if o.CreateUsersGroup.IsSet() { + toSerialize["create_users_group"] = o.CreateUsersGroup.Get() + } + if !IsNil(o.UserType) { + toSerialize["user_type"] = o.UserType + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserWriteStage) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "component", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "flow_set", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserWriteStage := _UserWriteStage{} + + err = json.Unmarshal(data, &varUserWriteStage) + + if err != nil { + return err + } + + *o = UserWriteStage(varUserWriteStage) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "component") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "flow_set") + delete(additionalProperties, "user_creation_mode") + delete(additionalProperties, "create_users_as_inactive") + delete(additionalProperties, "create_users_group") + delete(additionalProperties, "user_type") + delete(additionalProperties, "user_path_template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserWriteStage struct { + value *UserWriteStage + isSet bool +} + +func (v NullableUserWriteStage) Get() *UserWriteStage { + return v.value +} + +func (v *NullableUserWriteStage) Set(val *UserWriteStage) { + v.value = val + v.isSet = true +} + +func (v NullableUserWriteStage) IsSet() bool { + return v.isSet +} + +func (v *NullableUserWriteStage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserWriteStage(val *UserWriteStage) *NullableUserWriteStage { + return &NullableUserWriteStage{value: val, isSet: true} +} + +func (v NullableUserWriteStage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserWriteStage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_user_write_stage_request.go b/packages/client-go/model_user_write_stage_request.go new file mode 100644 index 0000000000..80345ed545 --- /dev/null +++ b/packages/client-go/model_user_write_stage_request.go @@ -0,0 +1,365 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the UserWriteStageRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UserWriteStageRequest{} + +// UserWriteStageRequest UserWriteStage Serializer +type UserWriteStageRequest struct { + Name string `json:"name"` + UserCreationMode *UserCreationModeEnum `json:"user_creation_mode,omitempty"` + // When set, newly created users are inactive and cannot login. + CreateUsersAsInactive *bool `json:"create_users_as_inactive,omitempty"` + // Optionally add newly created users to this group. + CreateUsersGroup NullableString `json:"create_users_group,omitempty"` + UserType *UserTypeEnum `json:"user_type,omitempty"` + UserPathTemplate *string `json:"user_path_template,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _UserWriteStageRequest UserWriteStageRequest + +// NewUserWriteStageRequest instantiates a new UserWriteStageRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUserWriteStageRequest(name string) *UserWriteStageRequest { + this := UserWriteStageRequest{} + this.Name = name + return &this +} + +// NewUserWriteStageRequestWithDefaults instantiates a new UserWriteStageRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUserWriteStageRequestWithDefaults() *UserWriteStageRequest { + this := UserWriteStageRequest{} + return &this +} + +// GetName returns the Name field value +func (o *UserWriteStageRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UserWriteStageRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *UserWriteStageRequest) SetName(v string) { + o.Name = v +} + +// GetUserCreationMode returns the UserCreationMode field value if set, zero value otherwise. +func (o *UserWriteStageRequest) GetUserCreationMode() UserCreationModeEnum { + if o == nil || IsNil(o.UserCreationMode) { + var ret UserCreationModeEnum + return ret + } + return *o.UserCreationMode +} + +// GetUserCreationModeOk returns a tuple with the UserCreationMode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStageRequest) GetUserCreationModeOk() (*UserCreationModeEnum, bool) { + if o == nil || IsNil(o.UserCreationMode) { + return nil, false + } + return o.UserCreationMode, true +} + +// HasUserCreationMode returns a boolean if a field has been set. +func (o *UserWriteStageRequest) HasUserCreationMode() bool { + if o != nil && !IsNil(o.UserCreationMode) { + return true + } + + return false +} + +// SetUserCreationMode gets a reference to the given UserCreationModeEnum and assigns it to the UserCreationMode field. +func (o *UserWriteStageRequest) SetUserCreationMode(v UserCreationModeEnum) { + o.UserCreationMode = &v +} + +// GetCreateUsersAsInactive returns the CreateUsersAsInactive field value if set, zero value otherwise. +func (o *UserWriteStageRequest) GetCreateUsersAsInactive() bool { + if o == nil || IsNil(o.CreateUsersAsInactive) { + var ret bool + return ret + } + return *o.CreateUsersAsInactive +} + +// GetCreateUsersAsInactiveOk returns a tuple with the CreateUsersAsInactive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStageRequest) GetCreateUsersAsInactiveOk() (*bool, bool) { + if o == nil || IsNil(o.CreateUsersAsInactive) { + return nil, false + } + return o.CreateUsersAsInactive, true +} + +// HasCreateUsersAsInactive returns a boolean if a field has been set. +func (o *UserWriteStageRequest) HasCreateUsersAsInactive() bool { + if o != nil && !IsNil(o.CreateUsersAsInactive) { + return true + } + + return false +} + +// SetCreateUsersAsInactive gets a reference to the given bool and assigns it to the CreateUsersAsInactive field. +func (o *UserWriteStageRequest) SetCreateUsersAsInactive(v bool) { + o.CreateUsersAsInactive = &v +} + +// GetCreateUsersGroup returns the CreateUsersGroup field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UserWriteStageRequest) GetCreateUsersGroup() string { + if o == nil || IsNil(o.CreateUsersGroup.Get()) { + var ret string + return ret + } + return *o.CreateUsersGroup.Get() +} + +// GetCreateUsersGroupOk returns a tuple with the CreateUsersGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UserWriteStageRequest) GetCreateUsersGroupOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreateUsersGroup.Get(), o.CreateUsersGroup.IsSet() +} + +// HasCreateUsersGroup returns a boolean if a field has been set. +func (o *UserWriteStageRequest) HasCreateUsersGroup() bool { + if o != nil && o.CreateUsersGroup.IsSet() { + return true + } + + return false +} + +// SetCreateUsersGroup gets a reference to the given NullableString and assigns it to the CreateUsersGroup field. +func (o *UserWriteStageRequest) SetCreateUsersGroup(v string) { + o.CreateUsersGroup.Set(&v) +} + +// SetCreateUsersGroupNil sets the value for CreateUsersGroup to be an explicit nil +func (o *UserWriteStageRequest) SetCreateUsersGroupNil() { + o.CreateUsersGroup.Set(nil) +} + +// UnsetCreateUsersGroup ensures that no value is present for CreateUsersGroup, not even an explicit nil +func (o *UserWriteStageRequest) UnsetCreateUsersGroup() { + o.CreateUsersGroup.Unset() +} + +// GetUserType returns the UserType field value if set, zero value otherwise. +func (o *UserWriteStageRequest) GetUserType() UserTypeEnum { + if o == nil || IsNil(o.UserType) { + var ret UserTypeEnum + return ret + } + return *o.UserType +} + +// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStageRequest) GetUserTypeOk() (*UserTypeEnum, bool) { + if o == nil || IsNil(o.UserType) { + return nil, false + } + return o.UserType, true +} + +// HasUserType returns a boolean if a field has been set. +func (o *UserWriteStageRequest) HasUserType() bool { + if o != nil && !IsNil(o.UserType) { + return true + } + + return false +} + +// SetUserType gets a reference to the given UserTypeEnum and assigns it to the UserType field. +func (o *UserWriteStageRequest) SetUserType(v UserTypeEnum) { + o.UserType = &v +} + +// GetUserPathTemplate returns the UserPathTemplate field value if set, zero value otherwise. +func (o *UserWriteStageRequest) GetUserPathTemplate() string { + if o == nil || IsNil(o.UserPathTemplate) { + var ret string + return ret + } + return *o.UserPathTemplate +} + +// GetUserPathTemplateOk returns a tuple with the UserPathTemplate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UserWriteStageRequest) GetUserPathTemplateOk() (*string, bool) { + if o == nil || IsNil(o.UserPathTemplate) { + return nil, false + } + return o.UserPathTemplate, true +} + +// HasUserPathTemplate returns a boolean if a field has been set. +func (o *UserWriteStageRequest) HasUserPathTemplate() bool { + if o != nil && !IsNil(o.UserPathTemplate) { + return true + } + + return false +} + +// SetUserPathTemplate gets a reference to the given string and assigns it to the UserPathTemplate field. +func (o *UserWriteStageRequest) SetUserPathTemplate(v string) { + o.UserPathTemplate = &v +} + +func (o UserWriteStageRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UserWriteStageRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if !IsNil(o.UserCreationMode) { + toSerialize["user_creation_mode"] = o.UserCreationMode + } + if !IsNil(o.CreateUsersAsInactive) { + toSerialize["create_users_as_inactive"] = o.CreateUsersAsInactive + } + if o.CreateUsersGroup.IsSet() { + toSerialize["create_users_group"] = o.CreateUsersGroup.Get() + } + if !IsNil(o.UserType) { + toSerialize["user_type"] = o.UserType + } + if !IsNil(o.UserPathTemplate) { + toSerialize["user_path_template"] = o.UserPathTemplate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *UserWriteStageRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUserWriteStageRequest := _UserWriteStageRequest{} + + err = json.Unmarshal(data, &varUserWriteStageRequest) + + if err != nil { + return err + } + + *o = UserWriteStageRequest(varUserWriteStageRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "user_creation_mode") + delete(additionalProperties, "create_users_as_inactive") + delete(additionalProperties, "create_users_group") + delete(additionalProperties, "user_type") + delete(additionalProperties, "user_path_template") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableUserWriteStageRequest struct { + value *UserWriteStageRequest + isSet bool +} + +func (v NullableUserWriteStageRequest) Get() *UserWriteStageRequest { + return v.value +} + +func (v *NullableUserWriteStageRequest) Set(val *UserWriteStageRequest) { + v.value = val + v.isSet = true +} + +func (v NullableUserWriteStageRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableUserWriteStageRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUserWriteStageRequest(val *UserWriteStageRequest) *NullableUserWriteStageRequest { + return &NullableUserWriteStageRequest{value: val, isSet: true} +} + +func (v NullableUserWriteStageRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUserWriteStageRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_validation_error.go b/packages/client-go/model_validation_error.go new file mode 100644 index 0000000000..c876a501f5 --- /dev/null +++ b/packages/client-go/model_validation_error.go @@ -0,0 +1,191 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// checks if the ValidationError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ValidationError{} + +// ValidationError Validation Error +type ValidationError struct { + NonFieldErrors []string `json:"non_field_errors,omitempty"` + Code *string `json:"code,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ValidationError ValidationError + +// NewValidationError instantiates a new ValidationError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewValidationError() *ValidationError { + this := ValidationError{} + return &this +} + +// NewValidationErrorWithDefaults instantiates a new ValidationError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewValidationErrorWithDefaults() *ValidationError { + this := ValidationError{} + return &this +} + +// GetNonFieldErrors returns the NonFieldErrors field value if set, zero value otherwise. +func (o *ValidationError) GetNonFieldErrors() []string { + if o == nil || IsNil(o.NonFieldErrors) { + var ret []string + return ret + } + return o.NonFieldErrors +} + +// GetNonFieldErrorsOk returns a tuple with the NonFieldErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetNonFieldErrorsOk() ([]string, bool) { + if o == nil || IsNil(o.NonFieldErrors) { + return nil, false + } + return o.NonFieldErrors, true +} + +// HasNonFieldErrors returns a boolean if a field has been set. +func (o *ValidationError) HasNonFieldErrors() bool { + if o != nil && !IsNil(o.NonFieldErrors) { + return true + } + + return false +} + +// SetNonFieldErrors gets a reference to the given []string and assigns it to the NonFieldErrors field. +func (o *ValidationError) SetNonFieldErrors(v []string) { + o.NonFieldErrors = v +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *ValidationError) GetCode() string { + if o == nil || IsNil(o.Code) { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ValidationError) GetCodeOk() (*string, bool) { + if o == nil || IsNil(o.Code) { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ValidationError) HasCode() bool { + if o != nil && !IsNil(o.Code) { + return true + } + + return false +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *ValidationError) SetCode(v string) { + o.Code = &v +} + +func (o ValidationError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ValidationError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NonFieldErrors) { + toSerialize["non_field_errors"] = o.NonFieldErrors + } + if !IsNil(o.Code) { + toSerialize["code"] = o.Code + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ValidationError) UnmarshalJSON(data []byte) (err error) { + varValidationError := _ValidationError{} + + err = json.Unmarshal(data, &varValidationError) + + if err != nil { + return err + } + + *o = ValidationError(varValidationError) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "non_field_errors") + delete(additionalProperties, "code") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableValidationError struct { + value *ValidationError + isSet bool +} + +func (v NullableValidationError) Get() *ValidationError { + return v.value +} + +func (v *NullableValidationError) Set(val *ValidationError) { + v.value = val + v.isSet = true +} + +func (v NullableValidationError) IsSet() bool { + return v.isSet +} + +func (v *NullableValidationError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableValidationError(val *ValidationError) *NullableValidationError { + return &NullableValidationError{value: val, isSet: true} +} + +func (v NullableValidationError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableValidationError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_vendor_enum.go b/packages/client-go/model_vendor_enum.go new file mode 100644 index 0000000000..a3a8939fec --- /dev/null +++ b/packages/client-go/model_vendor_enum.go @@ -0,0 +1,115 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// VendorEnum the model 'VendorEnum' +type VendorEnum string + +// List of VendorEnum +const ( + VENDORENUM_GOAUTHENTIK_IO_MERGED VendorEnum = "goauthentik.io/@merged" + VENDORENUM_GOAUTHENTIK_IO_PLATFORM VendorEnum = "goauthentik.io/platform" + VENDORENUM_FLEETDM_COM VendorEnum = "fleetdm.com" + VENDORENUM_CHROME_GOOGLE_COM VendorEnum = "chrome.google.com" +) + +// All allowed values of VendorEnum enum +var AllowedVendorEnumEnumValues = []VendorEnum{ + "goauthentik.io/@merged", + "goauthentik.io/platform", + "fleetdm.com", + "chrome.google.com", +} + +func (v *VendorEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := VendorEnum(value) + for _, existing := range AllowedVendorEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid VendorEnum", value) +} + +// NewVendorEnumFromValue returns a pointer to a valid VendorEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewVendorEnumFromValue(v string) (*VendorEnum, error) { + ev := VendorEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for VendorEnum: valid values are %v", v, AllowedVendorEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v VendorEnum) IsValid() bool { + for _, existing := range AllowedVendorEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to VendorEnum value +func (v VendorEnum) Ptr() *VendorEnum { + return &v +} + +type NullableVendorEnum struct { + value *VendorEnum + isSet bool +} + +func (v NullableVendorEnum) Get() *VendorEnum { + return v.value +} + +func (v *NullableVendorEnum) Set(val *VendorEnum) { + v.value = val + v.isSet = true +} + +func (v NullableVendorEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableVendorEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVendorEnum(val *VendorEnum) *NullableVendorEnum { + return &NullableVendorEnum{value: val, isSet: true} +} + +func (v NullableVendorEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVendorEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_version.go b/packages/client-go/model_version.go new file mode 100644 index 0000000000..0f308d686e --- /dev/null +++ b/packages/client-go/model_version.go @@ -0,0 +1,318 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Version type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Version{} + +// Version Get running and latest version. +type Version struct { + // Get current version + VersionCurrent string `json:"version_current"` + // Get latest version from cache + VersionLatest string `json:"version_latest"` + // Check if latest version is valid + VersionLatestValid bool `json:"version_latest_valid"` + // Get build hash, if version is not latest or released + BuildHash string `json:"build_hash"` + // Check if we're running the latest version + Outdated bool `json:"outdated"` + // Check if any outpost is outdated/has a version mismatch + OutpostOutdated bool `json:"outpost_outdated"` + AdditionalProperties map[string]interface{} +} + +type _Version Version + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersion(versionCurrent string, versionLatest string, versionLatestValid bool, buildHash string, outdated bool, outpostOutdated bool) *Version { + this := Version{} + this.VersionCurrent = versionCurrent + this.VersionLatest = versionLatest + this.VersionLatestValid = versionLatestValid + this.BuildHash = buildHash + this.Outdated = outdated + this.OutpostOutdated = outpostOutdated + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetVersionCurrent returns the VersionCurrent field value +func (o *Version) GetVersionCurrent() string { + if o == nil { + var ret string + return ret + } + + return o.VersionCurrent +} + +// GetVersionCurrentOk returns a tuple with the VersionCurrent field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionCurrentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VersionCurrent, true +} + +// SetVersionCurrent sets field value +func (o *Version) SetVersionCurrent(v string) { + o.VersionCurrent = v +} + +// GetVersionLatest returns the VersionLatest field value +func (o *Version) GetVersionLatest() string { + if o == nil { + var ret string + return ret + } + + return o.VersionLatest +} + +// GetVersionLatestOk returns a tuple with the VersionLatest field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionLatestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VersionLatest, true +} + +// SetVersionLatest sets field value +func (o *Version) SetVersionLatest(v string) { + o.VersionLatest = v +} + +// GetVersionLatestValid returns the VersionLatestValid field value +func (o *Version) GetVersionLatestValid() bool { + if o == nil { + var ret bool + return ret + } + + return o.VersionLatestValid +} + +// GetVersionLatestValidOk returns a tuple with the VersionLatestValid field value +// and a boolean to check if the value has been set. +func (o *Version) GetVersionLatestValidOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.VersionLatestValid, true +} + +// SetVersionLatestValid sets field value +func (o *Version) SetVersionLatestValid(v bool) { + o.VersionLatestValid = v +} + +// GetBuildHash returns the BuildHash field value +func (o *Version) GetBuildHash() string { + if o == nil { + var ret string + return ret + } + + return o.BuildHash +} + +// GetBuildHashOk returns a tuple with the BuildHash field value +// and a boolean to check if the value has been set. +func (o *Version) GetBuildHashOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.BuildHash, true +} + +// SetBuildHash sets field value +func (o *Version) SetBuildHash(v string) { + o.BuildHash = v +} + +// GetOutdated returns the Outdated field value +func (o *Version) GetOutdated() bool { + if o == nil { + var ret bool + return ret + } + + return o.Outdated +} + +// GetOutdatedOk returns a tuple with the Outdated field value +// and a boolean to check if the value has been set. +func (o *Version) GetOutdatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Outdated, true +} + +// SetOutdated sets field value +func (o *Version) SetOutdated(v bool) { + o.Outdated = v +} + +// GetOutpostOutdated returns the OutpostOutdated field value +func (o *Version) GetOutpostOutdated() bool { + if o == nil { + var ret bool + return ret + } + + return o.OutpostOutdated +} + +// GetOutpostOutdatedOk returns a tuple with the OutpostOutdated field value +// and a boolean to check if the value has been set. +func (o *Version) GetOutpostOutdatedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.OutpostOutdated, true +} + +// SetOutpostOutdated sets field value +func (o *Version) SetOutpostOutdated(v bool) { + o.OutpostOutdated = v +} + +func (o Version) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Version) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["version_current"] = o.VersionCurrent + toSerialize["version_latest"] = o.VersionLatest + toSerialize["version_latest_valid"] = o.VersionLatestValid + toSerialize["build_hash"] = o.BuildHash + toSerialize["outdated"] = o.Outdated + toSerialize["outpost_outdated"] = o.OutpostOutdated + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Version) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "version_current", + "version_latest", + "version_latest_valid", + "build_hash", + "outdated", + "outpost_outdated", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersion := _Version{} + + err = json.Unmarshal(data, &varVersion) + + if err != nil { + return err + } + + *o = Version(varVersion) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "version_current") + delete(additionalProperties, "version_latest") + delete(additionalProperties, "version_latest_valid") + delete(additionalProperties, "build_hash") + delete(additionalProperties, "outdated") + delete(additionalProperties, "outpost_outdated") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVersion struct { + value *Version + isSet bool +} + +func (v NullableVersion) Get() *Version { + return v.value +} + +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_version_history.go b/packages/client-go/model_version_history.go new file mode 100644 index 0000000000..32e0365041 --- /dev/null +++ b/packages/client-go/model_version_history.go @@ -0,0 +1,255 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the VersionHistory type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VersionHistory{} + +// VersionHistory VersionHistory Serializer +type VersionHistory struct { + Id int32 `json:"id"` + Timestamp time.Time `json:"timestamp"` + Version string `json:"version"` + Build string `json:"build"` + AdditionalProperties map[string]interface{} +} + +type _VersionHistory VersionHistory + +// NewVersionHistory instantiates a new VersionHistory object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersionHistory(id int32, timestamp time.Time, version string, build string) *VersionHistory { + this := VersionHistory{} + this.Id = id + this.Timestamp = timestamp + this.Version = version + this.Build = build + return &this +} + +// NewVersionHistoryWithDefaults instantiates a new VersionHistory object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionHistoryWithDefaults() *VersionHistory { + this := VersionHistory{} + return &this +} + +// GetId returns the Id field value +func (o *VersionHistory) GetId() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VersionHistory) GetIdOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VersionHistory) SetId(v int32) { + o.Id = v +} + +// GetTimestamp returns the Timestamp field value +func (o *VersionHistory) GetTimestamp() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *VersionHistory) GetTimestampOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *VersionHistory) SetTimestamp(v time.Time) { + o.Timestamp = v +} + +// GetVersion returns the Version field value +func (o *VersionHistory) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *VersionHistory) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *VersionHistory) SetVersion(v string) { + o.Version = v +} + +// GetBuild returns the Build field value +func (o *VersionHistory) GetBuild() string { + if o == nil { + var ret string + return ret + } + + return o.Build +} + +// GetBuildOk returns a tuple with the Build field value +// and a boolean to check if the value has been set. +func (o *VersionHistory) GetBuildOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Build, true +} + +// SetBuild sets field value +func (o *VersionHistory) SetBuild(v string) { + o.Build = v +} + +func (o VersionHistory) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VersionHistory) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["timestamp"] = o.Timestamp + toSerialize["version"] = o.Version + toSerialize["build"] = o.Build + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *VersionHistory) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "timestamp", + "version", + "build", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVersionHistory := _VersionHistory{} + + err = json.Unmarshal(data, &varVersionHistory) + + if err != nil { + return err + } + + *o = VersionHistory(varVersionHistory) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "timestamp") + delete(additionalProperties, "version") + delete(additionalProperties, "build") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableVersionHistory struct { + value *VersionHistory + isSet bool +} + +func (v NullableVersionHistory) Get() *VersionHistory { + return v.value +} + +func (v *NullableVersionHistory) Set(val *VersionHistory) { + v.value = val + v.isSet = true +} + +func (v NullableVersionHistory) IsSet() bool { + return v.isSet +} + +func (v *NullableVersionHistory) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersionHistory(val *VersionHistory) *NullableVersionHistory { + return &NullableVersionHistory{value: val, isSet: true} +} + +func (v NullableVersionHistory) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersionHistory) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_web_authn_device.go b/packages/client-go/model_web_authn_device.go new file mode 100644 index 0000000000..a052ae1546 --- /dev/null +++ b/packages/client-go/model_web_authn_device.go @@ -0,0 +1,315 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" + "time" +) + +// checks if the WebAuthnDevice type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebAuthnDevice{} + +// WebAuthnDevice Serializer for WebAuthn authenticator devices +type WebAuthnDevice struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + CreatedOn time.Time `json:"created_on"` + DeviceType NullableWebAuthnDeviceType `json:"device_type"` + Aaguid string `json:"aaguid"` + User PartialUser `json:"user"` + AdditionalProperties map[string]interface{} +} + +type _WebAuthnDevice WebAuthnDevice + +// NewWebAuthnDevice instantiates a new WebAuthnDevice object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebAuthnDevice(pk int32, name string, createdOn time.Time, deviceType NullableWebAuthnDeviceType, aaguid string, user PartialUser) *WebAuthnDevice { + this := WebAuthnDevice{} + this.Pk = pk + this.Name = name + this.CreatedOn = createdOn + this.DeviceType = deviceType + this.Aaguid = aaguid + this.User = user + return &this +} + +// NewWebAuthnDeviceWithDefaults instantiates a new WebAuthnDevice object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebAuthnDeviceWithDefaults() *WebAuthnDevice { + this := WebAuthnDevice{} + return &this +} + +// GetPk returns the Pk field value +func (o *WebAuthnDevice) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDevice) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *WebAuthnDevice) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *WebAuthnDevice) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDevice) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WebAuthnDevice) SetName(v string) { + o.Name = v +} + +// GetCreatedOn returns the CreatedOn field value +func (o *WebAuthnDevice) GetCreatedOn() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedOn +} + +// GetCreatedOnOk returns a tuple with the CreatedOn field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDevice) GetCreatedOnOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedOn, true +} + +// SetCreatedOn sets field value +func (o *WebAuthnDevice) SetCreatedOn(v time.Time) { + o.CreatedOn = v +} + +// GetDeviceType returns the DeviceType field value +// If the value is explicit nil, the zero value for WebAuthnDeviceType will be returned +func (o *WebAuthnDevice) GetDeviceType() WebAuthnDeviceType { + if o == nil || o.DeviceType.Get() == nil { + var ret WebAuthnDeviceType + return ret + } + + return *o.DeviceType.Get() +} + +// GetDeviceTypeOk returns a tuple with the DeviceType field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WebAuthnDevice) GetDeviceTypeOk() (*WebAuthnDeviceType, bool) { + if o == nil { + return nil, false + } + return o.DeviceType.Get(), o.DeviceType.IsSet() +} + +// SetDeviceType sets field value +func (o *WebAuthnDevice) SetDeviceType(v WebAuthnDeviceType) { + o.DeviceType.Set(&v) +} + +// GetAaguid returns the Aaguid field value +func (o *WebAuthnDevice) GetAaguid() string { + if o == nil { + var ret string + return ret + } + + return o.Aaguid +} + +// GetAaguidOk returns a tuple with the Aaguid field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDevice) GetAaguidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Aaguid, true +} + +// SetAaguid sets field value +func (o *WebAuthnDevice) SetAaguid(v string) { + o.Aaguid = v +} + +// GetUser returns the User field value +func (o *WebAuthnDevice) GetUser() PartialUser { + if o == nil { + var ret PartialUser + return ret + } + + return o.User +} + +// GetUserOk returns a tuple with the User field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDevice) GetUserOk() (*PartialUser, bool) { + if o == nil { + return nil, false + } + return &o.User, true +} + +// SetUser sets field value +func (o *WebAuthnDevice) SetUser(v PartialUser) { + o.User = v +} + +func (o WebAuthnDevice) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebAuthnDevice) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + toSerialize["created_on"] = o.CreatedOn + toSerialize["device_type"] = o.DeviceType.Get() + toSerialize["aaguid"] = o.Aaguid + toSerialize["user"] = o.User + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WebAuthnDevice) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "created_on", + "device_type", + "aaguid", + "user", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebAuthnDevice := _WebAuthnDevice{} + + err = json.Unmarshal(data, &varWebAuthnDevice) + + if err != nil { + return err + } + + *o = WebAuthnDevice(varWebAuthnDevice) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "created_on") + delete(additionalProperties, "device_type") + delete(additionalProperties, "aaguid") + delete(additionalProperties, "user") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWebAuthnDevice struct { + value *WebAuthnDevice + isSet bool +} + +func (v NullableWebAuthnDevice) Get() *WebAuthnDevice { + return v.value +} + +func (v *NullableWebAuthnDevice) Set(val *WebAuthnDevice) { + v.value = val + v.isSet = true +} + +func (v NullableWebAuthnDevice) IsSet() bool { + return v.isSet +} + +func (v *NullableWebAuthnDevice) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebAuthnDevice(val *WebAuthnDevice) *NullableWebAuthnDevice { + return &NullableWebAuthnDevice{value: val, isSet: true} +} + +func (v NullableWebAuthnDevice) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebAuthnDevice) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_web_authn_device_request.go b/packages/client-go/model_web_authn_device_request.go new file mode 100644 index 0000000000..e7d42fd1c6 --- /dev/null +++ b/packages/client-go/model_web_authn_device_request.go @@ -0,0 +1,167 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the WebAuthnDeviceRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebAuthnDeviceRequest{} + +// WebAuthnDeviceRequest Serializer for WebAuthn authenticator devices +type WebAuthnDeviceRequest struct { + Name string `json:"name"` + AdditionalProperties map[string]interface{} +} + +type _WebAuthnDeviceRequest WebAuthnDeviceRequest + +// NewWebAuthnDeviceRequest instantiates a new WebAuthnDeviceRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebAuthnDeviceRequest(name string) *WebAuthnDeviceRequest { + this := WebAuthnDeviceRequest{} + this.Name = name + return &this +} + +// NewWebAuthnDeviceRequestWithDefaults instantiates a new WebAuthnDeviceRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebAuthnDeviceRequestWithDefaults() *WebAuthnDeviceRequest { + this := WebAuthnDeviceRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WebAuthnDeviceRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDeviceRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WebAuthnDeviceRequest) SetName(v string) { + o.Name = v +} + +func (o WebAuthnDeviceRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebAuthnDeviceRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WebAuthnDeviceRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebAuthnDeviceRequest := _WebAuthnDeviceRequest{} + + err = json.Unmarshal(data, &varWebAuthnDeviceRequest) + + if err != nil { + return err + } + + *o = WebAuthnDeviceRequest(varWebAuthnDeviceRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWebAuthnDeviceRequest struct { + value *WebAuthnDeviceRequest + isSet bool +} + +func (v NullableWebAuthnDeviceRequest) Get() *WebAuthnDeviceRequest { + return v.value +} + +func (v *NullableWebAuthnDeviceRequest) Set(val *WebAuthnDeviceRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWebAuthnDeviceRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWebAuthnDeviceRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebAuthnDeviceRequest(val *WebAuthnDeviceRequest) *NullableWebAuthnDeviceRequest { + return &NullableWebAuthnDeviceRequest{value: val, isSet: true} +} + +func (v NullableWebAuthnDeviceRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebAuthnDeviceRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_web_authn_device_type.go b/packages/client-go/model_web_authn_device_type.go new file mode 100644 index 0000000000..1392cdd0f9 --- /dev/null +++ b/packages/client-go/model_web_authn_device_type.go @@ -0,0 +1,196 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the WebAuthnDeviceType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WebAuthnDeviceType{} + +// WebAuthnDeviceType WebAuthnDeviceType Serializer +type WebAuthnDeviceType struct { + Aaguid string `json:"aaguid"` + Description string `json:"description"` + AdditionalProperties map[string]interface{} +} + +type _WebAuthnDeviceType WebAuthnDeviceType + +// NewWebAuthnDeviceType instantiates a new WebAuthnDeviceType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWebAuthnDeviceType(aaguid string, description string) *WebAuthnDeviceType { + this := WebAuthnDeviceType{} + this.Aaguid = aaguid + this.Description = description + return &this +} + +// NewWebAuthnDeviceTypeWithDefaults instantiates a new WebAuthnDeviceType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWebAuthnDeviceTypeWithDefaults() *WebAuthnDeviceType { + this := WebAuthnDeviceType{} + return &this +} + +// GetAaguid returns the Aaguid field value +func (o *WebAuthnDeviceType) GetAaguid() string { + if o == nil { + var ret string + return ret + } + + return o.Aaguid +} + +// GetAaguidOk returns a tuple with the Aaguid field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDeviceType) GetAaguidOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Aaguid, true +} + +// SetAaguid sets field value +func (o *WebAuthnDeviceType) SetAaguid(v string) { + o.Aaguid = v +} + +// GetDescription returns the Description field value +func (o *WebAuthnDeviceType) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *WebAuthnDeviceType) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *WebAuthnDeviceType) SetDescription(v string) { + o.Description = v +} + +func (o WebAuthnDeviceType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WebAuthnDeviceType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["aaguid"] = o.Aaguid + toSerialize["description"] = o.Description + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WebAuthnDeviceType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "aaguid", + "description", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWebAuthnDeviceType := _WebAuthnDeviceType{} + + err = json.Unmarshal(data, &varWebAuthnDeviceType) + + if err != nil { + return err + } + + *o = WebAuthnDeviceType(varWebAuthnDeviceType) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "aaguid") + delete(additionalProperties, "description") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWebAuthnDeviceType struct { + value *WebAuthnDeviceType + isSet bool +} + +func (v NullableWebAuthnDeviceType) Get() *WebAuthnDeviceType { + return v.value +} + +func (v *NullableWebAuthnDeviceType) Set(val *WebAuthnDeviceType) { + v.value = val + v.isSet = true +} + +func (v NullableWebAuthnDeviceType) IsSet() bool { + return v.isSet +} + +func (v *NullableWebAuthnDeviceType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebAuthnDeviceType(val *WebAuthnDeviceType) *NullableWebAuthnDeviceType { + return &NullableWebAuthnDeviceType{value: val, isSet: true} +} + +func (v NullableWebAuthnDeviceType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebAuthnDeviceType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_web_authn_hint_enum.go b/packages/client-go/model_web_authn_hint_enum.go new file mode 100644 index 0000000000..39736f9d31 --- /dev/null +++ b/packages/client-go/model_web_authn_hint_enum.go @@ -0,0 +1,113 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// WebAuthnHintEnum the model 'WebAuthnHintEnum' +type WebAuthnHintEnum string + +// List of WebAuthnHintEnum +const ( + WEBAUTHNHINTENUM_SECURITY_KEY WebAuthnHintEnum = "security-key" + WEBAUTHNHINTENUM_CLIENT_DEVICE WebAuthnHintEnum = "client-device" + WEBAUTHNHINTENUM_HYBRID WebAuthnHintEnum = "hybrid" +) + +// All allowed values of WebAuthnHintEnum enum +var AllowedWebAuthnHintEnumEnumValues = []WebAuthnHintEnum{ + "security-key", + "client-device", + "hybrid", +} + +func (v *WebAuthnHintEnum) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := WebAuthnHintEnum(value) + for _, existing := range AllowedWebAuthnHintEnumEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid WebAuthnHintEnum", value) +} + +// NewWebAuthnHintEnumFromValue returns a pointer to a valid WebAuthnHintEnum +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewWebAuthnHintEnumFromValue(v string) (*WebAuthnHintEnum, error) { + ev := WebAuthnHintEnum(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for WebAuthnHintEnum: valid values are %v", v, AllowedWebAuthnHintEnumEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v WebAuthnHintEnum) IsValid() bool { + for _, existing := range AllowedWebAuthnHintEnumEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to WebAuthnHintEnum value +func (v WebAuthnHintEnum) Ptr() *WebAuthnHintEnum { + return &v +} + +type NullableWebAuthnHintEnum struct { + value *WebAuthnHintEnum + isSet bool +} + +func (v NullableWebAuthnHintEnum) Get() *WebAuthnHintEnum { + return v.value +} + +func (v *NullableWebAuthnHintEnum) Set(val *WebAuthnHintEnum) { + v.value = val + v.isSet = true +} + +func (v NullableWebAuthnHintEnum) IsSet() bool { + return v.isSet +} + +func (v *NullableWebAuthnHintEnum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWebAuthnHintEnum(val *WebAuthnHintEnum) *NullableWebAuthnHintEnum { + return &NullableWebAuthnHintEnum{value: val, isSet: true} +} + +func (v NullableWebAuthnHintEnum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWebAuthnHintEnum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_worker.go b/packages/client-go/model_worker.go new file mode 100644 index 0000000000..854eb37440 --- /dev/null +++ b/packages/client-go/model_worker.go @@ -0,0 +1,225 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the Worker type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Worker{} + +// Worker struct for Worker +type Worker struct { + WorkerId string `json:"worker_id"` + Version string `json:"version"` + VersionMatching bool `json:"version_matching"` + AdditionalProperties map[string]interface{} +} + +type _Worker Worker + +// NewWorker instantiates a new Worker object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWorker(workerId string, version string, versionMatching bool) *Worker { + this := Worker{} + this.WorkerId = workerId + this.Version = version + this.VersionMatching = versionMatching + return &this +} + +// NewWorkerWithDefaults instantiates a new Worker object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWorkerWithDefaults() *Worker { + this := Worker{} + return &this +} + +// GetWorkerId returns the WorkerId field value +func (o *Worker) GetWorkerId() string { + if o == nil { + var ret string + return ret + } + + return o.WorkerId +} + +// GetWorkerIdOk returns a tuple with the WorkerId field value +// and a boolean to check if the value has been set. +func (o *Worker) GetWorkerIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.WorkerId, true +} + +// SetWorkerId sets field value +func (o *Worker) SetWorkerId(v string) { + o.WorkerId = v +} + +// GetVersion returns the Version field value +func (o *Worker) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Worker) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Worker) SetVersion(v string) { + o.Version = v +} + +// GetVersionMatching returns the VersionMatching field value +func (o *Worker) GetVersionMatching() bool { + if o == nil { + var ret bool + return ret + } + + return o.VersionMatching +} + +// GetVersionMatchingOk returns a tuple with the VersionMatching field value +// and a boolean to check if the value has been set. +func (o *Worker) GetVersionMatchingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.VersionMatching, true +} + +// SetVersionMatching sets field value +func (o *Worker) SetVersionMatching(v bool) { + o.VersionMatching = v +} + +func (o Worker) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Worker) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["worker_id"] = o.WorkerId + toSerialize["version"] = o.Version + toSerialize["version_matching"] = o.VersionMatching + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Worker) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "worker_id", + "version", + "version_matching", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorker := _Worker{} + + err = json.Unmarshal(data, &varWorker) + + if err != nil { + return err + } + + *o = Worker(varWorker) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "worker_id") + delete(additionalProperties, "version") + delete(additionalProperties, "version_matching") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWorker struct { + value *Worker + isSet bool +} + +func (v NullableWorker) Get() *Worker { + return v.value +} + +func (v *NullableWorker) Set(val *Worker) { + v.value = val + v.isSet = true +} + +func (v NullableWorker) IsSet() bool { + return v.isSet +} + +func (v *NullableWorker) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWorker(val *Worker) *NullableWorker { + return &NullableWorker{value: val, isSet: true} +} + +func (v NullableWorker) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWorker) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ws_federation_provider.go b/packages/client-go/model_ws_federation_provider.go new file mode 100644 index 0000000000..2afc01f5de --- /dev/null +++ b/packages/client-go/model_ws_federation_provider.go @@ -0,0 +1,1203 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the WSFederationProvider type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WSFederationProvider{} + +// WSFederationProvider WSFederationProvider Serializer +type WSFederationProvider struct { + Pk int32 `json:"pk"` + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + // Get object component so that we know how to edit the object + Component string `json:"component"` + // Internal application name, used in URLs. + AssignedApplicationSlug NullableString `json:"assigned_application_slug"` + // Application's display Name. + AssignedApplicationName NullableString `json:"assigned_application_name"` + // Internal application name, used in URLs. + AssignedBackchannelApplicationSlug NullableString `json:"assigned_backchannel_application_slug"` + // Application's display Name. + AssignedBackchannelApplicationName NullableString `json:"assigned_backchannel_application_name"` + // Return object's verbose_name + VerboseName string `json:"verbose_name"` + // Return object's plural verbose_name + VerboseNamePlural string `json:"verbose_name_plural"` + // Return internal model name + MetaModelName string `json:"meta_model_name"` + ReplyUrl string `json:"reply_url"` + Wtrealm string `json:"wtrealm"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + // Get metadata download URL + UrlDownloadMetadata string `json:"url_download_metadata"` + // Get WS-Fed url + UrlWsfed string `json:"url_wsfed"` + AdditionalProperties map[string]interface{} +} + +type _WSFederationProvider WSFederationProvider + +// NewWSFederationProvider instantiates a new WSFederationProvider object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWSFederationProvider(pk int32, name string, authorizationFlow string, invalidationFlow string, component string, assignedApplicationSlug NullableString, assignedApplicationName NullableString, assignedBackchannelApplicationSlug NullableString, assignedBackchannelApplicationName NullableString, verboseName string, verboseNamePlural string, metaModelName string, replyUrl string, wtrealm string, urlDownloadMetadata string, urlWsfed string) *WSFederationProvider { + this := WSFederationProvider{} + this.Pk = pk + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.Component = component + this.AssignedApplicationSlug = assignedApplicationSlug + this.AssignedApplicationName = assignedApplicationName + this.AssignedBackchannelApplicationSlug = assignedBackchannelApplicationSlug + this.AssignedBackchannelApplicationName = assignedBackchannelApplicationName + this.VerboseName = verboseName + this.VerboseNamePlural = verboseNamePlural + this.MetaModelName = metaModelName + this.ReplyUrl = replyUrl + this.Wtrealm = wtrealm + this.UrlDownloadMetadata = urlDownloadMetadata + this.UrlWsfed = urlWsfed + return &this +} + +// NewWSFederationProviderWithDefaults instantiates a new WSFederationProvider object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWSFederationProviderWithDefaults() *WSFederationProvider { + this := WSFederationProvider{} + return &this +} + +// GetPk returns the Pk field value +func (o *WSFederationProvider) GetPk() int32 { + if o == nil { + var ret int32 + return ret + } + + return o.Pk +} + +// GetPkOk returns a tuple with the Pk field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetPkOk() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Pk, true +} + +// SetPk sets field value +func (o *WSFederationProvider) SetPk(v int32) { + o.Pk = v +} + +// GetName returns the Name field value +func (o *WSFederationProvider) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WSFederationProvider) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProvider) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *WSFederationProvider) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *WSFederationProvider) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *WSFederationProvider) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *WSFederationProvider) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *WSFederationProvider) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *WSFederationProvider) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *WSFederationProvider) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *WSFederationProvider) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *WSFederationProvider) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *WSFederationProvider) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *WSFederationProvider) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetComponent returns the Component field value +func (o *WSFederationProvider) GetComponent() string { + if o == nil { + var ret string + return ret + } + + return o.Component +} + +// GetComponentOk returns a tuple with the Component field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetComponentOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Component, true +} + +// SetComponent sets field value +func (o *WSFederationProvider) SetComponent(v string) { + o.Component = v +} + +// GetAssignedApplicationSlug returns the AssignedApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WSFederationProvider) GetAssignedApplicationSlug() string { + if o == nil || o.AssignedApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationSlug.Get() +} + +// GetAssignedApplicationSlugOk returns a tuple with the AssignedApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAssignedApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationSlug.Get(), o.AssignedApplicationSlug.IsSet() +} + +// SetAssignedApplicationSlug sets field value +func (o *WSFederationProvider) SetAssignedApplicationSlug(v string) { + o.AssignedApplicationSlug.Set(&v) +} + +// GetAssignedApplicationName returns the AssignedApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WSFederationProvider) GetAssignedApplicationName() string { + if o == nil || o.AssignedApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedApplicationName.Get() +} + +// GetAssignedApplicationNameOk returns a tuple with the AssignedApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAssignedApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedApplicationName.Get(), o.AssignedApplicationName.IsSet() +} + +// SetAssignedApplicationName sets field value +func (o *WSFederationProvider) SetAssignedApplicationName(v string) { + o.AssignedApplicationName.Set(&v) +} + +// GetAssignedBackchannelApplicationSlug returns the AssignedBackchannelApplicationSlug field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WSFederationProvider) GetAssignedBackchannelApplicationSlug() string { + if o == nil || o.AssignedBackchannelApplicationSlug.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationSlug.Get() +} + +// GetAssignedBackchannelApplicationSlugOk returns a tuple with the AssignedBackchannelApplicationSlug field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAssignedBackchannelApplicationSlugOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationSlug.Get(), o.AssignedBackchannelApplicationSlug.IsSet() +} + +// SetAssignedBackchannelApplicationSlug sets field value +func (o *WSFederationProvider) SetAssignedBackchannelApplicationSlug(v string) { + o.AssignedBackchannelApplicationSlug.Set(&v) +} + +// GetAssignedBackchannelApplicationName returns the AssignedBackchannelApplicationName field value +// If the value is explicit nil, the zero value for string will be returned +func (o *WSFederationProvider) GetAssignedBackchannelApplicationName() string { + if o == nil || o.AssignedBackchannelApplicationName.Get() == nil { + var ret string + return ret + } + + return *o.AssignedBackchannelApplicationName.Get() +} + +// GetAssignedBackchannelApplicationNameOk returns a tuple with the AssignedBackchannelApplicationName field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAssignedBackchannelApplicationNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AssignedBackchannelApplicationName.Get(), o.AssignedBackchannelApplicationName.IsSet() +} + +// SetAssignedBackchannelApplicationName sets field value +func (o *WSFederationProvider) SetAssignedBackchannelApplicationName(v string) { + o.AssignedBackchannelApplicationName.Set(&v) +} + +// GetVerboseName returns the VerboseName field value +func (o *WSFederationProvider) GetVerboseName() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseName +} + +// GetVerboseNameOk returns a tuple with the VerboseName field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetVerboseNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseName, true +} + +// SetVerboseName sets field value +func (o *WSFederationProvider) SetVerboseName(v string) { + o.VerboseName = v +} + +// GetVerboseNamePlural returns the VerboseNamePlural field value +func (o *WSFederationProvider) GetVerboseNamePlural() string { + if o == nil { + var ret string + return ret + } + + return o.VerboseNamePlural +} + +// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetVerboseNamePluralOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VerboseNamePlural, true +} + +// SetVerboseNamePlural sets field value +func (o *WSFederationProvider) SetVerboseNamePlural(v string) { + o.VerboseNamePlural = v +} + +// GetMetaModelName returns the MetaModelName field value +func (o *WSFederationProvider) GetMetaModelName() string { + if o == nil { + var ret string + return ret + } + + return o.MetaModelName +} + +// GetMetaModelNameOk returns a tuple with the MetaModelName field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetMetaModelNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MetaModelName, true +} + +// SetMetaModelName sets field value +func (o *WSFederationProvider) SetMetaModelName(v string) { + o.MetaModelName = v +} + +// GetReplyUrl returns the ReplyUrl field value +func (o *WSFederationProvider) GetReplyUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ReplyUrl +} + +// GetReplyUrlOk returns a tuple with the ReplyUrl field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetReplyUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReplyUrl, true +} + +// SetReplyUrl sets field value +func (o *WSFederationProvider) SetReplyUrl(v string) { + o.ReplyUrl = v +} + +// GetWtrealm returns the Wtrealm field value +func (o *WSFederationProvider) GetWtrealm() string { + if o == nil { + var ret string + return ret + } + + return o.Wtrealm +} + +// GetWtrealmOk returns a tuple with the Wtrealm field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetWtrealmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Wtrealm, true +} + +// SetWtrealm sets field value +func (o *WSFederationProvider) SetWtrealm(v string) { + o.Wtrealm = v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *WSFederationProvider) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *WSFederationProvider) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *WSFederationProvider) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *WSFederationProvider) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *WSFederationProvider) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *WSFederationProvider) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *WSFederationProvider) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *WSFederationProvider) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *WSFederationProvider) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProvider) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *WSFederationProvider) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *WSFederationProvider) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *WSFederationProvider) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *WSFederationProvider) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProvider) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *WSFederationProvider) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *WSFederationProvider) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *WSFederationProvider) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *WSFederationProvider) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *WSFederationProvider) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *WSFederationProvider) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *WSFederationProvider) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *WSFederationProvider) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *WSFederationProvider) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *WSFederationProvider) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProvider) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *WSFederationProvider) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *WSFederationProvider) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *WSFederationProvider) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *WSFederationProvider) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProvider) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProvider) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *WSFederationProvider) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *WSFederationProvider) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *WSFederationProvider) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *WSFederationProvider) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *WSFederationProvider) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *WSFederationProvider) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *WSFederationProvider) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *WSFederationProvider) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *WSFederationProvider) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *WSFederationProvider) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *WSFederationProvider) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *WSFederationProvider) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *WSFederationProvider) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +// GetUrlDownloadMetadata returns the UrlDownloadMetadata field value +func (o *WSFederationProvider) GetUrlDownloadMetadata() string { + if o == nil { + var ret string + return ret + } + + return o.UrlDownloadMetadata +} + +// GetUrlDownloadMetadataOk returns a tuple with the UrlDownloadMetadata field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetUrlDownloadMetadataOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlDownloadMetadata, true +} + +// SetUrlDownloadMetadata sets field value +func (o *WSFederationProvider) SetUrlDownloadMetadata(v string) { + o.UrlDownloadMetadata = v +} + +// GetUrlWsfed returns the UrlWsfed field value +func (o *WSFederationProvider) GetUrlWsfed() string { + if o == nil { + var ret string + return ret + } + + return o.UrlWsfed +} + +// GetUrlWsfedOk returns a tuple with the UrlWsfed field value +// and a boolean to check if the value has been set. +func (o *WSFederationProvider) GetUrlWsfedOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UrlWsfed, true +} + +// SetUrlWsfed sets field value +func (o *WSFederationProvider) SetUrlWsfed(v string) { + o.UrlWsfed = v +} + +func (o WSFederationProvider) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WSFederationProvider) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["pk"] = o.Pk + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["component"] = o.Component + toSerialize["assigned_application_slug"] = o.AssignedApplicationSlug.Get() + toSerialize["assigned_application_name"] = o.AssignedApplicationName.Get() + toSerialize["assigned_backchannel_application_slug"] = o.AssignedBackchannelApplicationSlug.Get() + toSerialize["assigned_backchannel_application_name"] = o.AssignedBackchannelApplicationName.Get() + toSerialize["verbose_name"] = o.VerboseName + toSerialize["verbose_name_plural"] = o.VerboseNamePlural + toSerialize["meta_model_name"] = o.MetaModelName + toSerialize["reply_url"] = o.ReplyUrl + toSerialize["wtrealm"] = o.Wtrealm + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + toSerialize["url_download_metadata"] = o.UrlDownloadMetadata + toSerialize["url_wsfed"] = o.UrlWsfed + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WSFederationProvider) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "pk", + "name", + "authorization_flow", + "invalidation_flow", + "component", + "assigned_application_slug", + "assigned_application_name", + "assigned_backchannel_application_slug", + "assigned_backchannel_application_name", + "verbose_name", + "verbose_name_plural", + "meta_model_name", + "reply_url", + "wtrealm", + "url_download_metadata", + "url_wsfed", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWSFederationProvider := _WSFederationProvider{} + + err = json.Unmarshal(data, &varWSFederationProvider) + + if err != nil { + return err + } + + *o = WSFederationProvider(varWSFederationProvider) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "pk") + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "component") + delete(additionalProperties, "assigned_application_slug") + delete(additionalProperties, "assigned_application_name") + delete(additionalProperties, "assigned_backchannel_application_slug") + delete(additionalProperties, "assigned_backchannel_application_name") + delete(additionalProperties, "verbose_name") + delete(additionalProperties, "verbose_name_plural") + delete(additionalProperties, "meta_model_name") + delete(additionalProperties, "reply_url") + delete(additionalProperties, "wtrealm") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "default_name_id_policy") + delete(additionalProperties, "url_download_metadata") + delete(additionalProperties, "url_wsfed") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWSFederationProvider struct { + value *WSFederationProvider + isSet bool +} + +func (v NullableWSFederationProvider) Get() *WSFederationProvider { + return v.value +} + +func (v *NullableWSFederationProvider) Set(val *WSFederationProvider) { + v.value = val + v.isSet = true +} + +func (v NullableWSFederationProvider) IsSet() bool { + return v.isSet +} + +func (v *NullableWSFederationProvider) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWSFederationProvider(val *WSFederationProvider) *NullableWSFederationProvider { + return &NullableWSFederationProvider{value: val, isSet: true} +} + +func (v NullableWSFederationProvider) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWSFederationProvider) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/model_ws_federation_provider_request.go b/packages/client-go/model_ws_federation_provider_request.go new file mode 100644 index 0000000000..4fb993f585 --- /dev/null +++ b/packages/client-go/model_ws_federation_provider_request.go @@ -0,0 +1,866 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" + "fmt" +) + +// checks if the WSFederationProviderRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &WSFederationProviderRequest{} + +// WSFederationProviderRequest WSFederationProvider Serializer +type WSFederationProviderRequest struct { + Name string `json:"name"` + // Flow used for authentication when the associated application is accessed by an un-authenticated user. + AuthenticationFlow NullableString `json:"authentication_flow,omitempty"` + // Flow used when authorizing this provider. + AuthorizationFlow string `json:"authorization_flow"` + // Flow used ending the session from a provider. + InvalidationFlow string `json:"invalidation_flow"` + PropertyMappings []string `json:"property_mappings,omitempty"` + ReplyUrl string `json:"reply_url"` + Wtrealm string `json:"wtrealm"` + // Assertion valid not before current time + this value (Format: hours=-1;minutes=-2;seconds=-3). + AssertionValidNotBefore *string `json:"assertion_valid_not_before,omitempty"` + // Assertion not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + AssertionValidNotOnOrAfter *string `json:"assertion_valid_not_on_or_after,omitempty"` + // Session not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3). + SessionValidNotOnOrAfter *string `json:"session_valid_not_on_or_after,omitempty"` + // Configure how the NameID value will be created. When left empty, the NameIDPolicy of the incoming request will be considered + NameIdMapping NullableString `json:"name_id_mapping,omitempty"` + // Configure how the AuthnContextClassRef value will be created. When left empty, the AuthnContextClassRef will be set based on which authentication methods the user used to authenticate. + AuthnContextClassRefMapping NullableString `json:"authn_context_class_ref_mapping,omitempty"` + DigestAlgorithm *DigestAlgorithmEnum `json:"digest_algorithm,omitempty"` + SignatureAlgorithm *SignatureAlgorithmEnum `json:"signature_algorithm,omitempty"` + // Keypair used to sign outgoing Responses going to the Service Provider. + SigningKp NullableString `json:"signing_kp,omitempty"` + // When selected, incoming assertions are encrypted by the IdP using the public key of the encryption keypair. The assertion is decrypted by the SP using the the private key. + EncryptionKp NullableString `json:"encryption_kp,omitempty"` + SignAssertion *bool `json:"sign_assertion,omitempty"` + SignLogoutRequest *bool `json:"sign_logout_request,omitempty"` + DefaultNameIdPolicy *SAMLNameIDPolicyEnum `json:"default_name_id_policy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _WSFederationProviderRequest WSFederationProviderRequest + +// NewWSFederationProviderRequest instantiates a new WSFederationProviderRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewWSFederationProviderRequest(name string, authorizationFlow string, invalidationFlow string, replyUrl string, wtrealm string) *WSFederationProviderRequest { + this := WSFederationProviderRequest{} + this.Name = name + this.AuthorizationFlow = authorizationFlow + this.InvalidationFlow = invalidationFlow + this.ReplyUrl = replyUrl + this.Wtrealm = wtrealm + return &this +} + +// NewWSFederationProviderRequestWithDefaults instantiates a new WSFederationProviderRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewWSFederationProviderRequestWithDefaults() *WSFederationProviderRequest { + this := WSFederationProviderRequest{} + return &this +} + +// GetName returns the Name field value +func (o *WSFederationProviderRequest) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *WSFederationProviderRequest) SetName(v string) { + o.Name = v +} + +// GetAuthenticationFlow returns the AuthenticationFlow field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProviderRequest) GetAuthenticationFlow() string { + if o == nil || IsNil(o.AuthenticationFlow.Get()) { + var ret string + return ret + } + return *o.AuthenticationFlow.Get() +} + +// GetAuthenticationFlowOk returns a tuple with the AuthenticationFlow field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProviderRequest) GetAuthenticationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthenticationFlow.Get(), o.AuthenticationFlow.IsSet() +} + +// HasAuthenticationFlow returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasAuthenticationFlow() bool { + if o != nil && o.AuthenticationFlow.IsSet() { + return true + } + + return false +} + +// SetAuthenticationFlow gets a reference to the given NullableString and assigns it to the AuthenticationFlow field. +func (o *WSFederationProviderRequest) SetAuthenticationFlow(v string) { + o.AuthenticationFlow.Set(&v) +} + +// SetAuthenticationFlowNil sets the value for AuthenticationFlow to be an explicit nil +func (o *WSFederationProviderRequest) SetAuthenticationFlowNil() { + o.AuthenticationFlow.Set(nil) +} + +// UnsetAuthenticationFlow ensures that no value is present for AuthenticationFlow, not even an explicit nil +func (o *WSFederationProviderRequest) UnsetAuthenticationFlow() { + o.AuthenticationFlow.Unset() +} + +// GetAuthorizationFlow returns the AuthorizationFlow field value +func (o *WSFederationProviderRequest) GetAuthorizationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.AuthorizationFlow +} + +// GetAuthorizationFlowOk returns a tuple with the AuthorizationFlow field value +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetAuthorizationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AuthorizationFlow, true +} + +// SetAuthorizationFlow sets field value +func (o *WSFederationProviderRequest) SetAuthorizationFlow(v string) { + o.AuthorizationFlow = v +} + +// GetInvalidationFlow returns the InvalidationFlow field value +func (o *WSFederationProviderRequest) GetInvalidationFlow() string { + if o == nil { + var ret string + return ret + } + + return o.InvalidationFlow +} + +// GetInvalidationFlowOk returns a tuple with the InvalidationFlow field value +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetInvalidationFlowOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.InvalidationFlow, true +} + +// SetInvalidationFlow sets field value +func (o *WSFederationProviderRequest) SetInvalidationFlow(v string) { + o.InvalidationFlow = v +} + +// GetPropertyMappings returns the PropertyMappings field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetPropertyMappings() []string { + if o == nil || IsNil(o.PropertyMappings) { + var ret []string + return ret + } + return o.PropertyMappings +} + +// GetPropertyMappingsOk returns a tuple with the PropertyMappings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetPropertyMappingsOk() ([]string, bool) { + if o == nil || IsNil(o.PropertyMappings) { + return nil, false + } + return o.PropertyMappings, true +} + +// HasPropertyMappings returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasPropertyMappings() bool { + if o != nil && !IsNil(o.PropertyMappings) { + return true + } + + return false +} + +// SetPropertyMappings gets a reference to the given []string and assigns it to the PropertyMappings field. +func (o *WSFederationProviderRequest) SetPropertyMappings(v []string) { + o.PropertyMappings = v +} + +// GetReplyUrl returns the ReplyUrl field value +func (o *WSFederationProviderRequest) GetReplyUrl() string { + if o == nil { + var ret string + return ret + } + + return o.ReplyUrl +} + +// GetReplyUrlOk returns a tuple with the ReplyUrl field value +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetReplyUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ReplyUrl, true +} + +// SetReplyUrl sets field value +func (o *WSFederationProviderRequest) SetReplyUrl(v string) { + o.ReplyUrl = v +} + +// GetWtrealm returns the Wtrealm field value +func (o *WSFederationProviderRequest) GetWtrealm() string { + if o == nil { + var ret string + return ret + } + + return o.Wtrealm +} + +// GetWtrealmOk returns a tuple with the Wtrealm field value +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetWtrealmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Wtrealm, true +} + +// SetWtrealm sets field value +func (o *WSFederationProviderRequest) SetWtrealm(v string) { + o.Wtrealm = v +} + +// GetAssertionValidNotBefore returns the AssertionValidNotBefore field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetAssertionValidNotBefore() string { + if o == nil || IsNil(o.AssertionValidNotBefore) { + var ret string + return ret + } + return *o.AssertionValidNotBefore +} + +// GetAssertionValidNotBeforeOk returns a tuple with the AssertionValidNotBefore field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetAssertionValidNotBeforeOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotBefore) { + return nil, false + } + return o.AssertionValidNotBefore, true +} + +// HasAssertionValidNotBefore returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasAssertionValidNotBefore() bool { + if o != nil && !IsNil(o.AssertionValidNotBefore) { + return true + } + + return false +} + +// SetAssertionValidNotBefore gets a reference to the given string and assigns it to the AssertionValidNotBefore field. +func (o *WSFederationProviderRequest) SetAssertionValidNotBefore(v string) { + o.AssertionValidNotBefore = &v +} + +// GetAssertionValidNotOnOrAfter returns the AssertionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetAssertionValidNotOnOrAfter() string { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.AssertionValidNotOnOrAfter +} + +// GetAssertionValidNotOnOrAfterOk returns a tuple with the AssertionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetAssertionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.AssertionValidNotOnOrAfter) { + return nil, false + } + return o.AssertionValidNotOnOrAfter, true +} + +// HasAssertionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasAssertionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.AssertionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetAssertionValidNotOnOrAfter gets a reference to the given string and assigns it to the AssertionValidNotOnOrAfter field. +func (o *WSFederationProviderRequest) SetAssertionValidNotOnOrAfter(v string) { + o.AssertionValidNotOnOrAfter = &v +} + +// GetSessionValidNotOnOrAfter returns the SessionValidNotOnOrAfter field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetSessionValidNotOnOrAfter() string { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + var ret string + return ret + } + return *o.SessionValidNotOnOrAfter +} + +// GetSessionValidNotOnOrAfterOk returns a tuple with the SessionValidNotOnOrAfter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetSessionValidNotOnOrAfterOk() (*string, bool) { + if o == nil || IsNil(o.SessionValidNotOnOrAfter) { + return nil, false + } + return o.SessionValidNotOnOrAfter, true +} + +// HasSessionValidNotOnOrAfter returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasSessionValidNotOnOrAfter() bool { + if o != nil && !IsNil(o.SessionValidNotOnOrAfter) { + return true + } + + return false +} + +// SetSessionValidNotOnOrAfter gets a reference to the given string and assigns it to the SessionValidNotOnOrAfter field. +func (o *WSFederationProviderRequest) SetSessionValidNotOnOrAfter(v string) { + o.SessionValidNotOnOrAfter = &v +} + +// GetNameIdMapping returns the NameIdMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProviderRequest) GetNameIdMapping() string { + if o == nil || IsNil(o.NameIdMapping.Get()) { + var ret string + return ret + } + return *o.NameIdMapping.Get() +} + +// GetNameIdMappingOk returns a tuple with the NameIdMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProviderRequest) GetNameIdMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NameIdMapping.Get(), o.NameIdMapping.IsSet() +} + +// HasNameIdMapping returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasNameIdMapping() bool { + if o != nil && o.NameIdMapping.IsSet() { + return true + } + + return false +} + +// SetNameIdMapping gets a reference to the given NullableString and assigns it to the NameIdMapping field. +func (o *WSFederationProviderRequest) SetNameIdMapping(v string) { + o.NameIdMapping.Set(&v) +} + +// SetNameIdMappingNil sets the value for NameIdMapping to be an explicit nil +func (o *WSFederationProviderRequest) SetNameIdMappingNil() { + o.NameIdMapping.Set(nil) +} + +// UnsetNameIdMapping ensures that no value is present for NameIdMapping, not even an explicit nil +func (o *WSFederationProviderRequest) UnsetNameIdMapping() { + o.NameIdMapping.Unset() +} + +// GetAuthnContextClassRefMapping returns the AuthnContextClassRefMapping field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProviderRequest) GetAuthnContextClassRefMapping() string { + if o == nil || IsNil(o.AuthnContextClassRefMapping.Get()) { + var ret string + return ret + } + return *o.AuthnContextClassRefMapping.Get() +} + +// GetAuthnContextClassRefMappingOk returns a tuple with the AuthnContextClassRefMapping field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProviderRequest) GetAuthnContextClassRefMappingOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.AuthnContextClassRefMapping.Get(), o.AuthnContextClassRefMapping.IsSet() +} + +// HasAuthnContextClassRefMapping returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasAuthnContextClassRefMapping() bool { + if o != nil && o.AuthnContextClassRefMapping.IsSet() { + return true + } + + return false +} + +// SetAuthnContextClassRefMapping gets a reference to the given NullableString and assigns it to the AuthnContextClassRefMapping field. +func (o *WSFederationProviderRequest) SetAuthnContextClassRefMapping(v string) { + o.AuthnContextClassRefMapping.Set(&v) +} + +// SetAuthnContextClassRefMappingNil sets the value for AuthnContextClassRefMapping to be an explicit nil +func (o *WSFederationProviderRequest) SetAuthnContextClassRefMappingNil() { + o.AuthnContextClassRefMapping.Set(nil) +} + +// UnsetAuthnContextClassRefMapping ensures that no value is present for AuthnContextClassRefMapping, not even an explicit nil +func (o *WSFederationProviderRequest) UnsetAuthnContextClassRefMapping() { + o.AuthnContextClassRefMapping.Unset() +} + +// GetDigestAlgorithm returns the DigestAlgorithm field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetDigestAlgorithm() DigestAlgorithmEnum { + if o == nil || IsNil(o.DigestAlgorithm) { + var ret DigestAlgorithmEnum + return ret + } + return *o.DigestAlgorithm +} + +// GetDigestAlgorithmOk returns a tuple with the DigestAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetDigestAlgorithmOk() (*DigestAlgorithmEnum, bool) { + if o == nil || IsNil(o.DigestAlgorithm) { + return nil, false + } + return o.DigestAlgorithm, true +} + +// HasDigestAlgorithm returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasDigestAlgorithm() bool { + if o != nil && !IsNil(o.DigestAlgorithm) { + return true + } + + return false +} + +// SetDigestAlgorithm gets a reference to the given DigestAlgorithmEnum and assigns it to the DigestAlgorithm field. +func (o *WSFederationProviderRequest) SetDigestAlgorithm(v DigestAlgorithmEnum) { + o.DigestAlgorithm = &v +} + +// GetSignatureAlgorithm returns the SignatureAlgorithm field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetSignatureAlgorithm() SignatureAlgorithmEnum { + if o == nil || IsNil(o.SignatureAlgorithm) { + var ret SignatureAlgorithmEnum + return ret + } + return *o.SignatureAlgorithm +} + +// GetSignatureAlgorithmOk returns a tuple with the SignatureAlgorithm field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetSignatureAlgorithmOk() (*SignatureAlgorithmEnum, bool) { + if o == nil || IsNil(o.SignatureAlgorithm) { + return nil, false + } + return o.SignatureAlgorithm, true +} + +// HasSignatureAlgorithm returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasSignatureAlgorithm() bool { + if o != nil && !IsNil(o.SignatureAlgorithm) { + return true + } + + return false +} + +// SetSignatureAlgorithm gets a reference to the given SignatureAlgorithmEnum and assigns it to the SignatureAlgorithm field. +func (o *WSFederationProviderRequest) SetSignatureAlgorithm(v SignatureAlgorithmEnum) { + o.SignatureAlgorithm = &v +} + +// GetSigningKp returns the SigningKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProviderRequest) GetSigningKp() string { + if o == nil || IsNil(o.SigningKp.Get()) { + var ret string + return ret + } + return *o.SigningKp.Get() +} + +// GetSigningKpOk returns a tuple with the SigningKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProviderRequest) GetSigningKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.SigningKp.Get(), o.SigningKp.IsSet() +} + +// HasSigningKp returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasSigningKp() bool { + if o != nil && o.SigningKp.IsSet() { + return true + } + + return false +} + +// SetSigningKp gets a reference to the given NullableString and assigns it to the SigningKp field. +func (o *WSFederationProviderRequest) SetSigningKp(v string) { + o.SigningKp.Set(&v) +} + +// SetSigningKpNil sets the value for SigningKp to be an explicit nil +func (o *WSFederationProviderRequest) SetSigningKpNil() { + o.SigningKp.Set(nil) +} + +// UnsetSigningKp ensures that no value is present for SigningKp, not even an explicit nil +func (o *WSFederationProviderRequest) UnsetSigningKp() { + o.SigningKp.Unset() +} + +// GetEncryptionKp returns the EncryptionKp field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *WSFederationProviderRequest) GetEncryptionKp() string { + if o == nil || IsNil(o.EncryptionKp.Get()) { + var ret string + return ret + } + return *o.EncryptionKp.Get() +} + +// GetEncryptionKpOk returns a tuple with the EncryptionKp field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *WSFederationProviderRequest) GetEncryptionKpOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.EncryptionKp.Get(), o.EncryptionKp.IsSet() +} + +// HasEncryptionKp returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasEncryptionKp() bool { + if o != nil && o.EncryptionKp.IsSet() { + return true + } + + return false +} + +// SetEncryptionKp gets a reference to the given NullableString and assigns it to the EncryptionKp field. +func (o *WSFederationProviderRequest) SetEncryptionKp(v string) { + o.EncryptionKp.Set(&v) +} + +// SetEncryptionKpNil sets the value for EncryptionKp to be an explicit nil +func (o *WSFederationProviderRequest) SetEncryptionKpNil() { + o.EncryptionKp.Set(nil) +} + +// UnsetEncryptionKp ensures that no value is present for EncryptionKp, not even an explicit nil +func (o *WSFederationProviderRequest) UnsetEncryptionKp() { + o.EncryptionKp.Unset() +} + +// GetSignAssertion returns the SignAssertion field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetSignAssertion() bool { + if o == nil || IsNil(o.SignAssertion) { + var ret bool + return ret + } + return *o.SignAssertion +} + +// GetSignAssertionOk returns a tuple with the SignAssertion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetSignAssertionOk() (*bool, bool) { + if o == nil || IsNil(o.SignAssertion) { + return nil, false + } + return o.SignAssertion, true +} + +// HasSignAssertion returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasSignAssertion() bool { + if o != nil && !IsNil(o.SignAssertion) { + return true + } + + return false +} + +// SetSignAssertion gets a reference to the given bool and assigns it to the SignAssertion field. +func (o *WSFederationProviderRequest) SetSignAssertion(v bool) { + o.SignAssertion = &v +} + +// GetSignLogoutRequest returns the SignLogoutRequest field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetSignLogoutRequest() bool { + if o == nil || IsNil(o.SignLogoutRequest) { + var ret bool + return ret + } + return *o.SignLogoutRequest +} + +// GetSignLogoutRequestOk returns a tuple with the SignLogoutRequest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetSignLogoutRequestOk() (*bool, bool) { + if o == nil || IsNil(o.SignLogoutRequest) { + return nil, false + } + return o.SignLogoutRequest, true +} + +// HasSignLogoutRequest returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasSignLogoutRequest() bool { + if o != nil && !IsNil(o.SignLogoutRequest) { + return true + } + + return false +} + +// SetSignLogoutRequest gets a reference to the given bool and assigns it to the SignLogoutRequest field. +func (o *WSFederationProviderRequest) SetSignLogoutRequest(v bool) { + o.SignLogoutRequest = &v +} + +// GetDefaultNameIdPolicy returns the DefaultNameIdPolicy field value if set, zero value otherwise. +func (o *WSFederationProviderRequest) GetDefaultNameIdPolicy() SAMLNameIDPolicyEnum { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + var ret SAMLNameIDPolicyEnum + return ret + } + return *o.DefaultNameIdPolicy +} + +// GetDefaultNameIdPolicyOk returns a tuple with the DefaultNameIdPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WSFederationProviderRequest) GetDefaultNameIdPolicyOk() (*SAMLNameIDPolicyEnum, bool) { + if o == nil || IsNil(o.DefaultNameIdPolicy) { + return nil, false + } + return o.DefaultNameIdPolicy, true +} + +// HasDefaultNameIdPolicy returns a boolean if a field has been set. +func (o *WSFederationProviderRequest) HasDefaultNameIdPolicy() bool { + if o != nil && !IsNil(o.DefaultNameIdPolicy) { + return true + } + + return false +} + +// SetDefaultNameIdPolicy gets a reference to the given SAMLNameIDPolicyEnum and assigns it to the DefaultNameIdPolicy field. +func (o *WSFederationProviderRequest) SetDefaultNameIdPolicy(v SAMLNameIDPolicyEnum) { + o.DefaultNameIdPolicy = &v +} + +func (o WSFederationProviderRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o WSFederationProviderRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + if o.AuthenticationFlow.IsSet() { + toSerialize["authentication_flow"] = o.AuthenticationFlow.Get() + } + toSerialize["authorization_flow"] = o.AuthorizationFlow + toSerialize["invalidation_flow"] = o.InvalidationFlow + if !IsNil(o.PropertyMappings) { + toSerialize["property_mappings"] = o.PropertyMappings + } + toSerialize["reply_url"] = o.ReplyUrl + toSerialize["wtrealm"] = o.Wtrealm + if !IsNil(o.AssertionValidNotBefore) { + toSerialize["assertion_valid_not_before"] = o.AssertionValidNotBefore + } + if !IsNil(o.AssertionValidNotOnOrAfter) { + toSerialize["assertion_valid_not_on_or_after"] = o.AssertionValidNotOnOrAfter + } + if !IsNil(o.SessionValidNotOnOrAfter) { + toSerialize["session_valid_not_on_or_after"] = o.SessionValidNotOnOrAfter + } + if o.NameIdMapping.IsSet() { + toSerialize["name_id_mapping"] = o.NameIdMapping.Get() + } + if o.AuthnContextClassRefMapping.IsSet() { + toSerialize["authn_context_class_ref_mapping"] = o.AuthnContextClassRefMapping.Get() + } + if !IsNil(o.DigestAlgorithm) { + toSerialize["digest_algorithm"] = o.DigestAlgorithm + } + if !IsNil(o.SignatureAlgorithm) { + toSerialize["signature_algorithm"] = o.SignatureAlgorithm + } + if o.SigningKp.IsSet() { + toSerialize["signing_kp"] = o.SigningKp.Get() + } + if o.EncryptionKp.IsSet() { + toSerialize["encryption_kp"] = o.EncryptionKp.Get() + } + if !IsNil(o.SignAssertion) { + toSerialize["sign_assertion"] = o.SignAssertion + } + if !IsNil(o.SignLogoutRequest) { + toSerialize["sign_logout_request"] = o.SignLogoutRequest + } + if !IsNil(o.DefaultNameIdPolicy) { + toSerialize["default_name_id_policy"] = o.DefaultNameIdPolicy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *WSFederationProviderRequest) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "authorization_flow", + "invalidation_flow", + "reply_url", + "wtrealm", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWSFederationProviderRequest := _WSFederationProviderRequest{} + + err = json.Unmarshal(data, &varWSFederationProviderRequest) + + if err != nil { + return err + } + + *o = WSFederationProviderRequest(varWSFederationProviderRequest) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "name") + delete(additionalProperties, "authentication_flow") + delete(additionalProperties, "authorization_flow") + delete(additionalProperties, "invalidation_flow") + delete(additionalProperties, "property_mappings") + delete(additionalProperties, "reply_url") + delete(additionalProperties, "wtrealm") + delete(additionalProperties, "assertion_valid_not_before") + delete(additionalProperties, "assertion_valid_not_on_or_after") + delete(additionalProperties, "session_valid_not_on_or_after") + delete(additionalProperties, "name_id_mapping") + delete(additionalProperties, "authn_context_class_ref_mapping") + delete(additionalProperties, "digest_algorithm") + delete(additionalProperties, "signature_algorithm") + delete(additionalProperties, "signing_kp") + delete(additionalProperties, "encryption_kp") + delete(additionalProperties, "sign_assertion") + delete(additionalProperties, "sign_logout_request") + delete(additionalProperties, "default_name_id_policy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableWSFederationProviderRequest struct { + value *WSFederationProviderRequest + isSet bool +} + +func (v NullableWSFederationProviderRequest) Get() *WSFederationProviderRequest { + return v.value +} + +func (v *NullableWSFederationProviderRequest) Set(val *WSFederationProviderRequest) { + v.value = val + v.isSet = true +} + +func (v NullableWSFederationProviderRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableWSFederationProviderRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableWSFederationProviderRequest(val *WSFederationProviderRequest) *NullableWSFederationProviderRequest { + return &NullableWSFederationProviderRequest{value: val, isSet: true} +} + +func (v NullableWSFederationProviderRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableWSFederationProviderRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/packages/client-go/response.go b/packages/client-go/response.go new file mode 100644 index 0000000000..1de9340547 --- /dev/null +++ b/packages/client-go/response.go @@ -0,0 +1,48 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/packages/client-go/utils.go b/packages/client-go/utils.go new file mode 100644 index 0000000000..9b4dc792ae --- /dev/null +++ b/packages/client-go/utils.go @@ -0,0 +1,362 @@ +/* +authentik + +Making authentication simple. + +API version: 2026.5.0-rc1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/packages/client-rust/Makefile b/packages/client-rust/Makefile index e60dcf7d74..61a60a3586 100644 --- a/packages/client-rust/Makefile +++ b/packages/client-rust/Makefile @@ -7,7 +7,7 @@ build: ifndef version $(error Usage: make build version=20xx.xx.xx) endif - rm -rf src + rm -rf "${PWD}/src" docker compose run --rm --user "${UID}:${GID}" gen \ generate \ -i /schema.yml \ @@ -16,9 +16,9 @@ endif -c /local/config.yaml \ --additional-properties=packageVersion=$(version) rm -rf \ - .gitignore \ - .openapi-generator \ - .travis.yml \ - docs \ - git_push.sh \ - README.md + "${PWD}/.gitignore" \ + "${PWD}/.openapi-generator" \ + "${PWD}/.travis.yml" \ + "${PWD}/docs" \ + "${PWD}/git_push.sh" \ + "${PWD}/README.md" diff --git a/scripts/test_docker.sh b/scripts/test_docker.sh index 408de5b9ce..dfd7f527cb 100755 --- a/scripts/test_docker.sh +++ b/scripts/test_docker.sh @@ -21,7 +21,6 @@ if [[ -v BUILD ]]; then # Ensure buildx is installed docker buildx install make gen-client-ts - make gen-client-go touch lifecycle/container/.env docker build -t "${AUTHENTIK_IMAGE}:${AUTHENTIK_TAG}" -f lifecycle/container/Dockerfile . diff --git a/website/api/clients/golang.md b/website/api/clients/golang.md index e72168ea12..d735714788 100644 --- a/website/api/clients/golang.md +++ b/website/api/clients/golang.md @@ -14,4 +14,4 @@ go get goauthentik.io/api/v3 The Go client is used by the Outpost to communicate with the backend authentik server. To build the go client, run `make gen-client-go`. -The generated files are stored in `/gen-go-api` in the root of the repository. +The generated files are stored in `/packages/client-go` in the root of the repository.